From 4e4a34717bcb0f8d91c5ca7b61301e5620e4d9b6 Mon Sep 17 00:00:00 2001 From: ffalor <35144141+ffalor@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:38:06 -0500 Subject: [PATCH] renerate spec 04/26/2024 (#427) * renerate spec 04/26/2024 * fix ioc example --- examples/falcon_iocs/falcon_iocs.go | 39 +- falcon/client/alerts/update_v3_parameters.go | 2 +- .../cloud_snapshots/cloud_snapshots_client.go | 200 +++ .../create_deployment_entity_parameters.go | 150 ++ .../create_deployment_entity_responses.go | 626 +++++++ .../get_credentials_mixin0_parameters.go | 2 +- .../get_credentials_mixin0_responses.go | 2 +- .../get_scan_report_parameters.go | 175 ++ .../get_scan_report_responses.go | 742 ++++++++ .../read_deployments_combined_parameters.go | 266 +++ .../read_deployments_combined_responses.go | 626 +++++++ .../read_deployments_entities_parameters.go | 175 ++ .../read_deployments_entities_responses.go | 626 +++++++ .../read_combined_images_export_parameters.go | 2 +- .../crowd_strike_api_specification_client.go | 15 +- ...connect_c_s_p_m_g_c_p_account_responses.go | 116 ++ .../create_c_s_p_m_azure_account_responses.go | 116 ++ .../cspm_registration_client.go | 168 +- ...s_p_m_azure_management_group_parameters.go | 175 ++ ..._s_p_m_azure_management_group_responses.go | 742 ++++++++ ...s_account_scripts_attachment_parameters.go | 274 +++ ...ws_account_scripts_attachment_responses.go | 18 +- ..._g_c_p_validate_accounts_ext_parameters.go | 150 ++ ...m_g_c_p_validate_accounts_ext_responses.go | 742 ++++++++ ...figuration_detection_i_ds_v2_parameters.go | 2 +- ...update_c_s_p_m_g_c_p_account_parameters.go | 6 +- .../update_c_s_p_m_g_c_p_account_responses.go | 56 +- ...m_g_c_p_service_accounts_ext_parameters.go | 150 ++ ..._m_g_c_p_service_accounts_ext_responses.go | 626 +++++++ ..._m_g_c_p_service_account_ext_parameters.go | 150 ++ ...p_m_g_c_p_service_account_ext_responses.go | 858 +++++++++ falcon/client/custom_ioa/custom_ioa_client.go | 40 + .../query_rule_groups_full_parameters.go | 2 +- .../query_rule_groups_mixin0_parameters.go | 2 +- .../query_rules_mixin0_parameters.go | 2 +- .../custom_ioa/update_rules_v2_parameters.go | 150 ++ .../update_rules_v2_responses.go} | 264 +-- .../connect_d4_c_g_c_p_account_responses.go | 116 ++ ..._discover_cloud_azure_account_responses.go | 116 ++ .../d4c_registration_client.go | 40 + ...s_account_scripts_attachment_parameters.go | 274 +++ ..._s_account_scripts_attachment_responses.go | 18 +- ...c_g_c_p_service_accounts_ext_parameters.go | 150 ++ ..._c_g_c_p_service_accounts_ext_responses.go | 626 +++++++ .../discover_iot/discover_iot_client.go | 40 + .../query_iot_hosts_v2_parameters.go | 272 +++ .../query_iot_hosts_v2_responses.go | 626 +++++++ .../drift_indicators_client.go | 40 - ...ead_drift_indicator_entities_parameters.go | 175 -- ...read_drift_indicator_entities_responses.go | 510 ------ .../aggregate_external_assets_parameters.go | 153 ++ .../aggregate_external_assets_responses.go | 626 +++++++ ...lob_download_external_assets_parameters.go | 183 ++ ...blob_download_external_assets_responses.go | 624 +++++++ ...blob_preview_external_assets_parameters.go | 183 ++ .../blob_preview_external_assets_responses.go | 626 +++++++ .../exposure_management_client.go | 285 +++ .../get_external_assets_parameters.go | 175 ++ .../get_external_assets_responses.go | 626 +++++++ .../patch_external_assets_parameters.go | 150 ++ .../patch_external_assets_responses.go | 626 +++++++ .../query_external_assets_parameters.go | 271 +++ .../query_external_assets_responses.go | 626 +++++++ .../aggregate_support_issues_parameters.go | 150 ++ .../aggregate_support_issues_responses.go | 626 +++++++ .../falcon_complete_dashboard_client.go | 40 + .../filevantage/create_rules_parameters.go | 4 + .../filevantage/update_rules_parameters.go | 2 + ...rches_dynamic_execute_alt_v1_parameters.go | 74 + ...arches_dynamic_execute_alt_v1_responses.go | 354 +++- ...aved_searches_execute_alt_v1_parameters.go | 80 +- ...saved_searches_execute_alt_v1_responses.go | 354 +++- ..._saved_searches_ingest_alt_v1_responses.go | 354 +++- .../download_results_parameters.go | 48 +- .../execute_dynamic_parameters.go | 74 + .../execute_dynamic_responses.go | 354 +++- .../foundry_logscale/execute_parameters.go | 80 +- .../foundry_logscale/execute_responses.go | 354 +++- .../foundry_logscale_client.go | 42 +- ...aved_searches_execute_alt_v1_parameters.go | 76 +- ...saved_searches_execute_alt_v1_responses.go | 354 +++- ..._job_results_download_alt_v1_parameters.go | 48 +- .../get_search_results_parameters.go | 76 +- .../get_search_results_responses.go | 354 +++- .../ingest_data_async_v1_parameters.go | 303 ++++ .../ingest_data_async_v1_responses.go | 742 ++++++++ .../foundry_logscale/ingest_data_responses.go | 354 +++- .../foundry_logscale/list_repos_responses.go | 354 +++- .../foundry_logscale/list_views_responses.go | 354 +++- .../foundry_logscale/populate_responses.go | 354 +++- .../tokens_create_responses.go | 116 ++ .../get_latest_intel_rule_file_parameters.go | 6 + .../intel/get_malware_entities_parameters.go | 175 ++ .../intel/get_malware_entities_responses.go | 394 +++++ falcon/client/intel/intel_client.go | 120 ++ .../intel/query_intel_rule_ids_parameters.go | 6 + .../client/intel/query_malware_parameters.go | 302 ++++ .../client/intel/query_malware_responses.go | 626 +++++++ ...ry_mitre_attacks_for_malware_parameters.go | 175 ++ ...ery_mitre_attacks_for_malware_responses.go | 394 +++++ .../create_i_o_a_exclusions_v1_responses.go | 54 +- .../ioa_exclusions/ioa_exclusions_client.go | 6 +- .../cluster_combined_parameters.go | 2 +- .../cluster_count_parameters.go | 2 +- ..._by_kubernetes_version_count_parameters.go | 2 +- .../clusters_by_status_count_parameters.go | 2 +- .../container_enrichment_responses.go | 510 ------ .../deployment_enrichment_responses.go | 510 ------ ...kubernetes_iom_by_date_range_parameters.go | 2 +- .../kubernetes_iom_count_parameters.go | 2 +- ...rnetes_iom_entities_combined_parameters.go | 2 +- .../kubernetes_protection_client.go | 120 -- .../query_kubernetes_ioms_parameters.go | 2 +- .../container_enrichment_parameters.go | 83 +- .../container_enrichment_responses.go | 89 + .../deployment_enrichment_parameters.go | 83 +- .../deployment_enrichment_responses.go | 89 + falcon/client/operations/operations_client.go | 136 ++ .../pod_enrichment_parameters.go | 83 +- .../operations/pod_enrichment_responses.go | 89 + falcon/client/provision/provision_client.go | 79 - .../batch_active_responder_cmd_parameters.go | 2 +- .../batch_cmd_parameters.go | 2 +- .../r_t_r_delete_queued_session_responses.go | 116 ++ ...ute_active_responder_command_parameters.go | 2 +- .../r_t_r_execute_command_parameters.go | 2 +- .../r_t_r_list_all_sessions_parameters.go | 2 +- .../real_time_response_client.go | 17 +- .../batch_admin_cmd_parameters.go | 2 +- .../r_t_r_execute_admin_command_parameters.go | 2 +- .../r_t_r_update_scripts_responses.go | 54 +- .../real_time_response_admin_client.go | 6 +- ...ad_sensor_installer_by_id_v2_parameters.go | 156 ++ ...oad_sensor_installer_by_id_v2_responses.go | 628 +++++++ ...ensor_installers_by_query_v2_parameters.go | 271 +++ ...sensor_installers_by_query_v2_responses.go | 510 ++++++ ...ensor_installers_by_query_v2_parameters.go | 271 +++ ...sensor_installers_by_query_v2_responses.go | 510 ++++++ ...ensor_installers_entities_v2_parameters.go | 175 ++ ...sensor_installers_entities_v2_responses.go | 742 ++++++++ .../sensor_download/sensor_download_client.go | 161 ++ .../workflow_definitions_create_parameters.go | 196 --- .../workflow_definitions_create_responses.go | 742 -------- .../workflow_definitions_export_parameters.go | 50 +- .../workflow_execute_internal_parameters.go | 411 +++++ .../workflow_execute_internal_responses.go | 742 ++++++++ .../workflow_mock_execute_parameters.go | 411 +++++ .../workflow_mock_execute_responses.go | 742 ++++++++ falcon/client/workflows/workflows_client.go | 122 +- .../get_assessment_v1_responses.go | 116 -- falcon/models/api_indicator_create_req_v1.go | 2 +- falcon/models/api_response_pagination.go | 2 +- falcon/models/api_rule_update_v2.go | 243 +++ falcon/models/api_rule_updates_request_v2.go | 175 ++ falcon/models/api_token_create_request_v1.go | 2 +- .../models/api_token_details_response_v1.go | 2 +- falcon/models/apidomain_query_response_v1.go | 17 + ...idomain_saved_search_execute_request_v1.go | 147 +- falcon/models/changes_change.go | 84 +- falcon/models/changes_host.go | 3 + falcon/models/changes_permissions_mac.go | 232 +++ falcon/models/client_f_q_l_statement.go | 105 ++ ...set.go => client_f_q_l_statement_value.go} | 6 +- falcon/models/client_job_status.go | 3 + ...onse.go => deployments_entity_response.go} | 152 +- falcon/models/detects_alert.go | 72 +- falcon/models/device_device.go | 12 + .../models/device_mapped_device_policies.go | 51 + falcon/models/deviceapi_device_swagger.go | 9 + falcon/models/domain_a_w_s_account_v2.go | 67 + .../domain_a_w_s_inventory_filter_setting.go | 105 ++ falcon/models/domain_actor_document.go | 554 +----- falcon/models/domain_api_entity_matched_v1.go | 56 - ...omain_api_evaluation_logic_host_info_v1.go | 124 -- .../domain_api_evaluation_logic_item_v1.go | 20 +- .../models/domain_api_evaluation_logic_v1.go | 72 +- ...pi_vulnerability_c_v_e_details_facet_v2.go | 3 + .../domain_api_vulnerability_host_facet_v2.go | 6 + .../domain_api_vulnerability_service_v2.go | 56 + falcon/models/domain_api_vulnerability_v2.go | 65 + falcon/models/domain_assessment_paging.go | 94 + .../domain_base_api_vulnerability_v2.go | 65 + falcon/models/domain_behavior.go | 3 + falcon/models/domain_botnet_config_source.go | 337 ---- falcon/models/domain_botnet_inject.go | 88 - ..._a_known_exploited_vulnerabilities_info.go | 93 + falcon/models/domain_c_id_group.go | 15 +- falcon/models/domain_c_p_s_rating.go | 350 ++++ .../domain_c_p_s_rating_history_entry.go | 93 + .../models/domain_c_p_s_rating_indicator.go | 105 ++ falcon/models/domain_c_v_e.go | 697 ++++++++ falcon/models/domain_c_v_e_exploit.go | 185 ++ .../models/domain_c_v_e_exploit_reference.go | 105 ++ falcon/models/domain_c_v_e_exploit_source.go | 175 ++ falcon/models/domain_c_v_s_sv2.go | 97 ++ falcon/models/domain_c_v_s_sv3.go | 121 ++ falcon/models/domain_cipher.go | 56 + falcon/models/domain_compliance.go | 62 + falcon/models/domain_condition.go | 34 + falcon/models/domain_content_package.go | 71 + falcon/models/domain_d_d_o_s_attack_source.go | 312 ---- .../models/domain_d_d_o_s_target_details.go | 224 --- ...domain_denormalized_adversary_reference.go | 77 + ...pair.go => domain_denormalized_country.go} | 40 +- .../domain_denormalized_customer_target.go | 71 + .../domain_denormalized_report_reference.go | 77 + ..._info.go => domain_denormalized_sector.go} | 24 +- .../domain_denormalized_threat_reference.go | 74 + .../domain_denormalized_threat_used_mitre.go | 139 ++ falcon/models/domain_device.go | 10 +- .../models/domain_discover_api_application.go | 54 + ...cover_api_application_browser_extension.go | 168 ++ ...lication_browser_extension_installation.go | 95 + falcon/models/domain_discover_api_host.go | 124 +- .../models/domain_discover_api_io_t_host.go | 337 +++- .../domain_discover_api_io_t_host_triage.go | 65 + .../models/domain_discover_api_meta_info.go | 198 +++ falcon/models/domain_discover_api_paging.go | 105 ++ falcon/models/domain_discover_api_response.go | 190 ++ falcon/models/domain_discover_params.go | 17 + falcon/models/domain_entity.go | 71 +- falcon/models/domain_event.go | 398 ++--- falcon/models/domain_event_metadata.go | 70 + ...ain_external_asset_api_patch_request_v1.go | 124 ++ .../domain_external_asset_application.go | 62 + .../domain_external_asset_certificate.go | 219 +++ ...al_asset_certificate_entity_identifiers.go | 95 + .../models/domain_external_asset_cloud_vm.go | 83 + ...ain_external_asset_discovery_attributes.go | 171 ++ ...xternal_asset_discovery_path_attributes.go | 121 ++ ...xternal_asset_discovery_step_attributes.go | 176 ++ ...in_external_asset_geographical_location.go | 133 ++ .../domain_external_asset_http_attributes.go | 83 + ...external_asset_redirect_step_attributes.go | 108 ++ .../domain_external_asset_s_s_l_record.go | 178 ++ .../models/domain_external_asset_service.go | 496 ++++++ ...main_external_asset_service_blobs_links.go | 59 + .../domain_external_asset_subsidiary.go | 88 + .../domain_external_assets_api_patch.go | 136 ++ .../domain_external_assets_api_triage.go | 65 + ...domain_external_assets_api_triage_patch.go | 59 + .../domain_external_assets_api_type_v1.go | 235 +++ ...domain_external_assets_blob_api_type_v1.go | 188 ++ falcon/models/domain_fem_dns_domain.go | 165 ++ falcon/models/domain_fem_external_asset.go | 475 +++++ falcon/models/domain_fem_external_ip.go | 241 +++ falcon/models/domain_g_c_p_account_v1.go | 124 ++ falcon/models/domain_generic_entity.go | 27 + falcon/models/domain_geo_point.go | 53 + falcon/models/domain_incident.go | 3 + falcon/models/domain_k_b_list.go | 88 + falcon/models/domain_malware_document.go | 1528 +++++++++++++++++ .../domain_malware_environment_aggregates.go | 105 ++ falcon/models/domain_malware_response.go | 237 +++ falcon/models/domain_matched_rule.go | 56 - falcon/models/domain_meta_info.go | 104 +- falcon/models/domain_news_document.go | 407 +---- falcon/models/domain_notification_v1.go | 9 + falcon/models/domain_pastebin_text_source.go | 125 -- ...main_pastebin_text_source_legacy_source.go | 11 - falcon/models/domain_policy_info.go | 67 +- falcon/models/domain_product.go | 439 +++++ falcon/models/domain_raw_event.go | 457 +++++ falcon/models/domain_reference.go | 88 + falcon/models/domain_remediation_i_ds.go | 88 + falcon/models/domain_report_params.go | 17 + falcon/models/domain_rule.go | 89 +- falcon/models/domain_scan_metadata.go | 3 + falcon/models/domain_schedule.go | 61 +- falcon/models/domain_sensor_installer_v2.go | 238 +++ falcon/models/domain_sensor_installers_v2.go | 237 +++ falcon/models/domain_simple_actor.go | 62 +- falcon/models/domain_tweet_source.go | 125 -- .../models/domain_update_rule_request_v1.go | 17 + falcon/models/domain_user.go | 58 +- falcon/models/domain_user_action.go | 10 +- falcon/models/domain_user_action_request.go | 2 +- falcon/models/domain_vuln.go | 71 + falcon/models/domain_vulnerability.go | 284 +-- falcon/models/domain_vulnerability_actor.go | 53 - .../domain_vulnerability_affected_product.go | 53 - .../domain_vulnerability_related_threat.go | 53 - falcon/models/domain_vulnerability_report.go | 53 - falcon/models/ecs_categorization.go | 122 ++ falcon/models/executions_trigger_result.go | 2 +- falcon/models/falconx_report_v1.go | 3 + .../models/falconx_sandbox_parameters_v1.go | 3 + falcon/models/falconx_summary_report_v1.go | 3 + falcon/models/graph_multi.go | 3 + falcon/models/graph_validation_error.go | 3 + .../models/host_groups_update_group_req_v1.go | 2 +- .../images_ext_combined_images_response.go | 2 +- .../jsonschema_condition_group_fields.go | 3 + falcon/models/jsonschema_sub_schema.go | 54 + falcon/models/jsonschema_ui_extensions.go | 50 + .../k8sassets_cluster_enrichment_data.go | 17 + .../k8sassets_container_enrichment_data.go | 118 -- ...assets_container_enrichment_data_agents.go | 27 - .../k8sassets_container_enrichment_entry.go | 125 -- .../k8sassets_deployment_enrichment_data.go | 71 - .../k8sassets_deployment_enrichment_entry.go | 125 -- .../models/k8sassets_pod_enrichment_data.go | 158 -- .../models/k8sassets_pod_enrichment_entry.go | 125 -- .../models/models_api_customer_and_image.go | 17 + falcon/models/models_application_library.go | 6 - falcon/models/models_cluster.go | 17 + falcon/models/models_container_image.go | 17 + .../models/models_create_deployment_input.go | 124 ++ falcon/models/models_deployment_resource.go | 122 ++ falcon/models/models_detection.go | 224 +++ .../models_detection_engine_info_type.go | 110 ++ falcon/models/models_detection_info_type.go | 108 ++ falcon/models/models_e_l_f_binary.go | 122 ++ falcon/models/models_job_meta_data.go | 200 +++ ...models_mock_execution_create_request_v1.go | 130 ++ falcon/models/models_node.go | 3 + falcon/models/models_o_s_info_type.go | 88 + .../models_package_vulnerability_type.go | 108 ++ falcon/models/models_pod.go | 3 + falcon/models/models_scan_report_type.go | 497 ++++++ falcon/models/models_scan_results.go | 269 +++ .../models_snapshot_inventory_application.go | 207 +++ falcon/models/models_vulnerabilities_type.go | 71 + falcon/models/models_vulnerability_type.go | 262 +++ falcon/models/policies_policy.go | 17 + .../registration_a_w_s_account_ext_v2.go | 3 + .../registration_a_w_s_account_patch.go | 3 + ...tration_g_c_p_account_patch_request_v1.go} | 26 +- .../registration_g_c_p_account_patch_v1.go | 128 ++ .../registration_g_c_p_account_req_obj_v2.go | 70 +- .../registration_g_c_p_account_rsp_obj_v2.go | 70 +- ...registration_g_c_p_account_validated_v1.go | 271 +++ ...on_g_c_p_account_validation_req_obj_v1.go} | 25 +- ...ion_g_c_p_account_validation_request_v1.go | 124 ++ ...n_g_c_p_account_validation_response_v1.go} | 152 +- ...gistration_g_c_p_service_account_ext_v1.go | 76 +- ..._g_c_p_service_account_patch_request_v1.go | 124 ++ ...stration_g_c_p_service_account_patch_v1.go | 139 ++ ...rvice_account_validation_request_obj_v1.go | 139 ++ ...p_service_account_validation_request_v1.go | 124 ++ ..._service_account_validation_response_v1.go | 235 +++ falcon/models/rulegroups_rule.go | 6 + .../models/sadomain_create_rule_request_v1.go | 34 + falcon/models/sadomain_rule.go | 20 + ...se.go => scanreports_entities_response.go} | 152 +- ...weet_source_legacy_source.go => string.go} | 6 +- falcon/models/v2_definition.go | 49 + falcon/models/v2_for_loop.go | 3 + falcon/models/v2_model.go | 347 ++++ falcon/models/vulncheck_e_p_s_s.go | 88 + falcon/models/vulncheck_exploit_botnets.go | 158 ++ .../vulncheck_exploit_c_v_e_reference.go | 105 ++ falcon/models/vulncheck_exploit_counts.go | 105 ++ falcon/models/vulncheck_exploit_details.go | 608 +++++++ falcon/models/vulncheck_exploit_ransomware.go | 141 ++ .../vulncheck_exploit_ransomware_data.go | 88 + falcon/models/vulncheck_exploit_record.go | 71 + .../models/vulncheck_exploit_threat_actor.go | 201 +++ falcon/models/vulncheck_exploit_timeline.go | 86 + falcon/models/vulncheck_exploit_trending.go | 71 + .../vulncheck_threat_actor_vendor_name.go | 56 + specs/transformation.jq | 48 +- 362 files changed, 51558 insertions(+), 8224 deletions(-) create mode 100644 falcon/client/cloud_snapshots/create_deployment_entity_parameters.go create mode 100644 falcon/client/cloud_snapshots/create_deployment_entity_responses.go rename falcon/client/{provision => cloud_snapshots}/get_credentials_mixin0_parameters.go (99%) rename falcon/client/{provision => cloud_snapshots}/get_credentials_mixin0_responses.go (99%) create mode 100644 falcon/client/cloud_snapshots/get_scan_report_parameters.go create mode 100644 falcon/client/cloud_snapshots/get_scan_report_responses.go create mode 100644 falcon/client/cloud_snapshots/read_deployments_combined_parameters.go create mode 100644 falcon/client/cloud_snapshots/read_deployments_combined_responses.go create mode 100644 falcon/client/cloud_snapshots/read_deployments_entities_parameters.go create mode 100644 falcon/client/cloud_snapshots/read_deployments_entities_responses.go create mode 100644 falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_parameters.go create mode 100644 falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_responses.go create mode 100644 falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_parameters.go create mode 100644 falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_responses.go create mode 100644 falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_parameters.go create mode 100644 falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_responses.go create mode 100644 falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_parameters.go create mode 100644 falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_responses.go create mode 100644 falcon/client/custom_ioa/update_rules_v2_parameters.go rename falcon/client/{kubernetes_protection/pod_enrichment_responses.go => custom_ioa/update_rules_v2_responses.go} (51%) create mode 100644 falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_parameters.go create mode 100644 falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_responses.go create mode 100644 falcon/client/discover_iot/query_iot_hosts_v2_parameters.go create mode 100644 falcon/client/discover_iot/query_iot_hosts_v2_responses.go delete mode 100644 falcon/client/drift_indicators/read_drift_indicator_entities_parameters.go delete mode 100644 falcon/client/drift_indicators/read_drift_indicator_entities_responses.go create mode 100644 falcon/client/exposure_management/aggregate_external_assets_parameters.go create mode 100644 falcon/client/exposure_management/aggregate_external_assets_responses.go create mode 100644 falcon/client/exposure_management/blob_download_external_assets_parameters.go create mode 100644 falcon/client/exposure_management/blob_download_external_assets_responses.go create mode 100644 falcon/client/exposure_management/blob_preview_external_assets_parameters.go create mode 100644 falcon/client/exposure_management/blob_preview_external_assets_responses.go create mode 100644 falcon/client/exposure_management/exposure_management_client.go create mode 100644 falcon/client/exposure_management/get_external_assets_parameters.go create mode 100644 falcon/client/exposure_management/get_external_assets_responses.go create mode 100644 falcon/client/exposure_management/patch_external_assets_parameters.go create mode 100644 falcon/client/exposure_management/patch_external_assets_responses.go create mode 100644 falcon/client/exposure_management/query_external_assets_parameters.go create mode 100644 falcon/client/exposure_management/query_external_assets_responses.go create mode 100644 falcon/client/falcon_complete_dashboard/aggregate_support_issues_parameters.go create mode 100644 falcon/client/falcon_complete_dashboard/aggregate_support_issues_responses.go create mode 100644 falcon/client/foundry_logscale/ingest_data_async_v1_parameters.go create mode 100644 falcon/client/foundry_logscale/ingest_data_async_v1_responses.go create mode 100644 falcon/client/intel/get_malware_entities_parameters.go create mode 100644 falcon/client/intel/get_malware_entities_responses.go create mode 100644 falcon/client/intel/query_malware_parameters.go create mode 100644 falcon/client/intel/query_malware_responses.go create mode 100644 falcon/client/intel/query_mitre_attacks_for_malware_parameters.go create mode 100644 falcon/client/intel/query_mitre_attacks_for_malware_responses.go delete mode 100644 falcon/client/kubernetes_protection/container_enrichment_responses.go delete mode 100644 falcon/client/kubernetes_protection/deployment_enrichment_responses.go rename falcon/client/{kubernetes_protection => operations}/container_enrichment_parameters.go (66%) create mode 100644 falcon/client/operations/container_enrichment_responses.go rename falcon/client/{kubernetes_protection => operations}/deployment_enrichment_parameters.go (66%) create mode 100644 falcon/client/operations/deployment_enrichment_responses.go create mode 100644 falcon/client/operations/operations_client.go rename falcon/client/{kubernetes_protection => operations}/pod_enrichment_parameters.go (68%) create mode 100644 falcon/client/operations/pod_enrichment_responses.go delete mode 100644 falcon/client/provision/provision_client.go create mode 100644 falcon/client/sensor_download/download_sensor_installer_by_id_v2_parameters.go create mode 100644 falcon/client/sensor_download/download_sensor_installer_by_id_v2_responses.go create mode 100644 falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_parameters.go create mode 100644 falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_responses.go create mode 100644 falcon/client/sensor_download/get_sensor_installers_by_query_v2_parameters.go create mode 100644 falcon/client/sensor_download/get_sensor_installers_by_query_v2_responses.go create mode 100644 falcon/client/sensor_download/get_sensor_installers_entities_v2_parameters.go create mode 100644 falcon/client/sensor_download/get_sensor_installers_entities_v2_responses.go delete mode 100644 falcon/client/workflows/workflow_definitions_create_parameters.go delete mode 100644 falcon/client/workflows/workflow_definitions_create_responses.go create mode 100644 falcon/client/workflows/workflow_execute_internal_parameters.go create mode 100644 falcon/client/workflows/workflow_execute_internal_responses.go create mode 100644 falcon/client/workflows/workflow_mock_execute_parameters.go create mode 100644 falcon/client/workflows/workflow_mock_execute_responses.go create mode 100644 falcon/models/api_rule_update_v2.go create mode 100644 falcon/models/api_rule_updates_request_v2.go create mode 100644 falcon/models/changes_permissions_mac.go create mode 100644 falcon/models/client_f_q_l_statement.go rename falcon/models/{api_response_pagination_offset.go => client_f_q_l_statement_value.go} (56%) rename falcon/models/{k8sassets_deployment_enrichment_response.go => deployments_entity_response.go} (58%) create mode 100644 falcon/models/domain_a_w_s_inventory_filter_setting.go delete mode 100644 falcon/models/domain_api_entity_matched_v1.go delete mode 100644 falcon/models/domain_api_evaluation_logic_host_info_v1.go create mode 100644 falcon/models/domain_api_vulnerability_service_v2.go create mode 100644 falcon/models/domain_assessment_paging.go delete mode 100644 falcon/models/domain_botnet_config_source.go delete mode 100644 falcon/models/domain_botnet_inject.go create mode 100644 falcon/models/domain_c_i_s_a_known_exploited_vulnerabilities_info.go create mode 100644 falcon/models/domain_c_p_s_rating.go create mode 100644 falcon/models/domain_c_p_s_rating_history_entry.go create mode 100644 falcon/models/domain_c_p_s_rating_indicator.go create mode 100644 falcon/models/domain_c_v_e.go create mode 100644 falcon/models/domain_c_v_e_exploit.go create mode 100644 falcon/models/domain_c_v_e_exploit_reference.go create mode 100644 falcon/models/domain_c_v_e_exploit_source.go create mode 100644 falcon/models/domain_c_v_s_sv2.go create mode 100644 falcon/models/domain_c_v_s_sv3.go create mode 100644 falcon/models/domain_cipher.go create mode 100644 falcon/models/domain_compliance.go create mode 100644 falcon/models/domain_content_package.go delete mode 100644 falcon/models/domain_d_d_o_s_attack_source.go delete mode 100644 falcon/models/domain_d_d_o_s_target_details.go create mode 100644 falcon/models/domain_denormalized_adversary_reference.go rename falcon/models/{domain_key_value_pair.go => domain_denormalized_country.go} (51%) create mode 100644 falcon/models/domain_denormalized_customer_target.go create mode 100644 falcon/models/domain_denormalized_report_reference.go rename falcon/models/{k8sassets_container_info.go => domain_denormalized_sector.go} (61%) create mode 100644 falcon/models/domain_denormalized_threat_reference.go create mode 100644 falcon/models/domain_denormalized_threat_used_mitre.go create mode 100644 falcon/models/domain_discover_api_application_browser_extension.go create mode 100644 falcon/models/domain_discover_api_application_browser_extension_installation.go create mode 100644 falcon/models/domain_discover_api_io_t_host_triage.go create mode 100644 falcon/models/domain_discover_api_meta_info.go create mode 100644 falcon/models/domain_discover_api_paging.go create mode 100644 falcon/models/domain_discover_api_response.go create mode 100644 falcon/models/domain_event_metadata.go create mode 100644 falcon/models/domain_external_asset_api_patch_request_v1.go create mode 100644 falcon/models/domain_external_asset_application.go create mode 100644 falcon/models/domain_external_asset_certificate.go create mode 100644 falcon/models/domain_external_asset_certificate_entity_identifiers.go create mode 100644 falcon/models/domain_external_asset_cloud_vm.go create mode 100644 falcon/models/domain_external_asset_discovery_attributes.go create mode 100644 falcon/models/domain_external_asset_discovery_path_attributes.go create mode 100644 falcon/models/domain_external_asset_discovery_step_attributes.go create mode 100644 falcon/models/domain_external_asset_geographical_location.go create mode 100644 falcon/models/domain_external_asset_http_attributes.go create mode 100644 falcon/models/domain_external_asset_redirect_step_attributes.go create mode 100644 falcon/models/domain_external_asset_s_s_l_record.go create mode 100644 falcon/models/domain_external_asset_service.go create mode 100644 falcon/models/domain_external_asset_service_blobs_links.go create mode 100644 falcon/models/domain_external_asset_subsidiary.go create mode 100644 falcon/models/domain_external_assets_api_patch.go create mode 100644 falcon/models/domain_external_assets_api_triage.go create mode 100644 falcon/models/domain_external_assets_api_triage_patch.go create mode 100644 falcon/models/domain_external_assets_api_type_v1.go create mode 100644 falcon/models/domain_external_assets_blob_api_type_v1.go create mode 100644 falcon/models/domain_fem_dns_domain.go create mode 100644 falcon/models/domain_fem_external_asset.go create mode 100644 falcon/models/domain_fem_external_ip.go create mode 100644 falcon/models/domain_generic_entity.go create mode 100644 falcon/models/domain_geo_point.go create mode 100644 falcon/models/domain_k_b_list.go create mode 100644 falcon/models/domain_malware_document.go create mode 100644 falcon/models/domain_malware_environment_aggregates.go create mode 100644 falcon/models/domain_malware_response.go delete mode 100644 falcon/models/domain_matched_rule.go delete mode 100644 falcon/models/domain_pastebin_text_source.go delete mode 100644 falcon/models/domain_pastebin_text_source_legacy_source.go create mode 100644 falcon/models/domain_product.go create mode 100644 falcon/models/domain_raw_event.go create mode 100644 falcon/models/domain_reference.go create mode 100644 falcon/models/domain_remediation_i_ds.go create mode 100644 falcon/models/domain_sensor_installer_v2.go create mode 100644 falcon/models/domain_sensor_installers_v2.go delete mode 100644 falcon/models/domain_tweet_source.go create mode 100644 falcon/models/domain_vuln.go delete mode 100644 falcon/models/domain_vulnerability_actor.go delete mode 100644 falcon/models/domain_vulnerability_affected_product.go delete mode 100644 falcon/models/domain_vulnerability_related_threat.go delete mode 100644 falcon/models/domain_vulnerability_report.go create mode 100644 falcon/models/ecs_categorization.go create mode 100644 falcon/models/jsonschema_ui_extensions.go delete mode 100644 falcon/models/k8sassets_container_enrichment_data.go delete mode 100644 falcon/models/k8sassets_container_enrichment_data_agents.go delete mode 100644 falcon/models/k8sassets_container_enrichment_entry.go delete mode 100644 falcon/models/k8sassets_deployment_enrichment_data.go delete mode 100644 falcon/models/k8sassets_deployment_enrichment_entry.go delete mode 100644 falcon/models/k8sassets_pod_enrichment_data.go delete mode 100644 falcon/models/k8sassets_pod_enrichment_entry.go create mode 100644 falcon/models/models_create_deployment_input.go create mode 100644 falcon/models/models_deployment_resource.go create mode 100644 falcon/models/models_detection.go create mode 100644 falcon/models/models_detection_engine_info_type.go create mode 100644 falcon/models/models_detection_info_type.go create mode 100644 falcon/models/models_e_l_f_binary.go create mode 100644 falcon/models/models_job_meta_data.go create mode 100644 falcon/models/models_mock_execution_create_request_v1.go create mode 100644 falcon/models/models_o_s_info_type.go create mode 100644 falcon/models/models_package_vulnerability_type.go create mode 100644 falcon/models/models_scan_report_type.go create mode 100644 falcon/models/models_scan_results.go create mode 100644 falcon/models/models_snapshot_inventory_application.go create mode 100644 falcon/models/models_vulnerabilities_type.go create mode 100644 falcon/models/models_vulnerability_type.go rename falcon/models/{registration_g_c_p_account_patch_request.go => registration_g_c_p_account_patch_request_v1.go} (70%) create mode 100644 falcon/models/registration_g_c_p_account_patch_v1.go create mode 100644 falcon/models/registration_g_c_p_account_validated_v1.go rename falcon/models/{registration_g_c_p_account_patch.go => registration_g_c_p_account_validation_req_obj_v1.go} (51%) create mode 100644 falcon/models/registration_g_c_p_account_validation_request_v1.go rename falcon/models/{k8sassets_container_enrichment_response.go => registration_g_c_p_account_validation_response_v1.go} (58%) create mode 100644 falcon/models/registration_g_c_p_service_account_patch_request_v1.go create mode 100644 falcon/models/registration_g_c_p_service_account_patch_v1.go create mode 100644 falcon/models/registration_g_c_p_service_account_validation_request_obj_v1.go create mode 100644 falcon/models/registration_g_c_p_service_account_validation_request_v1.go create mode 100644 falcon/models/registration_g_c_p_service_account_validation_response_v1.go rename falcon/models/{k8sassets_pod_enrichment_response.go => scanreports_entities_response.go} (60%) rename falcon/models/{domain_tweet_source_legacy_source.go => string.go} (54%) create mode 100644 falcon/models/v2_model.go create mode 100644 falcon/models/vulncheck_e_p_s_s.go create mode 100644 falcon/models/vulncheck_exploit_botnets.go create mode 100644 falcon/models/vulncheck_exploit_c_v_e_reference.go create mode 100644 falcon/models/vulncheck_exploit_counts.go create mode 100644 falcon/models/vulncheck_exploit_details.go create mode 100644 falcon/models/vulncheck_exploit_ransomware.go create mode 100644 falcon/models/vulncheck_exploit_ransomware_data.go create mode 100644 falcon/models/vulncheck_exploit_record.go create mode 100644 falcon/models/vulncheck_exploit_threat_actor.go create mode 100644 falcon/models/vulncheck_exploit_timeline.go create mode 100644 falcon/models/vulncheck_exploit_trending.go create mode 100644 falcon/models/vulncheck_threat_actor_vendor_name.go diff --git a/examples/falcon_iocs/falcon_iocs.go b/examples/falcon_iocs/falcon_iocs.go index 0b00191a..2013838d 100644 --- a/examples/falcon_iocs/falcon_iocs.go +++ b/examples/falcon_iocs/falcon_iocs.go @@ -82,7 +82,11 @@ func getIOCType(iocStr string) (string, error) { // addCrowdStrikeIOC will add a supported iocs with an optional description // defaults to an expiration date of 10 years & a severity of medium. // will detect on domains/ips and block on hashes. Retro detection enabled by default. -func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdStrikeAPISpecification) error { +func addCrowdStrikeIOCs( + iocs []string, + description string, + client *client.CrowdStrikeAPISpecification, +) error { body := models.APIIndicatorCreateReqsV1{} @@ -100,6 +104,8 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS action = "prevent" } + expiration := strfmt.DateTime(time.Now().Add(24 * time.Hour * 365 * 10)) + // add iocs to body truth := true body.Indicators = append(body.Indicators, &models.APIIndicatorCreateReqV1{ @@ -110,7 +116,7 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS Description: description, Platforms: []string{"windows", "mac", "linux"}, Value: iocStr, - Expiration: strfmt.DateTime(time.Now().Add(24 * time.Hour * 365 * 10)), + Expiration: &expiration, // Tags: []string{"example_tag1", "example_tag2"}, }) } @@ -134,13 +140,20 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS return nil } -func addCrowdStrikeIOC(iocStr string, description string, client *client.CrowdStrikeAPISpecification) error { +func addCrowdStrikeIOC( + iocStr string, + description string, + client *client.CrowdStrikeAPISpecification, +) error { return addCrowdStrikeIOCs([]string{iocStr}, description, client) } // searchCrowdStrikeIOC searches custom IOCs for an IOC and returns an id if found. // if no IOC is found, an empty string is returned -func _getCrowdStrikeIOCID(iocStr string, client *client.CrowdStrikeAPISpecification) (id string, err error) { +func _getCrowdStrikeIOCID( + iocStr string, + client *client.CrowdStrikeAPISpecification, +) (id string, err error) { fql := fmt.Sprintf(`value:"%s"`, iocStr) params := ioc.NewIndicatorSearchV1Params().WithFilter(&fql) @@ -219,9 +232,21 @@ func showCrowdStrikeIOC(iocStr string, client *client.CrowdStrikeAPISpecificatio func main() { - falconClientId := flag.String("client-id", os.Getenv("FALCON_CLIENT_ID"), "Client ID for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_ID env)") - falconClientSecret := flag.String("client-secret", os.Getenv("FALCON_CLIENT_SECRET"), "Client Secret for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_SECRET)") - clientCloud := flag.String("cloud", os.Getenv("FALCON_CLOUD"), "Falcon cloud abbreviation (us-1, us-2, eu-1, us-gov-1)") + falconClientId := flag.String( + "client-id", + os.Getenv("FALCON_CLIENT_ID"), + "Client ID for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_ID env)", + ) + falconClientSecret := flag.String( + "client-secret", + os.Getenv("FALCON_CLIENT_SECRET"), + "Client Secret for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_SECRET)", + ) + clientCloud := flag.String( + "cloud", + os.Getenv("FALCON_CLOUD"), + "Falcon cloud abbreviation (us-1, us-2, eu-1, us-gov-1)", + ) debug := flag.Bool("debug", false, "Debug requests") list := flag.Bool("list", false, "list all IOC values in the IOC management panel") diff --git a/falcon/client/alerts/update_v3_parameters.go b/falcon/client/alerts/update_v3_parameters.go index 43a4aa72..fbc4ec60 100644 --- a/falcon/client/alerts/update_v3_parameters.go +++ b/falcon/client/alerts/update_v3_parameters.go @@ -66,7 +66,7 @@ type UpdateV3Params struct { /* Body. - request body takes a list of action parameter request that is applied against all "ids" provided + request body takes a list of action parameter request that is applied against all "composite_ids" provided */ Body *models.DetectsapiPatchEntitiesAlertsV3Request diff --git a/falcon/client/cloud_snapshots/cloud_snapshots_client.go b/falcon/client/cloud_snapshots/cloud_snapshots_client.go index 2e2a4644..a3358d14 100644 --- a/falcon/client/cloud_snapshots/cloud_snapshots_client.go +++ b/falcon/client/cloud_snapshots/cloud_snapshots_client.go @@ -30,11 +30,211 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + CreateDeploymentEntity(params *CreateDeploymentEntityParams, opts ...ClientOption) (*CreateDeploymentEntityOK, error) + + GetCredentialsMixin0(params *GetCredentialsMixin0Params, opts ...ClientOption) (*GetCredentialsMixin0OK, error) + + GetScanReport(params *GetScanReportParams, opts ...ClientOption) (*GetScanReportOK, error) + + ReadDeploymentsCombined(params *ReadDeploymentsCombinedParams, opts ...ClientOption) (*ReadDeploymentsCombinedOK, error) + + ReadDeploymentsEntities(params *ReadDeploymentsEntitiesParams, opts ...ClientOption) (*ReadDeploymentsEntitiesOK, error) + Register(params *RegisterParams, opts ...ClientOption) (*RegisterOK, error) SetTransport(transport runtime.ClientTransport) } +/* +CreateDeploymentEntity launches a snapshot scan for a given cloud asset +*/ +func (a *Client) CreateDeploymentEntity(params *CreateDeploymentEntityParams, opts ...ClientOption) (*CreateDeploymentEntityOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateDeploymentEntityParams() + } + op := &runtime.ClientOperation{ + ID: "CreateDeploymentEntity", + Method: "POST", + PathPattern: "/snapshots/entities/deployments/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateDeploymentEntityReader{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.(*CreateDeploymentEntityOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for CreateDeploymentEntity: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetCredentialsMixin0 gets the registry credentials +*/ +func (a *Client) GetCredentialsMixin0(params *GetCredentialsMixin0Params, opts ...ClientOption) (*GetCredentialsMixin0OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCredentialsMixin0Params() + } + op := &runtime.ClientOperation{ + ID: "GetCredentialsMixin0", + Method: "GET", + PathPattern: "/snapshots/entities/image-registry-credentials/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetCredentialsMixin0Reader{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.(*GetCredentialsMixin0OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetCredentialsMixin0: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetScanReport retrieves the scan report for an instance +*/ +func (a *Client) GetScanReport(params *GetScanReportParams, opts ...ClientOption) (*GetScanReportOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetScanReportParams() + } + op := &runtime.ClientOperation{ + ID: "GetScanReport", + Method: "GET", + PathPattern: "/snapshots/entities/scanreports/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetScanReportReader{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.(*GetScanReportOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetScanReport: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadDeploymentsCombined retrieves snapshot jobs identified by the provided i ds +*/ +func (a *Client) ReadDeploymentsCombined(params *ReadDeploymentsCombinedParams, opts ...ClientOption) (*ReadDeploymentsCombinedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadDeploymentsCombinedParams() + } + op := &runtime.ClientOperation{ + ID: "ReadDeploymentsCombined", + Method: "GET", + PathPattern: "/snapshots/combined/deployments/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadDeploymentsCombinedReader{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.(*ReadDeploymentsCombinedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadDeploymentsCombined: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadDeploymentsEntities retrieves snapshot jobs identified by the provided i ds +*/ +func (a *Client) ReadDeploymentsEntities(params *ReadDeploymentsEntitiesParams, opts ...ClientOption) (*ReadDeploymentsEntitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadDeploymentsEntitiesParams() + } + op := &runtime.ClientOperation{ + ID: "ReadDeploymentsEntities", + Method: "GET", + PathPattern: "/snapshots/entities/deployments/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadDeploymentsEntitiesReader{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.(*ReadDeploymentsEntitiesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadDeploymentsEntities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* Register registers customer cloud account for snapshot scanning */ diff --git a/falcon/client/cloud_snapshots/create_deployment_entity_parameters.go b/falcon/client/cloud_snapshots/create_deployment_entity_parameters.go new file mode 100644 index 00000000..fb1053ee --- /dev/null +++ b/falcon/client/cloud_snapshots/create_deployment_entity_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewCreateDeploymentEntityParams creates a new CreateDeploymentEntityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateDeploymentEntityParams() *CreateDeploymentEntityParams { + return &CreateDeploymentEntityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateDeploymentEntityParamsWithTimeout creates a new CreateDeploymentEntityParams object +// with the ability to set a timeout on a request. +func NewCreateDeploymentEntityParamsWithTimeout(timeout time.Duration) *CreateDeploymentEntityParams { + return &CreateDeploymentEntityParams{ + timeout: timeout, + } +} + +// NewCreateDeploymentEntityParamsWithContext creates a new CreateDeploymentEntityParams object +// with the ability to set a context for a request. +func NewCreateDeploymentEntityParamsWithContext(ctx context.Context) *CreateDeploymentEntityParams { + return &CreateDeploymentEntityParams{ + Context: ctx, + } +} + +// NewCreateDeploymentEntityParamsWithHTTPClient creates a new CreateDeploymentEntityParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateDeploymentEntityParamsWithHTTPClient(client *http.Client) *CreateDeploymentEntityParams { + return &CreateDeploymentEntityParams{ + HTTPClient: client, + } +} + +/* +CreateDeploymentEntityParams contains all the parameters to send to the API endpoint + + for the create deployment entity operation. + + Typically these are written to a http.Request. +*/ +type CreateDeploymentEntityParams struct { + + // Body. + Body *models.ModelsCreateDeploymentInput + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create deployment entity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDeploymentEntityParams) WithDefaults() *CreateDeploymentEntityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create deployment entity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDeploymentEntityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create deployment entity params +func (o *CreateDeploymentEntityParams) WithTimeout(timeout time.Duration) *CreateDeploymentEntityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create deployment entity params +func (o *CreateDeploymentEntityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create deployment entity params +func (o *CreateDeploymentEntityParams) WithContext(ctx context.Context) *CreateDeploymentEntityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create deployment entity params +func (o *CreateDeploymentEntityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create deployment entity params +func (o *CreateDeploymentEntityParams) WithHTTPClient(client *http.Client) *CreateDeploymentEntityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create deployment entity params +func (o *CreateDeploymentEntityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create deployment entity params +func (o *CreateDeploymentEntityParams) WithBody(body *models.ModelsCreateDeploymentInput) *CreateDeploymentEntityParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create deployment entity params +func (o *CreateDeploymentEntityParams) SetBody(body *models.ModelsCreateDeploymentInput) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateDeploymentEntityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/cloud_snapshots/create_deployment_entity_responses.go b/falcon/client/cloud_snapshots/create_deployment_entity_responses.go new file mode 100644 index 00000000..98f5ad4d --- /dev/null +++ b/falcon/client/cloud_snapshots/create_deployment_entity_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// CreateDeploymentEntityReader is a Reader for the CreateDeploymentEntity structure. +type CreateDeploymentEntityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateDeploymentEntityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateDeploymentEntityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateDeploymentEntityBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateDeploymentEntityForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewCreateDeploymentEntityTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateDeploymentEntityInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /snapshots/entities/deployments/v1] CreateDeploymentEntity", response, response.Code()) + } +} + +// NewCreateDeploymentEntityOK creates a CreateDeploymentEntityOK with default headers values +func NewCreateDeploymentEntityOK() *CreateDeploymentEntityOK { + return &CreateDeploymentEntityOK{} +} + +/* +CreateDeploymentEntityOK describes a response with status code 200, with default header values. + +OK +*/ +type CreateDeploymentEntityOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DeploymentsEntityResponse +} + +// IsSuccess returns true when this create deployment entity o k response has a 2xx status code +func (o *CreateDeploymentEntityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create deployment entity o k response has a 3xx status code +func (o *CreateDeploymentEntityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create deployment entity o k response has a 4xx status code +func (o *CreateDeploymentEntityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create deployment entity o k response has a 5xx status code +func (o *CreateDeploymentEntityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create deployment entity o k response a status code equal to that given +func (o *CreateDeploymentEntityOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create deployment entity o k response +func (o *CreateDeploymentEntityOK) Code() int { + return 200 +} + +func (o *CreateDeploymentEntityOK) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityOK %+v", 200, o.Payload) +} + +func (o *CreateDeploymentEntityOK) String() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityOK %+v", 200, o.Payload) +} + +func (o *CreateDeploymentEntityOK) GetPayload() *models.DeploymentsEntityResponse { + return o.Payload +} + +func (o *CreateDeploymentEntityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DeploymentsEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDeploymentEntityBadRequest creates a CreateDeploymentEntityBadRequest with default headers values +func NewCreateDeploymentEntityBadRequest() *CreateDeploymentEntityBadRequest { + return &CreateDeploymentEntityBadRequest{} +} + +/* +CreateDeploymentEntityBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateDeploymentEntityBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create deployment entity bad request response has a 2xx status code +func (o *CreateDeploymentEntityBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create deployment entity bad request response has a 3xx status code +func (o *CreateDeploymentEntityBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create deployment entity bad request response has a 4xx status code +func (o *CreateDeploymentEntityBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create deployment entity bad request response has a 5xx status code +func (o *CreateDeploymentEntityBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create deployment entity bad request response a status code equal to that given +func (o *CreateDeploymentEntityBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create deployment entity bad request response +func (o *CreateDeploymentEntityBadRequest) Code() int { + return 400 +} + +func (o *CreateDeploymentEntityBadRequest) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityBadRequest %+v", 400, o.Payload) +} + +func (o *CreateDeploymentEntityBadRequest) String() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityBadRequest %+v", 400, o.Payload) +} + +func (o *CreateDeploymentEntityBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateDeploymentEntityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDeploymentEntityForbidden creates a CreateDeploymentEntityForbidden with default headers values +func NewCreateDeploymentEntityForbidden() *CreateDeploymentEntityForbidden { + return &CreateDeploymentEntityForbidden{} +} + +/* +CreateDeploymentEntityForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type CreateDeploymentEntityForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create deployment entity forbidden response has a 2xx status code +func (o *CreateDeploymentEntityForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create deployment entity forbidden response has a 3xx status code +func (o *CreateDeploymentEntityForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create deployment entity forbidden response has a 4xx status code +func (o *CreateDeploymentEntityForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create deployment entity forbidden response has a 5xx status code +func (o *CreateDeploymentEntityForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create deployment entity forbidden response a status code equal to that given +func (o *CreateDeploymentEntityForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create deployment entity forbidden response +func (o *CreateDeploymentEntityForbidden) Code() int { + return 403 +} + +func (o *CreateDeploymentEntityForbidden) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityForbidden %+v", 403, o.Payload) +} + +func (o *CreateDeploymentEntityForbidden) String() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityForbidden %+v", 403, o.Payload) +} + +func (o *CreateDeploymentEntityForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateDeploymentEntityForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDeploymentEntityTooManyRequests creates a CreateDeploymentEntityTooManyRequests with default headers values +func NewCreateDeploymentEntityTooManyRequests() *CreateDeploymentEntityTooManyRequests { + return &CreateDeploymentEntityTooManyRequests{} +} + +/* +CreateDeploymentEntityTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type CreateDeploymentEntityTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this create deployment entity too many requests response has a 2xx status code +func (o *CreateDeploymentEntityTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create deployment entity too many requests response has a 3xx status code +func (o *CreateDeploymentEntityTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create deployment entity too many requests response has a 4xx status code +func (o *CreateDeploymentEntityTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this create deployment entity too many requests response has a 5xx status code +func (o *CreateDeploymentEntityTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this create deployment entity too many requests response a status code equal to that given +func (o *CreateDeploymentEntityTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the create deployment entity too many requests response +func (o *CreateDeploymentEntityTooManyRequests) Code() int { + return 429 +} + +func (o *CreateDeploymentEntityTooManyRequests) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityTooManyRequests %+v", 429, o.Payload) +} + +func (o *CreateDeploymentEntityTooManyRequests) String() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityTooManyRequests %+v", 429, o.Payload) +} + +func (o *CreateDeploymentEntityTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *CreateDeploymentEntityTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDeploymentEntityInternalServerError creates a CreateDeploymentEntityInternalServerError with default headers values +func NewCreateDeploymentEntityInternalServerError() *CreateDeploymentEntityInternalServerError { + return &CreateDeploymentEntityInternalServerError{} +} + +/* +CreateDeploymentEntityInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type CreateDeploymentEntityInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create deployment entity internal server error response has a 2xx status code +func (o *CreateDeploymentEntityInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create deployment entity internal server error response has a 3xx status code +func (o *CreateDeploymentEntityInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create deployment entity internal server error response has a 4xx status code +func (o *CreateDeploymentEntityInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create deployment entity internal server error response has a 5xx status code +func (o *CreateDeploymentEntityInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create deployment entity internal server error response a status code equal to that given +func (o *CreateDeploymentEntityInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create deployment entity internal server error response +func (o *CreateDeploymentEntityInternalServerError) Code() int { + return 500 +} + +func (o *CreateDeploymentEntityInternalServerError) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateDeploymentEntityInternalServerError) String() string { + return fmt.Sprintf("[POST /snapshots/entities/deployments/v1][%d] createDeploymentEntityInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateDeploymentEntityInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateDeploymentEntityInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/provision/get_credentials_mixin0_parameters.go b/falcon/client/cloud_snapshots/get_credentials_mixin0_parameters.go similarity index 99% rename from falcon/client/provision/get_credentials_mixin0_parameters.go rename to falcon/client/cloud_snapshots/get_credentials_mixin0_parameters.go index 07f18ebf..f7664dc5 100644 --- a/falcon/client/provision/get_credentials_mixin0_parameters.go +++ b/falcon/client/cloud_snapshots/get_credentials_mixin0_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package provision +package cloud_snapshots // 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/falcon/client/provision/get_credentials_mixin0_responses.go b/falcon/client/cloud_snapshots/get_credentials_mixin0_responses.go similarity index 99% rename from falcon/client/provision/get_credentials_mixin0_responses.go rename to falcon/client/cloud_snapshots/get_credentials_mixin0_responses.go index a6f5d330..fb129408 100644 --- a/falcon/client/provision/get_credentials_mixin0_responses.go +++ b/falcon/client/cloud_snapshots/get_credentials_mixin0_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package provision +package cloud_snapshots // 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/falcon/client/cloud_snapshots/get_scan_report_parameters.go b/falcon/client/cloud_snapshots/get_scan_report_parameters.go new file mode 100644 index 00000000..116aa877 --- /dev/null +++ b/falcon/client/cloud_snapshots/get_scan_report_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetScanReportParams creates a new GetScanReportParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetScanReportParams() *GetScanReportParams { + return &GetScanReportParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetScanReportParamsWithTimeout creates a new GetScanReportParams object +// with the ability to set a timeout on a request. +func NewGetScanReportParamsWithTimeout(timeout time.Duration) *GetScanReportParams { + return &GetScanReportParams{ + timeout: timeout, + } +} + +// NewGetScanReportParamsWithContext creates a new GetScanReportParams object +// with the ability to set a context for a request. +func NewGetScanReportParamsWithContext(ctx context.Context) *GetScanReportParams { + return &GetScanReportParams{ + Context: ctx, + } +} + +// NewGetScanReportParamsWithHTTPClient creates a new GetScanReportParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetScanReportParamsWithHTTPClient(client *http.Client) *GetScanReportParams { + return &GetScanReportParams{ + HTTPClient: client, + } +} + +/* +GetScanReportParams contains all the parameters to send to the API endpoint + + for the get scan report operation. + + Typically these are written to a http.Request. +*/ +type GetScanReportParams struct { + + /* Ids. + + the instance identifiers to fetch the report for + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get scan report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScanReportParams) WithDefaults() *GetScanReportParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get scan report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScanReportParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get scan report params +func (o *GetScanReportParams) WithTimeout(timeout time.Duration) *GetScanReportParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get scan report params +func (o *GetScanReportParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get scan report params +func (o *GetScanReportParams) WithContext(ctx context.Context) *GetScanReportParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get scan report params +func (o *GetScanReportParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get scan report params +func (o *GetScanReportParams) WithHTTPClient(client *http.Client) *GetScanReportParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get scan report params +func (o *GetScanReportParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the get scan report params +func (o *GetScanReportParams) WithIds(ids []string) *GetScanReportParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the get scan report params +func (o *GetScanReportParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *GetScanReportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Ids != nil { + + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetScanReport binds the parameter ids +func (o *GetScanReportParams) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []string + + idsIIV := idsIIR // string as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "csv" + idsIS := swag.JoinByFormat(idsIC, "csv") + + return idsIS +} diff --git a/falcon/client/cloud_snapshots/get_scan_report_responses.go b/falcon/client/cloud_snapshots/get_scan_report_responses.go new file mode 100644 index 00000000..bcbc4477 --- /dev/null +++ b/falcon/client/cloud_snapshots/get_scan_report_responses.go @@ -0,0 +1,742 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// GetScanReportReader is a Reader for the GetScanReport structure. +type GetScanReportReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetScanReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetScanReportOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetScanReportBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetScanReportForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetScanReportNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetScanReportTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetScanReportInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /snapshots/entities/scanreports/v1] GetScanReport", response, response.Code()) + } +} + +// NewGetScanReportOK creates a GetScanReportOK with default headers values +func NewGetScanReportOK() *GetScanReportOK { + return &GetScanReportOK{} +} + +/* +GetScanReportOK describes a response with status code 200, with default header values. + +OK +*/ +type GetScanReportOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.ScanreportsEntitiesResponse +} + +// IsSuccess returns true when this get scan report o k response has a 2xx status code +func (o *GetScanReportOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get scan report o k response has a 3xx status code +func (o *GetScanReportOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scan report o k response has a 4xx status code +func (o *GetScanReportOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get scan report o k response has a 5xx status code +func (o *GetScanReportOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get scan report o k response a status code equal to that given +func (o *GetScanReportOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get scan report o k response +func (o *GetScanReportOK) Code() int { + return 200 +} + +func (o *GetScanReportOK) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportOK %+v", 200, o.Payload) +} + +func (o *GetScanReportOK) String() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportOK %+v", 200, o.Payload) +} + +func (o *GetScanReportOK) GetPayload() *models.ScanreportsEntitiesResponse { + return o.Payload +} + +func (o *GetScanReportOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.ScanreportsEntitiesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetScanReportBadRequest creates a GetScanReportBadRequest with default headers values +func NewGetScanReportBadRequest() *GetScanReportBadRequest { + return &GetScanReportBadRequest{} +} + +/* +GetScanReportBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetScanReportBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get scan report bad request response has a 2xx status code +func (o *GetScanReportBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get scan report bad request response has a 3xx status code +func (o *GetScanReportBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scan report bad request response has a 4xx status code +func (o *GetScanReportBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get scan report bad request response has a 5xx status code +func (o *GetScanReportBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get scan report bad request response a status code equal to that given +func (o *GetScanReportBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get scan report bad request response +func (o *GetScanReportBadRequest) Code() int { + return 400 +} + +func (o *GetScanReportBadRequest) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportBadRequest %+v", 400, o.Payload) +} + +func (o *GetScanReportBadRequest) String() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportBadRequest %+v", 400, o.Payload) +} + +func (o *GetScanReportBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetScanReportBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetScanReportForbidden creates a GetScanReportForbidden with default headers values +func NewGetScanReportForbidden() *GetScanReportForbidden { + return &GetScanReportForbidden{} +} + +/* +GetScanReportForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetScanReportForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get scan report forbidden response has a 2xx status code +func (o *GetScanReportForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get scan report forbidden response has a 3xx status code +func (o *GetScanReportForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scan report forbidden response has a 4xx status code +func (o *GetScanReportForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get scan report forbidden response has a 5xx status code +func (o *GetScanReportForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get scan report forbidden response a status code equal to that given +func (o *GetScanReportForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get scan report forbidden response +func (o *GetScanReportForbidden) Code() int { + return 403 +} + +func (o *GetScanReportForbidden) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportForbidden %+v", 403, o.Payload) +} + +func (o *GetScanReportForbidden) String() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportForbidden %+v", 403, o.Payload) +} + +func (o *GetScanReportForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetScanReportForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetScanReportNotFound creates a GetScanReportNotFound with default headers values +func NewGetScanReportNotFound() *GetScanReportNotFound { + return &GetScanReportNotFound{} +} + +/* +GetScanReportNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type GetScanReportNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get scan report not found response has a 2xx status code +func (o *GetScanReportNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get scan report not found response has a 3xx status code +func (o *GetScanReportNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scan report not found response has a 4xx status code +func (o *GetScanReportNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get scan report not found response has a 5xx status code +func (o *GetScanReportNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get scan report not found response a status code equal to that given +func (o *GetScanReportNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get scan report not found response +func (o *GetScanReportNotFound) Code() int { + return 404 +} + +func (o *GetScanReportNotFound) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportNotFound %+v", 404, o.Payload) +} + +func (o *GetScanReportNotFound) String() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportNotFound %+v", 404, o.Payload) +} + +func (o *GetScanReportNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetScanReportNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetScanReportTooManyRequests creates a GetScanReportTooManyRequests with default headers values +func NewGetScanReportTooManyRequests() *GetScanReportTooManyRequests { + return &GetScanReportTooManyRequests{} +} + +/* +GetScanReportTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetScanReportTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get scan report too many requests response has a 2xx status code +func (o *GetScanReportTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get scan report too many requests response has a 3xx status code +func (o *GetScanReportTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scan report too many requests response has a 4xx status code +func (o *GetScanReportTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get scan report too many requests response has a 5xx status code +func (o *GetScanReportTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get scan report too many requests response a status code equal to that given +func (o *GetScanReportTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get scan report too many requests response +func (o *GetScanReportTooManyRequests) Code() int { + return 429 +} + +func (o *GetScanReportTooManyRequests) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetScanReportTooManyRequests) String() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetScanReportTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetScanReportTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetScanReportInternalServerError creates a GetScanReportInternalServerError with default headers values +func NewGetScanReportInternalServerError() *GetScanReportInternalServerError { + return &GetScanReportInternalServerError{} +} + +/* +GetScanReportInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GetScanReportInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get scan report internal server error response has a 2xx status code +func (o *GetScanReportInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get scan report internal server error response has a 3xx status code +func (o *GetScanReportInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scan report internal server error response has a 4xx status code +func (o *GetScanReportInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get scan report internal server error response has a 5xx status code +func (o *GetScanReportInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get scan report internal server error response a status code equal to that given +func (o *GetScanReportInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get scan report internal server error response +func (o *GetScanReportInternalServerError) Code() int { + return 500 +} + +func (o *GetScanReportInternalServerError) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportInternalServerError %+v", 500, o.Payload) +} + +func (o *GetScanReportInternalServerError) String() string { + return fmt.Sprintf("[GET /snapshots/entities/scanreports/v1][%d] getScanReportInternalServerError %+v", 500, o.Payload) +} + +func (o *GetScanReportInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetScanReportInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/cloud_snapshots/read_deployments_combined_parameters.go b/falcon/client/cloud_snapshots/read_deployments_combined_parameters.go new file mode 100644 index 00000000..07b72e9a --- /dev/null +++ b/falcon/client/cloud_snapshots/read_deployments_combined_parameters.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewReadDeploymentsCombinedParams creates a new ReadDeploymentsCombinedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadDeploymentsCombinedParams() *ReadDeploymentsCombinedParams { + return &ReadDeploymentsCombinedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadDeploymentsCombinedParamsWithTimeout creates a new ReadDeploymentsCombinedParams object +// with the ability to set a timeout on a request. +func NewReadDeploymentsCombinedParamsWithTimeout(timeout time.Duration) *ReadDeploymentsCombinedParams { + return &ReadDeploymentsCombinedParams{ + timeout: timeout, + } +} + +// NewReadDeploymentsCombinedParamsWithContext creates a new ReadDeploymentsCombinedParams object +// with the ability to set a context for a request. +func NewReadDeploymentsCombinedParamsWithContext(ctx context.Context) *ReadDeploymentsCombinedParams { + return &ReadDeploymentsCombinedParams{ + Context: ctx, + } +} + +// NewReadDeploymentsCombinedParamsWithHTTPClient creates a new ReadDeploymentsCombinedParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadDeploymentsCombinedParamsWithHTTPClient(client *http.Client) *ReadDeploymentsCombinedParams { + return &ReadDeploymentsCombinedParams{ + HTTPClient: client, + } +} + +/* +ReadDeploymentsCombinedParams contains all the parameters to send to the API endpoint + + for the read deployments combined operation. + + Typically these are written to a http.Request. +*/ +type ReadDeploymentsCombinedParams struct { + + /* Filter. + + Search snapshot jobs using a query in Falcon Query Language (FQL). Supported filters: account_id,asset_identifier,cloud_provider,region,status + */ + Filter *string + + /* Limit. + + The upper-bound on the number of records to retrieve. + */ + Limit *int64 + + /* Offset. + + The offset from where to begin. + */ + Offset *int64 + + /* Sort. + + The fields to sort the records on. Supported columns: [account_id asset_identifier cloud_provider instance_type last_updated_timestamp region status] + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read deployments combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentsCombinedParams) WithDefaults() *ReadDeploymentsCombinedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read deployments combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentsCombinedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) WithTimeout(timeout time.Duration) *ReadDeploymentsCombinedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) WithContext(ctx context.Context) *ReadDeploymentsCombinedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) WithHTTPClient(client *http.Client) *ReadDeploymentsCombinedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) WithFilter(filter *string) *ReadDeploymentsCombinedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) WithLimit(limit *int64) *ReadDeploymentsCombinedParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) WithOffset(offset *int64) *ReadDeploymentsCombinedParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) WithSort(sort *string) *ReadDeploymentsCombinedParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the read deployments combined params +func (o *ReadDeploymentsCombinedParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadDeploymentsCombinedParams) 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.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/cloud_snapshots/read_deployments_combined_responses.go b/falcon/client/cloud_snapshots/read_deployments_combined_responses.go new file mode 100644 index 00000000..fb7431d9 --- /dev/null +++ b/falcon/client/cloud_snapshots/read_deployments_combined_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// ReadDeploymentsCombinedReader is a Reader for the ReadDeploymentsCombined structure. +type ReadDeploymentsCombinedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadDeploymentsCombinedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadDeploymentsCombinedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewReadDeploymentsCombinedBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReadDeploymentsCombinedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadDeploymentsCombinedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadDeploymentsCombinedInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /snapshots/combined/deployments/v1] ReadDeploymentsCombined", response, response.Code()) + } +} + +// NewReadDeploymentsCombinedOK creates a ReadDeploymentsCombinedOK with default headers values +func NewReadDeploymentsCombinedOK() *ReadDeploymentsCombinedOK { + return &ReadDeploymentsCombinedOK{} +} + +/* +ReadDeploymentsCombinedOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadDeploymentsCombinedOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DeploymentsEntityResponse +} + +// IsSuccess returns true when this read deployments combined o k response has a 2xx status code +func (o *ReadDeploymentsCombinedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read deployments combined o k response has a 3xx status code +func (o *ReadDeploymentsCombinedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments combined o k response has a 4xx status code +func (o *ReadDeploymentsCombinedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployments combined o k response has a 5xx status code +func (o *ReadDeploymentsCombinedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments combined o k response a status code equal to that given +func (o *ReadDeploymentsCombinedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read deployments combined o k response +func (o *ReadDeploymentsCombinedOK) Code() int { + return 200 +} + +func (o *ReadDeploymentsCombinedOK) Error() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentsCombinedOK) String() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentsCombinedOK) GetPayload() *models.DeploymentsEntityResponse { + return o.Payload +} + +func (o *ReadDeploymentsCombinedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DeploymentsEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsCombinedBadRequest creates a ReadDeploymentsCombinedBadRequest with default headers values +func NewReadDeploymentsCombinedBadRequest() *ReadDeploymentsCombinedBadRequest { + return &ReadDeploymentsCombinedBadRequest{} +} + +/* +ReadDeploymentsCombinedBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ReadDeploymentsCombinedBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this read deployments combined bad request response has a 2xx status code +func (o *ReadDeploymentsCombinedBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments combined bad request response has a 3xx status code +func (o *ReadDeploymentsCombinedBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments combined bad request response has a 4xx status code +func (o *ReadDeploymentsCombinedBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments combined bad request response has a 5xx status code +func (o *ReadDeploymentsCombinedBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments combined bad request response a status code equal to that given +func (o *ReadDeploymentsCombinedBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the read deployments combined bad request response +func (o *ReadDeploymentsCombinedBadRequest) Code() int { + return 400 +} + +func (o *ReadDeploymentsCombinedBadRequest) Error() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedBadRequest %+v", 400, o.Payload) +} + +func (o *ReadDeploymentsCombinedBadRequest) String() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedBadRequest %+v", 400, o.Payload) +} + +func (o *ReadDeploymentsCombinedBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ReadDeploymentsCombinedBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsCombinedForbidden creates a ReadDeploymentsCombinedForbidden with default headers values +func NewReadDeploymentsCombinedForbidden() *ReadDeploymentsCombinedForbidden { + return &ReadDeploymentsCombinedForbidden{} +} + +/* +ReadDeploymentsCombinedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadDeploymentsCombinedForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this read deployments combined forbidden response has a 2xx status code +func (o *ReadDeploymentsCombinedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments combined forbidden response has a 3xx status code +func (o *ReadDeploymentsCombinedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments combined forbidden response has a 4xx status code +func (o *ReadDeploymentsCombinedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments combined forbidden response has a 5xx status code +func (o *ReadDeploymentsCombinedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments combined forbidden response a status code equal to that given +func (o *ReadDeploymentsCombinedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read deployments combined forbidden response +func (o *ReadDeploymentsCombinedForbidden) Code() int { + return 403 +} + +func (o *ReadDeploymentsCombinedForbidden) Error() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentsCombinedForbidden) String() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentsCombinedForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ReadDeploymentsCombinedForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsCombinedTooManyRequests creates a ReadDeploymentsCombinedTooManyRequests with default headers values +func NewReadDeploymentsCombinedTooManyRequests() *ReadDeploymentsCombinedTooManyRequests { + return &ReadDeploymentsCombinedTooManyRequests{} +} + +/* +ReadDeploymentsCombinedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadDeploymentsCombinedTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this read deployments combined too many requests response has a 2xx status code +func (o *ReadDeploymentsCombinedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments combined too many requests response has a 3xx status code +func (o *ReadDeploymentsCombinedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments combined too many requests response has a 4xx status code +func (o *ReadDeploymentsCombinedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments combined too many requests response has a 5xx status code +func (o *ReadDeploymentsCombinedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments combined too many requests response a status code equal to that given +func (o *ReadDeploymentsCombinedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read deployments combined too many requests response +func (o *ReadDeploymentsCombinedTooManyRequests) Code() int { + return 429 +} + +func (o *ReadDeploymentsCombinedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentsCombinedTooManyRequests) String() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentsCombinedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentsCombinedTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsCombinedInternalServerError creates a ReadDeploymentsCombinedInternalServerError with default headers values +func NewReadDeploymentsCombinedInternalServerError() *ReadDeploymentsCombinedInternalServerError { + return &ReadDeploymentsCombinedInternalServerError{} +} + +/* +ReadDeploymentsCombinedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadDeploymentsCombinedInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this read deployments combined internal server error response has a 2xx status code +func (o *ReadDeploymentsCombinedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments combined internal server error response has a 3xx status code +func (o *ReadDeploymentsCombinedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments combined internal server error response has a 4xx status code +func (o *ReadDeploymentsCombinedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployments combined internal server error response has a 5xx status code +func (o *ReadDeploymentsCombinedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read deployments combined internal server error response a status code equal to that given +func (o *ReadDeploymentsCombinedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read deployments combined internal server error response +func (o *ReadDeploymentsCombinedInternalServerError) Code() int { + return 500 +} + +func (o *ReadDeploymentsCombinedInternalServerError) Error() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentsCombinedInternalServerError) String() string { + return fmt.Sprintf("[GET /snapshots/combined/deployments/v1][%d] readDeploymentsCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentsCombinedInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ReadDeploymentsCombinedInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/cloud_snapshots/read_deployments_entities_parameters.go b/falcon/client/cloud_snapshots/read_deployments_entities_parameters.go new file mode 100644 index 00000000..cc9b49f4 --- /dev/null +++ b/falcon/client/cloud_snapshots/read_deployments_entities_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewReadDeploymentsEntitiesParams creates a new ReadDeploymentsEntitiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadDeploymentsEntitiesParams() *ReadDeploymentsEntitiesParams { + return &ReadDeploymentsEntitiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadDeploymentsEntitiesParamsWithTimeout creates a new ReadDeploymentsEntitiesParams object +// with the ability to set a timeout on a request. +func NewReadDeploymentsEntitiesParamsWithTimeout(timeout time.Duration) *ReadDeploymentsEntitiesParams { + return &ReadDeploymentsEntitiesParams{ + timeout: timeout, + } +} + +// NewReadDeploymentsEntitiesParamsWithContext creates a new ReadDeploymentsEntitiesParams object +// with the ability to set a context for a request. +func NewReadDeploymentsEntitiesParamsWithContext(ctx context.Context) *ReadDeploymentsEntitiesParams { + return &ReadDeploymentsEntitiesParams{ + Context: ctx, + } +} + +// NewReadDeploymentsEntitiesParamsWithHTTPClient creates a new ReadDeploymentsEntitiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadDeploymentsEntitiesParamsWithHTTPClient(client *http.Client) *ReadDeploymentsEntitiesParams { + return &ReadDeploymentsEntitiesParams{ + HTTPClient: client, + } +} + +/* +ReadDeploymentsEntitiesParams contains all the parameters to send to the API endpoint + + for the read deployments entities operation. + + Typically these are written to a http.Request. +*/ +type ReadDeploymentsEntitiesParams struct { + + /* Ids. + + Search snapshot jobs by ids - The maximum amount is 100 IDs + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read deployments entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentsEntitiesParams) WithDefaults() *ReadDeploymentsEntitiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read deployments entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentsEntitiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) WithTimeout(timeout time.Duration) *ReadDeploymentsEntitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) WithContext(ctx context.Context) *ReadDeploymentsEntitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) WithHTTPClient(client *http.Client) *ReadDeploymentsEntitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) WithIds(ids []string) *ReadDeploymentsEntitiesParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the read deployments entities params +func (o *ReadDeploymentsEntitiesParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadDeploymentsEntitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Ids != nil { + + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamReadDeploymentsEntities binds the parameter ids +func (o *ReadDeploymentsEntitiesParams) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []string + + idsIIV := idsIIR // string as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "csv" + idsIS := swag.JoinByFormat(idsIC, "csv") + + return idsIS +} diff --git a/falcon/client/cloud_snapshots/read_deployments_entities_responses.go b/falcon/client/cloud_snapshots/read_deployments_entities_responses.go new file mode 100644 index 00000000..7d7504d6 --- /dev/null +++ b/falcon/client/cloud_snapshots/read_deployments_entities_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cloud_snapshots + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// ReadDeploymentsEntitiesReader is a Reader for the ReadDeploymentsEntities structure. +type ReadDeploymentsEntitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadDeploymentsEntitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadDeploymentsEntitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewReadDeploymentsEntitiesBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReadDeploymentsEntitiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadDeploymentsEntitiesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadDeploymentsEntitiesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /snapshots/entities/deployments/v1] ReadDeploymentsEntities", response, response.Code()) + } +} + +// NewReadDeploymentsEntitiesOK creates a ReadDeploymentsEntitiesOK with default headers values +func NewReadDeploymentsEntitiesOK() *ReadDeploymentsEntitiesOK { + return &ReadDeploymentsEntitiesOK{} +} + +/* +ReadDeploymentsEntitiesOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadDeploymentsEntitiesOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DeploymentsEntityResponse +} + +// IsSuccess returns true when this read deployments entities o k response has a 2xx status code +func (o *ReadDeploymentsEntitiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read deployments entities o k response has a 3xx status code +func (o *ReadDeploymentsEntitiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments entities o k response has a 4xx status code +func (o *ReadDeploymentsEntitiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployments entities o k response has a 5xx status code +func (o *ReadDeploymentsEntitiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments entities o k response a status code equal to that given +func (o *ReadDeploymentsEntitiesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read deployments entities o k response +func (o *ReadDeploymentsEntitiesOK) Code() int { + return 200 +} + +func (o *ReadDeploymentsEntitiesOK) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentsEntitiesOK) String() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentsEntitiesOK) GetPayload() *models.DeploymentsEntityResponse { + return o.Payload +} + +func (o *ReadDeploymentsEntitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DeploymentsEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsEntitiesBadRequest creates a ReadDeploymentsEntitiesBadRequest with default headers values +func NewReadDeploymentsEntitiesBadRequest() *ReadDeploymentsEntitiesBadRequest { + return &ReadDeploymentsEntitiesBadRequest{} +} + +/* +ReadDeploymentsEntitiesBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ReadDeploymentsEntitiesBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this read deployments entities bad request response has a 2xx status code +func (o *ReadDeploymentsEntitiesBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments entities bad request response has a 3xx status code +func (o *ReadDeploymentsEntitiesBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments entities bad request response has a 4xx status code +func (o *ReadDeploymentsEntitiesBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments entities bad request response has a 5xx status code +func (o *ReadDeploymentsEntitiesBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments entities bad request response a status code equal to that given +func (o *ReadDeploymentsEntitiesBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the read deployments entities bad request response +func (o *ReadDeploymentsEntitiesBadRequest) Code() int { + return 400 +} + +func (o *ReadDeploymentsEntitiesBadRequest) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesBadRequest %+v", 400, o.Payload) +} + +func (o *ReadDeploymentsEntitiesBadRequest) String() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesBadRequest %+v", 400, o.Payload) +} + +func (o *ReadDeploymentsEntitiesBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ReadDeploymentsEntitiesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsEntitiesForbidden creates a ReadDeploymentsEntitiesForbidden with default headers values +func NewReadDeploymentsEntitiesForbidden() *ReadDeploymentsEntitiesForbidden { + return &ReadDeploymentsEntitiesForbidden{} +} + +/* +ReadDeploymentsEntitiesForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadDeploymentsEntitiesForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this read deployments entities forbidden response has a 2xx status code +func (o *ReadDeploymentsEntitiesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments entities forbidden response has a 3xx status code +func (o *ReadDeploymentsEntitiesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments entities forbidden response has a 4xx status code +func (o *ReadDeploymentsEntitiesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments entities forbidden response has a 5xx status code +func (o *ReadDeploymentsEntitiesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments entities forbidden response a status code equal to that given +func (o *ReadDeploymentsEntitiesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read deployments entities forbidden response +func (o *ReadDeploymentsEntitiesForbidden) Code() int { + return 403 +} + +func (o *ReadDeploymentsEntitiesForbidden) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentsEntitiesForbidden) String() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentsEntitiesForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ReadDeploymentsEntitiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsEntitiesTooManyRequests creates a ReadDeploymentsEntitiesTooManyRequests with default headers values +func NewReadDeploymentsEntitiesTooManyRequests() *ReadDeploymentsEntitiesTooManyRequests { + return &ReadDeploymentsEntitiesTooManyRequests{} +} + +/* +ReadDeploymentsEntitiesTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadDeploymentsEntitiesTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this read deployments entities too many requests response has a 2xx status code +func (o *ReadDeploymentsEntitiesTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments entities too many requests response has a 3xx status code +func (o *ReadDeploymentsEntitiesTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments entities too many requests response has a 4xx status code +func (o *ReadDeploymentsEntitiesTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments entities too many requests response has a 5xx status code +func (o *ReadDeploymentsEntitiesTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments entities too many requests response a status code equal to that given +func (o *ReadDeploymentsEntitiesTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read deployments entities too many requests response +func (o *ReadDeploymentsEntitiesTooManyRequests) Code() int { + return 429 +} + +func (o *ReadDeploymentsEntitiesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentsEntitiesTooManyRequests) String() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentsEntitiesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentsEntitiesTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsEntitiesInternalServerError creates a ReadDeploymentsEntitiesInternalServerError with default headers values +func NewReadDeploymentsEntitiesInternalServerError() *ReadDeploymentsEntitiesInternalServerError { + return &ReadDeploymentsEntitiesInternalServerError{} +} + +/* +ReadDeploymentsEntitiesInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadDeploymentsEntitiesInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this read deployments entities internal server error response has a 2xx status code +func (o *ReadDeploymentsEntitiesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments entities internal server error response has a 3xx status code +func (o *ReadDeploymentsEntitiesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments entities internal server error response has a 4xx status code +func (o *ReadDeploymentsEntitiesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployments entities internal server error response has a 5xx status code +func (o *ReadDeploymentsEntitiesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read deployments entities internal server error response a status code equal to that given +func (o *ReadDeploymentsEntitiesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read deployments entities internal server error response +func (o *ReadDeploymentsEntitiesInternalServerError) Code() int { + return 500 +} + +func (o *ReadDeploymentsEntitiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentsEntitiesInternalServerError) String() string { + return fmt.Sprintf("[GET /snapshots/entities/deployments/v1][%d] readDeploymentsEntitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentsEntitiesInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ReadDeploymentsEntitiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/container_images/read_combined_images_export_parameters.go b/falcon/client/container_images/read_combined_images_export_parameters.go index 53b7ddf7..7ea77ae2 100644 --- a/falcon/client/container_images/read_combined_images_export_parameters.go +++ b/falcon/client/container_images/read_combined_images_export_parameters.go @@ -94,7 +94,7 @@ type ReadCombinedImagesExportParams struct { /* Sort. - The fields to sort the records on. Supported columns: [base_os cid containers detections firstScanned first_seen highest_detection_severity highest_vulnerability_severity image_digest image_id last_seen layers_with_vulnerabilities packages registry repository tag vulnerabilities] + The fields to sort the records on. Supported columns: [base_os cid detections firstScanned first_seen highest_cps_current_rating highest_detection_severity highest_vulnerability_severity image_digest image_id last_seen layers_with_vulnerabilities packages registry repository tag vulnerabilities] */ Sort *string diff --git a/falcon/client/crowd_strike_api_specification_client.go b/falcon/client/crowd_strike_api_specification_client.go index 792e4f50..b9cbb219 100644 --- a/falcon/client/crowd_strike_api_specification_client.go +++ b/falcon/client/crowd_strike_api_specification_client.go @@ -31,6 +31,7 @@ import ( "github.com/crowdstrike/gofalcon/falcon/client/drift_indicators" "github.com/crowdstrike/gofalcon/falcon/client/event_schema" "github.com/crowdstrike/gofalcon/falcon/client/event_streams" + "github.com/crowdstrike/gofalcon/falcon/client/exposure_management" "github.com/crowdstrike/gofalcon/falcon/client/falcon_complete_dashboard" "github.com/crowdstrike/gofalcon/falcon/client/falcon_container" "github.com/crowdstrike/gofalcon/falcon/client/falcon_container_cli" @@ -61,9 +62,9 @@ import ( "github.com/crowdstrike/gofalcon/falcon/client/mssp" "github.com/crowdstrike/gofalcon/falcon/client/oauth2" "github.com/crowdstrike/gofalcon/falcon/client/ods" + "github.com/crowdstrike/gofalcon/falcon/client/operations" "github.com/crowdstrike/gofalcon/falcon/client/overwatch_dashboard" "github.com/crowdstrike/gofalcon/falcon/client/prevention_policies" - "github.com/crowdstrike/gofalcon/falcon/client/provision" "github.com/crowdstrike/gofalcon/falcon/client/quarantine" "github.com/crowdstrike/gofalcon/falcon/client/quick_scan" "github.com/crowdstrike/gofalcon/falcon/client/real_time_response" @@ -150,6 +151,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *CrowdStrik cli.DriftIndicators = drift_indicators.New(transport, formats) cli.EventSchema = event_schema.New(transport, formats) cli.EventStreams = event_streams.New(transport, formats) + cli.ExposureManagement = exposure_management.New(transport, formats) cli.FalconCompleteDashboard = falcon_complete_dashboard.New(transport, formats) cli.FalconContainer = falcon_container.New(transport, formats) cli.FalconContainerCli = falcon_container_cli.New(transport, formats) @@ -180,9 +182,9 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *CrowdStrik cli.Mssp = mssp.New(transport, formats) cli.Oauth2 = oauth2.New(transport, formats) cli.Ods = ods.New(transport, formats) + cli.Operations = operations.New(transport, formats) cli.OverwatchDashboard = overwatch_dashboard.New(transport, formats) cli.PreventionPolicies = prevention_policies.New(transport, formats) - cli.Provision = provision.New(transport, formats) cli.Quarantine = quarantine.New(transport, formats) cli.QuickScan = quick_scan.New(transport, formats) cli.RealTimeResponse = real_time_response.New(transport, formats) @@ -290,6 +292,8 @@ type CrowdStrikeAPISpecification struct { EventStreams event_streams.ClientService + ExposureManagement exposure_management.ClientService + FalconCompleteDashboard falcon_complete_dashboard.ClientService FalconContainer falcon_container.ClientService @@ -350,12 +354,12 @@ type CrowdStrikeAPISpecification struct { Ods ods.ClientService + Operations operations.ClientService + OverwatchDashboard overwatch_dashboard.ClientService PreventionPolicies prevention_policies.ClientService - Provision provision.ClientService - Quarantine quarantine.ClientService QuickScan quick_scan.ClientService @@ -425,6 +429,7 @@ func (c *CrowdStrikeAPISpecification) SetTransport(transport runtime.ClientTrans c.DriftIndicators.SetTransport(transport) c.EventSchema.SetTransport(transport) c.EventStreams.SetTransport(transport) + c.ExposureManagement.SetTransport(transport) c.FalconCompleteDashboard.SetTransport(transport) c.FalconContainer.SetTransport(transport) c.FalconContainerCli.SetTransport(transport) @@ -455,9 +460,9 @@ func (c *CrowdStrikeAPISpecification) SetTransport(transport runtime.ClientTrans c.Mssp.SetTransport(transport) c.Oauth2.SetTransport(transport) c.Ods.SetTransport(transport) + c.Operations.SetTransport(transport) c.OverwatchDashboard.SetTransport(transport) c.PreventionPolicies.SetTransport(transport) - c.Provision.SetTransport(transport) c.Quarantine.SetTransport(transport) c.QuickScan.SetTransport(transport) c.RealTimeResponse.SetTransport(transport) diff --git a/falcon/client/cspm_registration/connect_c_s_p_m_g_c_p_account_responses.go b/falcon/client/cspm_registration/connect_c_s_p_m_g_c_p_account_responses.go index ce0b2c7b..5c6659e1 100644 --- a/falcon/client/cspm_registration/connect_c_s_p_m_g_c_p_account_responses.go +++ b/falcon/client/cspm_registration/connect_c_s_p_m_g_c_p_account_responses.go @@ -49,6 +49,12 @@ func (o *ConnectCSPMGCPAccountReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result + case 409: + result := NewConnectCSPMGCPAccountConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewConnectCSPMGCPAccountTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -506,6 +512,116 @@ func (o *ConnectCSPMGCPAccountForbidden) readResponse(response runtime.ClientRes return nil } +// NewConnectCSPMGCPAccountConflict creates a ConnectCSPMGCPAccountConflict with default headers values +func NewConnectCSPMGCPAccountConflict() *ConnectCSPMGCPAccountConflict { + return &ConnectCSPMGCPAccountConflict{} +} + +/* +ConnectCSPMGCPAccountConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type ConnectCSPMGCPAccountConflict struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPAccountResponseExtV2 +} + +// IsSuccess returns true when this connect c s p m g c p account conflict response has a 2xx status code +func (o *ConnectCSPMGCPAccountConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this connect c s p m g c p account conflict response has a 3xx status code +func (o *ConnectCSPMGCPAccountConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this connect c s p m g c p account conflict response has a 4xx status code +func (o *ConnectCSPMGCPAccountConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this connect c s p m g c p account conflict response has a 5xx status code +func (o *ConnectCSPMGCPAccountConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this connect c s p m g c p account conflict response a status code equal to that given +func (o *ConnectCSPMGCPAccountConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the connect c s p m g c p account conflict response +func (o *ConnectCSPMGCPAccountConflict) Code() int { + return 409 +} + +func (o *ConnectCSPMGCPAccountConflict) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/v2][%d] connectCSPMGCPAccountConflict %+v", 409, o.Payload) +} + +func (o *ConnectCSPMGCPAccountConflict) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/v2][%d] connectCSPMGCPAccountConflict %+v", 409, o.Payload) +} + +func (o *ConnectCSPMGCPAccountConflict) GetPayload() *models.RegistrationGCPAccountResponseExtV2 { + return o.Payload +} + +func (o *ConnectCSPMGCPAccountConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPAccountResponseExtV2) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewConnectCSPMGCPAccountTooManyRequests creates a ConnectCSPMGCPAccountTooManyRequests with default headers values func NewConnectCSPMGCPAccountTooManyRequests() *ConnectCSPMGCPAccountTooManyRequests { return &ConnectCSPMGCPAccountTooManyRequests{} diff --git a/falcon/client/cspm_registration/create_c_s_p_m_azure_account_responses.go b/falcon/client/cspm_registration/create_c_s_p_m_azure_account_responses.go index ce8ace38..91874146 100644 --- a/falcon/client/cspm_registration/create_c_s_p_m_azure_account_responses.go +++ b/falcon/client/cspm_registration/create_c_s_p_m_azure_account_responses.go @@ -49,6 +49,12 @@ func (o *CreateCSPMAzureAccountReader) ReadResponse(response runtime.ClientRespo return nil, err } return nil, result + case 409: + result := NewCreateCSPMAzureAccountConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewCreateCSPMAzureAccountTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -506,6 +512,116 @@ func (o *CreateCSPMAzureAccountForbidden) readResponse(response runtime.ClientRe return nil } +// NewCreateCSPMAzureAccountConflict creates a CreateCSPMAzureAccountConflict with default headers values +func NewCreateCSPMAzureAccountConflict() *CreateCSPMAzureAccountConflict { + return &CreateCSPMAzureAccountConflict{} +} + +/* +CreateCSPMAzureAccountConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type CreateCSPMAzureAccountConflict struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationAzureAccountResponseV1 +} + +// IsSuccess returns true when this create c s p m azure account conflict response has a 2xx status code +func (o *CreateCSPMAzureAccountConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create c s p m azure account conflict response has a 3xx status code +func (o *CreateCSPMAzureAccountConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create c s p m azure account conflict response has a 4xx status code +func (o *CreateCSPMAzureAccountConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this create c s p m azure account conflict response has a 5xx status code +func (o *CreateCSPMAzureAccountConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this create c s p m azure account conflict response a status code equal to that given +func (o *CreateCSPMAzureAccountConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the create c s p m azure account conflict response +func (o *CreateCSPMAzureAccountConflict) Code() int { + return 409 +} + +func (o *CreateCSPMAzureAccountConflict) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-azure/entities/account/v1][%d] createCSPMAzureAccountConflict %+v", 409, o.Payload) +} + +func (o *CreateCSPMAzureAccountConflict) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-azure/entities/account/v1][%d] createCSPMAzureAccountConflict %+v", 409, o.Payload) +} + +func (o *CreateCSPMAzureAccountConflict) GetPayload() *models.RegistrationAzureAccountResponseV1 { + return o.Payload +} + +func (o *CreateCSPMAzureAccountConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationAzureAccountResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewCreateCSPMAzureAccountTooManyRequests creates a CreateCSPMAzureAccountTooManyRequests with default headers values func NewCreateCSPMAzureAccountTooManyRequests() *CreateCSPMAzureAccountTooManyRequests { return &CreateCSPMAzureAccountTooManyRequests{} diff --git a/falcon/client/cspm_registration/cspm_registration_client.go b/falcon/client/cspm_registration/cspm_registration_client.go index bf116194..50ba3234 100644 --- a/falcon/client/cspm_registration/cspm_registration_client.go +++ b/falcon/client/cspm_registration/cspm_registration_client.go @@ -46,6 +46,8 @@ type ClientService interface { DeleteCSPMAzureAccount(params *DeleteCSPMAzureAccountParams, opts ...ClientOption) (*DeleteCSPMAzureAccountOK, *DeleteCSPMAzureAccountMultiStatus, error) + DeleteCSPMAzureManagementGroup(params *DeleteCSPMAzureManagementGroupParams, opts ...ClientOption) (*DeleteCSPMAzureManagementGroupOK, *DeleteCSPMAzureManagementGroupMultiStatus, error) + DeleteCSPMGCPAccount(params *DeleteCSPMGCPAccountParams, opts ...ClientOption) (*DeleteCSPMGCPAccountOK, *DeleteCSPMGCPAccountMultiStatus, error) GetBehaviorDetections(params *GetBehaviorDetectionsParams, opts ...ClientOption) (*GetBehaviorDetectionsOK, error) @@ -68,6 +70,8 @@ type ClientService interface { GetCSPMGCPUserScriptsAttachment(params *GetCSPMGCPUserScriptsAttachmentParams, opts ...ClientOption) (*GetCSPMGCPUserScriptsAttachmentOK, error) + GetCSPMGCPValidateAccountsExt(params *GetCSPMGCPValidateAccountsExtParams, opts ...ClientOption) (*GetCSPMGCPValidateAccountsExtOK, error) + GetCSPMPoliciesDetails(params *GetCSPMPoliciesDetailsParams, opts ...ClientOption) (*GetCSPMPoliciesDetailsOK, *GetCSPMPoliciesDetailsMultiStatus, error) GetCSPMPolicy(params *GetCSPMPolicyParams, opts ...ClientOption) (*GetCSPMPolicyOK, *GetCSPMPolicyMultiStatus, error) @@ -90,12 +94,16 @@ type ClientService interface { UpdateCSPMAzureTenantDefaultSubscriptionID(params *UpdateCSPMAzureTenantDefaultSubscriptionIDParams, opts ...ClientOption) (*UpdateCSPMAzureTenantDefaultSubscriptionIDCreated, error) - UpdateCSPMGCPAccount(params *UpdateCSPMGCPAccountParams, opts ...ClientOption) (*UpdateCSPMGCPAccountCreated, *UpdateCSPMGCPAccountMultiStatus, error) + UpdateCSPMGCPAccount(params *UpdateCSPMGCPAccountParams, opts ...ClientOption) (*UpdateCSPMGCPAccountOK, *UpdateCSPMGCPAccountMultiStatus, error) + + UpdateCSPMGCPServiceAccountsExt(params *UpdateCSPMGCPServiceAccountsExtParams, opts ...ClientOption) (*UpdateCSPMGCPServiceAccountsExtOK, error) UpdateCSPMPolicySettings(params *UpdateCSPMPolicySettingsParams, opts ...ClientOption) (*UpdateCSPMPolicySettingsOK, *UpdateCSPMPolicySettingsMultiStatus, error) UpdateCSPMScanSchedule(params *UpdateCSPMScanScheduleParams, opts ...ClientOption) (*UpdateCSPMScanScheduleOK, error) + ValidateCSPMGCPServiceAccountExt(params *ValidateCSPMGCPServiceAccountExtParams, opts ...ClientOption) (*ValidateCSPMGCPServiceAccountExtOK, *ValidateCSPMGCPServiceAccountExtMultiStatus, error) + SetTransport(transport runtime.ClientTransport) } @@ -410,6 +418,45 @@ func (a *Client) DeleteCSPMAzureAccount(params *DeleteCSPMAzureAccountParams, op panic(msg) } +/* +DeleteCSPMAzureManagementGroup deletes azure management groups from the system +*/ +func (a *Client) DeleteCSPMAzureManagementGroup(params *DeleteCSPMAzureManagementGroupParams, opts ...ClientOption) (*DeleteCSPMAzureManagementGroupOK, *DeleteCSPMAzureManagementGroupMultiStatus, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteCSPMAzureManagementGroupParams() + } + op := &runtime.ClientOperation{ + ID: "DeleteCSPMAzureManagementGroup", + Method: "DELETE", + PathPattern: "/cloud-connect-cspm-azure/entities/management-group/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteCSPMAzureManagementGroupReader{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, nil, err + } + switch value := result.(type) { + case *DeleteCSPMAzureManagementGroupOK: + return value, nil, nil + case *DeleteCSPMAzureManagementGroupMultiStatus: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for cspm_registration: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DeleteCSPMGCPAccount deletes a g c p account from the system */ @@ -834,6 +881,44 @@ func (a *Client) GetCSPMGCPUserScriptsAttachment(params *GetCSPMGCPUserScriptsAt panic(msg) } +/* +GetCSPMGCPValidateAccountsExt runs a synchronous health check +*/ +func (a *Client) GetCSPMGCPValidateAccountsExt(params *GetCSPMGCPValidateAccountsExtParams, opts ...ClientOption) (*GetCSPMGCPValidateAccountsExtOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCSPMGCPValidateAccountsExtParams() + } + op := &runtime.ClientOperation{ + ID: "GetCSPMGCPValidateAccountsExt", + Method: "POST", + PathPattern: "/cloud-connect-cspm-gcp/entities/account/validate/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetCSPMGCPValidateAccountsExtReader{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.(*GetCSPMGCPValidateAccountsExtOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetCSPMGCPValidateAccountsExt: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetCSPMPoliciesDetails givens an array of policy i ds returns detailed policies information */ @@ -1260,7 +1345,7 @@ func (a *Client) UpdateCSPMAzureTenantDefaultSubscriptionID(params *UpdateCSPMAz /* UpdateCSPMGCPAccount patches a existing account in our system for a customer */ -func (a *Client) UpdateCSPMGCPAccount(params *UpdateCSPMGCPAccountParams, opts ...ClientOption) (*UpdateCSPMGCPAccountCreated, *UpdateCSPMGCPAccountMultiStatus, error) { +func (a *Client) UpdateCSPMGCPAccount(params *UpdateCSPMGCPAccountParams, opts ...ClientOption) (*UpdateCSPMGCPAccountOK, *UpdateCSPMGCPAccountMultiStatus, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateCSPMGCPAccountParams() @@ -1286,7 +1371,7 @@ func (a *Client) UpdateCSPMGCPAccount(params *UpdateCSPMGCPAccountParams, opts . return nil, nil, err } switch value := result.(type) { - case *UpdateCSPMGCPAccountCreated: + case *UpdateCSPMGCPAccountOK: return value, nil, nil case *UpdateCSPMGCPAccountMultiStatus: return nil, value, nil @@ -1296,6 +1381,44 @@ func (a *Client) UpdateCSPMGCPAccount(params *UpdateCSPMGCPAccountParams, opts . panic(msg) } +/* +UpdateCSPMGCPServiceAccountsExt patches the service account key for external clients +*/ +func (a *Client) UpdateCSPMGCPServiceAccountsExt(params *UpdateCSPMGCPServiceAccountsExtParams, opts ...ClientOption) (*UpdateCSPMGCPServiceAccountsExtOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateCSPMGCPServiceAccountsExtParams() + } + op := &runtime.ClientOperation{ + ID: "UpdateCSPMGCPServiceAccountsExt", + Method: "PATCH", + PathPattern: "/cloud-connect-cspm-gcp/entities/service-accounts/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateCSPMGCPServiceAccountsExtReader{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.(*UpdateCSPMGCPServiceAccountsExtOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for UpdateCSPMGCPServiceAccountsExt: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* UpdateCSPMPolicySettings updates a policy setting can be used to override policy severity or to disable a policy entirely */ @@ -1373,6 +1496,45 @@ func (a *Client) UpdateCSPMScanSchedule(params *UpdateCSPMScanScheduleParams, op panic(msg) } +/* +ValidateCSPMGCPServiceAccountExt validates credentials for a service account +*/ +func (a *Client) ValidateCSPMGCPServiceAccountExt(params *ValidateCSPMGCPServiceAccountExtParams, opts ...ClientOption) (*ValidateCSPMGCPServiceAccountExtOK, *ValidateCSPMGCPServiceAccountExtMultiStatus, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateCSPMGCPServiceAccountExtParams() + } + op := &runtime.ClientOperation{ + ID: "ValidateCSPMGCPServiceAccountExt", + Method: "POST", + PathPattern: "/cloud-connect-cspm-gcp/entities/service-accounts/validate/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateCSPMGCPServiceAccountExtReader{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, nil, err + } + switch value := result.(type) { + case *ValidateCSPMGCPServiceAccountExtOK: + return value, nil, nil + case *ValidateCSPMGCPServiceAccountExtMultiStatus: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for cspm_registration: 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/falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_parameters.go b/falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_parameters.go new file mode 100644 index 00000000..96b55edf --- /dev/null +++ b/falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewDeleteCSPMAzureManagementGroupParams creates a new DeleteCSPMAzureManagementGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteCSPMAzureManagementGroupParams() *DeleteCSPMAzureManagementGroupParams { + return &DeleteCSPMAzureManagementGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteCSPMAzureManagementGroupParamsWithTimeout creates a new DeleteCSPMAzureManagementGroupParams object +// with the ability to set a timeout on a request. +func NewDeleteCSPMAzureManagementGroupParamsWithTimeout(timeout time.Duration) *DeleteCSPMAzureManagementGroupParams { + return &DeleteCSPMAzureManagementGroupParams{ + timeout: timeout, + } +} + +// NewDeleteCSPMAzureManagementGroupParamsWithContext creates a new DeleteCSPMAzureManagementGroupParams object +// with the ability to set a context for a request. +func NewDeleteCSPMAzureManagementGroupParamsWithContext(ctx context.Context) *DeleteCSPMAzureManagementGroupParams { + return &DeleteCSPMAzureManagementGroupParams{ + Context: ctx, + } +} + +// NewDeleteCSPMAzureManagementGroupParamsWithHTTPClient creates a new DeleteCSPMAzureManagementGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteCSPMAzureManagementGroupParamsWithHTTPClient(client *http.Client) *DeleteCSPMAzureManagementGroupParams { + return &DeleteCSPMAzureManagementGroupParams{ + HTTPClient: client, + } +} + +/* +DeleteCSPMAzureManagementGroupParams contains all the parameters to send to the API endpoint + + for the delete c s p m azure management group operation. + + Typically these are written to a http.Request. +*/ +type DeleteCSPMAzureManagementGroupParams struct { + + /* TenantIds. + + Tenant ids to remove + */ + TenantIds []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete c s p m azure management group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCSPMAzureManagementGroupParams) WithDefaults() *DeleteCSPMAzureManagementGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete c s p m azure management group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCSPMAzureManagementGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) WithTimeout(timeout time.Duration) *DeleteCSPMAzureManagementGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) WithContext(ctx context.Context) *DeleteCSPMAzureManagementGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) WithHTTPClient(client *http.Client) *DeleteCSPMAzureManagementGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTenantIds adds the tenantIds to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) WithTenantIds(tenantIds []string) *DeleteCSPMAzureManagementGroupParams { + o.SetTenantIds(tenantIds) + return o +} + +// SetTenantIds adds the tenantIds to the delete c s p m azure management group params +func (o *DeleteCSPMAzureManagementGroupParams) SetTenantIds(tenantIds []string) { + o.TenantIds = tenantIds +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteCSPMAzureManagementGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TenantIds != nil { + + // binding items for tenant_ids + joinedTenantIds := o.bindParamTenantIds(reg) + + // query array param tenant_ids + if err := r.SetQueryParam("tenant_ids", joinedTenantIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDeleteCSPMAzureManagementGroup binds the parameter tenant_ids +func (o *DeleteCSPMAzureManagementGroupParams) bindParamTenantIds(formats strfmt.Registry) []string { + tenantIdsIR := o.TenantIds + + var tenantIdsIC []string + for _, tenantIdsIIR := range tenantIdsIR { // explode []string + + tenantIdsIIV := tenantIdsIIR // string as string + tenantIdsIC = append(tenantIdsIC, tenantIdsIIV) + } + + // items.CollectionFormat: "multi" + tenantIdsIS := swag.JoinByFormat(tenantIdsIC, "multi") + + return tenantIdsIS +} diff --git a/falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_responses.go b/falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_responses.go new file mode 100644 index 00000000..a773e837 --- /dev/null +++ b/falcon/client/cspm_registration/delete_c_s_p_m_azure_management_group_responses.go @@ -0,0 +1,742 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// DeleteCSPMAzureManagementGroupReader is a Reader for the DeleteCSPMAzureManagementGroup structure. +type DeleteCSPMAzureManagementGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteCSPMAzureManagementGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteCSPMAzureManagementGroupOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 207: + result := NewDeleteCSPMAzureManagementGroupMultiStatus() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteCSPMAzureManagementGroupBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteCSPMAzureManagementGroupForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewDeleteCSPMAzureManagementGroupTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteCSPMAzureManagementGroupInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1] DeleteCSPMAzureManagementGroup", response, response.Code()) + } +} + +// NewDeleteCSPMAzureManagementGroupOK creates a DeleteCSPMAzureManagementGroupOK with default headers values +func NewDeleteCSPMAzureManagementGroupOK() *DeleteCSPMAzureManagementGroupOK { + return &DeleteCSPMAzureManagementGroupOK{} +} + +/* +DeleteCSPMAzureManagementGroupOK describes a response with status code 200, with default header values. + +OK +*/ +type DeleteCSPMAzureManagementGroupOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this delete c s p m azure management group o k response has a 2xx status code +func (o *DeleteCSPMAzureManagementGroupOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete c s p m azure management group o k response has a 3xx status code +func (o *DeleteCSPMAzureManagementGroupOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete c s p m azure management group o k response has a 4xx status code +func (o *DeleteCSPMAzureManagementGroupOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete c s p m azure management group o k response has a 5xx status code +func (o *DeleteCSPMAzureManagementGroupOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete c s p m azure management group o k response a status code equal to that given +func (o *DeleteCSPMAzureManagementGroupOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete c s p m azure management group o k response +func (o *DeleteCSPMAzureManagementGroupOK) Code() int { + return 200 +} + +func (o *DeleteCSPMAzureManagementGroupOK) Error() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupOK %+v", 200, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupOK) String() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupOK %+v", 200, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupOK) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *DeleteCSPMAzureManagementGroupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCSPMAzureManagementGroupMultiStatus creates a DeleteCSPMAzureManagementGroupMultiStatus with default headers values +func NewDeleteCSPMAzureManagementGroupMultiStatus() *DeleteCSPMAzureManagementGroupMultiStatus { + return &DeleteCSPMAzureManagementGroupMultiStatus{} +} + +/* +DeleteCSPMAzureManagementGroupMultiStatus describes a response with status code 207, with default header values. + +Multi-Status +*/ +type DeleteCSPMAzureManagementGroupMultiStatus struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this delete c s p m azure management group multi status response has a 2xx status code +func (o *DeleteCSPMAzureManagementGroupMultiStatus) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete c s p m azure management group multi status response has a 3xx status code +func (o *DeleteCSPMAzureManagementGroupMultiStatus) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete c s p m azure management group multi status response has a 4xx status code +func (o *DeleteCSPMAzureManagementGroupMultiStatus) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete c s p m azure management group multi status response has a 5xx status code +func (o *DeleteCSPMAzureManagementGroupMultiStatus) IsServerError() bool { + return false +} + +// IsCode returns true when this delete c s p m azure management group multi status response a status code equal to that given +func (o *DeleteCSPMAzureManagementGroupMultiStatus) IsCode(code int) bool { + return code == 207 +} + +// Code gets the status code for the delete c s p m azure management group multi status response +func (o *DeleteCSPMAzureManagementGroupMultiStatus) Code() int { + return 207 +} + +func (o *DeleteCSPMAzureManagementGroupMultiStatus) Error() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupMultiStatus %+v", 207, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupMultiStatus) String() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupMultiStatus %+v", 207, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupMultiStatus) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *DeleteCSPMAzureManagementGroupMultiStatus) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCSPMAzureManagementGroupBadRequest creates a DeleteCSPMAzureManagementGroupBadRequest with default headers values +func NewDeleteCSPMAzureManagementGroupBadRequest() *DeleteCSPMAzureManagementGroupBadRequest { + return &DeleteCSPMAzureManagementGroupBadRequest{} +} + +/* +DeleteCSPMAzureManagementGroupBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type DeleteCSPMAzureManagementGroupBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this delete c s p m azure management group bad request response has a 2xx status code +func (o *DeleteCSPMAzureManagementGroupBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete c s p m azure management group bad request response has a 3xx status code +func (o *DeleteCSPMAzureManagementGroupBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete c s p m azure management group bad request response has a 4xx status code +func (o *DeleteCSPMAzureManagementGroupBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete c s p m azure management group bad request response has a 5xx status code +func (o *DeleteCSPMAzureManagementGroupBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete c s p m azure management group bad request response a status code equal to that given +func (o *DeleteCSPMAzureManagementGroupBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the delete c s p m azure management group bad request response +func (o *DeleteCSPMAzureManagementGroupBadRequest) Code() int { + return 400 +} + +func (o *DeleteCSPMAzureManagementGroupBadRequest) Error() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupBadRequest) String() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *DeleteCSPMAzureManagementGroupBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCSPMAzureManagementGroupForbidden creates a DeleteCSPMAzureManagementGroupForbidden with default headers values +func NewDeleteCSPMAzureManagementGroupForbidden() *DeleteCSPMAzureManagementGroupForbidden { + return &DeleteCSPMAzureManagementGroupForbidden{} +} + +/* +DeleteCSPMAzureManagementGroupForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DeleteCSPMAzureManagementGroupForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this delete c s p m azure management group forbidden response has a 2xx status code +func (o *DeleteCSPMAzureManagementGroupForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete c s p m azure management group forbidden response has a 3xx status code +func (o *DeleteCSPMAzureManagementGroupForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete c s p m azure management group forbidden response has a 4xx status code +func (o *DeleteCSPMAzureManagementGroupForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete c s p m azure management group forbidden response has a 5xx status code +func (o *DeleteCSPMAzureManagementGroupForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this delete c s p m azure management group forbidden response a status code equal to that given +func (o *DeleteCSPMAzureManagementGroupForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the delete c s p m azure management group forbidden response +func (o *DeleteCSPMAzureManagementGroupForbidden) Code() int { + return 403 +} + +func (o *DeleteCSPMAzureManagementGroupForbidden) Error() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupForbidden %+v", 403, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupForbidden) String() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupForbidden %+v", 403, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *DeleteCSPMAzureManagementGroupForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCSPMAzureManagementGroupTooManyRequests creates a DeleteCSPMAzureManagementGroupTooManyRequests with default headers values +func NewDeleteCSPMAzureManagementGroupTooManyRequests() *DeleteCSPMAzureManagementGroupTooManyRequests { + return &DeleteCSPMAzureManagementGroupTooManyRequests{} +} + +/* +DeleteCSPMAzureManagementGroupTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type DeleteCSPMAzureManagementGroupTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this delete c s p m azure management group too many requests response has a 2xx status code +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete c s p m azure management group too many requests response has a 3xx status code +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete c s p m azure management group too many requests response has a 4xx status code +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete c s p m azure management group too many requests response has a 5xx status code +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this delete c s p m azure management group too many requests response a status code equal to that given +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the delete c s p m azure management group too many requests response +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) Code() int { + return 429 +} + +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) Error() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupTooManyRequests %+v", 429, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) String() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupTooManyRequests %+v", 429, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *DeleteCSPMAzureManagementGroupTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCSPMAzureManagementGroupInternalServerError creates a DeleteCSPMAzureManagementGroupInternalServerError with default headers values +func NewDeleteCSPMAzureManagementGroupInternalServerError() *DeleteCSPMAzureManagementGroupInternalServerError { + return &DeleteCSPMAzureManagementGroupInternalServerError{} +} + +/* +DeleteCSPMAzureManagementGroupInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type DeleteCSPMAzureManagementGroupInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this delete c s p m azure management group internal server error response has a 2xx status code +func (o *DeleteCSPMAzureManagementGroupInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete c s p m azure management group internal server error response has a 3xx status code +func (o *DeleteCSPMAzureManagementGroupInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete c s p m azure management group internal server error response has a 4xx status code +func (o *DeleteCSPMAzureManagementGroupInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete c s p m azure management group internal server error response has a 5xx status code +func (o *DeleteCSPMAzureManagementGroupInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete c s p m azure management group internal server error response a status code equal to that given +func (o *DeleteCSPMAzureManagementGroupInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the delete c s p m azure management group internal server error response +func (o *DeleteCSPMAzureManagementGroupInternalServerError) Code() int { + return 500 +} + +func (o *DeleteCSPMAzureManagementGroupInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupInternalServerError) String() string { + return fmt.Sprintf("[DELETE /cloud-connect-cspm-azure/entities/management-group/v1][%d] deleteCSPMAzureManagementGroupInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteCSPMAzureManagementGroupInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *DeleteCSPMAzureManagementGroupInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_parameters.go b/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_parameters.go index c8ddaa53..b5cbed06 100644 --- a/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_parameters.go +++ b/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_parameters.go @@ -62,12 +62,51 @@ GetCSPMAwsAccountScriptsAttachmentParams contains all the parameters to send to */ type GetCSPMAwsAccountScriptsAttachmentParams struct { + /* Accounts. + + The list of accounts to register + */ + Accounts []string + + /* AwsProfile. + + The AWS profile to be used during registration + */ + AwsProfile *string + + // BehaviorAssessmentEnabled. + BehaviorAssessmentEnabled *string + + /* CustomRoleName. + + The custom IAM role to be used during registration + */ + CustomRoleName *string + /* Ids. AWS account IDs */ Ids []string + /* OrganizationID. + + The AWS organization ID to be registered + */ + OrganizationID *string + + // SensorManagementEnabled. + SensorManagementEnabled *string + + /* Template. + + Template to be rendered + */ + Template *string + + // UseExistingCloudtrail. + UseExistingCloudtrail *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -121,6 +160,50 @@ func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetHTTPClient(client *http.Cl o.HTTPClient = client } +// WithAccounts adds the accounts to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithAccounts(accounts []string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetAccounts(accounts) + return o +} + +// SetAccounts adds the accounts to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetAccounts(accounts []string) { + o.Accounts = accounts +} + +// WithAwsProfile adds the awsProfile to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithAwsProfile(awsProfile *string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetAwsProfile(awsProfile) + return o +} + +// SetAwsProfile adds the awsProfile to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetAwsProfile(awsProfile *string) { + o.AwsProfile = awsProfile +} + +// WithBehaviorAssessmentEnabled adds the behaviorAssessmentEnabled to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithBehaviorAssessmentEnabled(behaviorAssessmentEnabled *string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetBehaviorAssessmentEnabled(behaviorAssessmentEnabled) + return o +} + +// SetBehaviorAssessmentEnabled adds the behaviorAssessmentEnabled to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetBehaviorAssessmentEnabled(behaviorAssessmentEnabled *string) { + o.BehaviorAssessmentEnabled = behaviorAssessmentEnabled +} + +// WithCustomRoleName adds the customRoleName to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithCustomRoleName(customRoleName *string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetCustomRoleName(customRoleName) + return o +} + +// SetCustomRoleName adds the customRoleName to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetCustomRoleName(customRoleName *string) { + o.CustomRoleName = customRoleName +} + // WithIds adds the ids to the get c s p m aws account scripts attachment params func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithIds(ids []string) *GetCSPMAwsAccountScriptsAttachmentParams { o.SetIds(ids) @@ -132,6 +215,50 @@ func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetIds(ids []string) { o.Ids = ids } +// WithOrganizationID adds the organizationID to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithOrganizationID(organizationID *string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetOrganizationID(organizationID *string) { + o.OrganizationID = organizationID +} + +// WithSensorManagementEnabled adds the sensorManagementEnabled to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithSensorManagementEnabled(sensorManagementEnabled *string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetSensorManagementEnabled(sensorManagementEnabled) + return o +} + +// SetSensorManagementEnabled adds the sensorManagementEnabled to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetSensorManagementEnabled(sensorManagementEnabled *string) { + o.SensorManagementEnabled = sensorManagementEnabled +} + +// WithTemplate adds the template to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithTemplate(template *string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetTemplate(template) + return o +} + +// SetTemplate adds the template to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetTemplate(template *string) { + o.Template = template +} + +// WithUseExistingCloudtrail adds the useExistingCloudtrail to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) WithUseExistingCloudtrail(useExistingCloudtrail *string) *GetCSPMAwsAccountScriptsAttachmentParams { + o.SetUseExistingCloudtrail(useExistingCloudtrail) + return o +} + +// SetUseExistingCloudtrail adds the useExistingCloudtrail to the get c s p m aws account scripts attachment params +func (o *GetCSPMAwsAccountScriptsAttachmentParams) SetUseExistingCloudtrail(useExistingCloudtrail *string) { + o.UseExistingCloudtrail = useExistingCloudtrail +} + // WriteToRequest writes these params to a swagger request func (o *GetCSPMAwsAccountScriptsAttachmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -140,6 +267,68 @@ func (o *GetCSPMAwsAccountScriptsAttachmentParams) WriteToRequest(r runtime.Clie } var res []error + if o.Accounts != nil { + + // binding items for accounts + joinedAccounts := o.bindParamAccounts(reg) + + // query array param accounts + if err := r.SetQueryParam("accounts", joinedAccounts...); err != nil { + return err + } + } + + if o.AwsProfile != nil { + + // query param aws_profile + var qrAwsProfile string + + if o.AwsProfile != nil { + qrAwsProfile = *o.AwsProfile + } + qAwsProfile := qrAwsProfile + if qAwsProfile != "" { + + if err := r.SetQueryParam("aws_profile", qAwsProfile); err != nil { + return err + } + } + } + + if o.BehaviorAssessmentEnabled != nil { + + // query param behavior_assessment_enabled + var qrBehaviorAssessmentEnabled string + + if o.BehaviorAssessmentEnabled != nil { + qrBehaviorAssessmentEnabled = *o.BehaviorAssessmentEnabled + } + qBehaviorAssessmentEnabled := qrBehaviorAssessmentEnabled + if qBehaviorAssessmentEnabled != "" { + + if err := r.SetQueryParam("behavior_assessment_enabled", qBehaviorAssessmentEnabled); err != nil { + return err + } + } + } + + if o.CustomRoleName != nil { + + // query param custom_role_name + var qrCustomRoleName string + + if o.CustomRoleName != nil { + qrCustomRoleName = *o.CustomRoleName + } + qCustomRoleName := qrCustomRoleName + if qCustomRoleName != "" { + + if err := r.SetQueryParam("custom_role_name", qCustomRoleName); err != nil { + return err + } + } + } + if o.Ids != nil { // binding items for ids @@ -151,12 +340,97 @@ func (o *GetCSPMAwsAccountScriptsAttachmentParams) WriteToRequest(r runtime.Clie } } + if o.OrganizationID != nil { + + // query param organization_id + var qrOrganizationID string + + if o.OrganizationID != nil { + qrOrganizationID = *o.OrganizationID + } + qOrganizationID := qrOrganizationID + if qOrganizationID != "" { + + if err := r.SetQueryParam("organization_id", qOrganizationID); err != nil { + return err + } + } + } + + if o.SensorManagementEnabled != nil { + + // query param sensor_management_enabled + var qrSensorManagementEnabled string + + if o.SensorManagementEnabled != nil { + qrSensorManagementEnabled = *o.SensorManagementEnabled + } + qSensorManagementEnabled := qrSensorManagementEnabled + if qSensorManagementEnabled != "" { + + if err := r.SetQueryParam("sensor_management_enabled", qSensorManagementEnabled); err != nil { + return err + } + } + } + + if o.Template != nil { + + // query param template + var qrTemplate string + + if o.Template != nil { + qrTemplate = *o.Template + } + qTemplate := qrTemplate + if qTemplate != "" { + + if err := r.SetQueryParam("template", qTemplate); err != nil { + return err + } + } + } + + if o.UseExistingCloudtrail != nil { + + // query param use_existing_cloudtrail + var qrUseExistingCloudtrail string + + if o.UseExistingCloudtrail != nil { + qrUseExistingCloudtrail = *o.UseExistingCloudtrail + } + qUseExistingCloudtrail := qrUseExistingCloudtrail + if qUseExistingCloudtrail != "" { + + if err := r.SetQueryParam("use_existing_cloudtrail", qUseExistingCloudtrail); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +// bindParamGetCSPMAwsAccountScriptsAttachment binds the parameter accounts +func (o *GetCSPMAwsAccountScriptsAttachmentParams) bindParamAccounts(formats strfmt.Registry) []string { + accountsIR := o.Accounts + + var accountsIC []string + for _, accountsIIR := range accountsIR { // explode []string + + accountsIIV := accountsIIR // string as string + accountsIC = append(accountsIC, accountsIIV) + } + + // items.CollectionFormat: "multi" + accountsIS := swag.JoinByFormat(accountsIC, "multi") + + return accountsIS +} + // bindParamGetCSPMAwsAccountScriptsAttachment binds the parameter ids func (o *GetCSPMAwsAccountScriptsAttachmentParams) bindParamIds(formats strfmt.Registry) []string { idsIR := o.Ids diff --git a/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_responses.go b/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_responses.go index e023def6..372e13e2 100644 --- a/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_responses.go +++ b/falcon/client/cspm_registration/get_c_s_p_m_aws_account_scripts_attachment_responses.go @@ -194,7 +194,7 @@ type GetCSPMAwsAccountScriptsAttachmentBadRequest struct { */ XRateLimitRemaining int64 - Payload *models.RegistrationAWSProvisionGetAccountScriptResponseV2 + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get c s p m aws account scripts attachment bad request response has a 2xx status code @@ -235,7 +235,7 @@ func (o *GetCSPMAwsAccountScriptsAttachmentBadRequest) String() string { return fmt.Sprintf("[GET /cloud-connect-cspm-aws/entities/user-scripts-download/v1][%d] getCSPMAwsAccountScriptsAttachmentBadRequest %+v", 400, o.Payload) } -func (o *GetCSPMAwsAccountScriptsAttachmentBadRequest) GetPayload() *models.RegistrationAWSProvisionGetAccountScriptResponseV2 { +func (o *GetCSPMAwsAccountScriptsAttachmentBadRequest) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -270,7 +270,7 @@ func (o *GetCSPMAwsAccountScriptsAttachmentBadRequest) readResponse(response run o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.RegistrationAWSProvisionGetAccountScriptResponseV2) + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -304,7 +304,7 @@ type GetCSPMAwsAccountScriptsAttachmentForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get c s p m aws account scripts attachment forbidden response has a 2xx status code @@ -345,7 +345,7 @@ func (o *GetCSPMAwsAccountScriptsAttachmentForbidden) String() string { return fmt.Sprintf("[GET /cloud-connect-cspm-aws/entities/user-scripts-download/v1][%d] getCSPMAwsAccountScriptsAttachmentForbidden %+v", 403, o.Payload) } -func (o *GetCSPMAwsAccountScriptsAttachmentForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetCSPMAwsAccountScriptsAttachmentForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -380,7 +380,7 @@ func (o *GetCSPMAwsAccountScriptsAttachmentForbidden) readResponse(response runt o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -539,7 +539,7 @@ type GetCSPMAwsAccountScriptsAttachmentInternalServerError struct { */ XRateLimitRemaining int64 - Payload *models.RegistrationAWSProvisionGetAccountScriptResponseV2 + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get c s p m aws account scripts attachment internal server error response has a 2xx status code @@ -580,7 +580,7 @@ func (o *GetCSPMAwsAccountScriptsAttachmentInternalServerError) String() string return fmt.Sprintf("[GET /cloud-connect-cspm-aws/entities/user-scripts-download/v1][%d] getCSPMAwsAccountScriptsAttachmentInternalServerError %+v", 500, o.Payload) } -func (o *GetCSPMAwsAccountScriptsAttachmentInternalServerError) GetPayload() *models.RegistrationAWSProvisionGetAccountScriptResponseV2 { +func (o *GetCSPMAwsAccountScriptsAttachmentInternalServerError) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -615,7 +615,7 @@ func (o *GetCSPMAwsAccountScriptsAttachmentInternalServerError) readResponse(res o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.RegistrationAWSProvisionGetAccountScriptResponseV2) + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_parameters.go b/falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_parameters.go new file mode 100644 index 00000000..28816c81 --- /dev/null +++ b/falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewGetCSPMGCPValidateAccountsExtParams creates a new GetCSPMGCPValidateAccountsExtParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCSPMGCPValidateAccountsExtParams() *GetCSPMGCPValidateAccountsExtParams { + return &GetCSPMGCPValidateAccountsExtParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCSPMGCPValidateAccountsExtParamsWithTimeout creates a new GetCSPMGCPValidateAccountsExtParams object +// with the ability to set a timeout on a request. +func NewGetCSPMGCPValidateAccountsExtParamsWithTimeout(timeout time.Duration) *GetCSPMGCPValidateAccountsExtParams { + return &GetCSPMGCPValidateAccountsExtParams{ + timeout: timeout, + } +} + +// NewGetCSPMGCPValidateAccountsExtParamsWithContext creates a new GetCSPMGCPValidateAccountsExtParams object +// with the ability to set a context for a request. +func NewGetCSPMGCPValidateAccountsExtParamsWithContext(ctx context.Context) *GetCSPMGCPValidateAccountsExtParams { + return &GetCSPMGCPValidateAccountsExtParams{ + Context: ctx, + } +} + +// NewGetCSPMGCPValidateAccountsExtParamsWithHTTPClient creates a new GetCSPMGCPValidateAccountsExtParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCSPMGCPValidateAccountsExtParamsWithHTTPClient(client *http.Client) *GetCSPMGCPValidateAccountsExtParams { + return &GetCSPMGCPValidateAccountsExtParams{ + HTTPClient: client, + } +} + +/* +GetCSPMGCPValidateAccountsExtParams contains all the parameters to send to the API endpoint + + for the get c s p m g c p validate accounts ext operation. + + Typically these are written to a http.Request. +*/ +type GetCSPMGCPValidateAccountsExtParams struct { + + // Body. + Body *models.RegistrationGCPAccountValidationRequestV1 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get c s p m g c p validate accounts ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCSPMGCPValidateAccountsExtParams) WithDefaults() *GetCSPMGCPValidateAccountsExtParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get c s p m g c p validate accounts ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCSPMGCPValidateAccountsExtParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) WithTimeout(timeout time.Duration) *GetCSPMGCPValidateAccountsExtParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) WithContext(ctx context.Context) *GetCSPMGCPValidateAccountsExtParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) WithHTTPClient(client *http.Client) *GetCSPMGCPValidateAccountsExtParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) WithBody(body *models.RegistrationGCPAccountValidationRequestV1) *GetCSPMGCPValidateAccountsExtParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get c s p m g c p validate accounts ext params +func (o *GetCSPMGCPValidateAccountsExtParams) SetBody(body *models.RegistrationGCPAccountValidationRequestV1) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCSPMGCPValidateAccountsExtParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_responses.go b/falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_responses.go new file mode 100644 index 00000000..c952157c --- /dev/null +++ b/falcon/client/cspm_registration/get_c_s_p_m_g_c_p_validate_accounts_ext_responses.go @@ -0,0 +1,742 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// GetCSPMGCPValidateAccountsExtReader is a Reader for the GetCSPMGCPValidateAccountsExt structure. +type GetCSPMGCPValidateAccountsExtReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCSPMGCPValidateAccountsExtReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCSPMGCPValidateAccountsExtOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetCSPMGCPValidateAccountsExtBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCSPMGCPValidateAccountsExtForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCSPMGCPValidateAccountsExtNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetCSPMGCPValidateAccountsExtTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCSPMGCPValidateAccountsExtInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1] GetCSPMGCPValidateAccountsExt", response, response.Code()) + } +} + +// NewGetCSPMGCPValidateAccountsExtOK creates a GetCSPMGCPValidateAccountsExtOK with default headers values +func NewGetCSPMGCPValidateAccountsExtOK() *GetCSPMGCPValidateAccountsExtOK { + return &GetCSPMGCPValidateAccountsExtOK{} +} + +/* +GetCSPMGCPValidateAccountsExtOK describes a response with status code 200, with default header values. + +OK +*/ +type GetCSPMGCPValidateAccountsExtOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPAccountValidationResponseV1 +} + +// IsSuccess returns true when this get c s p m g c p validate accounts ext o k response has a 2xx status code +func (o *GetCSPMGCPValidateAccountsExtOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get c s p m g c p validate accounts ext o k response has a 3xx status code +func (o *GetCSPMGCPValidateAccountsExtOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get c s p m g c p validate accounts ext o k response has a 4xx status code +func (o *GetCSPMGCPValidateAccountsExtOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get c s p m g c p validate accounts ext o k response has a 5xx status code +func (o *GetCSPMGCPValidateAccountsExtOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get c s p m g c p validate accounts ext o k response a status code equal to that given +func (o *GetCSPMGCPValidateAccountsExtOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get c s p m g c p validate accounts ext o k response +func (o *GetCSPMGCPValidateAccountsExtOK) Code() int { + return 200 +} + +func (o *GetCSPMGCPValidateAccountsExtOK) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtOK %+v", 200, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtOK) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtOK %+v", 200, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtOK) GetPayload() *models.RegistrationGCPAccountValidationResponseV1 { + return o.Payload +} + +func (o *GetCSPMGCPValidateAccountsExtOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCSPMGCPValidateAccountsExtBadRequest creates a GetCSPMGCPValidateAccountsExtBadRequest with default headers values +func NewGetCSPMGCPValidateAccountsExtBadRequest() *GetCSPMGCPValidateAccountsExtBadRequest { + return &GetCSPMGCPValidateAccountsExtBadRequest{} +} + +/* +GetCSPMGCPValidateAccountsExtBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetCSPMGCPValidateAccountsExtBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPAccountValidationResponseV1 +} + +// IsSuccess returns true when this get c s p m g c p validate accounts ext bad request response has a 2xx status code +func (o *GetCSPMGCPValidateAccountsExtBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get c s p m g c p validate accounts ext bad request response has a 3xx status code +func (o *GetCSPMGCPValidateAccountsExtBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get c s p m g c p validate accounts ext bad request response has a 4xx status code +func (o *GetCSPMGCPValidateAccountsExtBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get c s p m g c p validate accounts ext bad request response has a 5xx status code +func (o *GetCSPMGCPValidateAccountsExtBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get c s p m g c p validate accounts ext bad request response a status code equal to that given +func (o *GetCSPMGCPValidateAccountsExtBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get c s p m g c p validate accounts ext bad request response +func (o *GetCSPMGCPValidateAccountsExtBadRequest) Code() int { + return 400 +} + +func (o *GetCSPMGCPValidateAccountsExtBadRequest) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtBadRequest %+v", 400, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtBadRequest) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtBadRequest %+v", 400, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtBadRequest) GetPayload() *models.RegistrationGCPAccountValidationResponseV1 { + return o.Payload +} + +func (o *GetCSPMGCPValidateAccountsExtBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCSPMGCPValidateAccountsExtForbidden creates a GetCSPMGCPValidateAccountsExtForbidden with default headers values +func NewGetCSPMGCPValidateAccountsExtForbidden() *GetCSPMGCPValidateAccountsExtForbidden { + return &GetCSPMGCPValidateAccountsExtForbidden{} +} + +/* +GetCSPMGCPValidateAccountsExtForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetCSPMGCPValidateAccountsExtForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get c s p m g c p validate accounts ext forbidden response has a 2xx status code +func (o *GetCSPMGCPValidateAccountsExtForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get c s p m g c p validate accounts ext forbidden response has a 3xx status code +func (o *GetCSPMGCPValidateAccountsExtForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get c s p m g c p validate accounts ext forbidden response has a 4xx status code +func (o *GetCSPMGCPValidateAccountsExtForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get c s p m g c p validate accounts ext forbidden response has a 5xx status code +func (o *GetCSPMGCPValidateAccountsExtForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get c s p m g c p validate accounts ext forbidden response a status code equal to that given +func (o *GetCSPMGCPValidateAccountsExtForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get c s p m g c p validate accounts ext forbidden response +func (o *GetCSPMGCPValidateAccountsExtForbidden) Code() int { + return 403 +} + +func (o *GetCSPMGCPValidateAccountsExtForbidden) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtForbidden %+v", 403, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtForbidden) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtForbidden %+v", 403, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetCSPMGCPValidateAccountsExtForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCSPMGCPValidateAccountsExtNotFound creates a GetCSPMGCPValidateAccountsExtNotFound with default headers values +func NewGetCSPMGCPValidateAccountsExtNotFound() *GetCSPMGCPValidateAccountsExtNotFound { + return &GetCSPMGCPValidateAccountsExtNotFound{} +} + +/* +GetCSPMGCPValidateAccountsExtNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type GetCSPMGCPValidateAccountsExtNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPAccountValidationResponseV1 +} + +// IsSuccess returns true when this get c s p m g c p validate accounts ext not found response has a 2xx status code +func (o *GetCSPMGCPValidateAccountsExtNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get c s p m g c p validate accounts ext not found response has a 3xx status code +func (o *GetCSPMGCPValidateAccountsExtNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get c s p m g c p validate accounts ext not found response has a 4xx status code +func (o *GetCSPMGCPValidateAccountsExtNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get c s p m g c p validate accounts ext not found response has a 5xx status code +func (o *GetCSPMGCPValidateAccountsExtNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get c s p m g c p validate accounts ext not found response a status code equal to that given +func (o *GetCSPMGCPValidateAccountsExtNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get c s p m g c p validate accounts ext not found response +func (o *GetCSPMGCPValidateAccountsExtNotFound) Code() int { + return 404 +} + +func (o *GetCSPMGCPValidateAccountsExtNotFound) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtNotFound %+v", 404, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtNotFound) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtNotFound %+v", 404, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtNotFound) GetPayload() *models.RegistrationGCPAccountValidationResponseV1 { + return o.Payload +} + +func (o *GetCSPMGCPValidateAccountsExtNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCSPMGCPValidateAccountsExtTooManyRequests creates a GetCSPMGCPValidateAccountsExtTooManyRequests with default headers values +func NewGetCSPMGCPValidateAccountsExtTooManyRequests() *GetCSPMGCPValidateAccountsExtTooManyRequests { + return &GetCSPMGCPValidateAccountsExtTooManyRequests{} +} + +/* +GetCSPMGCPValidateAccountsExtTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetCSPMGCPValidateAccountsExtTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get c s p m g c p validate accounts ext too many requests response has a 2xx status code +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get c s p m g c p validate accounts ext too many requests response has a 3xx status code +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get c s p m g c p validate accounts ext too many requests response has a 4xx status code +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get c s p m g c p validate accounts ext too many requests response has a 5xx status code +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get c s p m g c p validate accounts ext too many requests response a status code equal to that given +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get c s p m g c p validate accounts ext too many requests response +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) Code() int { + return 429 +} + +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetCSPMGCPValidateAccountsExtTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCSPMGCPValidateAccountsExtInternalServerError creates a GetCSPMGCPValidateAccountsExtInternalServerError with default headers values +func NewGetCSPMGCPValidateAccountsExtInternalServerError() *GetCSPMGCPValidateAccountsExtInternalServerError { + return &GetCSPMGCPValidateAccountsExtInternalServerError{} +} + +/* +GetCSPMGCPValidateAccountsExtInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GetCSPMGCPValidateAccountsExtInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPAccountValidationResponseV1 +} + +// IsSuccess returns true when this get c s p m g c p validate accounts ext internal server error response has a 2xx status code +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get c s p m g c p validate accounts ext internal server error response has a 3xx status code +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get c s p m g c p validate accounts ext internal server error response has a 4xx status code +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get c s p m g c p validate accounts ext internal server error response has a 5xx status code +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get c s p m g c p validate accounts ext internal server error response a status code equal to that given +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get c s p m g c p validate accounts ext internal server error response +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) Code() int { + return 500 +} + +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/account/validate/v1][%d] getCSPMGCPValidateAccountsExtInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) GetPayload() *models.RegistrationGCPAccountValidationResponseV1 { + return o.Payload +} + +func (o *GetCSPMGCPValidateAccountsExtInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/cspm_registration/get_configuration_detection_i_ds_v2_parameters.go b/falcon/client/cspm_registration/get_configuration_detection_i_ds_v2_parameters.go index c200c270..4553bb9d 100644 --- a/falcon/client/cspm_registration/get_configuration_detection_i_ds_v2_parameters.go +++ b/falcon/client/cspm_registration/get_configuration_detection_i_ds_v2_parameters.go @@ -64,7 +64,7 @@ type GetConfigurationDetectionIDsV2Params struct { /* Filter. - use_current_scan_ids - *use this to get records for latest scans* + use_current_scan_ids - *use this to get records for latest scans (ignored when next_token is set)* account_name account_id agent_id diff --git a/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_parameters.go b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_parameters.go index 6c1f90df..05830b39 100644 --- a/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_parameters.go +++ b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_parameters.go @@ -64,7 +64,7 @@ UpdateCSPMGCPAccountParams contains all the parameters to send to the API endpoi type UpdateCSPMGCPAccountParams struct { // Body. - Body *models.RegistrationGCPAccountPatchRequest + Body *models.RegistrationGCPAccountPatchRequestV1 timeout time.Duration Context context.Context @@ -120,13 +120,13 @@ func (o *UpdateCSPMGCPAccountParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the update c s p m g c p account params -func (o *UpdateCSPMGCPAccountParams) WithBody(body *models.RegistrationGCPAccountPatchRequest) *UpdateCSPMGCPAccountParams { +func (o *UpdateCSPMGCPAccountParams) WithBody(body *models.RegistrationGCPAccountPatchRequestV1) *UpdateCSPMGCPAccountParams { o.SetBody(body) return o } // SetBody adds the body to the update c s p m g c p account params -func (o *UpdateCSPMGCPAccountParams) SetBody(body *models.RegistrationGCPAccountPatchRequest) { +func (o *UpdateCSPMGCPAccountParams) SetBody(body *models.RegistrationGCPAccountPatchRequestV1) { o.Body = body } diff --git a/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_responses.go b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_responses.go index bd62be32..dfdbebe9 100644 --- a/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_responses.go +++ b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_account_responses.go @@ -25,8 +25,8 @@ type UpdateCSPMGCPAccountReader struct { // ReadResponse reads a server response into the received o. func (o *UpdateCSPMGCPAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 201: - result := NewUpdateCSPMGCPAccountCreated() + case 200: + result := NewUpdateCSPMGCPAccountOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -66,17 +66,17 @@ func (o *UpdateCSPMGCPAccountReader) ReadResponse(response runtime.ClientRespons } } -// NewUpdateCSPMGCPAccountCreated creates a UpdateCSPMGCPAccountCreated with default headers values -func NewUpdateCSPMGCPAccountCreated() *UpdateCSPMGCPAccountCreated { - return &UpdateCSPMGCPAccountCreated{} +// NewUpdateCSPMGCPAccountOK creates a UpdateCSPMGCPAccountOK with default headers values +func NewUpdateCSPMGCPAccountOK() *UpdateCSPMGCPAccountOK { + return &UpdateCSPMGCPAccountOK{} } /* -UpdateCSPMGCPAccountCreated describes a response with status code 201, with default header values. +UpdateCSPMGCPAccountOK describes a response with status code 200, with default header values. -Created +OK */ -type UpdateCSPMGCPAccountCreated struct { +type UpdateCSPMGCPAccountOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -93,49 +93,49 @@ type UpdateCSPMGCPAccountCreated struct { Payload *models.RegistrationGCPAccountResponseV1 } -// IsSuccess returns true when this update c s p m g c p account created response has a 2xx status code -func (o *UpdateCSPMGCPAccountCreated) IsSuccess() bool { +// IsSuccess returns true when this update c s p m g c p account o k response has a 2xx status code +func (o *UpdateCSPMGCPAccountOK) IsSuccess() bool { return true } -// IsRedirect returns true when this update c s p m g c p account created response has a 3xx status code -func (o *UpdateCSPMGCPAccountCreated) IsRedirect() bool { +// IsRedirect returns true when this update c s p m g c p account o k response has a 3xx status code +func (o *UpdateCSPMGCPAccountOK) IsRedirect() bool { return false } -// IsClientError returns true when this update c s p m g c p account created response has a 4xx status code -func (o *UpdateCSPMGCPAccountCreated) IsClientError() bool { +// IsClientError returns true when this update c s p m g c p account o k response has a 4xx status code +func (o *UpdateCSPMGCPAccountOK) IsClientError() bool { return false } -// IsServerError returns true when this update c s p m g c p account created response has a 5xx status code -func (o *UpdateCSPMGCPAccountCreated) IsServerError() bool { +// IsServerError returns true when this update c s p m g c p account o k response has a 5xx status code +func (o *UpdateCSPMGCPAccountOK) IsServerError() bool { return false } -// IsCode returns true when this update c s p m g c p account created response a status code equal to that given -func (o *UpdateCSPMGCPAccountCreated) IsCode(code int) bool { - return code == 201 +// IsCode returns true when this update c s p m g c p account o k response a status code equal to that given +func (o *UpdateCSPMGCPAccountOK) IsCode(code int) bool { + return code == 200 } -// Code gets the status code for the update c s p m g c p account created response -func (o *UpdateCSPMGCPAccountCreated) Code() int { - return 201 +// Code gets the status code for the update c s p m g c p account o k response +func (o *UpdateCSPMGCPAccountOK) Code() int { + return 200 } -func (o *UpdateCSPMGCPAccountCreated) Error() string { - return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/account/v1][%d] updateCSPMGCPAccountCreated %+v", 201, o.Payload) +func (o *UpdateCSPMGCPAccountOK) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/account/v1][%d] updateCSPMGCPAccountOK %+v", 200, o.Payload) } -func (o *UpdateCSPMGCPAccountCreated) String() string { - return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/account/v1][%d] updateCSPMGCPAccountCreated %+v", 201, o.Payload) +func (o *UpdateCSPMGCPAccountOK) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/account/v1][%d] updateCSPMGCPAccountOK %+v", 200, o.Payload) } -func (o *UpdateCSPMGCPAccountCreated) GetPayload() *models.RegistrationGCPAccountResponseV1 { +func (o *UpdateCSPMGCPAccountOK) GetPayload() *models.RegistrationGCPAccountResponseV1 { return o.Payload } -func (o *UpdateCSPMGCPAccountCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UpdateCSPMGCPAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") diff --git a/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_parameters.go b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_parameters.go new file mode 100644 index 00000000..83600cc9 --- /dev/null +++ b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewUpdateCSPMGCPServiceAccountsExtParams creates a new UpdateCSPMGCPServiceAccountsExtParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateCSPMGCPServiceAccountsExtParams() *UpdateCSPMGCPServiceAccountsExtParams { + return &UpdateCSPMGCPServiceAccountsExtParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateCSPMGCPServiceAccountsExtParamsWithTimeout creates a new UpdateCSPMGCPServiceAccountsExtParams object +// with the ability to set a timeout on a request. +func NewUpdateCSPMGCPServiceAccountsExtParamsWithTimeout(timeout time.Duration) *UpdateCSPMGCPServiceAccountsExtParams { + return &UpdateCSPMGCPServiceAccountsExtParams{ + timeout: timeout, + } +} + +// NewUpdateCSPMGCPServiceAccountsExtParamsWithContext creates a new UpdateCSPMGCPServiceAccountsExtParams object +// with the ability to set a context for a request. +func NewUpdateCSPMGCPServiceAccountsExtParamsWithContext(ctx context.Context) *UpdateCSPMGCPServiceAccountsExtParams { + return &UpdateCSPMGCPServiceAccountsExtParams{ + Context: ctx, + } +} + +// NewUpdateCSPMGCPServiceAccountsExtParamsWithHTTPClient creates a new UpdateCSPMGCPServiceAccountsExtParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateCSPMGCPServiceAccountsExtParamsWithHTTPClient(client *http.Client) *UpdateCSPMGCPServiceAccountsExtParams { + return &UpdateCSPMGCPServiceAccountsExtParams{ + HTTPClient: client, + } +} + +/* +UpdateCSPMGCPServiceAccountsExtParams contains all the parameters to send to the API endpoint + + for the update c s p m g c p service accounts ext operation. + + Typically these are written to a http.Request. +*/ +type UpdateCSPMGCPServiceAccountsExtParams struct { + + // Body. + Body *models.RegistrationGCPServiceAccountPatchRequestV1 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update c s p m g c p service accounts ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCSPMGCPServiceAccountsExtParams) WithDefaults() *UpdateCSPMGCPServiceAccountsExtParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update c s p m g c p service accounts ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCSPMGCPServiceAccountsExtParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) WithTimeout(timeout time.Duration) *UpdateCSPMGCPServiceAccountsExtParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) WithContext(ctx context.Context) *UpdateCSPMGCPServiceAccountsExtParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) WithHTTPClient(client *http.Client) *UpdateCSPMGCPServiceAccountsExtParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) WithBody(body *models.RegistrationGCPServiceAccountPatchRequestV1) *UpdateCSPMGCPServiceAccountsExtParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update c s p m g c p service accounts ext params +func (o *UpdateCSPMGCPServiceAccountsExtParams) SetBody(body *models.RegistrationGCPServiceAccountPatchRequestV1) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateCSPMGCPServiceAccountsExtParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_responses.go b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_responses.go new file mode 100644 index 00000000..ebe18195 --- /dev/null +++ b/falcon/client/cspm_registration/update_c_s_p_m_g_c_p_service_accounts_ext_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// UpdateCSPMGCPServiceAccountsExtReader is a Reader for the UpdateCSPMGCPServiceAccountsExt structure. +type UpdateCSPMGCPServiceAccountsExtReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateCSPMGCPServiceAccountsExtReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateCSPMGCPServiceAccountsExtOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateCSPMGCPServiceAccountsExtBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateCSPMGCPServiceAccountsExtForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewUpdateCSPMGCPServiceAccountsExtTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateCSPMGCPServiceAccountsExtInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1] UpdateCSPMGCPServiceAccountsExt", response, response.Code()) + } +} + +// NewUpdateCSPMGCPServiceAccountsExtOK creates a UpdateCSPMGCPServiceAccountsExtOK with default headers values +func NewUpdateCSPMGCPServiceAccountsExtOK() *UpdateCSPMGCPServiceAccountsExtOK { + return &UpdateCSPMGCPServiceAccountsExtOK{} +} + +/* +UpdateCSPMGCPServiceAccountsExtOK describes a response with status code 200, with default header values. + +OK +*/ +type UpdateCSPMGCPServiceAccountsExtOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountResponseExtV1 +} + +// IsSuccess returns true when this update c s p m g c p service accounts ext o k response has a 2xx status code +func (o *UpdateCSPMGCPServiceAccountsExtOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update c s p m g c p service accounts ext o k response has a 3xx status code +func (o *UpdateCSPMGCPServiceAccountsExtOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update c s p m g c p service accounts ext o k response has a 4xx status code +func (o *UpdateCSPMGCPServiceAccountsExtOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update c s p m g c p service accounts ext o k response has a 5xx status code +func (o *UpdateCSPMGCPServiceAccountsExtOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update c s p m g c p service accounts ext o k response a status code equal to that given +func (o *UpdateCSPMGCPServiceAccountsExtOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update c s p m g c p service accounts ext o k response +func (o *UpdateCSPMGCPServiceAccountsExtOK) Code() int { + return 200 +} + +func (o *UpdateCSPMGCPServiceAccountsExtOK) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtOK %+v", 200, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtOK) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtOK %+v", 200, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtOK) GetPayload() *models.RegistrationGCPServiceAccountResponseExtV1 { + return o.Payload +} + +func (o *UpdateCSPMGCPServiceAccountsExtOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountResponseExtV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateCSPMGCPServiceAccountsExtBadRequest creates a UpdateCSPMGCPServiceAccountsExtBadRequest with default headers values +func NewUpdateCSPMGCPServiceAccountsExtBadRequest() *UpdateCSPMGCPServiceAccountsExtBadRequest { + return &UpdateCSPMGCPServiceAccountsExtBadRequest{} +} + +/* +UpdateCSPMGCPServiceAccountsExtBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateCSPMGCPServiceAccountsExtBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountResponseExtV1 +} + +// IsSuccess returns true when this update c s p m g c p service accounts ext bad request response has a 2xx status code +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update c s p m g c p service accounts ext bad request response has a 3xx status code +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update c s p m g c p service accounts ext bad request response has a 4xx status code +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update c s p m g c p service accounts ext bad request response has a 5xx status code +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update c s p m g c p service accounts ext bad request response a status code equal to that given +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update c s p m g c p service accounts ext bad request response +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) Code() int { + return 400 +} + +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) GetPayload() *models.RegistrationGCPServiceAccountResponseExtV1 { + return o.Payload +} + +func (o *UpdateCSPMGCPServiceAccountsExtBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountResponseExtV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateCSPMGCPServiceAccountsExtForbidden creates a UpdateCSPMGCPServiceAccountsExtForbidden with default headers values +func NewUpdateCSPMGCPServiceAccountsExtForbidden() *UpdateCSPMGCPServiceAccountsExtForbidden { + return &UpdateCSPMGCPServiceAccountsExtForbidden{} +} + +/* +UpdateCSPMGCPServiceAccountsExtForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type UpdateCSPMGCPServiceAccountsExtForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this update c s p m g c p service accounts ext forbidden response has a 2xx status code +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update c s p m g c p service accounts ext forbidden response has a 3xx status code +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update c s p m g c p service accounts ext forbidden response has a 4xx status code +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update c s p m g c p service accounts ext forbidden response has a 5xx status code +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update c s p m g c p service accounts ext forbidden response a status code equal to that given +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update c s p m g c p service accounts ext forbidden response +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) Code() int { + return 403 +} + +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtForbidden %+v", 403, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtForbidden %+v", 403, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *UpdateCSPMGCPServiceAccountsExtForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateCSPMGCPServiceAccountsExtTooManyRequests creates a UpdateCSPMGCPServiceAccountsExtTooManyRequests with default headers values +func NewUpdateCSPMGCPServiceAccountsExtTooManyRequests() *UpdateCSPMGCPServiceAccountsExtTooManyRequests { + return &UpdateCSPMGCPServiceAccountsExtTooManyRequests{} +} + +/* +UpdateCSPMGCPServiceAccountsExtTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type UpdateCSPMGCPServiceAccountsExtTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this update c s p m g c p service accounts ext too many requests response has a 2xx status code +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update c s p m g c p service accounts ext too many requests response has a 3xx status code +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update c s p m g c p service accounts ext too many requests response has a 4xx status code +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this update c s p m g c p service accounts ext too many requests response has a 5xx status code +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this update c s p m g c p service accounts ext too many requests response a status code equal to that given +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the update c s p m g c p service accounts ext too many requests response +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) Code() int { + return 429 +} + +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *UpdateCSPMGCPServiceAccountsExtTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateCSPMGCPServiceAccountsExtInternalServerError creates a UpdateCSPMGCPServiceAccountsExtInternalServerError with default headers values +func NewUpdateCSPMGCPServiceAccountsExtInternalServerError() *UpdateCSPMGCPServiceAccountsExtInternalServerError { + return &UpdateCSPMGCPServiceAccountsExtInternalServerError{} +} + +/* +UpdateCSPMGCPServiceAccountsExtInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type UpdateCSPMGCPServiceAccountsExtInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountResponseExtV1 +} + +// IsSuccess returns true when this update c s p m g c p service accounts ext internal server error response has a 2xx status code +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update c s p m g c p service accounts ext internal server error response has a 3xx status code +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update c s p m g c p service accounts ext internal server error response has a 4xx status code +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update c s p m g c p service accounts ext internal server error response has a 5xx status code +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update c s p m g c p service accounts ext internal server error response a status code equal to that given +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update c s p m g c p service accounts ext internal server error response +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) Code() int { + return 500 +} + +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-cspm-gcp/entities/service-accounts/v1][%d] updateCSPMGCPServiceAccountsExtInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) GetPayload() *models.RegistrationGCPServiceAccountResponseExtV1 { + return o.Payload +} + +func (o *UpdateCSPMGCPServiceAccountsExtInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountResponseExtV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_parameters.go b/falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_parameters.go new file mode 100644 index 00000000..e0dedf3e --- /dev/null +++ b/falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewValidateCSPMGCPServiceAccountExtParams creates a new ValidateCSPMGCPServiceAccountExtParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewValidateCSPMGCPServiceAccountExtParams() *ValidateCSPMGCPServiceAccountExtParams { + return &ValidateCSPMGCPServiceAccountExtParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateCSPMGCPServiceAccountExtParamsWithTimeout creates a new ValidateCSPMGCPServiceAccountExtParams object +// with the ability to set a timeout on a request. +func NewValidateCSPMGCPServiceAccountExtParamsWithTimeout(timeout time.Duration) *ValidateCSPMGCPServiceAccountExtParams { + return &ValidateCSPMGCPServiceAccountExtParams{ + timeout: timeout, + } +} + +// NewValidateCSPMGCPServiceAccountExtParamsWithContext creates a new ValidateCSPMGCPServiceAccountExtParams object +// with the ability to set a context for a request. +func NewValidateCSPMGCPServiceAccountExtParamsWithContext(ctx context.Context) *ValidateCSPMGCPServiceAccountExtParams { + return &ValidateCSPMGCPServiceAccountExtParams{ + Context: ctx, + } +} + +// NewValidateCSPMGCPServiceAccountExtParamsWithHTTPClient creates a new ValidateCSPMGCPServiceAccountExtParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateCSPMGCPServiceAccountExtParamsWithHTTPClient(client *http.Client) *ValidateCSPMGCPServiceAccountExtParams { + return &ValidateCSPMGCPServiceAccountExtParams{ + HTTPClient: client, + } +} + +/* +ValidateCSPMGCPServiceAccountExtParams contains all the parameters to send to the API endpoint + + for the validate c s p m g c p service account ext operation. + + Typically these are written to a http.Request. +*/ +type ValidateCSPMGCPServiceAccountExtParams struct { + + // Body. + Body *models.RegistrationGCPServiceAccountValidationRequestV1 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate c s p m g c p service account ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateCSPMGCPServiceAccountExtParams) WithDefaults() *ValidateCSPMGCPServiceAccountExtParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate c s p m g c p service account ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateCSPMGCPServiceAccountExtParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) WithTimeout(timeout time.Duration) *ValidateCSPMGCPServiceAccountExtParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) WithContext(ctx context.Context) *ValidateCSPMGCPServiceAccountExtParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) WithHTTPClient(client *http.Client) *ValidateCSPMGCPServiceAccountExtParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) WithBody(body *models.RegistrationGCPServiceAccountValidationRequestV1) *ValidateCSPMGCPServiceAccountExtParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the validate c s p m g c p service account ext params +func (o *ValidateCSPMGCPServiceAccountExtParams) SetBody(body *models.RegistrationGCPServiceAccountValidationRequestV1) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateCSPMGCPServiceAccountExtParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_responses.go b/falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_responses.go new file mode 100644 index 00000000..1db1b6d0 --- /dev/null +++ b/falcon/client/cspm_registration/validate_c_s_p_m_g_c_p_service_account_ext_responses.go @@ -0,0 +1,858 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package cspm_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// ValidateCSPMGCPServiceAccountExtReader is a Reader for the ValidateCSPMGCPServiceAccountExt structure. +type ValidateCSPMGCPServiceAccountExtReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateCSPMGCPServiceAccountExtReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateCSPMGCPServiceAccountExtOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 207: + result := NewValidateCSPMGCPServiceAccountExtMultiStatus() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewValidateCSPMGCPServiceAccountExtBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewValidateCSPMGCPServiceAccountExtForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewValidateCSPMGCPServiceAccountExtNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewValidateCSPMGCPServiceAccountExtTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewValidateCSPMGCPServiceAccountExtInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1] ValidateCSPMGCPServiceAccountExt", response, response.Code()) + } +} + +// NewValidateCSPMGCPServiceAccountExtOK creates a ValidateCSPMGCPServiceAccountExtOK with default headers values +func NewValidateCSPMGCPServiceAccountExtOK() *ValidateCSPMGCPServiceAccountExtOK { + return &ValidateCSPMGCPServiceAccountExtOK{} +} + +/* +ValidateCSPMGCPServiceAccountExtOK describes a response with status code 200, with default header values. + +Created +*/ +type ValidateCSPMGCPServiceAccountExtOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountValidationResponseV1 +} + +// IsSuccess returns true when this validate c s p m g c p service account ext o k response has a 2xx status code +func (o *ValidateCSPMGCPServiceAccountExtOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate c s p m g c p service account ext o k response has a 3xx status code +func (o *ValidateCSPMGCPServiceAccountExtOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate c s p m g c p service account ext o k response has a 4xx status code +func (o *ValidateCSPMGCPServiceAccountExtOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate c s p m g c p service account ext o k response has a 5xx status code +func (o *ValidateCSPMGCPServiceAccountExtOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate c s p m g c p service account ext o k response a status code equal to that given +func (o *ValidateCSPMGCPServiceAccountExtOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate c s p m g c p service account ext o k response +func (o *ValidateCSPMGCPServiceAccountExtOK) Code() int { + return 200 +} + +func (o *ValidateCSPMGCPServiceAccountExtOK) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtOK %+v", 200, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtOK) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtOK %+v", 200, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtOK) GetPayload() *models.RegistrationGCPServiceAccountValidationResponseV1 { + return o.Payload +} + +func (o *ValidateCSPMGCPServiceAccountExtOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateCSPMGCPServiceAccountExtMultiStatus creates a ValidateCSPMGCPServiceAccountExtMultiStatus with default headers values +func NewValidateCSPMGCPServiceAccountExtMultiStatus() *ValidateCSPMGCPServiceAccountExtMultiStatus { + return &ValidateCSPMGCPServiceAccountExtMultiStatus{} +} + +/* +ValidateCSPMGCPServiceAccountExtMultiStatus describes a response with status code 207, with default header values. + +Multi-Status +*/ +type ValidateCSPMGCPServiceAccountExtMultiStatus struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountValidationResponseV1 +} + +// IsSuccess returns true when this validate c s p m g c p service account ext multi status response has a 2xx status code +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate c s p m g c p service account ext multi status response has a 3xx status code +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate c s p m g c p service account ext multi status response has a 4xx status code +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate c s p m g c p service account ext multi status response has a 5xx status code +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) IsServerError() bool { + return false +} + +// IsCode returns true when this validate c s p m g c p service account ext multi status response a status code equal to that given +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) IsCode(code int) bool { + return code == 207 +} + +// Code gets the status code for the validate c s p m g c p service account ext multi status response +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) Code() int { + return 207 +} + +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtMultiStatus %+v", 207, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtMultiStatus %+v", 207, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) GetPayload() *models.RegistrationGCPServiceAccountValidationResponseV1 { + return o.Payload +} + +func (o *ValidateCSPMGCPServiceAccountExtMultiStatus) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateCSPMGCPServiceAccountExtBadRequest creates a ValidateCSPMGCPServiceAccountExtBadRequest with default headers values +func NewValidateCSPMGCPServiceAccountExtBadRequest() *ValidateCSPMGCPServiceAccountExtBadRequest { + return &ValidateCSPMGCPServiceAccountExtBadRequest{} +} + +/* +ValidateCSPMGCPServiceAccountExtBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ValidateCSPMGCPServiceAccountExtBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountValidationResponseV1 +} + +// IsSuccess returns true when this validate c s p m g c p service account ext bad request response has a 2xx status code +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate c s p m g c p service account ext bad request response has a 3xx status code +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate c s p m g c p service account ext bad request response has a 4xx status code +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this validate c s p m g c p service account ext bad request response has a 5xx status code +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this validate c s p m g c p service account ext bad request response a status code equal to that given +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the validate c s p m g c p service account ext bad request response +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) Code() int { + return 400 +} + +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtBadRequest %+v", 400, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtBadRequest %+v", 400, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) GetPayload() *models.RegistrationGCPServiceAccountValidationResponseV1 { + return o.Payload +} + +func (o *ValidateCSPMGCPServiceAccountExtBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateCSPMGCPServiceAccountExtForbidden creates a ValidateCSPMGCPServiceAccountExtForbidden with default headers values +func NewValidateCSPMGCPServiceAccountExtForbidden() *ValidateCSPMGCPServiceAccountExtForbidden { + return &ValidateCSPMGCPServiceAccountExtForbidden{} +} + +/* +ValidateCSPMGCPServiceAccountExtForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ValidateCSPMGCPServiceAccountExtForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this validate c s p m g c p service account ext forbidden response has a 2xx status code +func (o *ValidateCSPMGCPServiceAccountExtForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate c s p m g c p service account ext forbidden response has a 3xx status code +func (o *ValidateCSPMGCPServiceAccountExtForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate c s p m g c p service account ext forbidden response has a 4xx status code +func (o *ValidateCSPMGCPServiceAccountExtForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this validate c s p m g c p service account ext forbidden response has a 5xx status code +func (o *ValidateCSPMGCPServiceAccountExtForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this validate c s p m g c p service account ext forbidden response a status code equal to that given +func (o *ValidateCSPMGCPServiceAccountExtForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the validate c s p m g c p service account ext forbidden response +func (o *ValidateCSPMGCPServiceAccountExtForbidden) Code() int { + return 403 +} + +func (o *ValidateCSPMGCPServiceAccountExtForbidden) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtForbidden %+v", 403, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtForbidden) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtForbidden %+v", 403, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ValidateCSPMGCPServiceAccountExtForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateCSPMGCPServiceAccountExtNotFound creates a ValidateCSPMGCPServiceAccountExtNotFound with default headers values +func NewValidateCSPMGCPServiceAccountExtNotFound() *ValidateCSPMGCPServiceAccountExtNotFound { + return &ValidateCSPMGCPServiceAccountExtNotFound{} +} + +/* +ValidateCSPMGCPServiceAccountExtNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ValidateCSPMGCPServiceAccountExtNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountValidationResponseV1 +} + +// IsSuccess returns true when this validate c s p m g c p service account ext not found response has a 2xx status code +func (o *ValidateCSPMGCPServiceAccountExtNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate c s p m g c p service account ext not found response has a 3xx status code +func (o *ValidateCSPMGCPServiceAccountExtNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate c s p m g c p service account ext not found response has a 4xx status code +func (o *ValidateCSPMGCPServiceAccountExtNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this validate c s p m g c p service account ext not found response has a 5xx status code +func (o *ValidateCSPMGCPServiceAccountExtNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this validate c s p m g c p service account ext not found response a status code equal to that given +func (o *ValidateCSPMGCPServiceAccountExtNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the validate c s p m g c p service account ext not found response +func (o *ValidateCSPMGCPServiceAccountExtNotFound) Code() int { + return 404 +} + +func (o *ValidateCSPMGCPServiceAccountExtNotFound) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtNotFound %+v", 404, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtNotFound) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtNotFound %+v", 404, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtNotFound) GetPayload() *models.RegistrationGCPServiceAccountValidationResponseV1 { + return o.Payload +} + +func (o *ValidateCSPMGCPServiceAccountExtNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateCSPMGCPServiceAccountExtTooManyRequests creates a ValidateCSPMGCPServiceAccountExtTooManyRequests with default headers values +func NewValidateCSPMGCPServiceAccountExtTooManyRequests() *ValidateCSPMGCPServiceAccountExtTooManyRequests { + return &ValidateCSPMGCPServiceAccountExtTooManyRequests{} +} + +/* +ValidateCSPMGCPServiceAccountExtTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ValidateCSPMGCPServiceAccountExtTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this validate c s p m g c p service account ext too many requests response has a 2xx status code +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate c s p m g c p service account ext too many requests response has a 3xx status code +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate c s p m g c p service account ext too many requests response has a 4xx status code +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this validate c s p m g c p service account ext too many requests response has a 5xx status code +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this validate c s p m g c p service account ext too many requests response a status code equal to that given +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the validate c s p m g c p service account ext too many requests response +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) Code() int { + return 429 +} + +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ValidateCSPMGCPServiceAccountExtTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateCSPMGCPServiceAccountExtInternalServerError creates a ValidateCSPMGCPServiceAccountExtInternalServerError with default headers values +func NewValidateCSPMGCPServiceAccountExtInternalServerError() *ValidateCSPMGCPServiceAccountExtInternalServerError { + return &ValidateCSPMGCPServiceAccountExtInternalServerError{} +} + +/* +ValidateCSPMGCPServiceAccountExtInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ValidateCSPMGCPServiceAccountExtInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountValidationResponseV1 +} + +// IsSuccess returns true when this validate c s p m g c p service account ext internal server error response has a 2xx status code +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate c s p m g c p service account ext internal server error response has a 3xx status code +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate c s p m g c p service account ext internal server error response has a 4xx status code +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate c s p m g c p service account ext internal server error response has a 5xx status code +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this validate c s p m g c p service account ext internal server error response a status code equal to that given +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the validate c s p m g c p service account ext internal server error response +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) Code() int { + return 500 +} + +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) Error() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtInternalServerError %+v", 500, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) String() string { + return fmt.Sprintf("[POST /cloud-connect-cspm-gcp/entities/service-accounts/validate/v1][%d] validateCSPMGCPServiceAccountExtInternalServerError %+v", 500, o.Payload) +} + +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) GetPayload() *models.RegistrationGCPServiceAccountValidationResponseV1 { + return o.Payload +} + +func (o *ValidateCSPMGCPServiceAccountExtInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountValidationResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/custom_ioa/custom_ioa_client.go b/falcon/client/custom_ioa/custom_ioa_client.go index 16d4def5..d0e53d63 100644 --- a/falcon/client/custom_ioa/custom_ioa_client.go +++ b/falcon/client/custom_ioa/custom_ioa_client.go @@ -66,6 +66,8 @@ type ClientService interface { UpdateRules(params *UpdateRulesParams, opts ...ClientOption) (*UpdateRulesOK, error) + UpdateRulesV2(params *UpdateRulesV2Params, opts ...ClientOption) (*UpdateRulesV2OK, error) + Validate(params *ValidateParams, opts ...ClientOption) (*ValidateOK, error) SetTransport(transport runtime.ClientTransport) @@ -755,6 +757,44 @@ func (a *Client) UpdateRules(params *UpdateRulesParams, opts ...ClientOption) (* panic(msg) } +/* +UpdateRulesV2 updates name description enabled or field values for individual rules within a rule group the v1 flavor of this call requires the caller to specify the complete state for all the rules in the rule group instead the v2 flavor will accept the subset of rules in the rule group and apply the attribute updates to the subset of rules in the rule group return the updated rules +*/ +func (a *Client) UpdateRulesV2(params *UpdateRulesV2Params, opts ...ClientOption) (*UpdateRulesV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateRulesV2Params() + } + op := &runtime.ClientOperation{ + ID: "update-rules-v2", + Method: "PATCH", + PathPattern: "/ioarules/entities/rules/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateRulesV2Reader{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.(*UpdateRulesV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update-rules-v2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* Validate validates field values and checks for matches if a test string is provided */ diff --git a/falcon/client/custom_ioa/query_rule_groups_full_parameters.go b/falcon/client/custom_ioa/query_rule_groups_full_parameters.go index 7b1d2d21..81c998c5 100644 --- a/falcon/client/custom_ioa/query_rule_groups_full_parameters.go +++ b/falcon/client/custom_ioa/query_rule_groups_full_parameters.go @@ -88,7 +88,7 @@ type QueryRuleGroupsFullParams struct { /* Sort. - Possible order by fields: {enabled, name, created_by, created_on, modified_by, modified_on} + Possible order by fields: {modified_by, modified_on, enabled, name, created_by, created_on} */ Sort *string diff --git a/falcon/client/custom_ioa/query_rule_groups_mixin0_parameters.go b/falcon/client/custom_ioa/query_rule_groups_mixin0_parameters.go index 3a9e9bf7..7e582af9 100644 --- a/falcon/client/custom_ioa/query_rule_groups_mixin0_parameters.go +++ b/falcon/client/custom_ioa/query_rule_groups_mixin0_parameters.go @@ -88,7 +88,7 @@ type QueryRuleGroupsMixin0Params struct { /* Sort. - Possible order by fields: {enabled, name, created_by, created_on, modified_by, modified_on} + Possible order by fields: {modified_by, modified_on, enabled, name, created_by, created_on} */ Sort *string diff --git a/falcon/client/custom_ioa/query_rules_mixin0_parameters.go b/falcon/client/custom_ioa/query_rules_mixin0_parameters.go index e4a37ec3..d0663b11 100644 --- a/falcon/client/custom_ioa/query_rules_mixin0_parameters.go +++ b/falcon/client/custom_ioa/query_rules_mixin0_parameters.go @@ -88,7 +88,7 @@ type QueryRulesMixin0Params struct { /* Sort. - Possible order by fields: {rules.current_version.description, rules.current_version.action_label, rules.current_version.modified_on, rules.created_on, rules.current_version.name, rules.created_by, rules.current_version.pattern_severity, rules.current_version.modified_by, rules.ruletype_name, rules.enabled} + Possible order by fields: {rules.ruletype_name, rules.enabled, rules.created_on, rules.current_version.action_label, rules.current_version.modified_by, rules.created_by, rules.current_version.name, rules.current_version.description, rules.current_version.pattern_severity, rules.current_version.modified_on} */ Sort *string diff --git a/falcon/client/custom_ioa/update_rules_v2_parameters.go b/falcon/client/custom_ioa/update_rules_v2_parameters.go new file mode 100644 index 00000000..3dd8912b --- /dev/null +++ b/falcon/client/custom_ioa/update_rules_v2_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_ioa + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewUpdateRulesV2Params creates a new UpdateRulesV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateRulesV2Params() *UpdateRulesV2Params { + return &UpdateRulesV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateRulesV2ParamsWithTimeout creates a new UpdateRulesV2Params object +// with the ability to set a timeout on a request. +func NewUpdateRulesV2ParamsWithTimeout(timeout time.Duration) *UpdateRulesV2Params { + return &UpdateRulesV2Params{ + timeout: timeout, + } +} + +// NewUpdateRulesV2ParamsWithContext creates a new UpdateRulesV2Params object +// with the ability to set a context for a request. +func NewUpdateRulesV2ParamsWithContext(ctx context.Context) *UpdateRulesV2Params { + return &UpdateRulesV2Params{ + Context: ctx, + } +} + +// NewUpdateRulesV2ParamsWithHTTPClient creates a new UpdateRulesV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateRulesV2ParamsWithHTTPClient(client *http.Client) *UpdateRulesV2Params { + return &UpdateRulesV2Params{ + HTTPClient: client, + } +} + +/* +UpdateRulesV2Params contains all the parameters to send to the API endpoint + + for the update rules v2 operation. + + Typically these are written to a http.Request. +*/ +type UpdateRulesV2Params struct { + + // Body. + Body *models.APIRuleUpdatesRequestV2 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update rules v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRulesV2Params) WithDefaults() *UpdateRulesV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update rules v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRulesV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update rules v2 params +func (o *UpdateRulesV2Params) WithTimeout(timeout time.Duration) *UpdateRulesV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update rules v2 params +func (o *UpdateRulesV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update rules v2 params +func (o *UpdateRulesV2Params) WithContext(ctx context.Context) *UpdateRulesV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update rules v2 params +func (o *UpdateRulesV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update rules v2 params +func (o *UpdateRulesV2Params) WithHTTPClient(client *http.Client) *UpdateRulesV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update rules v2 params +func (o *UpdateRulesV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update rules v2 params +func (o *UpdateRulesV2Params) WithBody(body *models.APIRuleUpdatesRequestV2) *UpdateRulesV2Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update rules v2 params +func (o *UpdateRulesV2Params) SetBody(body *models.APIRuleUpdatesRequestV2) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateRulesV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/pod_enrichment_responses.go b/falcon/client/custom_ioa/update_rules_v2_responses.go similarity index 51% rename from falcon/client/kubernetes_protection/pod_enrichment_responses.go rename to falcon/client/custom_ioa/update_rules_v2_responses.go index db35b316..aa931b73 100644 --- a/falcon/client/kubernetes_protection/pod_enrichment_responses.go +++ b/falcon/client/custom_ioa/update_rules_v2_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package kubernetes_protection +package custom_ioa // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -17,54 +17,54 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// PodEnrichmentReader is a Reader for the PodEnrichment structure. -type PodEnrichmentReader struct { +// UpdateRulesV2Reader is a Reader for the UpdateRulesV2 structure. +type UpdateRulesV2Reader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *PodEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *UpdateRulesV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewPodEnrichmentOK() + result := NewUpdateRulesV2OK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewPodEnrichmentForbidden() + result := NewUpdateRulesV2Forbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 429: - result := NewPodEnrichmentTooManyRequests() + case 404: + result := NewUpdateRulesV2NotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result - case 500: - result := NewPodEnrichmentInternalServerError() + case 429: + result := NewUpdateRulesV2TooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[GET /container-security/aggregates/enrichment/pods/entities/v1] PodEnrichment", response, response.Code()) + return nil, runtime.NewAPIError("[PATCH /ioarules/entities/rules/v2] update-rules-v2", response, response.Code()) } } -// NewPodEnrichmentOK creates a PodEnrichmentOK with default headers values -func NewPodEnrichmentOK() *PodEnrichmentOK { - return &PodEnrichmentOK{} +// NewUpdateRulesV2OK creates a UpdateRulesV2OK with default headers values +func NewUpdateRulesV2OK() *UpdateRulesV2OK { + return &UpdateRulesV2OK{} } /* -PodEnrichmentOK describes a response with status code 200, with default header values. +UpdateRulesV2OK describes a response with status code 200, with default header values. OK */ -type PodEnrichmentOK struct { +type UpdateRulesV2OK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -78,52 +78,52 @@ type PodEnrichmentOK struct { */ XRateLimitRemaining int64 - Payload *models.K8sassetsPodEnrichmentResponse + Payload *models.APIRulesResponse } -// IsSuccess returns true when this pod enrichment o k response has a 2xx status code -func (o *PodEnrichmentOK) IsSuccess() bool { +// IsSuccess returns true when this update rules v2 o k response has a 2xx status code +func (o *UpdateRulesV2OK) IsSuccess() bool { return true } -// IsRedirect returns true when this pod enrichment o k response has a 3xx status code -func (o *PodEnrichmentOK) IsRedirect() bool { +// IsRedirect returns true when this update rules v2 o k response has a 3xx status code +func (o *UpdateRulesV2OK) IsRedirect() bool { return false } -// IsClientError returns true when this pod enrichment o k response has a 4xx status code -func (o *PodEnrichmentOK) IsClientError() bool { +// IsClientError returns true when this update rules v2 o k response has a 4xx status code +func (o *UpdateRulesV2OK) IsClientError() bool { return false } -// IsServerError returns true when this pod enrichment o k response has a 5xx status code -func (o *PodEnrichmentOK) IsServerError() bool { +// IsServerError returns true when this update rules v2 o k response has a 5xx status code +func (o *UpdateRulesV2OK) IsServerError() bool { return false } -// IsCode returns true when this pod enrichment o k response a status code equal to that given -func (o *PodEnrichmentOK) IsCode(code int) bool { +// IsCode returns true when this update rules v2 o k response a status code equal to that given +func (o *UpdateRulesV2OK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the pod enrichment o k response -func (o *PodEnrichmentOK) Code() int { +// Code gets the status code for the update rules v2 o k response +func (o *UpdateRulesV2OK) Code() int { return 200 } -func (o *PodEnrichmentOK) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentOK %+v", 200, o.Payload) +func (o *UpdateRulesV2OK) Error() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2OK %+v", 200, o.Payload) } -func (o *PodEnrichmentOK) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentOK %+v", 200, o.Payload) +func (o *UpdateRulesV2OK) String() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2OK %+v", 200, o.Payload) } -func (o *PodEnrichmentOK) GetPayload() *models.K8sassetsPodEnrichmentResponse { +func (o *UpdateRulesV2OK) GetPayload() *models.APIRulesResponse { return o.Payload } -func (o *PodEnrichmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UpdateRulesV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -154,7 +154,7 @@ func (o *PodEnrichmentOK) readResponse(response runtime.ClientResponse, consumer o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.K8sassetsPodEnrichmentResponse) + o.Payload = new(models.APIRulesResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -164,17 +164,17 @@ func (o *PodEnrichmentOK) readResponse(response runtime.ClientResponse, consumer return nil } -// NewPodEnrichmentForbidden creates a PodEnrichmentForbidden with default headers values -func NewPodEnrichmentForbidden() *PodEnrichmentForbidden { - return &PodEnrichmentForbidden{} +// NewUpdateRulesV2Forbidden creates a UpdateRulesV2Forbidden with default headers values +func NewUpdateRulesV2Forbidden() *UpdateRulesV2Forbidden { + return &UpdateRulesV2Forbidden{} } /* -PodEnrichmentForbidden describes a response with status code 403, with default header values. +UpdateRulesV2Forbidden describes a response with status code 403, with default header values. Forbidden */ -type PodEnrichmentForbidden struct { +type UpdateRulesV2Forbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -191,49 +191,49 @@ type PodEnrichmentForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this pod enrichment forbidden response has a 2xx status code -func (o *PodEnrichmentForbidden) IsSuccess() bool { +// IsSuccess returns true when this update rules v2 forbidden response has a 2xx status code +func (o *UpdateRulesV2Forbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this pod enrichment forbidden response has a 3xx status code -func (o *PodEnrichmentForbidden) IsRedirect() bool { +// IsRedirect returns true when this update rules v2 forbidden response has a 3xx status code +func (o *UpdateRulesV2Forbidden) IsRedirect() bool { return false } -// IsClientError returns true when this pod enrichment forbidden response has a 4xx status code -func (o *PodEnrichmentForbidden) IsClientError() bool { +// IsClientError returns true when this update rules v2 forbidden response has a 4xx status code +func (o *UpdateRulesV2Forbidden) IsClientError() bool { return true } -// IsServerError returns true when this pod enrichment forbidden response has a 5xx status code -func (o *PodEnrichmentForbidden) IsServerError() bool { +// IsServerError returns true when this update rules v2 forbidden response has a 5xx status code +func (o *UpdateRulesV2Forbidden) IsServerError() bool { return false } -// IsCode returns true when this pod enrichment forbidden response a status code equal to that given -func (o *PodEnrichmentForbidden) IsCode(code int) bool { +// IsCode returns true when this update rules v2 forbidden response a status code equal to that given +func (o *UpdateRulesV2Forbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the pod enrichment forbidden response -func (o *PodEnrichmentForbidden) Code() int { +// Code gets the status code for the update rules v2 forbidden response +func (o *UpdateRulesV2Forbidden) Code() int { return 403 } -func (o *PodEnrichmentForbidden) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentForbidden %+v", 403, o.Payload) +func (o *UpdateRulesV2Forbidden) Error() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2Forbidden %+v", 403, o.Payload) } -func (o *PodEnrichmentForbidden) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentForbidden %+v", 403, o.Payload) +func (o *UpdateRulesV2Forbidden) String() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2Forbidden %+v", 403, o.Payload) } -func (o *PodEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *UpdateRulesV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *PodEnrichmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UpdateRulesV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -274,17 +274,17 @@ func (o *PodEnrichmentForbidden) readResponse(response runtime.ClientResponse, c return nil } -// NewPodEnrichmentTooManyRequests creates a PodEnrichmentTooManyRequests with default headers values -func NewPodEnrichmentTooManyRequests() *PodEnrichmentTooManyRequests { - return &PodEnrichmentTooManyRequests{} +// NewUpdateRulesV2NotFound creates a UpdateRulesV2NotFound with default headers values +func NewUpdateRulesV2NotFound() *UpdateRulesV2NotFound { + return &UpdateRulesV2NotFound{} } /* -PodEnrichmentTooManyRequests describes a response with status code 429, with default header values. +UpdateRulesV2NotFound describes a response with status code 404, with default header values. -Too Many Requests +Not Found */ -type PodEnrichmentTooManyRequests struct { +type UpdateRulesV2NotFound struct { /* Trace-ID: submit to support if resolving an issue */ @@ -298,56 +298,52 @@ type PodEnrichmentTooManyRequests struct { */ XRateLimitRemaining int64 - /* Too many requests, retry after this time (as milliseconds since epoch) - */ - XRateLimitRetryAfter int64 - - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } -// IsSuccess returns true when this pod enrichment too many requests response has a 2xx status code -func (o *PodEnrichmentTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this update rules v2 not found response has a 2xx status code +func (o *UpdateRulesV2NotFound) IsSuccess() bool { return false } -// IsRedirect returns true when this pod enrichment too many requests response has a 3xx status code -func (o *PodEnrichmentTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this update rules v2 not found response has a 3xx status code +func (o *UpdateRulesV2NotFound) IsRedirect() bool { return false } -// IsClientError returns true when this pod enrichment too many requests response has a 4xx status code -func (o *PodEnrichmentTooManyRequests) IsClientError() bool { +// IsClientError returns true when this update rules v2 not found response has a 4xx status code +func (o *UpdateRulesV2NotFound) IsClientError() bool { return true } -// IsServerError returns true when this pod enrichment too many requests response has a 5xx status code -func (o *PodEnrichmentTooManyRequests) IsServerError() bool { +// IsServerError returns true when this update rules v2 not found response has a 5xx status code +func (o *UpdateRulesV2NotFound) IsServerError() bool { return false } -// IsCode returns true when this pod enrichment too many requests response a status code equal to that given -func (o *PodEnrichmentTooManyRequests) IsCode(code int) bool { - return code == 429 +// IsCode returns true when this update rules v2 not found response a status code equal to that given +func (o *UpdateRulesV2NotFound) IsCode(code int) bool { + return code == 404 } -// Code gets the status code for the pod enrichment too many requests response -func (o *PodEnrichmentTooManyRequests) Code() int { - return 429 +// Code gets the status code for the update rules v2 not found response +func (o *UpdateRulesV2NotFound) Code() int { + return 404 } -func (o *PodEnrichmentTooManyRequests) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentTooManyRequests %+v", 429, o.Payload) +func (o *UpdateRulesV2NotFound) Error() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2NotFound %+v", 404, o.Payload) } -func (o *PodEnrichmentTooManyRequests) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentTooManyRequests %+v", 429, o.Payload) +func (o *UpdateRulesV2NotFound) String() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2NotFound %+v", 404, o.Payload) } -func (o *PodEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *UpdateRulesV2NotFound) GetPayload() *models.MsaspecResponseFields { return o.Payload } -func (o *PodEnrichmentTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UpdateRulesV2NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -378,18 +374,7 @@ func (o *PodEnrichmentTooManyRequests) readResponse(response runtime.ClientRespo o.XRateLimitRemaining = valxRateLimitRemaining } - // hydrates response header X-RateLimit-RetryAfter - hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") - - if hdrXRateLimitRetryAfter != "" { - valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) - if err != nil { - return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) - } - o.XRateLimitRetryAfter = valxRateLimitRetryAfter - } - - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -399,17 +384,17 @@ func (o *PodEnrichmentTooManyRequests) readResponse(response runtime.ClientRespo return nil } -// NewPodEnrichmentInternalServerError creates a PodEnrichmentInternalServerError with default headers values -func NewPodEnrichmentInternalServerError() *PodEnrichmentInternalServerError { - return &PodEnrichmentInternalServerError{} +// NewUpdateRulesV2TooManyRequests creates a UpdateRulesV2TooManyRequests with default headers values +func NewUpdateRulesV2TooManyRequests() *UpdateRulesV2TooManyRequests { + return &UpdateRulesV2TooManyRequests{} } /* -PodEnrichmentInternalServerError describes a response with status code 500, with default header values. +UpdateRulesV2TooManyRequests describes a response with status code 429, with default header values. -Internal Server Error +Too Many Requests */ -type PodEnrichmentInternalServerError struct { +type UpdateRulesV2TooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -423,52 +408,56 @@ type PodEnrichmentInternalServerError struct { */ XRateLimitRemaining int64 - Payload *models.CoreEntitiesResponse -} + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 -// IsSuccess returns true when this pod enrichment internal server error response has a 2xx status code -func (o *PodEnrichmentInternalServerError) IsSuccess() bool { - return false + Payload *models.MsaReplyMetaOnly } -// IsRedirect returns true when this pod enrichment internal server error response has a 3xx status code -func (o *PodEnrichmentInternalServerError) IsRedirect() bool { +// IsSuccess returns true when this update rules v2 too many requests response has a 2xx status code +func (o *UpdateRulesV2TooManyRequests) IsSuccess() bool { return false } -// IsClientError returns true when this pod enrichment internal server error response has a 4xx status code -func (o *PodEnrichmentInternalServerError) IsClientError() bool { +// IsRedirect returns true when this update rules v2 too many requests response has a 3xx status code +func (o *UpdateRulesV2TooManyRequests) IsRedirect() bool { return false } -// IsServerError returns true when this pod enrichment internal server error response has a 5xx status code -func (o *PodEnrichmentInternalServerError) IsServerError() bool { +// IsClientError returns true when this update rules v2 too many requests response has a 4xx status code +func (o *UpdateRulesV2TooManyRequests) IsClientError() bool { return true } -// IsCode returns true when this pod enrichment internal server error response a status code equal to that given -func (o *PodEnrichmentInternalServerError) IsCode(code int) bool { - return code == 500 +// IsServerError returns true when this update rules v2 too many requests response has a 5xx status code +func (o *UpdateRulesV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this update rules v2 too many requests response a status code equal to that given +func (o *UpdateRulesV2TooManyRequests) IsCode(code int) bool { + return code == 429 } -// Code gets the status code for the pod enrichment internal server error response -func (o *PodEnrichmentInternalServerError) Code() int { - return 500 +// Code gets the status code for the update rules v2 too many requests response +func (o *UpdateRulesV2TooManyRequests) Code() int { + return 429 } -func (o *PodEnrichmentInternalServerError) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentInternalServerError %+v", 500, o.Payload) +func (o *UpdateRulesV2TooManyRequests) Error() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2TooManyRequests %+v", 429, o.Payload) } -func (o *PodEnrichmentInternalServerError) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] podEnrichmentInternalServerError %+v", 500, o.Payload) +func (o *UpdateRulesV2TooManyRequests) String() string { + return fmt.Sprintf("[PATCH /ioarules/entities/rules/v2][%d] updateRulesV2TooManyRequests %+v", 429, o.Payload) } -func (o *PodEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { +func (o *UpdateRulesV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *PodEnrichmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UpdateRulesV2TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -499,7 +488,18 @@ func (o *PodEnrichmentInternalServerError) readResponse(response runtime.ClientR o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.CoreEntitiesResponse) + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/falcon/client/d4c_registration/connect_d4_c_g_c_p_account_responses.go b/falcon/client/d4c_registration/connect_d4_c_g_c_p_account_responses.go index 7c9a14be..cb1b7483 100644 --- a/falcon/client/d4c_registration/connect_d4_c_g_c_p_account_responses.go +++ b/falcon/client/d4c_registration/connect_d4_c_g_c_p_account_responses.go @@ -49,6 +49,12 @@ func (o *ConnectD4CGCPAccountReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result + case 409: + result := NewConnectD4CGCPAccountConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewConnectD4CGCPAccountTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -506,6 +512,116 @@ func (o *ConnectD4CGCPAccountForbidden) readResponse(response runtime.ClientResp return nil } +// NewConnectD4CGCPAccountConflict creates a ConnectD4CGCPAccountConflict with default headers values +func NewConnectD4CGCPAccountConflict() *ConnectD4CGCPAccountConflict { + return &ConnectD4CGCPAccountConflict{} +} + +/* +ConnectD4CGCPAccountConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type ConnectD4CGCPAccountConflict struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPAccountResponseExtV2 +} + +// IsSuccess returns true when this connect d4 c g c p account conflict response has a 2xx status code +func (o *ConnectD4CGCPAccountConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this connect d4 c g c p account conflict response has a 3xx status code +func (o *ConnectD4CGCPAccountConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this connect d4 c g c p account conflict response has a 4xx status code +func (o *ConnectD4CGCPAccountConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this connect d4 c g c p account conflict response has a 5xx status code +func (o *ConnectD4CGCPAccountConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this connect d4 c g c p account conflict response a status code equal to that given +func (o *ConnectD4CGCPAccountConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the connect d4 c g c p account conflict response +func (o *ConnectD4CGCPAccountConflict) Code() int { + return 409 +} + +func (o *ConnectD4CGCPAccountConflict) Error() string { + return fmt.Sprintf("[POST /cloud-connect-gcp/entities/account/v2][%d] connectD4CGCPAccountConflict %+v", 409, o.Payload) +} + +func (o *ConnectD4CGCPAccountConflict) String() string { + return fmt.Sprintf("[POST /cloud-connect-gcp/entities/account/v2][%d] connectD4CGCPAccountConflict %+v", 409, o.Payload) +} + +func (o *ConnectD4CGCPAccountConflict) GetPayload() *models.RegistrationGCPAccountResponseExtV2 { + return o.Payload +} + +func (o *ConnectD4CGCPAccountConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPAccountResponseExtV2) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewConnectD4CGCPAccountTooManyRequests creates a ConnectD4CGCPAccountTooManyRequests with default headers values func NewConnectD4CGCPAccountTooManyRequests() *ConnectD4CGCPAccountTooManyRequests { return &ConnectD4CGCPAccountTooManyRequests{} diff --git a/falcon/client/d4c_registration/create_discover_cloud_azure_account_responses.go b/falcon/client/d4c_registration/create_discover_cloud_azure_account_responses.go index 51ce9e40..4da8008d 100644 --- a/falcon/client/d4c_registration/create_discover_cloud_azure_account_responses.go +++ b/falcon/client/d4c_registration/create_discover_cloud_azure_account_responses.go @@ -49,6 +49,12 @@ func (o *CreateDiscoverCloudAzureAccountReader) ReadResponse(response runtime.Cl return nil, err } return nil, result + case 409: + result := NewCreateDiscoverCloudAzureAccountConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewCreateDiscoverCloudAzureAccountTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -506,6 +512,116 @@ func (o *CreateDiscoverCloudAzureAccountForbidden) readResponse(response runtime return nil } +// NewCreateDiscoverCloudAzureAccountConflict creates a CreateDiscoverCloudAzureAccountConflict with default headers values +func NewCreateDiscoverCloudAzureAccountConflict() *CreateDiscoverCloudAzureAccountConflict { + return &CreateDiscoverCloudAzureAccountConflict{} +} + +/* +CreateDiscoverCloudAzureAccountConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type CreateDiscoverCloudAzureAccountConflict struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationAzureAccountResponseV1 +} + +// IsSuccess returns true when this create discover cloud azure account conflict response has a 2xx status code +func (o *CreateDiscoverCloudAzureAccountConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create discover cloud azure account conflict response has a 3xx status code +func (o *CreateDiscoverCloudAzureAccountConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create discover cloud azure account conflict response has a 4xx status code +func (o *CreateDiscoverCloudAzureAccountConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this create discover cloud azure account conflict response has a 5xx status code +func (o *CreateDiscoverCloudAzureAccountConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this create discover cloud azure account conflict response a status code equal to that given +func (o *CreateDiscoverCloudAzureAccountConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the create discover cloud azure account conflict response +func (o *CreateDiscoverCloudAzureAccountConflict) Code() int { + return 409 +} + +func (o *CreateDiscoverCloudAzureAccountConflict) Error() string { + return fmt.Sprintf("[POST /cloud-connect-azure/entities/account/v1][%d] createDiscoverCloudAzureAccountConflict %+v", 409, o.Payload) +} + +func (o *CreateDiscoverCloudAzureAccountConflict) String() string { + return fmt.Sprintf("[POST /cloud-connect-azure/entities/account/v1][%d] createDiscoverCloudAzureAccountConflict %+v", 409, o.Payload) +} + +func (o *CreateDiscoverCloudAzureAccountConflict) GetPayload() *models.RegistrationAzureAccountResponseV1 { + return o.Payload +} + +func (o *CreateDiscoverCloudAzureAccountConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationAzureAccountResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewCreateDiscoverCloudAzureAccountTooManyRequests creates a CreateDiscoverCloudAzureAccountTooManyRequests with default headers values func NewCreateDiscoverCloudAzureAccountTooManyRequests() *CreateDiscoverCloudAzureAccountTooManyRequests { return &CreateDiscoverCloudAzureAccountTooManyRequests{} diff --git a/falcon/client/d4c_registration/d4c_registration_client.go b/falcon/client/d4c_registration/d4c_registration_client.go index 8369c24d..ceec711a 100644 --- a/falcon/client/d4c_registration/d4c_registration_client.go +++ b/falcon/client/d4c_registration/d4c_registration_client.go @@ -68,6 +68,8 @@ type ClientService interface { GetHorizonD4CScripts(params *GetHorizonD4CScriptsParams, opts ...ClientOption) (*GetHorizonD4CScriptsOK, error) + UpdateD4CGCPServiceAccountsExt(params *UpdateD4CGCPServiceAccountsExtParams, opts ...ClientOption) (*UpdateD4CGCPServiceAccountsExtOK, error) + UpdateDiscoverCloudAzureAccountClientID(params *UpdateDiscoverCloudAzureAccountClientIDParams, opts ...ClientOption) (*UpdateDiscoverCloudAzureAccountClientIDCreated, error) SetTransport(transport runtime.ClientTransport) @@ -807,6 +809,44 @@ func (a *Client) GetHorizonD4CScripts(params *GetHorizonD4CScriptsParams, opts . panic(msg) } +/* +UpdateD4CGCPServiceAccountsExt patches the service account key for external clients +*/ +func (a *Client) UpdateD4CGCPServiceAccountsExt(params *UpdateD4CGCPServiceAccountsExtParams, opts ...ClientOption) (*UpdateD4CGCPServiceAccountsExtOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateD4CGCPServiceAccountsExtParams() + } + op := &runtime.ClientOperation{ + ID: "UpdateD4CGCPServiceAccountsExt", + Method: "PATCH", + PathPattern: "/cloud-connect-gcp/entities/service-accounts/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateD4CGCPServiceAccountsExtReader{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.(*UpdateD4CGCPServiceAccountsExtOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for UpdateD4CGCPServiceAccountsExt: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* UpdateDiscoverCloudAzureAccountClientID updates an azure service account in our system by with the user created client id created with the public key we ve provided */ diff --git a/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_parameters.go b/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_parameters.go index dea7e219..a272a34f 100644 --- a/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_parameters.go +++ b/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_parameters.go @@ -62,12 +62,51 @@ GetD4CAWSAccountScriptsAttachmentParams contains all the parameters to send to t */ type GetD4CAWSAccountScriptsAttachmentParams struct { + /* Accounts. + + The list of accounts to register + */ + Accounts []string + + /* AwsProfile. + + The AWS profile to be used during registration + */ + AwsProfile *string + + // BehaviorAssessmentEnabled. + BehaviorAssessmentEnabled *string + + /* CustomRoleName. + + The custom IAM role to be used during registration + */ + CustomRoleName *string + /* Ids. AWS account IDs */ Ids []string + /* OrganizationID. + + The AWS organization ID to be registered + */ + OrganizationID *string + + // SensorManagementEnabled. + SensorManagementEnabled *string + + /* Template. + + Template to be rendered + */ + Template *string + + // UseExistingCloudtrail. + UseExistingCloudtrail *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -121,6 +160,50 @@ func (o *GetD4CAWSAccountScriptsAttachmentParams) SetHTTPClient(client *http.Cli o.HTTPClient = client } +// WithAccounts adds the accounts to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithAccounts(accounts []string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetAccounts(accounts) + return o +} + +// SetAccounts adds the accounts to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetAccounts(accounts []string) { + o.Accounts = accounts +} + +// WithAwsProfile adds the awsProfile to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithAwsProfile(awsProfile *string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetAwsProfile(awsProfile) + return o +} + +// SetAwsProfile adds the awsProfile to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetAwsProfile(awsProfile *string) { + o.AwsProfile = awsProfile +} + +// WithBehaviorAssessmentEnabled adds the behaviorAssessmentEnabled to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithBehaviorAssessmentEnabled(behaviorAssessmentEnabled *string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetBehaviorAssessmentEnabled(behaviorAssessmentEnabled) + return o +} + +// SetBehaviorAssessmentEnabled adds the behaviorAssessmentEnabled to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetBehaviorAssessmentEnabled(behaviorAssessmentEnabled *string) { + o.BehaviorAssessmentEnabled = behaviorAssessmentEnabled +} + +// WithCustomRoleName adds the customRoleName to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithCustomRoleName(customRoleName *string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetCustomRoleName(customRoleName) + return o +} + +// SetCustomRoleName adds the customRoleName to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetCustomRoleName(customRoleName *string) { + o.CustomRoleName = customRoleName +} + // WithIds adds the ids to the get d4 c a w s account scripts attachment params func (o *GetD4CAWSAccountScriptsAttachmentParams) WithIds(ids []string) *GetD4CAWSAccountScriptsAttachmentParams { o.SetIds(ids) @@ -132,6 +215,50 @@ func (o *GetD4CAWSAccountScriptsAttachmentParams) SetIds(ids []string) { o.Ids = ids } +// WithOrganizationID adds the organizationID to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithOrganizationID(organizationID *string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetOrganizationID(organizationID) + return o +} + +// SetOrganizationID adds the organizationId to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetOrganizationID(organizationID *string) { + o.OrganizationID = organizationID +} + +// WithSensorManagementEnabled adds the sensorManagementEnabled to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithSensorManagementEnabled(sensorManagementEnabled *string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetSensorManagementEnabled(sensorManagementEnabled) + return o +} + +// SetSensorManagementEnabled adds the sensorManagementEnabled to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetSensorManagementEnabled(sensorManagementEnabled *string) { + o.SensorManagementEnabled = sensorManagementEnabled +} + +// WithTemplate adds the template to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithTemplate(template *string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetTemplate(template) + return o +} + +// SetTemplate adds the template to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetTemplate(template *string) { + o.Template = template +} + +// WithUseExistingCloudtrail adds the useExistingCloudtrail to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) WithUseExistingCloudtrail(useExistingCloudtrail *string) *GetD4CAWSAccountScriptsAttachmentParams { + o.SetUseExistingCloudtrail(useExistingCloudtrail) + return o +} + +// SetUseExistingCloudtrail adds the useExistingCloudtrail to the get d4 c a w s account scripts attachment params +func (o *GetD4CAWSAccountScriptsAttachmentParams) SetUseExistingCloudtrail(useExistingCloudtrail *string) { + o.UseExistingCloudtrail = useExistingCloudtrail +} + // WriteToRequest writes these params to a swagger request func (o *GetD4CAWSAccountScriptsAttachmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -140,6 +267,68 @@ func (o *GetD4CAWSAccountScriptsAttachmentParams) WriteToRequest(r runtime.Clien } var res []error + if o.Accounts != nil { + + // binding items for accounts + joinedAccounts := o.bindParamAccounts(reg) + + // query array param accounts + if err := r.SetQueryParam("accounts", joinedAccounts...); err != nil { + return err + } + } + + if o.AwsProfile != nil { + + // query param aws_profile + var qrAwsProfile string + + if o.AwsProfile != nil { + qrAwsProfile = *o.AwsProfile + } + qAwsProfile := qrAwsProfile + if qAwsProfile != "" { + + if err := r.SetQueryParam("aws_profile", qAwsProfile); err != nil { + return err + } + } + } + + if o.BehaviorAssessmentEnabled != nil { + + // query param behavior_assessment_enabled + var qrBehaviorAssessmentEnabled string + + if o.BehaviorAssessmentEnabled != nil { + qrBehaviorAssessmentEnabled = *o.BehaviorAssessmentEnabled + } + qBehaviorAssessmentEnabled := qrBehaviorAssessmentEnabled + if qBehaviorAssessmentEnabled != "" { + + if err := r.SetQueryParam("behavior_assessment_enabled", qBehaviorAssessmentEnabled); err != nil { + return err + } + } + } + + if o.CustomRoleName != nil { + + // query param custom_role_name + var qrCustomRoleName string + + if o.CustomRoleName != nil { + qrCustomRoleName = *o.CustomRoleName + } + qCustomRoleName := qrCustomRoleName + if qCustomRoleName != "" { + + if err := r.SetQueryParam("custom_role_name", qCustomRoleName); err != nil { + return err + } + } + } + if o.Ids != nil { // binding items for ids @@ -151,12 +340,97 @@ func (o *GetD4CAWSAccountScriptsAttachmentParams) WriteToRequest(r runtime.Clien } } + if o.OrganizationID != nil { + + // query param organization_id + var qrOrganizationID string + + if o.OrganizationID != nil { + qrOrganizationID = *o.OrganizationID + } + qOrganizationID := qrOrganizationID + if qOrganizationID != "" { + + if err := r.SetQueryParam("organization_id", qOrganizationID); err != nil { + return err + } + } + } + + if o.SensorManagementEnabled != nil { + + // query param sensor_management_enabled + var qrSensorManagementEnabled string + + if o.SensorManagementEnabled != nil { + qrSensorManagementEnabled = *o.SensorManagementEnabled + } + qSensorManagementEnabled := qrSensorManagementEnabled + if qSensorManagementEnabled != "" { + + if err := r.SetQueryParam("sensor_management_enabled", qSensorManagementEnabled); err != nil { + return err + } + } + } + + if o.Template != nil { + + // query param template + var qrTemplate string + + if o.Template != nil { + qrTemplate = *o.Template + } + qTemplate := qrTemplate + if qTemplate != "" { + + if err := r.SetQueryParam("template", qTemplate); err != nil { + return err + } + } + } + + if o.UseExistingCloudtrail != nil { + + // query param use_existing_cloudtrail + var qrUseExistingCloudtrail string + + if o.UseExistingCloudtrail != nil { + qrUseExistingCloudtrail = *o.UseExistingCloudtrail + } + qUseExistingCloudtrail := qrUseExistingCloudtrail + if qUseExistingCloudtrail != "" { + + if err := r.SetQueryParam("use_existing_cloudtrail", qUseExistingCloudtrail); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +// bindParamGetD4CAWSAccountScriptsAttachment binds the parameter accounts +func (o *GetD4CAWSAccountScriptsAttachmentParams) bindParamAccounts(formats strfmt.Registry) []string { + accountsIR := o.Accounts + + var accountsIC []string + for _, accountsIIR := range accountsIR { // explode []string + + accountsIIV := accountsIIR // string as string + accountsIC = append(accountsIC, accountsIIV) + } + + // items.CollectionFormat: "multi" + accountsIS := swag.JoinByFormat(accountsIC, "multi") + + return accountsIS +} + // bindParamGetD4CAWSAccountScriptsAttachment binds the parameter ids func (o *GetD4CAWSAccountScriptsAttachmentParams) bindParamIds(formats strfmt.Registry) []string { idsIR := o.Ids diff --git a/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_responses.go b/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_responses.go index 95de1966..39c3cd03 100644 --- a/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_responses.go +++ b/falcon/client/d4c_registration/get_d4_c_a_w_s_account_scripts_attachment_responses.go @@ -194,7 +194,7 @@ type GetD4CAWSAccountScriptsAttachmentBadRequest struct { */ XRateLimitRemaining int64 - Payload *models.RegistrationAWSProvisionGetAccountScriptResponseV2 + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get d4 c a w s account scripts attachment bad request response has a 2xx status code @@ -235,7 +235,7 @@ func (o *GetD4CAWSAccountScriptsAttachmentBadRequest) String() string { return fmt.Sprintf("[GET /cloud-connect-aws/entities/user-scripts-download/v1][%d] getD4CAWSAccountScriptsAttachmentBadRequest %+v", 400, o.Payload) } -func (o *GetD4CAWSAccountScriptsAttachmentBadRequest) GetPayload() *models.RegistrationAWSProvisionGetAccountScriptResponseV2 { +func (o *GetD4CAWSAccountScriptsAttachmentBadRequest) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -270,7 +270,7 @@ func (o *GetD4CAWSAccountScriptsAttachmentBadRequest) readResponse(response runt o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.RegistrationAWSProvisionGetAccountScriptResponseV2) + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -304,7 +304,7 @@ type GetD4CAWSAccountScriptsAttachmentForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get d4 c a w s account scripts attachment forbidden response has a 2xx status code @@ -345,7 +345,7 @@ func (o *GetD4CAWSAccountScriptsAttachmentForbidden) String() string { return fmt.Sprintf("[GET /cloud-connect-aws/entities/user-scripts-download/v1][%d] getD4CAWSAccountScriptsAttachmentForbidden %+v", 403, o.Payload) } -func (o *GetD4CAWSAccountScriptsAttachmentForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetD4CAWSAccountScriptsAttachmentForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -380,7 +380,7 @@ func (o *GetD4CAWSAccountScriptsAttachmentForbidden) readResponse(response runti o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -539,7 +539,7 @@ type GetD4CAWSAccountScriptsAttachmentInternalServerError struct { */ XRateLimitRemaining int64 - Payload *models.RegistrationAWSProvisionGetAccountScriptResponseV2 + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get d4 c a w s account scripts attachment internal server error response has a 2xx status code @@ -580,7 +580,7 @@ func (o *GetD4CAWSAccountScriptsAttachmentInternalServerError) String() string { return fmt.Sprintf("[GET /cloud-connect-aws/entities/user-scripts-download/v1][%d] getD4CAWSAccountScriptsAttachmentInternalServerError %+v", 500, o.Payload) } -func (o *GetD4CAWSAccountScriptsAttachmentInternalServerError) GetPayload() *models.RegistrationAWSProvisionGetAccountScriptResponseV2 { +func (o *GetD4CAWSAccountScriptsAttachmentInternalServerError) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -615,7 +615,7 @@ func (o *GetD4CAWSAccountScriptsAttachmentInternalServerError) readResponse(resp o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.RegistrationAWSProvisionGetAccountScriptResponseV2) + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_parameters.go b/falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_parameters.go new file mode 100644 index 00000000..90fe0ffd --- /dev/null +++ b/falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package d4c_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewUpdateD4CGCPServiceAccountsExtParams creates a new UpdateD4CGCPServiceAccountsExtParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateD4CGCPServiceAccountsExtParams() *UpdateD4CGCPServiceAccountsExtParams { + return &UpdateD4CGCPServiceAccountsExtParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateD4CGCPServiceAccountsExtParamsWithTimeout creates a new UpdateD4CGCPServiceAccountsExtParams object +// with the ability to set a timeout on a request. +func NewUpdateD4CGCPServiceAccountsExtParamsWithTimeout(timeout time.Duration) *UpdateD4CGCPServiceAccountsExtParams { + return &UpdateD4CGCPServiceAccountsExtParams{ + timeout: timeout, + } +} + +// NewUpdateD4CGCPServiceAccountsExtParamsWithContext creates a new UpdateD4CGCPServiceAccountsExtParams object +// with the ability to set a context for a request. +func NewUpdateD4CGCPServiceAccountsExtParamsWithContext(ctx context.Context) *UpdateD4CGCPServiceAccountsExtParams { + return &UpdateD4CGCPServiceAccountsExtParams{ + Context: ctx, + } +} + +// NewUpdateD4CGCPServiceAccountsExtParamsWithHTTPClient creates a new UpdateD4CGCPServiceAccountsExtParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateD4CGCPServiceAccountsExtParamsWithHTTPClient(client *http.Client) *UpdateD4CGCPServiceAccountsExtParams { + return &UpdateD4CGCPServiceAccountsExtParams{ + HTTPClient: client, + } +} + +/* +UpdateD4CGCPServiceAccountsExtParams contains all the parameters to send to the API endpoint + + for the update d4 c g c p service accounts ext operation. + + Typically these are written to a http.Request. +*/ +type UpdateD4CGCPServiceAccountsExtParams struct { + + // Body. + Body *models.RegistrationGCPServiceAccountPatchRequestV1 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update d4 c g c p service accounts ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateD4CGCPServiceAccountsExtParams) WithDefaults() *UpdateD4CGCPServiceAccountsExtParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update d4 c g c p service accounts ext params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateD4CGCPServiceAccountsExtParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) WithTimeout(timeout time.Duration) *UpdateD4CGCPServiceAccountsExtParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) WithContext(ctx context.Context) *UpdateD4CGCPServiceAccountsExtParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) WithHTTPClient(client *http.Client) *UpdateD4CGCPServiceAccountsExtParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) WithBody(body *models.RegistrationGCPServiceAccountPatchRequestV1) *UpdateD4CGCPServiceAccountsExtParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update d4 c g c p service accounts ext params +func (o *UpdateD4CGCPServiceAccountsExtParams) SetBody(body *models.RegistrationGCPServiceAccountPatchRequestV1) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateD4CGCPServiceAccountsExtParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_responses.go b/falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_responses.go new file mode 100644 index 00000000..28828dfd --- /dev/null +++ b/falcon/client/d4c_registration/update_d4_c_g_c_p_service_accounts_ext_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package d4c_registration + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// UpdateD4CGCPServiceAccountsExtReader is a Reader for the UpdateD4CGCPServiceAccountsExt structure. +type UpdateD4CGCPServiceAccountsExtReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateD4CGCPServiceAccountsExtReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateD4CGCPServiceAccountsExtOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateD4CGCPServiceAccountsExtBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateD4CGCPServiceAccountsExtForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewUpdateD4CGCPServiceAccountsExtTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateD4CGCPServiceAccountsExtInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /cloud-connect-gcp/entities/service-accounts/v1] UpdateD4CGCPServiceAccountsExt", response, response.Code()) + } +} + +// NewUpdateD4CGCPServiceAccountsExtOK creates a UpdateD4CGCPServiceAccountsExtOK with default headers values +func NewUpdateD4CGCPServiceAccountsExtOK() *UpdateD4CGCPServiceAccountsExtOK { + return &UpdateD4CGCPServiceAccountsExtOK{} +} + +/* +UpdateD4CGCPServiceAccountsExtOK describes a response with status code 200, with default header values. + +OK +*/ +type UpdateD4CGCPServiceAccountsExtOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountResponseExtV1 +} + +// IsSuccess returns true when this update d4 c g c p service accounts ext o k response has a 2xx status code +func (o *UpdateD4CGCPServiceAccountsExtOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update d4 c g c p service accounts ext o k response has a 3xx status code +func (o *UpdateD4CGCPServiceAccountsExtOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update d4 c g c p service accounts ext o k response has a 4xx status code +func (o *UpdateD4CGCPServiceAccountsExtOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update d4 c g c p service accounts ext o k response has a 5xx status code +func (o *UpdateD4CGCPServiceAccountsExtOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update d4 c g c p service accounts ext o k response a status code equal to that given +func (o *UpdateD4CGCPServiceAccountsExtOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update d4 c g c p service accounts ext o k response +func (o *UpdateD4CGCPServiceAccountsExtOK) Code() int { + return 200 +} + +func (o *UpdateD4CGCPServiceAccountsExtOK) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtOK %+v", 200, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtOK) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtOK %+v", 200, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtOK) GetPayload() *models.RegistrationGCPServiceAccountResponseExtV1 { + return o.Payload +} + +func (o *UpdateD4CGCPServiceAccountsExtOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountResponseExtV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateD4CGCPServiceAccountsExtBadRequest creates a UpdateD4CGCPServiceAccountsExtBadRequest with default headers values +func NewUpdateD4CGCPServiceAccountsExtBadRequest() *UpdateD4CGCPServiceAccountsExtBadRequest { + return &UpdateD4CGCPServiceAccountsExtBadRequest{} +} + +/* +UpdateD4CGCPServiceAccountsExtBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateD4CGCPServiceAccountsExtBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountResponseExtV1 +} + +// IsSuccess returns true when this update d4 c g c p service accounts ext bad request response has a 2xx status code +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update d4 c g c p service accounts ext bad request response has a 3xx status code +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update d4 c g c p service accounts ext bad request response has a 4xx status code +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update d4 c g c p service accounts ext bad request response has a 5xx status code +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update d4 c g c p service accounts ext bad request response a status code equal to that given +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update d4 c g c p service accounts ext bad request response +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) Code() int { + return 400 +} + +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) GetPayload() *models.RegistrationGCPServiceAccountResponseExtV1 { + return o.Payload +} + +func (o *UpdateD4CGCPServiceAccountsExtBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountResponseExtV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateD4CGCPServiceAccountsExtForbidden creates a UpdateD4CGCPServiceAccountsExtForbidden with default headers values +func NewUpdateD4CGCPServiceAccountsExtForbidden() *UpdateD4CGCPServiceAccountsExtForbidden { + return &UpdateD4CGCPServiceAccountsExtForbidden{} +} + +/* +UpdateD4CGCPServiceAccountsExtForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type UpdateD4CGCPServiceAccountsExtForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this update d4 c g c p service accounts ext forbidden response has a 2xx status code +func (o *UpdateD4CGCPServiceAccountsExtForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update d4 c g c p service accounts ext forbidden response has a 3xx status code +func (o *UpdateD4CGCPServiceAccountsExtForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update d4 c g c p service accounts ext forbidden response has a 4xx status code +func (o *UpdateD4CGCPServiceAccountsExtForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update d4 c g c p service accounts ext forbidden response has a 5xx status code +func (o *UpdateD4CGCPServiceAccountsExtForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update d4 c g c p service accounts ext forbidden response a status code equal to that given +func (o *UpdateD4CGCPServiceAccountsExtForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update d4 c g c p service accounts ext forbidden response +func (o *UpdateD4CGCPServiceAccountsExtForbidden) Code() int { + return 403 +} + +func (o *UpdateD4CGCPServiceAccountsExtForbidden) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtForbidden %+v", 403, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtForbidden) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtForbidden %+v", 403, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *UpdateD4CGCPServiceAccountsExtForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateD4CGCPServiceAccountsExtTooManyRequests creates a UpdateD4CGCPServiceAccountsExtTooManyRequests with default headers values +func NewUpdateD4CGCPServiceAccountsExtTooManyRequests() *UpdateD4CGCPServiceAccountsExtTooManyRequests { + return &UpdateD4CGCPServiceAccountsExtTooManyRequests{} +} + +/* +UpdateD4CGCPServiceAccountsExtTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type UpdateD4CGCPServiceAccountsExtTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this update d4 c g c p service accounts ext too many requests response has a 2xx status code +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update d4 c g c p service accounts ext too many requests response has a 3xx status code +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update d4 c g c p service accounts ext too many requests response has a 4xx status code +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this update d4 c g c p service accounts ext too many requests response has a 5xx status code +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this update d4 c g c p service accounts ext too many requests response a status code equal to that given +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the update d4 c g c p service accounts ext too many requests response +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) Code() int { + return 429 +} + +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtTooManyRequests %+v", 429, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *UpdateD4CGCPServiceAccountsExtTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateD4CGCPServiceAccountsExtInternalServerError creates a UpdateD4CGCPServiceAccountsExtInternalServerError with default headers values +func NewUpdateD4CGCPServiceAccountsExtInternalServerError() *UpdateD4CGCPServiceAccountsExtInternalServerError { + return &UpdateD4CGCPServiceAccountsExtInternalServerError{} +} + +/* +UpdateD4CGCPServiceAccountsExtInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type UpdateD4CGCPServiceAccountsExtInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.RegistrationGCPServiceAccountResponseExtV1 +} + +// IsSuccess returns true when this update d4 c g c p service accounts ext internal server error response has a 2xx status code +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update d4 c g c p service accounts ext internal server error response has a 3xx status code +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update d4 c g c p service accounts ext internal server error response has a 4xx status code +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update d4 c g c p service accounts ext internal server error response has a 5xx status code +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update d4 c g c p service accounts ext internal server error response a status code equal to that given +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update d4 c g c p service accounts ext internal server error response +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) Code() int { + return 500 +} + +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) String() string { + return fmt.Sprintf("[PATCH /cloud-connect-gcp/entities/service-accounts/v1][%d] updateD4CGCPServiceAccountsExtInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) GetPayload() *models.RegistrationGCPServiceAccountResponseExtV1 { + return o.Payload +} + +func (o *UpdateD4CGCPServiceAccountsExtInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.RegistrationGCPServiceAccountResponseExtV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/discover_iot/discover_iot_client.go b/falcon/client/discover_iot/discover_iot_client.go index 69c61d7f..247b949b 100644 --- a/falcon/client/discover_iot/discover_iot_client.go +++ b/falcon/client/discover_iot/discover_iot_client.go @@ -34,6 +34,8 @@ type ClientService interface { QueryIotHosts(params *QueryIotHostsParams, opts ...ClientOption) (*QueryIotHostsOK, error) + QueryIotHostsV2(params *QueryIotHostsV2Params, opts ...ClientOption) (*QueryIotHostsV2OK, error) + SetTransport(transport runtime.ClientTransport) } @@ -113,6 +115,44 @@ func (a *Client) QueryIotHosts(params *QueryIotHostsParams, opts ...ClientOption panic(msg) } +/* +QueryIotHostsV2 searches for io t assets in your environment by providing an f q l falcon query language filter and paging details returns a set of asset i ds which match the filter criteria +*/ +func (a *Client) QueryIotHostsV2(params *QueryIotHostsV2Params, opts ...ClientOption) (*QueryIotHostsV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewQueryIotHostsV2Params() + } + op := &runtime.ClientOperation{ + ID: "query-iot-hostsV2", + Method: "GET", + PathPattern: "/discover/queries/iot-hosts/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &QueryIotHostsV2Reader{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.(*QueryIotHostsV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for query-iot-hostsV2: 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/falcon/client/discover_iot/query_iot_hosts_v2_parameters.go b/falcon/client/discover_iot/query_iot_hosts_v2_parameters.go new file mode 100644 index 00000000..4cb137f9 --- /dev/null +++ b/falcon/client/discover_iot/query_iot_hosts_v2_parameters.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package discover_iot + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewQueryIotHostsV2Params creates a new QueryIotHostsV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewQueryIotHostsV2Params() *QueryIotHostsV2Params { + return &QueryIotHostsV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewQueryIotHostsV2ParamsWithTimeout creates a new QueryIotHostsV2Params object +// with the ability to set a timeout on a request. +func NewQueryIotHostsV2ParamsWithTimeout(timeout time.Duration) *QueryIotHostsV2Params { + return &QueryIotHostsV2Params{ + timeout: timeout, + } +} + +// NewQueryIotHostsV2ParamsWithContext creates a new QueryIotHostsV2Params object +// with the ability to set a context for a request. +func NewQueryIotHostsV2ParamsWithContext(ctx context.Context) *QueryIotHostsV2Params { + return &QueryIotHostsV2Params{ + Context: ctx, + } +} + +// NewQueryIotHostsV2ParamsWithHTTPClient creates a new QueryIotHostsV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewQueryIotHostsV2ParamsWithHTTPClient(client *http.Client) *QueryIotHostsV2Params { + return &QueryIotHostsV2Params{ + HTTPClient: client, + } +} + +/* +QueryIotHostsV2Params contains all the parameters to send to the API endpoint + + for the query iot hosts v2 operation. + + Typically these are written to a http.Request. +*/ +type QueryIotHostsV2Params struct { + + /* After. + + A pagination token used with the `limit` parameter to manage pagination of results. On your first request, don't provide an `after` token. On subsequent requests, provide the `after` token from the previous response to continue from that place in the results. + */ + After *string + + /* Filter. + + Filter assets using an FQL query. Common filter options include: + Available filter fields that support exact match: device_family, device_class, device_type, device_mode, business_criticality, line_of_business, virtual_zone, subnet, purdue_level, vlan, local_ip_addresses, mac_addresses, physical_connections_count, data_providers + Available filter fields that supports wildcard (*): device_family, device_class, device_type, device_mode, business_criticality, line_of_business, virtual_zone, subnet, purdue_level, vlan, local_ip_addresses, mac_addresses, data_providers + Available filter fields that supports range comparisons (>, <, >=, <=): physical_connections_count + All filter fields and operations supports negation (!). + */ + Filter *string + + /* Limit. + + The number of asset IDs to return in this response (min: 1, max: 100, default: 100). Use with the `after` parameter to manage pagination of results. + */ + Limit *int64 + + /* Sort. + + Sort assets by their properties. A single sort field is allowed. Common sort options include: + + + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the query iot hosts v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryIotHostsV2Params) WithDefaults() *QueryIotHostsV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the query iot hosts v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryIotHostsV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) WithTimeout(timeout time.Duration) *QueryIotHostsV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) WithContext(ctx context.Context) *QueryIotHostsV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) WithHTTPClient(client *http.Client) *QueryIotHostsV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAfter adds the after to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) WithAfter(after *string) *QueryIotHostsV2Params { + o.SetAfter(after) + return o +} + +// SetAfter adds the after to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) SetAfter(after *string) { + o.After = after +} + +// WithFilter adds the filter to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) WithFilter(filter *string) *QueryIotHostsV2Params { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) WithLimit(limit *int64) *QueryIotHostsV2Params { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithSort adds the sort to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) WithSort(sort *string) *QueryIotHostsV2Params { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the query iot hosts v2 params +func (o *QueryIotHostsV2Params) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *QueryIotHostsV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.After != nil { + + // query param after + var qrAfter string + + if o.After != nil { + qrAfter = *o.After + } + qAfter := qrAfter + if qAfter != "" { + + if err := r.SetQueryParam("after", qAfter); err != nil { + return err + } + } + } + + 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.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/discover_iot/query_iot_hosts_v2_responses.go b/falcon/client/discover_iot/query_iot_hosts_v2_responses.go new file mode 100644 index 00000000..9db5795e --- /dev/null +++ b/falcon/client/discover_iot/query_iot_hosts_v2_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package discover_iot + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// QueryIotHostsV2Reader is a Reader for the QueryIotHostsV2 structure. +type QueryIotHostsV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *QueryIotHostsV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewQueryIotHostsV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewQueryIotHostsV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewQueryIotHostsV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewQueryIotHostsV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewQueryIotHostsV2InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /discover/queries/iot-hosts/v2] query-iot-hostsV2", response, response.Code()) + } +} + +// NewQueryIotHostsV2OK creates a QueryIotHostsV2OK with default headers values +func NewQueryIotHostsV2OK() *QueryIotHostsV2OK { + return &QueryIotHostsV2OK{} +} + +/* +QueryIotHostsV2OK describes a response with status code 200, with default header values. + +OK +*/ +type QueryIotHostsV2OK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainDiscoverAPIResponse +} + +// IsSuccess returns true when this query iot hosts v2 o k response has a 2xx status code +func (o *QueryIotHostsV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this query iot hosts v2 o k response has a 3xx status code +func (o *QueryIotHostsV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query iot hosts v2 o k response has a 4xx status code +func (o *QueryIotHostsV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this query iot hosts v2 o k response has a 5xx status code +func (o *QueryIotHostsV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this query iot hosts v2 o k response a status code equal to that given +func (o *QueryIotHostsV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the query iot hosts v2 o k response +func (o *QueryIotHostsV2OK) Code() int { + return 200 +} + +func (o *QueryIotHostsV2OK) Error() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2OK %+v", 200, o.Payload) +} + +func (o *QueryIotHostsV2OK) String() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2OK %+v", 200, o.Payload) +} + +func (o *QueryIotHostsV2OK) GetPayload() *models.DomainDiscoverAPIResponse { + return o.Payload +} + +func (o *QueryIotHostsV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainDiscoverAPIResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryIotHostsV2BadRequest creates a QueryIotHostsV2BadRequest with default headers values +func NewQueryIotHostsV2BadRequest() *QueryIotHostsV2BadRequest { + return &QueryIotHostsV2BadRequest{} +} + +/* +QueryIotHostsV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type QueryIotHostsV2BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this query iot hosts v2 bad request response has a 2xx status code +func (o *QueryIotHostsV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query iot hosts v2 bad request response has a 3xx status code +func (o *QueryIotHostsV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query iot hosts v2 bad request response has a 4xx status code +func (o *QueryIotHostsV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this query iot hosts v2 bad request response has a 5xx status code +func (o *QueryIotHostsV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this query iot hosts v2 bad request response a status code equal to that given +func (o *QueryIotHostsV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the query iot hosts v2 bad request response +func (o *QueryIotHostsV2BadRequest) Code() int { + return 400 +} + +func (o *QueryIotHostsV2BadRequest) Error() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2BadRequest %+v", 400, o.Payload) +} + +func (o *QueryIotHostsV2BadRequest) String() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2BadRequest %+v", 400, o.Payload) +} + +func (o *QueryIotHostsV2BadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *QueryIotHostsV2BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryIotHostsV2Forbidden creates a QueryIotHostsV2Forbidden with default headers values +func NewQueryIotHostsV2Forbidden() *QueryIotHostsV2Forbidden { + return &QueryIotHostsV2Forbidden{} +} + +/* +QueryIotHostsV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type QueryIotHostsV2Forbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query iot hosts v2 forbidden response has a 2xx status code +func (o *QueryIotHostsV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query iot hosts v2 forbidden response has a 3xx status code +func (o *QueryIotHostsV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query iot hosts v2 forbidden response has a 4xx status code +func (o *QueryIotHostsV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this query iot hosts v2 forbidden response has a 5xx status code +func (o *QueryIotHostsV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this query iot hosts v2 forbidden response a status code equal to that given +func (o *QueryIotHostsV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the query iot hosts v2 forbidden response +func (o *QueryIotHostsV2Forbidden) Code() int { + return 403 +} + +func (o *QueryIotHostsV2Forbidden) Error() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2Forbidden %+v", 403, o.Payload) +} + +func (o *QueryIotHostsV2Forbidden) String() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2Forbidden %+v", 403, o.Payload) +} + +func (o *QueryIotHostsV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryIotHostsV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryIotHostsV2TooManyRequests creates a QueryIotHostsV2TooManyRequests with default headers values +func NewQueryIotHostsV2TooManyRequests() *QueryIotHostsV2TooManyRequests { + return &QueryIotHostsV2TooManyRequests{} +} + +/* +QueryIotHostsV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type QueryIotHostsV2TooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query iot hosts v2 too many requests response has a 2xx status code +func (o *QueryIotHostsV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query iot hosts v2 too many requests response has a 3xx status code +func (o *QueryIotHostsV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query iot hosts v2 too many requests response has a 4xx status code +func (o *QueryIotHostsV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this query iot hosts v2 too many requests response has a 5xx status code +func (o *QueryIotHostsV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this query iot hosts v2 too many requests response a status code equal to that given +func (o *QueryIotHostsV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the query iot hosts v2 too many requests response +func (o *QueryIotHostsV2TooManyRequests) Code() int { + return 429 +} + +func (o *QueryIotHostsV2TooManyRequests) Error() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryIotHostsV2TooManyRequests) String() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryIotHostsV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryIotHostsV2TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryIotHostsV2InternalServerError creates a QueryIotHostsV2InternalServerError with default headers values +func NewQueryIotHostsV2InternalServerError() *QueryIotHostsV2InternalServerError { + return &QueryIotHostsV2InternalServerError{} +} + +/* +QueryIotHostsV2InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type QueryIotHostsV2InternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this query iot hosts v2 internal server error response has a 2xx status code +func (o *QueryIotHostsV2InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query iot hosts v2 internal server error response has a 3xx status code +func (o *QueryIotHostsV2InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query iot hosts v2 internal server error response has a 4xx status code +func (o *QueryIotHostsV2InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this query iot hosts v2 internal server error response has a 5xx status code +func (o *QueryIotHostsV2InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this query iot hosts v2 internal server error response a status code equal to that given +func (o *QueryIotHostsV2InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the query iot hosts v2 internal server error response +func (o *QueryIotHostsV2InternalServerError) Code() int { + return 500 +} + +func (o *QueryIotHostsV2InternalServerError) Error() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2InternalServerError %+v", 500, o.Payload) +} + +func (o *QueryIotHostsV2InternalServerError) String() string { + return fmt.Sprintf("[GET /discover/queries/iot-hosts/v2][%d] queryIotHostsV2InternalServerError %+v", 500, o.Payload) +} + +func (o *QueryIotHostsV2InternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *QueryIotHostsV2InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/drift_indicators/drift_indicators_client.go b/falcon/client/drift_indicators/drift_indicators_client.go index 5af8849b..a7ac4a83 100644 --- a/falcon/client/drift_indicators/drift_indicators_client.go +++ b/falcon/client/drift_indicators/drift_indicators_client.go @@ -32,8 +32,6 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { GetDriftIndicatorsValuesByDate(params *GetDriftIndicatorsValuesByDateParams, opts ...ClientOption) (*GetDriftIndicatorsValuesByDateOK, error) - ReadDriftIndicatorEntities(params *ReadDriftIndicatorEntitiesParams, opts ...ClientOption) (*ReadDriftIndicatorEntitiesOK, error) - ReadDriftIndicatorsCount(params *ReadDriftIndicatorsCountParams, opts ...ClientOption) (*ReadDriftIndicatorsCountOK, error) SearchAndReadDriftIndicatorEntities(params *SearchAndReadDriftIndicatorEntitiesParams, opts ...ClientOption) (*SearchAndReadDriftIndicatorEntitiesOK, error) @@ -81,44 +79,6 @@ func (a *Client) GetDriftIndicatorsValuesByDate(params *GetDriftIndicatorsValues panic(msg) } -/* -ReadDriftIndicatorEntities retrieves drift indicator entities identified by the provided i ds -*/ -func (a *Client) ReadDriftIndicatorEntities(params *ReadDriftIndicatorEntitiesParams, opts ...ClientOption) (*ReadDriftIndicatorEntitiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewReadDriftIndicatorEntitiesParams() - } - op := &runtime.ClientOperation{ - ID: "ReadDriftIndicatorEntities", - Method: "GET", - PathPattern: "/container-security/entities/drift-indicators/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ReadDriftIndicatorEntitiesReader{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.(*ReadDriftIndicatorEntitiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ReadDriftIndicatorEntities: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* ReadDriftIndicatorsCount returns the total count of drift indicators over a time period */ diff --git a/falcon/client/drift_indicators/read_drift_indicator_entities_parameters.go b/falcon/client/drift_indicators/read_drift_indicator_entities_parameters.go deleted file mode 100644 index 877a51da..00000000 --- a/falcon/client/drift_indicators/read_drift_indicator_entities_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package drift_indicators - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewReadDriftIndicatorEntitiesParams creates a new ReadDriftIndicatorEntitiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewReadDriftIndicatorEntitiesParams() *ReadDriftIndicatorEntitiesParams { - return &ReadDriftIndicatorEntitiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewReadDriftIndicatorEntitiesParamsWithTimeout creates a new ReadDriftIndicatorEntitiesParams object -// with the ability to set a timeout on a request. -func NewReadDriftIndicatorEntitiesParamsWithTimeout(timeout time.Duration) *ReadDriftIndicatorEntitiesParams { - return &ReadDriftIndicatorEntitiesParams{ - timeout: timeout, - } -} - -// NewReadDriftIndicatorEntitiesParamsWithContext creates a new ReadDriftIndicatorEntitiesParams object -// with the ability to set a context for a request. -func NewReadDriftIndicatorEntitiesParamsWithContext(ctx context.Context) *ReadDriftIndicatorEntitiesParams { - return &ReadDriftIndicatorEntitiesParams{ - Context: ctx, - } -} - -// NewReadDriftIndicatorEntitiesParamsWithHTTPClient creates a new ReadDriftIndicatorEntitiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewReadDriftIndicatorEntitiesParamsWithHTTPClient(client *http.Client) *ReadDriftIndicatorEntitiesParams { - return &ReadDriftIndicatorEntitiesParams{ - HTTPClient: client, - } -} - -/* -ReadDriftIndicatorEntitiesParams contains all the parameters to send to the API endpoint - - for the read drift indicator entities operation. - - Typically these are written to a http.Request. -*/ -type ReadDriftIndicatorEntitiesParams struct { - - /* Ids. - - Search Drift Indicators by ids - The maximum amount is 100 IDs - */ - Ids []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the read drift indicator entities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReadDriftIndicatorEntitiesParams) WithDefaults() *ReadDriftIndicatorEntitiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the read drift indicator entities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReadDriftIndicatorEntitiesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) WithTimeout(timeout time.Duration) *ReadDriftIndicatorEntitiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) WithContext(ctx context.Context) *ReadDriftIndicatorEntitiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) WithHTTPClient(client *http.Client) *ReadDriftIndicatorEntitiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIds adds the ids to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) WithIds(ids []string) *ReadDriftIndicatorEntitiesParams { - o.SetIds(ids) - return o -} - -// SetIds adds the ids to the read drift indicator entities params -func (o *ReadDriftIndicatorEntitiesParams) SetIds(ids []string) { - o.Ids = ids -} - -// WriteToRequest writes these params to a swagger request -func (o *ReadDriftIndicatorEntitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Ids != nil { - - // binding items for ids - joinedIds := o.bindParamIds(reg) - - // query array param ids - if err := r.SetQueryParam("ids", joinedIds...); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParamReadDriftIndicatorEntities binds the parameter ids -func (o *ReadDriftIndicatorEntitiesParams) bindParamIds(formats strfmt.Registry) []string { - idsIR := o.Ids - - var idsIC []string - for _, idsIIR := range idsIR { // explode []string - - idsIIV := idsIIR // string as string - idsIC = append(idsIC, idsIIV) - } - - // items.CollectionFormat: "csv" - idsIS := swag.JoinByFormat(idsIC, "csv") - - return idsIS -} diff --git a/falcon/client/drift_indicators/read_drift_indicator_entities_responses.go b/falcon/client/drift_indicators/read_drift_indicator_entities_responses.go deleted file mode 100644 index 1ed5c3d0..00000000 --- a/falcon/client/drift_indicators/read_drift_indicator_entities_responses.go +++ /dev/null @@ -1,510 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package drift_indicators - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/crowdstrike/gofalcon/falcon/models" -) - -// ReadDriftIndicatorEntitiesReader is a Reader for the ReadDriftIndicatorEntities structure. -type ReadDriftIndicatorEntitiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ReadDriftIndicatorEntitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewReadDriftIndicatorEntitiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewReadDriftIndicatorEntitiesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewReadDriftIndicatorEntitiesTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewReadDriftIndicatorEntitiesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /container-security/entities/drift-indicators/v1] ReadDriftIndicatorEntities", response, response.Code()) - } -} - -// NewReadDriftIndicatorEntitiesOK creates a ReadDriftIndicatorEntitiesOK with default headers values -func NewReadDriftIndicatorEntitiesOK() *ReadDriftIndicatorEntitiesOK { - return &ReadDriftIndicatorEntitiesOK{} -} - -/* -ReadDriftIndicatorEntitiesOK describes a response with status code 200, with default header values. - -OK -*/ -type ReadDriftIndicatorEntitiesOK struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.DriftindicatorsDriftEntityResponse -} - -// IsSuccess returns true when this read drift indicator entities o k response has a 2xx status code -func (o *ReadDriftIndicatorEntitiesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this read drift indicator entities o k response has a 3xx status code -func (o *ReadDriftIndicatorEntitiesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this read drift indicator entities o k response has a 4xx status code -func (o *ReadDriftIndicatorEntitiesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this read drift indicator entities o k response has a 5xx status code -func (o *ReadDriftIndicatorEntitiesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this read drift indicator entities o k response a status code equal to that given -func (o *ReadDriftIndicatorEntitiesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the read drift indicator entities o k response -func (o *ReadDriftIndicatorEntitiesOK) Code() int { - return 200 -} - -func (o *ReadDriftIndicatorEntitiesOK) Error() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesOK %+v", 200, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesOK) String() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesOK %+v", 200, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesOK) GetPayload() *models.DriftindicatorsDriftEntityResponse { - return o.Payload -} - -func (o *ReadDriftIndicatorEntitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.DriftindicatorsDriftEntityResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReadDriftIndicatorEntitiesForbidden creates a ReadDriftIndicatorEntitiesForbidden with default headers values -func NewReadDriftIndicatorEntitiesForbidden() *ReadDriftIndicatorEntitiesForbidden { - return &ReadDriftIndicatorEntitiesForbidden{} -} - -/* -ReadDriftIndicatorEntitiesForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ReadDriftIndicatorEntitiesForbidden struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this read drift indicator entities forbidden response has a 2xx status code -func (o *ReadDriftIndicatorEntitiesForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this read drift indicator entities forbidden response has a 3xx status code -func (o *ReadDriftIndicatorEntitiesForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this read drift indicator entities forbidden response has a 4xx status code -func (o *ReadDriftIndicatorEntitiesForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this read drift indicator entities forbidden response has a 5xx status code -func (o *ReadDriftIndicatorEntitiesForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this read drift indicator entities forbidden response a status code equal to that given -func (o *ReadDriftIndicatorEntitiesForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the read drift indicator entities forbidden response -func (o *ReadDriftIndicatorEntitiesForbidden) Code() int { - return 403 -} - -func (o *ReadDriftIndicatorEntitiesForbidden) Error() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesForbidden %+v", 403, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesForbidden) String() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesForbidden %+v", 403, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *ReadDriftIndicatorEntitiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReadDriftIndicatorEntitiesTooManyRequests creates a ReadDriftIndicatorEntitiesTooManyRequests with default headers values -func NewReadDriftIndicatorEntitiesTooManyRequests() *ReadDriftIndicatorEntitiesTooManyRequests { - return &ReadDriftIndicatorEntitiesTooManyRequests{} -} - -/* -ReadDriftIndicatorEntitiesTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type ReadDriftIndicatorEntitiesTooManyRequests struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - /* Too many requests, retry after this time (as milliseconds since epoch) - */ - XRateLimitRetryAfter int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this read drift indicator entities too many requests response has a 2xx status code -func (o *ReadDriftIndicatorEntitiesTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this read drift indicator entities too many requests response has a 3xx status code -func (o *ReadDriftIndicatorEntitiesTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this read drift indicator entities too many requests response has a 4xx status code -func (o *ReadDriftIndicatorEntitiesTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this read drift indicator entities too many requests response has a 5xx status code -func (o *ReadDriftIndicatorEntitiesTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this read drift indicator entities too many requests response a status code equal to that given -func (o *ReadDriftIndicatorEntitiesTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the read drift indicator entities too many requests response -func (o *ReadDriftIndicatorEntitiesTooManyRequests) Code() int { - return 429 -} - -func (o *ReadDriftIndicatorEntitiesTooManyRequests) Error() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesTooManyRequests %+v", 429, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesTooManyRequests) String() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesTooManyRequests %+v", 429, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *ReadDriftIndicatorEntitiesTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - // hydrates response header X-RateLimit-RetryAfter - hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") - - if hdrXRateLimitRetryAfter != "" { - valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) - if err != nil { - return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) - } - o.XRateLimitRetryAfter = valxRateLimitRetryAfter - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReadDriftIndicatorEntitiesInternalServerError creates a ReadDriftIndicatorEntitiesInternalServerError with default headers values -func NewReadDriftIndicatorEntitiesInternalServerError() *ReadDriftIndicatorEntitiesInternalServerError { - return &ReadDriftIndicatorEntitiesInternalServerError{} -} - -/* -ReadDriftIndicatorEntitiesInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ReadDriftIndicatorEntitiesInternalServerError struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.CoreEntitiesResponse -} - -// IsSuccess returns true when this read drift indicator entities internal server error response has a 2xx status code -func (o *ReadDriftIndicatorEntitiesInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this read drift indicator entities internal server error response has a 3xx status code -func (o *ReadDriftIndicatorEntitiesInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this read drift indicator entities internal server error response has a 4xx status code -func (o *ReadDriftIndicatorEntitiesInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this read drift indicator entities internal server error response has a 5xx status code -func (o *ReadDriftIndicatorEntitiesInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this read drift indicator entities internal server error response a status code equal to that given -func (o *ReadDriftIndicatorEntitiesInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the read drift indicator entities internal server error response -func (o *ReadDriftIndicatorEntitiesInternalServerError) Code() int { - return 500 -} - -func (o *ReadDriftIndicatorEntitiesInternalServerError) Error() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesInternalServerError %+v", 500, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesInternalServerError) String() string { - return fmt.Sprintf("[GET /container-security/entities/drift-indicators/v1][%d] readDriftIndicatorEntitiesInternalServerError %+v", 500, o.Payload) -} - -func (o *ReadDriftIndicatorEntitiesInternalServerError) GetPayload() *models.CoreEntitiesResponse { - return o.Payload -} - -func (o *ReadDriftIndicatorEntitiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.CoreEntitiesResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/falcon/client/exposure_management/aggregate_external_assets_parameters.go b/falcon/client/exposure_management/aggregate_external_assets_parameters.go new file mode 100644 index 00000000..48a1c4e1 --- /dev/null +++ b/falcon/client/exposure_management/aggregate_external_assets_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewAggregateExternalAssetsParams creates a new AggregateExternalAssetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAggregateExternalAssetsParams() *AggregateExternalAssetsParams { + return &AggregateExternalAssetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAggregateExternalAssetsParamsWithTimeout creates a new AggregateExternalAssetsParams object +// with the ability to set a timeout on a request. +func NewAggregateExternalAssetsParamsWithTimeout(timeout time.Duration) *AggregateExternalAssetsParams { + return &AggregateExternalAssetsParams{ + timeout: timeout, + } +} + +// NewAggregateExternalAssetsParamsWithContext creates a new AggregateExternalAssetsParams object +// with the ability to set a context for a request. +func NewAggregateExternalAssetsParamsWithContext(ctx context.Context) *AggregateExternalAssetsParams { + return &AggregateExternalAssetsParams{ + Context: ctx, + } +} + +// NewAggregateExternalAssetsParamsWithHTTPClient creates a new AggregateExternalAssetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewAggregateExternalAssetsParamsWithHTTPClient(client *http.Client) *AggregateExternalAssetsParams { + return &AggregateExternalAssetsParams{ + HTTPClient: client, + } +} + +/* +AggregateExternalAssetsParams contains all the parameters to send to the API endpoint + + for the aggregate external assets operation. + + Typically these are written to a http.Request. +*/ +type AggregateExternalAssetsParams struct { + + /* Body. + + Aggregation specification. + */ + Body []*models.MsaAggregateQueryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the aggregate external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateExternalAssetsParams) WithDefaults() *AggregateExternalAssetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the aggregate external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateExternalAssetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the aggregate external assets params +func (o *AggregateExternalAssetsParams) WithTimeout(timeout time.Duration) *AggregateExternalAssetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the aggregate external assets params +func (o *AggregateExternalAssetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the aggregate external assets params +func (o *AggregateExternalAssetsParams) WithContext(ctx context.Context) *AggregateExternalAssetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the aggregate external assets params +func (o *AggregateExternalAssetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the aggregate external assets params +func (o *AggregateExternalAssetsParams) WithHTTPClient(client *http.Client) *AggregateExternalAssetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the aggregate external assets params +func (o *AggregateExternalAssetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the aggregate external assets params +func (o *AggregateExternalAssetsParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregateExternalAssetsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the aggregate external assets params +func (o *AggregateExternalAssetsParams) SetBody(body []*models.MsaAggregateQueryRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AggregateExternalAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/exposure_management/aggregate_external_assets_responses.go b/falcon/client/exposure_management/aggregate_external_assets_responses.go new file mode 100644 index 00000000..fca57780 --- /dev/null +++ b/falcon/client/exposure_management/aggregate_external_assets_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// AggregateExternalAssetsReader is a Reader for the AggregateExternalAssets structure. +type AggregateExternalAssetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AggregateExternalAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAggregateExternalAssetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAggregateExternalAssetsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewAggregateExternalAssetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewAggregateExternalAssetsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewAggregateExternalAssetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /fem/aggregates/external-assets/v1] aggregate-external-assets", response, response.Code()) + } +} + +// NewAggregateExternalAssetsOK creates a AggregateExternalAssetsOK with default headers values +func NewAggregateExternalAssetsOK() *AggregateExternalAssetsOK { + return &AggregateExternalAssetsOK{} +} + +/* +AggregateExternalAssetsOK describes a response with status code 200, with default header values. + +OK +*/ +type AggregateExternalAssetsOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaAggregatesResponse +} + +// IsSuccess returns true when this aggregate external assets o k response has a 2xx status code +func (o *AggregateExternalAssetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this aggregate external assets o k response has a 3xx status code +func (o *AggregateExternalAssetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate external assets o k response has a 4xx status code +func (o *AggregateExternalAssetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate external assets o k response has a 5xx status code +func (o *AggregateExternalAssetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate external assets o k response a status code equal to that given +func (o *AggregateExternalAssetsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the aggregate external assets o k response +func (o *AggregateExternalAssetsOK) Code() int { + return 200 +} + +func (o *AggregateExternalAssetsOK) Error() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *AggregateExternalAssetsOK) String() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *AggregateExternalAssetsOK) GetPayload() *models.MsaAggregatesResponse { + return o.Payload +} + +func (o *AggregateExternalAssetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaAggregatesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateExternalAssetsBadRequest creates a AggregateExternalAssetsBadRequest with default headers values +func NewAggregateExternalAssetsBadRequest() *AggregateExternalAssetsBadRequest { + return &AggregateExternalAssetsBadRequest{} +} + +/* +AggregateExternalAssetsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type AggregateExternalAssetsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this aggregate external assets bad request response has a 2xx status code +func (o *AggregateExternalAssetsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate external assets bad request response has a 3xx status code +func (o *AggregateExternalAssetsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate external assets bad request response has a 4xx status code +func (o *AggregateExternalAssetsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate external assets bad request response has a 5xx status code +func (o *AggregateExternalAssetsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate external assets bad request response a status code equal to that given +func (o *AggregateExternalAssetsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the aggregate external assets bad request response +func (o *AggregateExternalAssetsBadRequest) Code() int { + return 400 +} + +func (o *AggregateExternalAssetsBadRequest) Error() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *AggregateExternalAssetsBadRequest) String() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *AggregateExternalAssetsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateExternalAssetsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateExternalAssetsForbidden creates a AggregateExternalAssetsForbidden with default headers values +func NewAggregateExternalAssetsForbidden() *AggregateExternalAssetsForbidden { + return &AggregateExternalAssetsForbidden{} +} + +/* +AggregateExternalAssetsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type AggregateExternalAssetsForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this aggregate external assets forbidden response has a 2xx status code +func (o *AggregateExternalAssetsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate external assets forbidden response has a 3xx status code +func (o *AggregateExternalAssetsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate external assets forbidden response has a 4xx status code +func (o *AggregateExternalAssetsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate external assets forbidden response has a 5xx status code +func (o *AggregateExternalAssetsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate external assets forbidden response a status code equal to that given +func (o *AggregateExternalAssetsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the aggregate external assets forbidden response +func (o *AggregateExternalAssetsForbidden) Code() int { + return 403 +} + +func (o *AggregateExternalAssetsForbidden) Error() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *AggregateExternalAssetsForbidden) String() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *AggregateExternalAssetsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *AggregateExternalAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateExternalAssetsTooManyRequests creates a AggregateExternalAssetsTooManyRequests with default headers values +func NewAggregateExternalAssetsTooManyRequests() *AggregateExternalAssetsTooManyRequests { + return &AggregateExternalAssetsTooManyRequests{} +} + +/* +AggregateExternalAssetsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type AggregateExternalAssetsTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this aggregate external assets too many requests response has a 2xx status code +func (o *AggregateExternalAssetsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate external assets too many requests response has a 3xx status code +func (o *AggregateExternalAssetsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate external assets too many requests response has a 4xx status code +func (o *AggregateExternalAssetsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate external assets too many requests response has a 5xx status code +func (o *AggregateExternalAssetsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate external assets too many requests response a status code equal to that given +func (o *AggregateExternalAssetsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the aggregate external assets too many requests response +func (o *AggregateExternalAssetsTooManyRequests) Code() int { + return 429 +} + +func (o *AggregateExternalAssetsTooManyRequests) Error() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregateExternalAssetsTooManyRequests) String() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregateExternalAssetsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *AggregateExternalAssetsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateExternalAssetsInternalServerError creates a AggregateExternalAssetsInternalServerError with default headers values +func NewAggregateExternalAssetsInternalServerError() *AggregateExternalAssetsInternalServerError { + return &AggregateExternalAssetsInternalServerError{} +} + +/* +AggregateExternalAssetsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type AggregateExternalAssetsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this aggregate external assets internal server error response has a 2xx status code +func (o *AggregateExternalAssetsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate external assets internal server error response has a 3xx status code +func (o *AggregateExternalAssetsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate external assets internal server error response has a 4xx status code +func (o *AggregateExternalAssetsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate external assets internal server error response has a 5xx status code +func (o *AggregateExternalAssetsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this aggregate external assets internal server error response a status code equal to that given +func (o *AggregateExternalAssetsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the aggregate external assets internal server error response +func (o *AggregateExternalAssetsInternalServerError) Code() int { + return 500 +} + +func (o *AggregateExternalAssetsInternalServerError) Error() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregateExternalAssetsInternalServerError) String() string { + return fmt.Sprintf("[POST /fem/aggregates/external-assets/v1][%d] aggregateExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregateExternalAssetsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateExternalAssetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/exposure_management/blob_download_external_assets_parameters.go b/falcon/client/exposure_management/blob_download_external_assets_parameters.go new file mode 100644 index 00000000..2c4d0776 --- /dev/null +++ b/falcon/client/exposure_management/blob_download_external_assets_parameters.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewBlobDownloadExternalAssetsParams creates a new BlobDownloadExternalAssetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewBlobDownloadExternalAssetsParams() *BlobDownloadExternalAssetsParams { + return &BlobDownloadExternalAssetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewBlobDownloadExternalAssetsParamsWithTimeout creates a new BlobDownloadExternalAssetsParams object +// with the ability to set a timeout on a request. +func NewBlobDownloadExternalAssetsParamsWithTimeout(timeout time.Duration) *BlobDownloadExternalAssetsParams { + return &BlobDownloadExternalAssetsParams{ + timeout: timeout, + } +} + +// NewBlobDownloadExternalAssetsParamsWithContext creates a new BlobDownloadExternalAssetsParams object +// with the ability to set a context for a request. +func NewBlobDownloadExternalAssetsParamsWithContext(ctx context.Context) *BlobDownloadExternalAssetsParams { + return &BlobDownloadExternalAssetsParams{ + Context: ctx, + } +} + +// NewBlobDownloadExternalAssetsParamsWithHTTPClient creates a new BlobDownloadExternalAssetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewBlobDownloadExternalAssetsParamsWithHTTPClient(client *http.Client) *BlobDownloadExternalAssetsParams { + return &BlobDownloadExternalAssetsParams{ + HTTPClient: client, + } +} + +/* +BlobDownloadExternalAssetsParams contains all the parameters to send to the API endpoint + + for the blob download external assets operation. + + Typically these are written to a http.Request. +*/ +type BlobDownloadExternalAssetsParams struct { + + /* AssetID. + + The Asset ID + */ + AssetID string + + /* Hash. + + The File Hash + */ + Hash string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the blob download external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BlobDownloadExternalAssetsParams) WithDefaults() *BlobDownloadExternalAssetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the blob download external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BlobDownloadExternalAssetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) WithTimeout(timeout time.Duration) *BlobDownloadExternalAssetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) WithContext(ctx context.Context) *BlobDownloadExternalAssetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) WithHTTPClient(client *http.Client) *BlobDownloadExternalAssetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssetID adds the assetID to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) WithAssetID(assetID string) *BlobDownloadExternalAssetsParams { + o.SetAssetID(assetID) + return o +} + +// SetAssetID adds the assetId to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) SetAssetID(assetID string) { + o.AssetID = assetID +} + +// WithHash adds the hash to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) WithHash(hash string) *BlobDownloadExternalAssetsParams { + o.SetHash(hash) + return o +} + +// SetHash adds the hash to the blob download external assets params +func (o *BlobDownloadExternalAssetsParams) SetHash(hash string) { + o.Hash = hash +} + +// WriteToRequest writes these params to a swagger request +func (o *BlobDownloadExternalAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param assetId + qrAssetID := o.AssetID + qAssetID := qrAssetID + if qAssetID != "" { + + if err := r.SetQueryParam("assetId", qAssetID); err != nil { + return err + } + } + + // query param hash + qrHash := o.Hash + qHash := qrHash + if qHash != "" { + + if err := r.SetQueryParam("hash", qHash); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/exposure_management/blob_download_external_assets_responses.go b/falcon/client/exposure_management/blob_download_external_assets_responses.go new file mode 100644 index 00000000..4bc8e611 --- /dev/null +++ b/falcon/client/exposure_management/blob_download_external_assets_responses.go @@ -0,0 +1,624 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// BlobDownloadExternalAssetsReader is a Reader for the BlobDownloadExternalAssets structure. +type BlobDownloadExternalAssetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *BlobDownloadExternalAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewBlobDownloadExternalAssetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewBlobDownloadExternalAssetsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewBlobDownloadExternalAssetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewBlobDownloadExternalAssetsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewBlobDownloadExternalAssetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /fem/entities/blobs-download/v1] blob-download-external-assets", response, response.Code()) + } +} + +// NewBlobDownloadExternalAssetsOK creates a BlobDownloadExternalAssetsOK with default headers values +func NewBlobDownloadExternalAssetsOK() *BlobDownloadExternalAssetsOK { + return &BlobDownloadExternalAssetsOK{} +} + +/* +BlobDownloadExternalAssetsOK describes a response with status code 200, with default header values. + +OK +*/ +type BlobDownloadExternalAssetsOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload []int64 +} + +// IsSuccess returns true when this blob download external assets o k response has a 2xx status code +func (o *BlobDownloadExternalAssetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this blob download external assets o k response has a 3xx status code +func (o *BlobDownloadExternalAssetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob download external assets o k response has a 4xx status code +func (o *BlobDownloadExternalAssetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this blob download external assets o k response has a 5xx status code +func (o *BlobDownloadExternalAssetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this blob download external assets o k response a status code equal to that given +func (o *BlobDownloadExternalAssetsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the blob download external assets o k response +func (o *BlobDownloadExternalAssetsOK) Code() int { + return 200 +} + +func (o *BlobDownloadExternalAssetsOK) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *BlobDownloadExternalAssetsOK) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *BlobDownloadExternalAssetsOK) GetPayload() []int64 { + return o.Payload +} + +func (o *BlobDownloadExternalAssetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobDownloadExternalAssetsBadRequest creates a BlobDownloadExternalAssetsBadRequest with default headers values +func NewBlobDownloadExternalAssetsBadRequest() *BlobDownloadExternalAssetsBadRequest { + return &BlobDownloadExternalAssetsBadRequest{} +} + +/* +BlobDownloadExternalAssetsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type BlobDownloadExternalAssetsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this blob download external assets bad request response has a 2xx status code +func (o *BlobDownloadExternalAssetsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob download external assets bad request response has a 3xx status code +func (o *BlobDownloadExternalAssetsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob download external assets bad request response has a 4xx status code +func (o *BlobDownloadExternalAssetsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this blob download external assets bad request response has a 5xx status code +func (o *BlobDownloadExternalAssetsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this blob download external assets bad request response a status code equal to that given +func (o *BlobDownloadExternalAssetsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the blob download external assets bad request response +func (o *BlobDownloadExternalAssetsBadRequest) Code() int { + return 400 +} + +func (o *BlobDownloadExternalAssetsBadRequest) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *BlobDownloadExternalAssetsBadRequest) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *BlobDownloadExternalAssetsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *BlobDownloadExternalAssetsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobDownloadExternalAssetsForbidden creates a BlobDownloadExternalAssetsForbidden with default headers values +func NewBlobDownloadExternalAssetsForbidden() *BlobDownloadExternalAssetsForbidden { + return &BlobDownloadExternalAssetsForbidden{} +} + +/* +BlobDownloadExternalAssetsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type BlobDownloadExternalAssetsForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this blob download external assets forbidden response has a 2xx status code +func (o *BlobDownloadExternalAssetsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob download external assets forbidden response has a 3xx status code +func (o *BlobDownloadExternalAssetsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob download external assets forbidden response has a 4xx status code +func (o *BlobDownloadExternalAssetsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this blob download external assets forbidden response has a 5xx status code +func (o *BlobDownloadExternalAssetsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this blob download external assets forbidden response a status code equal to that given +func (o *BlobDownloadExternalAssetsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the blob download external assets forbidden response +func (o *BlobDownloadExternalAssetsForbidden) Code() int { + return 403 +} + +func (o *BlobDownloadExternalAssetsForbidden) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *BlobDownloadExternalAssetsForbidden) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *BlobDownloadExternalAssetsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *BlobDownloadExternalAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobDownloadExternalAssetsTooManyRequests creates a BlobDownloadExternalAssetsTooManyRequests with default headers values +func NewBlobDownloadExternalAssetsTooManyRequests() *BlobDownloadExternalAssetsTooManyRequests { + return &BlobDownloadExternalAssetsTooManyRequests{} +} + +/* +BlobDownloadExternalAssetsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type BlobDownloadExternalAssetsTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this blob download external assets too many requests response has a 2xx status code +func (o *BlobDownloadExternalAssetsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob download external assets too many requests response has a 3xx status code +func (o *BlobDownloadExternalAssetsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob download external assets too many requests response has a 4xx status code +func (o *BlobDownloadExternalAssetsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this blob download external assets too many requests response has a 5xx status code +func (o *BlobDownloadExternalAssetsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this blob download external assets too many requests response a status code equal to that given +func (o *BlobDownloadExternalAssetsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the blob download external assets too many requests response +func (o *BlobDownloadExternalAssetsTooManyRequests) Code() int { + return 429 +} + +func (o *BlobDownloadExternalAssetsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *BlobDownloadExternalAssetsTooManyRequests) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *BlobDownloadExternalAssetsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *BlobDownloadExternalAssetsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobDownloadExternalAssetsInternalServerError creates a BlobDownloadExternalAssetsInternalServerError with default headers values +func NewBlobDownloadExternalAssetsInternalServerError() *BlobDownloadExternalAssetsInternalServerError { + return &BlobDownloadExternalAssetsInternalServerError{} +} + +/* +BlobDownloadExternalAssetsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type BlobDownloadExternalAssetsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this blob download external assets internal server error response has a 2xx status code +func (o *BlobDownloadExternalAssetsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob download external assets internal server error response has a 3xx status code +func (o *BlobDownloadExternalAssetsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob download external assets internal server error response has a 4xx status code +func (o *BlobDownloadExternalAssetsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this blob download external assets internal server error response has a 5xx status code +func (o *BlobDownloadExternalAssetsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this blob download external assets internal server error response a status code equal to that given +func (o *BlobDownloadExternalAssetsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the blob download external assets internal server error response +func (o *BlobDownloadExternalAssetsInternalServerError) Code() int { + return 500 +} + +func (o *BlobDownloadExternalAssetsInternalServerError) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *BlobDownloadExternalAssetsInternalServerError) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-download/v1][%d] blobDownloadExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *BlobDownloadExternalAssetsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *BlobDownloadExternalAssetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/exposure_management/blob_preview_external_assets_parameters.go b/falcon/client/exposure_management/blob_preview_external_assets_parameters.go new file mode 100644 index 00000000..e480b590 --- /dev/null +++ b/falcon/client/exposure_management/blob_preview_external_assets_parameters.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewBlobPreviewExternalAssetsParams creates a new BlobPreviewExternalAssetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewBlobPreviewExternalAssetsParams() *BlobPreviewExternalAssetsParams { + return &BlobPreviewExternalAssetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewBlobPreviewExternalAssetsParamsWithTimeout creates a new BlobPreviewExternalAssetsParams object +// with the ability to set a timeout on a request. +func NewBlobPreviewExternalAssetsParamsWithTimeout(timeout time.Duration) *BlobPreviewExternalAssetsParams { + return &BlobPreviewExternalAssetsParams{ + timeout: timeout, + } +} + +// NewBlobPreviewExternalAssetsParamsWithContext creates a new BlobPreviewExternalAssetsParams object +// with the ability to set a context for a request. +func NewBlobPreviewExternalAssetsParamsWithContext(ctx context.Context) *BlobPreviewExternalAssetsParams { + return &BlobPreviewExternalAssetsParams{ + Context: ctx, + } +} + +// NewBlobPreviewExternalAssetsParamsWithHTTPClient creates a new BlobPreviewExternalAssetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewBlobPreviewExternalAssetsParamsWithHTTPClient(client *http.Client) *BlobPreviewExternalAssetsParams { + return &BlobPreviewExternalAssetsParams{ + HTTPClient: client, + } +} + +/* +BlobPreviewExternalAssetsParams contains all the parameters to send to the API endpoint + + for the blob preview external assets operation. + + Typically these are written to a http.Request. +*/ +type BlobPreviewExternalAssetsParams struct { + + /* AssetID. + + The Asset ID + */ + AssetID string + + /* Hash. + + The File Hash + */ + Hash string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the blob preview external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BlobPreviewExternalAssetsParams) WithDefaults() *BlobPreviewExternalAssetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the blob preview external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BlobPreviewExternalAssetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) WithTimeout(timeout time.Duration) *BlobPreviewExternalAssetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) WithContext(ctx context.Context) *BlobPreviewExternalAssetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) WithHTTPClient(client *http.Client) *BlobPreviewExternalAssetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssetID adds the assetID to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) WithAssetID(assetID string) *BlobPreviewExternalAssetsParams { + o.SetAssetID(assetID) + return o +} + +// SetAssetID adds the assetId to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) SetAssetID(assetID string) { + o.AssetID = assetID +} + +// WithHash adds the hash to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) WithHash(hash string) *BlobPreviewExternalAssetsParams { + o.SetHash(hash) + return o +} + +// SetHash adds the hash to the blob preview external assets params +func (o *BlobPreviewExternalAssetsParams) SetHash(hash string) { + o.Hash = hash +} + +// WriteToRequest writes these params to a swagger request +func (o *BlobPreviewExternalAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param assetId + qrAssetID := o.AssetID + qAssetID := qrAssetID + if qAssetID != "" { + + if err := r.SetQueryParam("assetId", qAssetID); err != nil { + return err + } + } + + // query param hash + qrHash := o.Hash + qHash := qrHash + if qHash != "" { + + if err := r.SetQueryParam("hash", qHash); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/exposure_management/blob_preview_external_assets_responses.go b/falcon/client/exposure_management/blob_preview_external_assets_responses.go new file mode 100644 index 00000000..cd9b7e0c --- /dev/null +++ b/falcon/client/exposure_management/blob_preview_external_assets_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// BlobPreviewExternalAssetsReader is a Reader for the BlobPreviewExternalAssets structure. +type BlobPreviewExternalAssetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *BlobPreviewExternalAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewBlobPreviewExternalAssetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewBlobPreviewExternalAssetsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewBlobPreviewExternalAssetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewBlobPreviewExternalAssetsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewBlobPreviewExternalAssetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /fem/entities/blobs-preview/v1] blob-preview-external-assets", response, response.Code()) + } +} + +// NewBlobPreviewExternalAssetsOK creates a BlobPreviewExternalAssetsOK with default headers values +func NewBlobPreviewExternalAssetsOK() *BlobPreviewExternalAssetsOK { + return &BlobPreviewExternalAssetsOK{} +} + +/* +BlobPreviewExternalAssetsOK describes a response with status code 200, with default header values. + +OK +*/ +type BlobPreviewExternalAssetsOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainExternalAssetsBlobAPITypeV1 +} + +// IsSuccess returns true when this blob preview external assets o k response has a 2xx status code +func (o *BlobPreviewExternalAssetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this blob preview external assets o k response has a 3xx status code +func (o *BlobPreviewExternalAssetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob preview external assets o k response has a 4xx status code +func (o *BlobPreviewExternalAssetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this blob preview external assets o k response has a 5xx status code +func (o *BlobPreviewExternalAssetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this blob preview external assets o k response a status code equal to that given +func (o *BlobPreviewExternalAssetsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the blob preview external assets o k response +func (o *BlobPreviewExternalAssetsOK) Code() int { + return 200 +} + +func (o *BlobPreviewExternalAssetsOK) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *BlobPreviewExternalAssetsOK) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *BlobPreviewExternalAssetsOK) GetPayload() *models.DomainExternalAssetsBlobAPITypeV1 { + return o.Payload +} + +func (o *BlobPreviewExternalAssetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainExternalAssetsBlobAPITypeV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobPreviewExternalAssetsBadRequest creates a BlobPreviewExternalAssetsBadRequest with default headers values +func NewBlobPreviewExternalAssetsBadRequest() *BlobPreviewExternalAssetsBadRequest { + return &BlobPreviewExternalAssetsBadRequest{} +} + +/* +BlobPreviewExternalAssetsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type BlobPreviewExternalAssetsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this blob preview external assets bad request response has a 2xx status code +func (o *BlobPreviewExternalAssetsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob preview external assets bad request response has a 3xx status code +func (o *BlobPreviewExternalAssetsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob preview external assets bad request response has a 4xx status code +func (o *BlobPreviewExternalAssetsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this blob preview external assets bad request response has a 5xx status code +func (o *BlobPreviewExternalAssetsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this blob preview external assets bad request response a status code equal to that given +func (o *BlobPreviewExternalAssetsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the blob preview external assets bad request response +func (o *BlobPreviewExternalAssetsBadRequest) Code() int { + return 400 +} + +func (o *BlobPreviewExternalAssetsBadRequest) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *BlobPreviewExternalAssetsBadRequest) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *BlobPreviewExternalAssetsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *BlobPreviewExternalAssetsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobPreviewExternalAssetsForbidden creates a BlobPreviewExternalAssetsForbidden with default headers values +func NewBlobPreviewExternalAssetsForbidden() *BlobPreviewExternalAssetsForbidden { + return &BlobPreviewExternalAssetsForbidden{} +} + +/* +BlobPreviewExternalAssetsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type BlobPreviewExternalAssetsForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this blob preview external assets forbidden response has a 2xx status code +func (o *BlobPreviewExternalAssetsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob preview external assets forbidden response has a 3xx status code +func (o *BlobPreviewExternalAssetsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob preview external assets forbidden response has a 4xx status code +func (o *BlobPreviewExternalAssetsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this blob preview external assets forbidden response has a 5xx status code +func (o *BlobPreviewExternalAssetsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this blob preview external assets forbidden response a status code equal to that given +func (o *BlobPreviewExternalAssetsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the blob preview external assets forbidden response +func (o *BlobPreviewExternalAssetsForbidden) Code() int { + return 403 +} + +func (o *BlobPreviewExternalAssetsForbidden) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *BlobPreviewExternalAssetsForbidden) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *BlobPreviewExternalAssetsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *BlobPreviewExternalAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobPreviewExternalAssetsTooManyRequests creates a BlobPreviewExternalAssetsTooManyRequests with default headers values +func NewBlobPreviewExternalAssetsTooManyRequests() *BlobPreviewExternalAssetsTooManyRequests { + return &BlobPreviewExternalAssetsTooManyRequests{} +} + +/* +BlobPreviewExternalAssetsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type BlobPreviewExternalAssetsTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this blob preview external assets too many requests response has a 2xx status code +func (o *BlobPreviewExternalAssetsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob preview external assets too many requests response has a 3xx status code +func (o *BlobPreviewExternalAssetsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob preview external assets too many requests response has a 4xx status code +func (o *BlobPreviewExternalAssetsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this blob preview external assets too many requests response has a 5xx status code +func (o *BlobPreviewExternalAssetsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this blob preview external assets too many requests response a status code equal to that given +func (o *BlobPreviewExternalAssetsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the blob preview external assets too many requests response +func (o *BlobPreviewExternalAssetsTooManyRequests) Code() int { + return 429 +} + +func (o *BlobPreviewExternalAssetsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *BlobPreviewExternalAssetsTooManyRequests) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *BlobPreviewExternalAssetsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *BlobPreviewExternalAssetsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewBlobPreviewExternalAssetsInternalServerError creates a BlobPreviewExternalAssetsInternalServerError with default headers values +func NewBlobPreviewExternalAssetsInternalServerError() *BlobPreviewExternalAssetsInternalServerError { + return &BlobPreviewExternalAssetsInternalServerError{} +} + +/* +BlobPreviewExternalAssetsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type BlobPreviewExternalAssetsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this blob preview external assets internal server error response has a 2xx status code +func (o *BlobPreviewExternalAssetsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this blob preview external assets internal server error response has a 3xx status code +func (o *BlobPreviewExternalAssetsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this blob preview external assets internal server error response has a 4xx status code +func (o *BlobPreviewExternalAssetsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this blob preview external assets internal server error response has a 5xx status code +func (o *BlobPreviewExternalAssetsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this blob preview external assets internal server error response a status code equal to that given +func (o *BlobPreviewExternalAssetsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the blob preview external assets internal server error response +func (o *BlobPreviewExternalAssetsInternalServerError) Code() int { + return 500 +} + +func (o *BlobPreviewExternalAssetsInternalServerError) Error() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *BlobPreviewExternalAssetsInternalServerError) String() string { + return fmt.Sprintf("[GET /fem/entities/blobs-preview/v1][%d] blobPreviewExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *BlobPreviewExternalAssetsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *BlobPreviewExternalAssetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/exposure_management/exposure_management_client.go b/falcon/client/exposure_management/exposure_management_client.go new file mode 100644 index 00000000..9f209175 --- /dev/null +++ b/falcon/client/exposure_management/exposure_management_client.go @@ -0,0 +1,285 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// 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 exposure management API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for exposure management 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 { + AggregateExternalAssets(params *AggregateExternalAssetsParams, opts ...ClientOption) (*AggregateExternalAssetsOK, error) + + BlobDownloadExternalAssets(params *BlobDownloadExternalAssetsParams, opts ...ClientOption) (*BlobDownloadExternalAssetsOK, error) + + BlobPreviewExternalAssets(params *BlobPreviewExternalAssetsParams, opts ...ClientOption) (*BlobPreviewExternalAssetsOK, error) + + GetExternalAssets(params *GetExternalAssetsParams, opts ...ClientOption) (*GetExternalAssetsOK, error) + + PatchExternalAssets(params *PatchExternalAssetsParams, opts ...ClientOption) (*PatchExternalAssetsOK, error) + + QueryExternalAssets(params *QueryExternalAssetsParams, opts ...ClientOption) (*QueryExternalAssetsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +AggregateExternalAssets returns external assets aggregates + +Returns external assets aggregates as specified via JSON in request body. +*/ +func (a *Client) AggregateExternalAssets(params *AggregateExternalAssetsParams, opts ...ClientOption) (*AggregateExternalAssetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAggregateExternalAssetsParams() + } + op := &runtime.ClientOperation{ + ID: "aggregate-external-assets", + Method: "POST", + PathPattern: "/fem/aggregates/external-assets/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AggregateExternalAssetsReader{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.(*AggregateExternalAssetsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for aggregate-external-assets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +BlobDownloadExternalAssets downloads the entire contents of the blob the relative link to this endpoint is returned in the g e t entities external assets v1 request + +Download the entire contents of the blob. +*/ +func (a *Client) BlobDownloadExternalAssets(params *BlobDownloadExternalAssetsParams, opts ...ClientOption) (*BlobDownloadExternalAssetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewBlobDownloadExternalAssetsParams() + } + op := &runtime.ClientOperation{ + ID: "blob-download-external-assets", + Method: "GET", + PathPattern: "/fem/entities/blobs-download/v1", + ProducesMediaTypes: []string{"application/octet-stream"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &BlobDownloadExternalAssetsReader{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.(*BlobDownloadExternalAssetsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for blob-download-external-assets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +BlobPreviewExternalAssets downloads a preview of the blob the relative link to this endpoint is returned in the g e t entities external assets v1 request + +Download a preview of the blob. +*/ +func (a *Client) BlobPreviewExternalAssets(params *BlobPreviewExternalAssetsParams, opts ...ClientOption) (*BlobPreviewExternalAssetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewBlobPreviewExternalAssetsParams() + } + op := &runtime.ClientOperation{ + ID: "blob-preview-external-assets", + Method: "GET", + PathPattern: "/fem/entities/blobs-preview/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &BlobPreviewExternalAssetsReader{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.(*BlobPreviewExternalAssetsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for blob-preview-external-assets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetExternalAssets gets details on external assets by providing one or more i ds +*/ +func (a *Client) GetExternalAssets(params *GetExternalAssetsParams, opts ...ClientOption) (*GetExternalAssetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetExternalAssetsParams() + } + op := &runtime.ClientOperation{ + ID: "get-external-assets", + Method: "GET", + PathPattern: "/fem/entities/external-assets/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetExternalAssetsReader{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.(*GetExternalAssetsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get-external-assets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PatchExternalAssets updates the details of external assets +*/ +func (a *Client) PatchExternalAssets(params *PatchExternalAssetsParams, opts ...ClientOption) (*PatchExternalAssetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPatchExternalAssetsParams() + } + op := &runtime.ClientOperation{ + ID: "patch-external-assets", + Method: "PATCH", + PathPattern: "/fem/entities/external-assets/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PatchExternalAssetsReader{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.(*PatchExternalAssetsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for patch-external-assets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +QueryExternalAssets gets a list of external asset i ds that match the provided filter conditions use these i ds with the entities external assets v1 endpoints +*/ +func (a *Client) QueryExternalAssets(params *QueryExternalAssetsParams, opts ...ClientOption) (*QueryExternalAssetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewQueryExternalAssetsParams() + } + op := &runtime.ClientOperation{ + ID: "query-external-assets", + Method: "GET", + PathPattern: "/fem/queries/external-assets/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &QueryExternalAssetsReader{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.(*QueryExternalAssetsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for query-external-assets: 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/falcon/client/exposure_management/get_external_assets_parameters.go b/falcon/client/exposure_management/get_external_assets_parameters.go new file mode 100644 index 00000000..99bc0d7e --- /dev/null +++ b/falcon/client/exposure_management/get_external_assets_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetExternalAssetsParams creates a new GetExternalAssetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetExternalAssetsParams() *GetExternalAssetsParams { + return &GetExternalAssetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetExternalAssetsParamsWithTimeout creates a new GetExternalAssetsParams object +// with the ability to set a timeout on a request. +func NewGetExternalAssetsParamsWithTimeout(timeout time.Duration) *GetExternalAssetsParams { + return &GetExternalAssetsParams{ + timeout: timeout, + } +} + +// NewGetExternalAssetsParamsWithContext creates a new GetExternalAssetsParams object +// with the ability to set a context for a request. +func NewGetExternalAssetsParamsWithContext(ctx context.Context) *GetExternalAssetsParams { + return &GetExternalAssetsParams{ + Context: ctx, + } +} + +// NewGetExternalAssetsParamsWithHTTPClient creates a new GetExternalAssetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetExternalAssetsParamsWithHTTPClient(client *http.Client) *GetExternalAssetsParams { + return &GetExternalAssetsParams{ + HTTPClient: client, + } +} + +/* +GetExternalAssetsParams contains all the parameters to send to the API endpoint + + for the get external assets operation. + + Typically these are written to a http.Request. +*/ +type GetExternalAssetsParams struct { + + /* Ids. + + One or more asset IDs (max: 100). Find asset IDs with GET `/fem/queries/external-assets/v1` + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalAssetsParams) WithDefaults() *GetExternalAssetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetExternalAssetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get external assets params +func (o *GetExternalAssetsParams) WithTimeout(timeout time.Duration) *GetExternalAssetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get external assets params +func (o *GetExternalAssetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get external assets params +func (o *GetExternalAssetsParams) WithContext(ctx context.Context) *GetExternalAssetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get external assets params +func (o *GetExternalAssetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get external assets params +func (o *GetExternalAssetsParams) WithHTTPClient(client *http.Client) *GetExternalAssetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get external assets params +func (o *GetExternalAssetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the get external assets params +func (o *GetExternalAssetsParams) WithIds(ids []string) *GetExternalAssetsParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the get external assets params +func (o *GetExternalAssetsParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *GetExternalAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Ids != nil { + + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetExternalAssets binds the parameter ids +func (o *GetExternalAssetsParams) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []string + + idsIIV := idsIIR // string as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "multi" + idsIS := swag.JoinByFormat(idsIC, "multi") + + return idsIS +} diff --git a/falcon/client/exposure_management/get_external_assets_responses.go b/falcon/client/exposure_management/get_external_assets_responses.go new file mode 100644 index 00000000..2b2091f1 --- /dev/null +++ b/falcon/client/exposure_management/get_external_assets_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// GetExternalAssetsReader is a Reader for the GetExternalAssets structure. +type GetExternalAssetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetExternalAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetExternalAssetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetExternalAssetsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetExternalAssetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetExternalAssetsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetExternalAssetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /fem/entities/external-assets/v1] get-external-assets", response, response.Code()) + } +} + +// NewGetExternalAssetsOK creates a GetExternalAssetsOK with default headers values +func NewGetExternalAssetsOK() *GetExternalAssetsOK { + return &GetExternalAssetsOK{} +} + +/* +GetExternalAssetsOK describes a response with status code 200, with default header values. + +OK +*/ +type GetExternalAssetsOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainExternalAssetsAPITypeV1 +} + +// IsSuccess returns true when this get external assets o k response has a 2xx status code +func (o *GetExternalAssetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get external assets o k response has a 3xx status code +func (o *GetExternalAssetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get external assets o k response has a 4xx status code +func (o *GetExternalAssetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get external assets o k response has a 5xx status code +func (o *GetExternalAssetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get external assets o k response a status code equal to that given +func (o *GetExternalAssetsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get external assets o k response +func (o *GetExternalAssetsOK) Code() int { + return 200 +} + +func (o *GetExternalAssetsOK) Error() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *GetExternalAssetsOK) String() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *GetExternalAssetsOK) GetPayload() *models.DomainExternalAssetsAPITypeV1 { + return o.Payload +} + +func (o *GetExternalAssetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainExternalAssetsAPITypeV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetExternalAssetsBadRequest creates a GetExternalAssetsBadRequest with default headers values +func NewGetExternalAssetsBadRequest() *GetExternalAssetsBadRequest { + return &GetExternalAssetsBadRequest{} +} + +/* +GetExternalAssetsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetExternalAssetsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get external assets bad request response has a 2xx status code +func (o *GetExternalAssetsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get external assets bad request response has a 3xx status code +func (o *GetExternalAssetsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get external assets bad request response has a 4xx status code +func (o *GetExternalAssetsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get external assets bad request response has a 5xx status code +func (o *GetExternalAssetsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get external assets bad request response a status code equal to that given +func (o *GetExternalAssetsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get external assets bad request response +func (o *GetExternalAssetsBadRequest) Code() int { + return 400 +} + +func (o *GetExternalAssetsBadRequest) Error() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *GetExternalAssetsBadRequest) String() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *GetExternalAssetsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetExternalAssetsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetExternalAssetsForbidden creates a GetExternalAssetsForbidden with default headers values +func NewGetExternalAssetsForbidden() *GetExternalAssetsForbidden { + return &GetExternalAssetsForbidden{} +} + +/* +GetExternalAssetsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetExternalAssetsForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get external assets forbidden response has a 2xx status code +func (o *GetExternalAssetsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get external assets forbidden response has a 3xx status code +func (o *GetExternalAssetsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get external assets forbidden response has a 4xx status code +func (o *GetExternalAssetsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get external assets forbidden response has a 5xx status code +func (o *GetExternalAssetsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get external assets forbidden response a status code equal to that given +func (o *GetExternalAssetsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get external assets forbidden response +func (o *GetExternalAssetsForbidden) Code() int { + return 403 +} + +func (o *GetExternalAssetsForbidden) Error() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *GetExternalAssetsForbidden) String() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *GetExternalAssetsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetExternalAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetExternalAssetsTooManyRequests creates a GetExternalAssetsTooManyRequests with default headers values +func NewGetExternalAssetsTooManyRequests() *GetExternalAssetsTooManyRequests { + return &GetExternalAssetsTooManyRequests{} +} + +/* +GetExternalAssetsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetExternalAssetsTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get external assets too many requests response has a 2xx status code +func (o *GetExternalAssetsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get external assets too many requests response has a 3xx status code +func (o *GetExternalAssetsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get external assets too many requests response has a 4xx status code +func (o *GetExternalAssetsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get external assets too many requests response has a 5xx status code +func (o *GetExternalAssetsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get external assets too many requests response a status code equal to that given +func (o *GetExternalAssetsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get external assets too many requests response +func (o *GetExternalAssetsTooManyRequests) Code() int { + return 429 +} + +func (o *GetExternalAssetsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetExternalAssetsTooManyRequests) String() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetExternalAssetsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetExternalAssetsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetExternalAssetsInternalServerError creates a GetExternalAssetsInternalServerError with default headers values +func NewGetExternalAssetsInternalServerError() *GetExternalAssetsInternalServerError { + return &GetExternalAssetsInternalServerError{} +} + +/* +GetExternalAssetsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GetExternalAssetsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get external assets internal server error response has a 2xx status code +func (o *GetExternalAssetsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get external assets internal server error response has a 3xx status code +func (o *GetExternalAssetsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get external assets internal server error response has a 4xx status code +func (o *GetExternalAssetsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get external assets internal server error response has a 5xx status code +func (o *GetExternalAssetsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get external assets internal server error response a status code equal to that given +func (o *GetExternalAssetsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get external assets internal server error response +func (o *GetExternalAssetsInternalServerError) Code() int { + return 500 +} + +func (o *GetExternalAssetsInternalServerError) Error() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetExternalAssetsInternalServerError) String() string { + return fmt.Sprintf("[GET /fem/entities/external-assets/v1][%d] getExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetExternalAssetsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetExternalAssetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/exposure_management/patch_external_assets_parameters.go b/falcon/client/exposure_management/patch_external_assets_parameters.go new file mode 100644 index 00000000..c7658123 --- /dev/null +++ b/falcon/client/exposure_management/patch_external_assets_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewPatchExternalAssetsParams creates a new PatchExternalAssetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPatchExternalAssetsParams() *PatchExternalAssetsParams { + return &PatchExternalAssetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPatchExternalAssetsParamsWithTimeout creates a new PatchExternalAssetsParams object +// with the ability to set a timeout on a request. +func NewPatchExternalAssetsParamsWithTimeout(timeout time.Duration) *PatchExternalAssetsParams { + return &PatchExternalAssetsParams{ + timeout: timeout, + } +} + +// NewPatchExternalAssetsParamsWithContext creates a new PatchExternalAssetsParams object +// with the ability to set a context for a request. +func NewPatchExternalAssetsParamsWithContext(ctx context.Context) *PatchExternalAssetsParams { + return &PatchExternalAssetsParams{ + Context: ctx, + } +} + +// NewPatchExternalAssetsParamsWithHTTPClient creates a new PatchExternalAssetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewPatchExternalAssetsParamsWithHTTPClient(client *http.Client) *PatchExternalAssetsParams { + return &PatchExternalAssetsParams{ + HTTPClient: client, + } +} + +/* +PatchExternalAssetsParams contains all the parameters to send to the API endpoint + + for the patch external assets operation. + + Typically these are written to a http.Request. +*/ +type PatchExternalAssetsParams struct { + + // Body. + Body *models.DomainExternalAssetAPIPatchRequestV1 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the patch external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchExternalAssetsParams) WithDefaults() *PatchExternalAssetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchExternalAssetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the patch external assets params +func (o *PatchExternalAssetsParams) WithTimeout(timeout time.Duration) *PatchExternalAssetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the patch external assets params +func (o *PatchExternalAssetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the patch external assets params +func (o *PatchExternalAssetsParams) WithContext(ctx context.Context) *PatchExternalAssetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the patch external assets params +func (o *PatchExternalAssetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the patch external assets params +func (o *PatchExternalAssetsParams) WithHTTPClient(client *http.Client) *PatchExternalAssetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the patch external assets params +func (o *PatchExternalAssetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the patch external assets params +func (o *PatchExternalAssetsParams) WithBody(body *models.DomainExternalAssetAPIPatchRequestV1) *PatchExternalAssetsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the patch external assets params +func (o *PatchExternalAssetsParams) SetBody(body *models.DomainExternalAssetAPIPatchRequestV1) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *PatchExternalAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/exposure_management/patch_external_assets_responses.go b/falcon/client/exposure_management/patch_external_assets_responses.go new file mode 100644 index 00000000..e22c13fd --- /dev/null +++ b/falcon/client/exposure_management/patch_external_assets_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// PatchExternalAssetsReader is a Reader for the PatchExternalAssets structure. +type PatchExternalAssetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchExternalAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPatchExternalAssetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPatchExternalAssetsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPatchExternalAssetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewPatchExternalAssetsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPatchExternalAssetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /fem/entities/external-assets/v1] patch-external-assets", response, response.Code()) + } +} + +// NewPatchExternalAssetsOK creates a PatchExternalAssetsOK with default headers values +func NewPatchExternalAssetsOK() *PatchExternalAssetsOK { + return &PatchExternalAssetsOK{} +} + +/* +PatchExternalAssetsOK describes a response with status code 200, with default header values. + +OK +*/ +type PatchExternalAssetsOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainExternalAssetsAPITypeV1 +} + +// IsSuccess returns true when this patch external assets o k response has a 2xx status code +func (o *PatchExternalAssetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this patch external assets o k response has a 3xx status code +func (o *PatchExternalAssetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch external assets o k response has a 4xx status code +func (o *PatchExternalAssetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this patch external assets o k response has a 5xx status code +func (o *PatchExternalAssetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this patch external assets o k response a status code equal to that given +func (o *PatchExternalAssetsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the patch external assets o k response +func (o *PatchExternalAssetsOK) Code() int { + return 200 +} + +func (o *PatchExternalAssetsOK) Error() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *PatchExternalAssetsOK) String() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *PatchExternalAssetsOK) GetPayload() *models.DomainExternalAssetsAPITypeV1 { + return o.Payload +} + +func (o *PatchExternalAssetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainExternalAssetsAPITypeV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchExternalAssetsBadRequest creates a PatchExternalAssetsBadRequest with default headers values +func NewPatchExternalAssetsBadRequest() *PatchExternalAssetsBadRequest { + return &PatchExternalAssetsBadRequest{} +} + +/* +PatchExternalAssetsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PatchExternalAssetsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this patch external assets bad request response has a 2xx status code +func (o *PatchExternalAssetsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this patch external assets bad request response has a 3xx status code +func (o *PatchExternalAssetsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch external assets bad request response has a 4xx status code +func (o *PatchExternalAssetsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this patch external assets bad request response has a 5xx status code +func (o *PatchExternalAssetsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this patch external assets bad request response a status code equal to that given +func (o *PatchExternalAssetsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the patch external assets bad request response +func (o *PatchExternalAssetsBadRequest) Code() int { + return 400 +} + +func (o *PatchExternalAssetsBadRequest) Error() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *PatchExternalAssetsBadRequest) String() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *PatchExternalAssetsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *PatchExternalAssetsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchExternalAssetsForbidden creates a PatchExternalAssetsForbidden with default headers values +func NewPatchExternalAssetsForbidden() *PatchExternalAssetsForbidden { + return &PatchExternalAssetsForbidden{} +} + +/* +PatchExternalAssetsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PatchExternalAssetsForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this patch external assets forbidden response has a 2xx status code +func (o *PatchExternalAssetsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this patch external assets forbidden response has a 3xx status code +func (o *PatchExternalAssetsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch external assets forbidden response has a 4xx status code +func (o *PatchExternalAssetsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this patch external assets forbidden response has a 5xx status code +func (o *PatchExternalAssetsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this patch external assets forbidden response a status code equal to that given +func (o *PatchExternalAssetsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the patch external assets forbidden response +func (o *PatchExternalAssetsForbidden) Code() int { + return 403 +} + +func (o *PatchExternalAssetsForbidden) Error() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *PatchExternalAssetsForbidden) String() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *PatchExternalAssetsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *PatchExternalAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchExternalAssetsTooManyRequests creates a PatchExternalAssetsTooManyRequests with default headers values +func NewPatchExternalAssetsTooManyRequests() *PatchExternalAssetsTooManyRequests { + return &PatchExternalAssetsTooManyRequests{} +} + +/* +PatchExternalAssetsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type PatchExternalAssetsTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this patch external assets too many requests response has a 2xx status code +func (o *PatchExternalAssetsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this patch external assets too many requests response has a 3xx status code +func (o *PatchExternalAssetsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch external assets too many requests response has a 4xx status code +func (o *PatchExternalAssetsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this patch external assets too many requests response has a 5xx status code +func (o *PatchExternalAssetsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this patch external assets too many requests response a status code equal to that given +func (o *PatchExternalAssetsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the patch external assets too many requests response +func (o *PatchExternalAssetsTooManyRequests) Code() int { + return 429 +} + +func (o *PatchExternalAssetsTooManyRequests) Error() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *PatchExternalAssetsTooManyRequests) String() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *PatchExternalAssetsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *PatchExternalAssetsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchExternalAssetsInternalServerError creates a PatchExternalAssetsInternalServerError with default headers values +func NewPatchExternalAssetsInternalServerError() *PatchExternalAssetsInternalServerError { + return &PatchExternalAssetsInternalServerError{} +} + +/* +PatchExternalAssetsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PatchExternalAssetsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this patch external assets internal server error response has a 2xx status code +func (o *PatchExternalAssetsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this patch external assets internal server error response has a 3xx status code +func (o *PatchExternalAssetsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch external assets internal server error response has a 4xx status code +func (o *PatchExternalAssetsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this patch external assets internal server error response has a 5xx status code +func (o *PatchExternalAssetsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this patch external assets internal server error response a status code equal to that given +func (o *PatchExternalAssetsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the patch external assets internal server error response +func (o *PatchExternalAssetsInternalServerError) Code() int { + return 500 +} + +func (o *PatchExternalAssetsInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *PatchExternalAssetsInternalServerError) String() string { + return fmt.Sprintf("[PATCH /fem/entities/external-assets/v1][%d] patchExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *PatchExternalAssetsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *PatchExternalAssetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/exposure_management/query_external_assets_parameters.go b/falcon/client/exposure_management/query_external_assets_parameters.go new file mode 100644 index 00000000..73a8d306 --- /dev/null +++ b/falcon/client/exposure_management/query_external_assets_parameters.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewQueryExternalAssetsParams creates a new QueryExternalAssetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewQueryExternalAssetsParams() *QueryExternalAssetsParams { + return &QueryExternalAssetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewQueryExternalAssetsParamsWithTimeout creates a new QueryExternalAssetsParams object +// with the ability to set a timeout on a request. +func NewQueryExternalAssetsParamsWithTimeout(timeout time.Duration) *QueryExternalAssetsParams { + return &QueryExternalAssetsParams{ + timeout: timeout, + } +} + +// NewQueryExternalAssetsParamsWithContext creates a new QueryExternalAssetsParams object +// with the ability to set a context for a request. +func NewQueryExternalAssetsParamsWithContext(ctx context.Context) *QueryExternalAssetsParams { + return &QueryExternalAssetsParams{ + Context: ctx, + } +} + +// NewQueryExternalAssetsParamsWithHTTPClient creates a new QueryExternalAssetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewQueryExternalAssetsParamsWithHTTPClient(client *http.Client) *QueryExternalAssetsParams { + return &QueryExternalAssetsParams{ + HTTPClient: client, + } +} + +/* +QueryExternalAssetsParams contains all the parameters to send to the API endpoint + + for the query external assets operation. + + Typically these are written to a http.Request. +*/ +type QueryExternalAssetsParams struct { + + /* Filter. + + Filter assets using an FQL query. Common filter options include: +
Available filter fields that support exact match: asset_id, asset_type, confidence, connectivity_status, criticality, criticality_description, criticality_timestamp, criticality_username, data_providers, discovered_by, dns_domain.fqdn, dns_domain.isps, dns_domain.parent_domain, dns_domain.resolved_ips, dns_domain.services.applications.category, dns_domain.services.applications.cpe, dns_domain.services.applications.name, dns_domain.services.applications.vendor, dns_domain.services.applications.version, dns_domain.services.cloud_provider, dns_domain.services.cpes, dns_domain.services.hosting_provider, dns_domain.services.last_seen, dns_domain.services.platform_name, dns_domain.services.port, dns_domain.services.protocol, dns_domain.services.protocol_port, dns_domain.services.status, dns_domain.services.status_code, dns_domain.services.transport, dns_domain.type, first_seen, id, internet_exposure, ip.asn, ip.cloud_vm.description, ip.cloud_vm.instance_id, ip.cloud_vm.lifecycle, ip.cloud_vm.mac_address, ip.cloud_vm.owner_id, ip.cloud_vm.platform, ip.cloud_vm.private_ip, ip.cloud_vm.public_ip, ip.cloud_vm.region, ip.cloud_vm.security_groups, ip.cloud_vm.source, ip.cloud_vm.status, ip.fqdns, ip.ip_address, ip.isp, ip.location.area_code, ip.location.city, ip.location.country_code, ip.location.country_name, ip.location.postal_code, ip.location.region_code, ip.location.region_name, ip.location.timezone, ip.ptr, ip.aid, ip.services.applications.category, ip.services.applications.cpe, ip.services.applications.name, ip.services.applications.vendor, ip.services.applications.version, ip.services.cloud_provider, ip.services.cpes, ip.services.first_seen, ip.services.last_seen, ip.services.platform_name, ip.services.port, ip.services.protocol, ip.services.protocol_port, ip.services.status, ip.services.status_code, ip.services.transport, last_seen, manual, perimeter, subsidiaries.id, subsidiaries.name, triage.action, triage.assigned_to, triage.description, triage.status, triage.updated_by, triage.updated_timestamp +
Available filter fields that supports wildcard (*): asset_id, asset_type, confidence, connectivity_status, criticality, criticality_username, data_providers, discovered_by, dns_domain.fqdn, dns_domain.isps, dns_domain.parent_domain, dns_domain.resolved_ips, dns_domain.services.applications.category, dns_domain.services.applications.cpe, dns_domain.services.applications.name, dns_domain.services.applications.vendor, dns_domain.services.applications.version, dns_domain.services.cloud_provider, dns_domain.services.cpes, dns_domain.services.hosting_provider, dns_domain.services.id, dns_domain.services.platform_name, dns_domain.services.port, dns_domain.services.protocol, dns_domain.services.protocol_port, dns_domain.services.status, dns_domain.services.status_code, dns_domain.services.transport, dns_domain.type, id, internet_exposure, ip.asn, ip.cloud_vm.instance_id, ip.cloud_vm.lifecycle, ip.cloud_vm.mac_address, ip.cloud_vm.owner_id, ip.cloud_vm.platform, ip.cloud_vm.private_ip, ip.cloud_vm.public_ip, ip.cloud_vm.region, ip.cloud_vm.security_groups, ip.cloud_vm.source, ip.cloud_vm.status, ip.fqdns, ip.ip_address, ip.isp, ip.location.area_code, ip.location.city, ip.location.country_code, ip.location.country_name, ip.location.postal_code, ip.location.region_code, ip.location.region_name, ip.location.timezone, ip.ptr, ip.aid, ip.services.applications.category, ip.services.applications.cpe, ip.services.applications.name, ip.services.applications.vendor, ip.services.applications.version, ip.services.cloud_provider, ip.services.cpes, ip.services.platform_name, ip.services.port, ip.services.protocol, ip.services.protocol_port, ip.services.status, ip.services.status_code, ip.services.transport, manual, perimeter, subsidiaries.id, subsidiaries.name, triage.action, triage.assigned_to, triage.description, triage.status, triage.updated_by +
Available filter fields that supports in ([v1, v2]): asset_id, asset_type, confidence, connectivity_status, criticality, criticality_username, data_providers, discovered_by, dns_domain.fqdn, dns_domain.isps, dns_domain.parent_domain, dns_domain.services.applications.category, dns_domain.services.applications.cpe, dns_domain.services.applications.name, dns_domain.services.applications.vendor, dns_domain.services.applications.version, dns_domain.services.cloud_provider, dns_domain.services.cpes, dns_domain.services.id, dns_domain.services.platform_name, dns_domain.services.port, dns_domain.services.protocol, dns_domain.services.protocol_port, dns_domain.services.status, dns_domain.services.status_code, dns_domain.services.transport, dns_domain.type, id, internet_exposure, ip.asn, ip.cloud_vm.instance_id, ip.cloud_vm.lifecycle, ip.cloud_vm.mac_address, ip.cloud_vm.owner_id, ip.cloud_vm.platform, ip.cloud_vm.region, ip.cloud_vm.security_groups, ip.cloud_vm.source, ip.cloud_vm.status, ip.fqdns, ip.isp, ip.location.area_code, ip.location.city, ip.location.country_code, ip.location.country_name, ip.location.postal_code, ip.location.region_code, ip.location.region_name, ip.location.timezone, ip.ptr, ip.aid, ip.services.applications.category, ip.services.applications.cpe, ip.services.applications.name, ip.services.applications.vendor, ip.services.applications.version, ip.services.cloud_provider, ip.services.cpes, ip.services.platform_name, ip.services.port, ip.services.protocol, ip.services.protocol_port, ip.services.status, ip.services.status_code, ip.services.transport, manual, perimeter, subsidiaries.id, subsidiaries.name, triage.action, triage.assigned_to, triage.description, triage.status, triage.updated_by +
Available filter fields that supports range comparisons (>, <, >=, <=): criticality_timestamp, dns_domain.resolved_ips, dns_domain.services.first_seen, dns_domain.services.last_seen, dns_domain.services.port, dns_domain.services.status_code, first_seen, ip.cloud_vm.private_ip, ip.cloud_vm.public_ip, ip.ip_address, ip.services.first_seen, ip.services.last_seen, ip.services.port, ip.services.status_code, last_seen, triage.updated_timestamp +
All filter fields and operations supports negation (!). + */ + Filter *string + + /* Limit. + + Number of IDs to return. + */ + Limit *int64 + + /* Offset. + + Starting index of result set from which to return IDs. + */ + Offset *string + + /* Sort. + + Order by fields. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the query external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryExternalAssetsParams) WithDefaults() *QueryExternalAssetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the query external assets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryExternalAssetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the query external assets params +func (o *QueryExternalAssetsParams) WithTimeout(timeout time.Duration) *QueryExternalAssetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the query external assets params +func (o *QueryExternalAssetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the query external assets params +func (o *QueryExternalAssetsParams) WithContext(ctx context.Context) *QueryExternalAssetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the query external assets params +func (o *QueryExternalAssetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the query external assets params +func (o *QueryExternalAssetsParams) WithHTTPClient(client *http.Client) *QueryExternalAssetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the query external assets params +func (o *QueryExternalAssetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the query external assets params +func (o *QueryExternalAssetsParams) WithFilter(filter *string) *QueryExternalAssetsParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the query external assets params +func (o *QueryExternalAssetsParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the query external assets params +func (o *QueryExternalAssetsParams) WithLimit(limit *int64) *QueryExternalAssetsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the query external assets params +func (o *QueryExternalAssetsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the query external assets params +func (o *QueryExternalAssetsParams) WithOffset(offset *string) *QueryExternalAssetsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the query external assets params +func (o *QueryExternalAssetsParams) SetOffset(offset *string) { + o.Offset = offset +} + +// WithSort adds the sort to the query external assets params +func (o *QueryExternalAssetsParams) WithSort(sort *string) *QueryExternalAssetsParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the query external assets params +func (o *QueryExternalAssetsParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *QueryExternalAssetsParams) 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 string + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := qrOffset + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/exposure_management/query_external_assets_responses.go b/falcon/client/exposure_management/query_external_assets_responses.go new file mode 100644 index 00000000..4796c9c2 --- /dev/null +++ b/falcon/client/exposure_management/query_external_assets_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package exposure_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// QueryExternalAssetsReader is a Reader for the QueryExternalAssets structure. +type QueryExternalAssetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *QueryExternalAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewQueryExternalAssetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewQueryExternalAssetsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewQueryExternalAssetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewQueryExternalAssetsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewQueryExternalAssetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /fem/queries/external-assets/v1] query-external-assets", response, response.Code()) + } +} + +// NewQueryExternalAssetsOK creates a QueryExternalAssetsOK with default headers values +func NewQueryExternalAssetsOK() *QueryExternalAssetsOK { + return &QueryExternalAssetsOK{} +} + +/* +QueryExternalAssetsOK describes a response with status code 200, with default header values. + +OK +*/ +type QueryExternalAssetsOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this query external assets o k response has a 2xx status code +func (o *QueryExternalAssetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this query external assets o k response has a 3xx status code +func (o *QueryExternalAssetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query external assets o k response has a 4xx status code +func (o *QueryExternalAssetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this query external assets o k response has a 5xx status code +func (o *QueryExternalAssetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this query external assets o k response a status code equal to that given +func (o *QueryExternalAssetsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the query external assets o k response +func (o *QueryExternalAssetsOK) Code() int { + return 200 +} + +func (o *QueryExternalAssetsOK) Error() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *QueryExternalAssetsOK) String() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsOK %+v", 200, o.Payload) +} + +func (o *QueryExternalAssetsOK) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *QueryExternalAssetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryExternalAssetsBadRequest creates a QueryExternalAssetsBadRequest with default headers values +func NewQueryExternalAssetsBadRequest() *QueryExternalAssetsBadRequest { + return &QueryExternalAssetsBadRequest{} +} + +/* +QueryExternalAssetsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type QueryExternalAssetsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this query external assets bad request response has a 2xx status code +func (o *QueryExternalAssetsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query external assets bad request response has a 3xx status code +func (o *QueryExternalAssetsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query external assets bad request response has a 4xx status code +func (o *QueryExternalAssetsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this query external assets bad request response has a 5xx status code +func (o *QueryExternalAssetsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this query external assets bad request response a status code equal to that given +func (o *QueryExternalAssetsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the query external assets bad request response +func (o *QueryExternalAssetsBadRequest) Code() int { + return 400 +} + +func (o *QueryExternalAssetsBadRequest) Error() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *QueryExternalAssetsBadRequest) String() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsBadRequest %+v", 400, o.Payload) +} + +func (o *QueryExternalAssetsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *QueryExternalAssetsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryExternalAssetsForbidden creates a QueryExternalAssetsForbidden with default headers values +func NewQueryExternalAssetsForbidden() *QueryExternalAssetsForbidden { + return &QueryExternalAssetsForbidden{} +} + +/* +QueryExternalAssetsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type QueryExternalAssetsForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query external assets forbidden response has a 2xx status code +func (o *QueryExternalAssetsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query external assets forbidden response has a 3xx status code +func (o *QueryExternalAssetsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query external assets forbidden response has a 4xx status code +func (o *QueryExternalAssetsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this query external assets forbidden response has a 5xx status code +func (o *QueryExternalAssetsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this query external assets forbidden response a status code equal to that given +func (o *QueryExternalAssetsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the query external assets forbidden response +func (o *QueryExternalAssetsForbidden) Code() int { + return 403 +} + +func (o *QueryExternalAssetsForbidden) Error() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *QueryExternalAssetsForbidden) String() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsForbidden %+v", 403, o.Payload) +} + +func (o *QueryExternalAssetsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryExternalAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryExternalAssetsTooManyRequests creates a QueryExternalAssetsTooManyRequests with default headers values +func NewQueryExternalAssetsTooManyRequests() *QueryExternalAssetsTooManyRequests { + return &QueryExternalAssetsTooManyRequests{} +} + +/* +QueryExternalAssetsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type QueryExternalAssetsTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query external assets too many requests response has a 2xx status code +func (o *QueryExternalAssetsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query external assets too many requests response has a 3xx status code +func (o *QueryExternalAssetsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query external assets too many requests response has a 4xx status code +func (o *QueryExternalAssetsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this query external assets too many requests response has a 5xx status code +func (o *QueryExternalAssetsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this query external assets too many requests response a status code equal to that given +func (o *QueryExternalAssetsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the query external assets too many requests response +func (o *QueryExternalAssetsTooManyRequests) Code() int { + return 429 +} + +func (o *QueryExternalAssetsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryExternalAssetsTooManyRequests) String() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsTooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryExternalAssetsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryExternalAssetsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryExternalAssetsInternalServerError creates a QueryExternalAssetsInternalServerError with default headers values +func NewQueryExternalAssetsInternalServerError() *QueryExternalAssetsInternalServerError { + return &QueryExternalAssetsInternalServerError{} +} + +/* +QueryExternalAssetsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type QueryExternalAssetsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this query external assets internal server error response has a 2xx status code +func (o *QueryExternalAssetsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query external assets internal server error response has a 3xx status code +func (o *QueryExternalAssetsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query external assets internal server error response has a 4xx status code +func (o *QueryExternalAssetsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this query external assets internal server error response has a 5xx status code +func (o *QueryExternalAssetsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this query external assets internal server error response a status code equal to that given +func (o *QueryExternalAssetsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the query external assets internal server error response +func (o *QueryExternalAssetsInternalServerError) Code() int { + return 500 +} + +func (o *QueryExternalAssetsInternalServerError) Error() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *QueryExternalAssetsInternalServerError) String() string { + return fmt.Sprintf("[GET /fem/queries/external-assets/v1][%d] queryExternalAssetsInternalServerError %+v", 500, o.Payload) +} + +func (o *QueryExternalAssetsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *QueryExternalAssetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/falcon_complete_dashboard/aggregate_support_issues_parameters.go b/falcon/client/falcon_complete_dashboard/aggregate_support_issues_parameters.go new file mode 100644 index 00000000..dbec5609 --- /dev/null +++ b/falcon/client/falcon_complete_dashboard/aggregate_support_issues_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package falcon_complete_dashboard + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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/crowdstrike/gofalcon/falcon/models" +) + +// NewAggregateSupportIssuesParams creates a new AggregateSupportIssuesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAggregateSupportIssuesParams() *AggregateSupportIssuesParams { + return &AggregateSupportIssuesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAggregateSupportIssuesParamsWithTimeout creates a new AggregateSupportIssuesParams object +// with the ability to set a timeout on a request. +func NewAggregateSupportIssuesParamsWithTimeout(timeout time.Duration) *AggregateSupportIssuesParams { + return &AggregateSupportIssuesParams{ + timeout: timeout, + } +} + +// NewAggregateSupportIssuesParamsWithContext creates a new AggregateSupportIssuesParams object +// with the ability to set a context for a request. +func NewAggregateSupportIssuesParamsWithContext(ctx context.Context) *AggregateSupportIssuesParams { + return &AggregateSupportIssuesParams{ + Context: ctx, + } +} + +// NewAggregateSupportIssuesParamsWithHTTPClient creates a new AggregateSupportIssuesParams object +// with the ability to set a custom HTTPClient for a request. +func NewAggregateSupportIssuesParamsWithHTTPClient(client *http.Client) *AggregateSupportIssuesParams { + return &AggregateSupportIssuesParams{ + HTTPClient: client, + } +} + +/* +AggregateSupportIssuesParams contains all the parameters to send to the API endpoint + + for the aggregate support issues operation. + + Typically these are written to a http.Request. +*/ +type AggregateSupportIssuesParams struct { + + // Body. + Body []*models.MsaAggregateQueryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the aggregate support issues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateSupportIssuesParams) WithDefaults() *AggregateSupportIssuesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the aggregate support issues params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateSupportIssuesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the aggregate support issues params +func (o *AggregateSupportIssuesParams) WithTimeout(timeout time.Duration) *AggregateSupportIssuesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the aggregate support issues params +func (o *AggregateSupportIssuesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the aggregate support issues params +func (o *AggregateSupportIssuesParams) WithContext(ctx context.Context) *AggregateSupportIssuesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the aggregate support issues params +func (o *AggregateSupportIssuesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the aggregate support issues params +func (o *AggregateSupportIssuesParams) WithHTTPClient(client *http.Client) *AggregateSupportIssuesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the aggregate support issues params +func (o *AggregateSupportIssuesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the aggregate support issues params +func (o *AggregateSupportIssuesParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregateSupportIssuesParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the aggregate support issues params +func (o *AggregateSupportIssuesParams) SetBody(body []*models.MsaAggregateQueryRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AggregateSupportIssuesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/falcon_complete_dashboard/aggregate_support_issues_responses.go b/falcon/client/falcon_complete_dashboard/aggregate_support_issues_responses.go new file mode 100644 index 00000000..04ebf468 --- /dev/null +++ b/falcon/client/falcon_complete_dashboard/aggregate_support_issues_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package falcon_complete_dashboard + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// AggregateSupportIssuesReader is a Reader for the AggregateSupportIssues structure. +type AggregateSupportIssuesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AggregateSupportIssuesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAggregateSupportIssuesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAggregateSupportIssuesBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewAggregateSupportIssuesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewAggregateSupportIssuesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewAggregateSupportIssuesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /falcon-complete-dashboards/aggregates/support-issues/v1] AggregateSupportIssues", response, response.Code()) + } +} + +// NewAggregateSupportIssuesOK creates a AggregateSupportIssuesOK with default headers values +func NewAggregateSupportIssuesOK() *AggregateSupportIssuesOK { + return &AggregateSupportIssuesOK{} +} + +/* +AggregateSupportIssuesOK describes a response with status code 200, with default header values. + +OK +*/ +type AggregateSupportIssuesOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaAggregatesResponse +} + +// IsSuccess returns true when this aggregate support issues o k response has a 2xx status code +func (o *AggregateSupportIssuesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this aggregate support issues o k response has a 3xx status code +func (o *AggregateSupportIssuesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate support issues o k response has a 4xx status code +func (o *AggregateSupportIssuesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate support issues o k response has a 5xx status code +func (o *AggregateSupportIssuesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate support issues o k response a status code equal to that given +func (o *AggregateSupportIssuesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the aggregate support issues o k response +func (o *AggregateSupportIssuesOK) Code() int { + return 200 +} + +func (o *AggregateSupportIssuesOK) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesOK %+v", 200, o.Payload) +} + +func (o *AggregateSupportIssuesOK) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesOK %+v", 200, o.Payload) +} + +func (o *AggregateSupportIssuesOK) GetPayload() *models.MsaAggregatesResponse { + return o.Payload +} + +func (o *AggregateSupportIssuesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaAggregatesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateSupportIssuesBadRequest creates a AggregateSupportIssuesBadRequest with default headers values +func NewAggregateSupportIssuesBadRequest() *AggregateSupportIssuesBadRequest { + return &AggregateSupportIssuesBadRequest{} +} + +/* +AggregateSupportIssuesBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type AggregateSupportIssuesBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this aggregate support issues bad request response has a 2xx status code +func (o *AggregateSupportIssuesBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate support issues bad request response has a 3xx status code +func (o *AggregateSupportIssuesBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate support issues bad request response has a 4xx status code +func (o *AggregateSupportIssuesBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate support issues bad request response has a 5xx status code +func (o *AggregateSupportIssuesBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate support issues bad request response a status code equal to that given +func (o *AggregateSupportIssuesBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the aggregate support issues bad request response +func (o *AggregateSupportIssuesBadRequest) Code() int { + return 400 +} + +func (o *AggregateSupportIssuesBadRequest) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesBadRequest %+v", 400, o.Payload) +} + +func (o *AggregateSupportIssuesBadRequest) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesBadRequest %+v", 400, o.Payload) +} + +func (o *AggregateSupportIssuesBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateSupportIssuesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateSupportIssuesForbidden creates a AggregateSupportIssuesForbidden with default headers values +func NewAggregateSupportIssuesForbidden() *AggregateSupportIssuesForbidden { + return &AggregateSupportIssuesForbidden{} +} + +/* +AggregateSupportIssuesForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type AggregateSupportIssuesForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this aggregate support issues forbidden response has a 2xx status code +func (o *AggregateSupportIssuesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate support issues forbidden response has a 3xx status code +func (o *AggregateSupportIssuesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate support issues forbidden response has a 4xx status code +func (o *AggregateSupportIssuesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate support issues forbidden response has a 5xx status code +func (o *AggregateSupportIssuesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate support issues forbidden response a status code equal to that given +func (o *AggregateSupportIssuesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the aggregate support issues forbidden response +func (o *AggregateSupportIssuesForbidden) Code() int { + return 403 +} + +func (o *AggregateSupportIssuesForbidden) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesForbidden %+v", 403, o.Payload) +} + +func (o *AggregateSupportIssuesForbidden) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesForbidden %+v", 403, o.Payload) +} + +func (o *AggregateSupportIssuesForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateSupportIssuesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateSupportIssuesTooManyRequests creates a AggregateSupportIssuesTooManyRequests with default headers values +func NewAggregateSupportIssuesTooManyRequests() *AggregateSupportIssuesTooManyRequests { + return &AggregateSupportIssuesTooManyRequests{} +} + +/* +AggregateSupportIssuesTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type AggregateSupportIssuesTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this aggregate support issues too many requests response has a 2xx status code +func (o *AggregateSupportIssuesTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate support issues too many requests response has a 3xx status code +func (o *AggregateSupportIssuesTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate support issues too many requests response has a 4xx status code +func (o *AggregateSupportIssuesTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate support issues too many requests response has a 5xx status code +func (o *AggregateSupportIssuesTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate support issues too many requests response a status code equal to that given +func (o *AggregateSupportIssuesTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the aggregate support issues too many requests response +func (o *AggregateSupportIssuesTooManyRequests) Code() int { + return 429 +} + +func (o *AggregateSupportIssuesTooManyRequests) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregateSupportIssuesTooManyRequests) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregateSupportIssuesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *AggregateSupportIssuesTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAggregateSupportIssuesInternalServerError creates a AggregateSupportIssuesInternalServerError with default headers values +func NewAggregateSupportIssuesInternalServerError() *AggregateSupportIssuesInternalServerError { + return &AggregateSupportIssuesInternalServerError{} +} + +/* +AggregateSupportIssuesInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type AggregateSupportIssuesInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this aggregate support issues internal server error response has a 2xx status code +func (o *AggregateSupportIssuesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate support issues internal server error response has a 3xx status code +func (o *AggregateSupportIssuesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate support issues internal server error response has a 4xx status code +func (o *AggregateSupportIssuesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate support issues internal server error response has a 5xx status code +func (o *AggregateSupportIssuesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this aggregate support issues internal server error response a status code equal to that given +func (o *AggregateSupportIssuesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the aggregate support issues internal server error response +func (o *AggregateSupportIssuesInternalServerError) Code() int { + return 500 +} + +func (o *AggregateSupportIssuesInternalServerError) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregateSupportIssuesInternalServerError) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/support-issues/v1][%d] aggregateSupportIssuesInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregateSupportIssuesInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateSupportIssuesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/falcon_complete_dashboard/falcon_complete_dashboard_client.go b/falcon/client/falcon_complete_dashboard/falcon_complete_dashboard_client.go index c4775a00..517b1119 100644 --- a/falcon/client/falcon_complete_dashboard/falcon_complete_dashboard_client.go +++ b/falcon/client/falcon_complete_dashboard/falcon_complete_dashboard_client.go @@ -50,6 +50,8 @@ type ClientService interface { AggregateSensorUpdatePolicy(params *AggregateSensorUpdatePolicyParams, opts ...ClientOption) (*AggregateSensorUpdatePolicyOK, error) + AggregateSupportIssues(params *AggregateSupportIssuesParams, opts ...ClientOption) (*AggregateSupportIssuesOK, error) + AggregateTotalDeviceCounts(params *AggregateTotalDeviceCountsParams, opts ...ClientOption) (*AggregateTotalDeviceCountsOK, error) GetDeviceCountCollectionQueriesByFilter(params *GetDeviceCountCollectionQueriesByFilterParams, opts ...ClientOption) (*GetDeviceCountCollectionQueriesByFilterOK, error) @@ -505,6 +507,44 @@ func (a *Client) AggregateSensorUpdatePolicy(params *AggregateSensorUpdatePolicy panic(msg) } +/* +AggregateSupportIssues retrieves aggregate support issue ticket values based on the matched filter +*/ +func (a *Client) AggregateSupportIssues(params *AggregateSupportIssuesParams, opts ...ClientOption) (*AggregateSupportIssuesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAggregateSupportIssuesParams() + } + op := &runtime.ClientOperation{ + ID: "AggregateSupportIssues", + Method: "POST", + PathPattern: "/falcon-complete-dashboards/aggregates/support-issues/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AggregateSupportIssuesReader{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.(*AggregateSupportIssuesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for AggregateSupportIssues: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* AggregateTotalDeviceCounts retrieves aggregate total host devices based on the matched filter */ diff --git a/falcon/client/filevantage/create_rules_parameters.go b/falcon/client/filevantage/create_rules_parameters.go index c84fbfba..efa44515 100644 --- a/falcon/client/filevantage/create_rules_parameters.go +++ b/falcon/client/filevantage/create_rules_parameters.go @@ -105,6 +105,8 @@ type CreateRulesParams struct { * `enable_content_capture` + * `enable_hash_capture` + File system directory monitoring: * `watch_delete_directory_changes` @@ -141,6 +143,8 @@ type CreateRulesParams struct { * `watch_set_value_changes` + * `watch_permissions_key_changes` + * `watch_delete_value_changes` * `watch_create_file_changes` diff --git a/falcon/client/filevantage/update_rules_parameters.go b/falcon/client/filevantage/update_rules_parameters.go index 10712490..9959698b 100644 --- a/falcon/client/filevantage/update_rules_parameters.go +++ b/falcon/client/filevantage/update_rules_parameters.go @@ -105,6 +105,8 @@ type UpdateRulesParams struct { * `enable_content_capture` + * `enable_hash_capture` + File system directory monitoring: * `watch_delete_directory_changes` diff --git a/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_parameters.go b/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_parameters.go index f11c2bc2..3c98dc81 100644 --- a/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_parameters.go +++ b/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_parameters.go @@ -85,6 +85,18 @@ type CreateSavedSearchesDynamicExecuteAltV1Params struct { */ IncludeTestData *bool + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + + /* MatchResponseSchema. + + Whether to validate search results against their schema + */ + MatchResponseSchema *bool + /* Metadata. Whether to include metadata in the response @@ -119,12 +131,18 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1Params) SetDefaults() { includeTestDataDefault = bool(false) + inferJSONTypesDefault = bool(false) + + matchResponseSchemaDefault = bool(false) + metadataDefault = bool(false) ) val := CreateSavedSearchesDynamicExecuteAltV1Params{ IncludeSchemaGeneration: &includeSchemaGenerationDefault, IncludeTestData: &includeTestDataDefault, + InferJSONTypes: &inferJSONTypesDefault, + MatchResponseSchema: &matchResponseSchemaDefault, Metadata: &metadataDefault, } @@ -211,6 +229,28 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1Params) SetIncludeTestData(includ o.IncludeTestData = includeTestData } +// WithInferJSONTypes adds the inferJSONTypes to the create saved searches dynamic execute alt v1 params +func (o *CreateSavedSearchesDynamicExecuteAltV1Params) WithInferJSONTypes(inferJSONTypes *bool) *CreateSavedSearchesDynamicExecuteAltV1Params { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the create saved searches dynamic execute alt v1 params +func (o *CreateSavedSearchesDynamicExecuteAltV1Params) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + +// WithMatchResponseSchema adds the matchResponseSchema to the create saved searches dynamic execute alt v1 params +func (o *CreateSavedSearchesDynamicExecuteAltV1Params) WithMatchResponseSchema(matchResponseSchema *bool) *CreateSavedSearchesDynamicExecuteAltV1Params { + o.SetMatchResponseSchema(matchResponseSchema) + return o +} + +// SetMatchResponseSchema adds the matchResponseSchema to the create saved searches dynamic execute alt v1 params +func (o *CreateSavedSearchesDynamicExecuteAltV1Params) SetMatchResponseSchema(matchResponseSchema *bool) { + o.MatchResponseSchema = matchResponseSchema +} + // WithMetadata adds the metadata to the create saved searches dynamic execute alt v1 params func (o *CreateSavedSearchesDynamicExecuteAltV1Params) WithMetadata(metadata *bool) *CreateSavedSearchesDynamicExecuteAltV1Params { o.SetMetadata(metadata) @@ -297,6 +337,40 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1Params) WriteToRequest(r runtime. } } + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + + if o.MatchResponseSchema != nil { + + // query param match_response_schema + var qrMatchResponseSchema bool + + if o.MatchResponseSchema != nil { + qrMatchResponseSchema = *o.MatchResponseSchema + } + qMatchResponseSchema := swag.FormatBool(qrMatchResponseSchema) + if qMatchResponseSchema != "" { + + if err := r.SetQueryParam("match_response_schema", qMatchResponseSchema); err != nil { + return err + } + } + } + if o.Metadata != nil { // query param metadata diff --git a/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_responses.go b/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_responses.go index 55de6610..d04e0d08 100644 --- a/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_responses.go +++ b/falcon/client/foundry_logscale/create_saved_searches_dynamic_execute_alt_v1_responses.go @@ -31,18 +31,36 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1Reader) ReadResponse(response run return nil, err } return result, nil + case 400: + result := NewCreateSavedSearchesDynamicExecuteAltV1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewCreateSavedSearchesDynamicExecuteAltV1Forbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewCreateSavedSearchesDynamicExecuteAltV1NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewCreateSavedSearchesDynamicExecuteAltV1TooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewCreateSavedSearchesDynamicExecuteAltV1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1] CreateSavedSearchesDynamicExecuteAltV1", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1OK) readResponse(response runtime return nil } +// NewCreateSavedSearchesDynamicExecuteAltV1BadRequest creates a CreateSavedSearchesDynamicExecuteAltV1BadRequest with default headers values +func NewCreateSavedSearchesDynamicExecuteAltV1BadRequest() *CreateSavedSearchesDynamicExecuteAltV1BadRequest { + return &CreateSavedSearchesDynamicExecuteAltV1BadRequest{} +} + +/* +CreateSavedSearchesDynamicExecuteAltV1BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateSavedSearchesDynamicExecuteAltV1BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches dynamic execute alt v1 bad request response has a 2xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches dynamic execute alt v1 bad request response has a 3xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches dynamic execute alt v1 bad request response has a 4xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create saved searches dynamic execute alt v1 bad request response has a 5xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create saved searches dynamic execute alt v1 bad request response a status code equal to that given +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create saved searches dynamic execute alt v1 bad request response +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) Code() int { + return 400 +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] createSavedSearchesDynamicExecuteAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] createSavedSearchesDynamicExecuteAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewCreateSavedSearchesDynamicExecuteAltV1Forbidden creates a CreateSavedSearchesDynamicExecuteAltV1Forbidden with default headers values func NewCreateSavedSearchesDynamicExecuteAltV1Forbidden() *CreateSavedSearchesDynamicExecuteAltV1Forbidden { return &CreateSavedSearchesDynamicExecuteAltV1Forbidden{} @@ -182,7 +310,7 @@ type CreateSavedSearchesDynamicExecuteAltV1Forbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this create saved searches dynamic execute alt v1 forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1Forbidden) String() string { return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] createSavedSearchesDynamicExecuteAltV1Forbidden %+v", 403, o.Payload) } -func (o *CreateSavedSearchesDynamicExecuteAltV1Forbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *CreateSavedSearchesDynamicExecuteAltV1Forbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1Forbidden) readResponse(response o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSavedSearchesDynamicExecuteAltV1NotFound creates a CreateSavedSearchesDynamicExecuteAltV1NotFound with default headers values +func NewCreateSavedSearchesDynamicExecuteAltV1NotFound() *CreateSavedSearchesDynamicExecuteAltV1NotFound { + return &CreateSavedSearchesDynamicExecuteAltV1NotFound{} +} + +/* +CreateSavedSearchesDynamicExecuteAltV1NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type CreateSavedSearchesDynamicExecuteAltV1NotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches dynamic execute alt v1 not found response has a 2xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches dynamic execute alt v1 not found response has a 3xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches dynamic execute alt v1 not found response has a 4xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create saved searches dynamic execute alt v1 not found response has a 5xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create saved searches dynamic execute alt v1 not found response a status code equal to that given +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create saved searches dynamic execute alt v1 not found response +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) Code() int { + return 404 +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] createSavedSearchesDynamicExecuteAltV1NotFound %+v", 404, o.Payload) +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] createSavedSearchesDynamicExecuteAltV1NotFound %+v", 404, o.Payload) +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *CreateSavedSearchesDynamicExecuteAltV1TooManyRequests) readResponse(res return nil } + +// NewCreateSavedSearchesDynamicExecuteAltV1InternalServerError creates a CreateSavedSearchesDynamicExecuteAltV1InternalServerError with default headers values +func NewCreateSavedSearchesDynamicExecuteAltV1InternalServerError() *CreateSavedSearchesDynamicExecuteAltV1InternalServerError { + return &CreateSavedSearchesDynamicExecuteAltV1InternalServerError{} +} + +/* +CreateSavedSearchesDynamicExecuteAltV1InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type CreateSavedSearchesDynamicExecuteAltV1InternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches dynamic execute alt v1 internal server error response has a 2xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches dynamic execute alt v1 internal server error response has a 3xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches dynamic execute alt v1 internal server error response has a 4xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create saved searches dynamic execute alt v1 internal server error response has a 5xx status code +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create saved searches dynamic execute alt v1 internal server error response a status code equal to that given +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create saved searches dynamic execute alt v1 internal server error response +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) Code() int { + return 500 +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] createSavedSearchesDynamicExecuteAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] createSavedSearchesDynamicExecuteAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesDynamicExecuteAltV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_parameters.go b/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_parameters.go index ef894d18..f9bb7a0a 100644 --- a/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_parameters.go +++ b/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_parameters.go @@ -85,6 +85,18 @@ type CreateSavedSearchesExecuteAltV1Params struct { */ IncludeTestData *bool + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + + /* MatchResponseSchema. + + Whether to validate search results against their schema + */ + MatchResponseSchema *bool + /* Metadata. Whether to include metadata in the response @@ -113,13 +125,19 @@ func (o *CreateSavedSearchesExecuteAltV1Params) SetDefaults() { includeTestDataDefault = bool(false) + inferJSONTypesDefault = bool(false) + + matchResponseSchemaDefault = bool(false) + metadataDefault = bool(false) ) val := CreateSavedSearchesExecuteAltV1Params{ - Detailed: &detailedDefault, - IncludeTestData: &includeTestDataDefault, - Metadata: &metadataDefault, + Detailed: &detailedDefault, + IncludeTestData: &includeTestDataDefault, + InferJSONTypes: &inferJSONTypesDefault, + MatchResponseSchema: &matchResponseSchemaDefault, + Metadata: &metadataDefault, } val.timeout = o.timeout @@ -205,6 +223,28 @@ func (o *CreateSavedSearchesExecuteAltV1Params) SetIncludeTestData(includeTestDa o.IncludeTestData = includeTestData } +// WithInferJSONTypes adds the inferJSONTypes to the create saved searches execute alt v1 params +func (o *CreateSavedSearchesExecuteAltV1Params) WithInferJSONTypes(inferJSONTypes *bool) *CreateSavedSearchesExecuteAltV1Params { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the create saved searches execute alt v1 params +func (o *CreateSavedSearchesExecuteAltV1Params) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + +// WithMatchResponseSchema adds the matchResponseSchema to the create saved searches execute alt v1 params +func (o *CreateSavedSearchesExecuteAltV1Params) WithMatchResponseSchema(matchResponseSchema *bool) *CreateSavedSearchesExecuteAltV1Params { + o.SetMatchResponseSchema(matchResponseSchema) + return o +} + +// SetMatchResponseSchema adds the matchResponseSchema to the create saved searches execute alt v1 params +func (o *CreateSavedSearchesExecuteAltV1Params) SetMatchResponseSchema(matchResponseSchema *bool) { + o.MatchResponseSchema = matchResponseSchema +} + // WithMetadata adds the metadata to the create saved searches execute alt v1 params func (o *CreateSavedSearchesExecuteAltV1Params) WithMetadata(metadata *bool) *CreateSavedSearchesExecuteAltV1Params { o.SetMetadata(metadata) @@ -280,6 +320,40 @@ func (o *CreateSavedSearchesExecuteAltV1Params) WriteToRequest(r runtime.ClientR } } + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + + if o.MatchResponseSchema != nil { + + // query param match_response_schema + var qrMatchResponseSchema bool + + if o.MatchResponseSchema != nil { + qrMatchResponseSchema = *o.MatchResponseSchema + } + qMatchResponseSchema := swag.FormatBool(qrMatchResponseSchema) + if qMatchResponseSchema != "" { + + if err := r.SetQueryParam("match_response_schema", qMatchResponseSchema); err != nil { + return err + } + } + } + if o.Metadata != nil { // query param metadata diff --git a/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_responses.go b/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_responses.go index 688ae163..030793c4 100644 --- a/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_responses.go +++ b/falcon/client/foundry_logscale/create_saved_searches_execute_alt_v1_responses.go @@ -31,18 +31,36 @@ func (o *CreateSavedSearchesExecuteAltV1Reader) ReadResponse(response runtime.Cl return nil, err } return result, nil + case 400: + result := NewCreateSavedSearchesExecuteAltV1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewCreateSavedSearchesExecuteAltV1Forbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewCreateSavedSearchesExecuteAltV1NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewCreateSavedSearchesExecuteAltV1TooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewCreateSavedSearchesExecuteAltV1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches-execute/v1] CreateSavedSearchesExecuteAltV1", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *CreateSavedSearchesExecuteAltV1OK) readResponse(response runtime.Client return nil } +// NewCreateSavedSearchesExecuteAltV1BadRequest creates a CreateSavedSearchesExecuteAltV1BadRequest with default headers values +func NewCreateSavedSearchesExecuteAltV1BadRequest() *CreateSavedSearchesExecuteAltV1BadRequest { + return &CreateSavedSearchesExecuteAltV1BadRequest{} +} + +/* +CreateSavedSearchesExecuteAltV1BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateSavedSearchesExecuteAltV1BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches execute alt v1 bad request response has a 2xx status code +func (o *CreateSavedSearchesExecuteAltV1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches execute alt v1 bad request response has a 3xx status code +func (o *CreateSavedSearchesExecuteAltV1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches execute alt v1 bad request response has a 4xx status code +func (o *CreateSavedSearchesExecuteAltV1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create saved searches execute alt v1 bad request response has a 5xx status code +func (o *CreateSavedSearchesExecuteAltV1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create saved searches execute alt v1 bad request response a status code equal to that given +func (o *CreateSavedSearchesExecuteAltV1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create saved searches execute alt v1 bad request response +func (o *CreateSavedSearchesExecuteAltV1BadRequest) Code() int { + return 400 +} + +func (o *CreateSavedSearchesExecuteAltV1BadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] createSavedSearchesExecuteAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *CreateSavedSearchesExecuteAltV1BadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] createSavedSearchesExecuteAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *CreateSavedSearchesExecuteAltV1BadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesExecuteAltV1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewCreateSavedSearchesExecuteAltV1Forbidden creates a CreateSavedSearchesExecuteAltV1Forbidden with default headers values func NewCreateSavedSearchesExecuteAltV1Forbidden() *CreateSavedSearchesExecuteAltV1Forbidden { return &CreateSavedSearchesExecuteAltV1Forbidden{} @@ -182,7 +310,7 @@ type CreateSavedSearchesExecuteAltV1Forbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this create saved searches execute alt v1 forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *CreateSavedSearchesExecuteAltV1Forbidden) String() string { return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] createSavedSearchesExecuteAltV1Forbidden %+v", 403, o.Payload) } -func (o *CreateSavedSearchesExecuteAltV1Forbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *CreateSavedSearchesExecuteAltV1Forbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *CreateSavedSearchesExecuteAltV1Forbidden) readResponse(response runtime o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSavedSearchesExecuteAltV1NotFound creates a CreateSavedSearchesExecuteAltV1NotFound with default headers values +func NewCreateSavedSearchesExecuteAltV1NotFound() *CreateSavedSearchesExecuteAltV1NotFound { + return &CreateSavedSearchesExecuteAltV1NotFound{} +} + +/* +CreateSavedSearchesExecuteAltV1NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type CreateSavedSearchesExecuteAltV1NotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches execute alt v1 not found response has a 2xx status code +func (o *CreateSavedSearchesExecuteAltV1NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches execute alt v1 not found response has a 3xx status code +func (o *CreateSavedSearchesExecuteAltV1NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches execute alt v1 not found response has a 4xx status code +func (o *CreateSavedSearchesExecuteAltV1NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create saved searches execute alt v1 not found response has a 5xx status code +func (o *CreateSavedSearchesExecuteAltV1NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create saved searches execute alt v1 not found response a status code equal to that given +func (o *CreateSavedSearchesExecuteAltV1NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create saved searches execute alt v1 not found response +func (o *CreateSavedSearchesExecuteAltV1NotFound) Code() int { + return 404 +} + +func (o *CreateSavedSearchesExecuteAltV1NotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] createSavedSearchesExecuteAltV1NotFound %+v", 404, o.Payload) +} + +func (o *CreateSavedSearchesExecuteAltV1NotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] createSavedSearchesExecuteAltV1NotFound %+v", 404, o.Payload) +} + +func (o *CreateSavedSearchesExecuteAltV1NotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesExecuteAltV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *CreateSavedSearchesExecuteAltV1TooManyRequests) readResponse(response r return nil } + +// NewCreateSavedSearchesExecuteAltV1InternalServerError creates a CreateSavedSearchesExecuteAltV1InternalServerError with default headers values +func NewCreateSavedSearchesExecuteAltV1InternalServerError() *CreateSavedSearchesExecuteAltV1InternalServerError { + return &CreateSavedSearchesExecuteAltV1InternalServerError{} +} + +/* +CreateSavedSearchesExecuteAltV1InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type CreateSavedSearchesExecuteAltV1InternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches execute alt v1 internal server error response has a 2xx status code +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches execute alt v1 internal server error response has a 3xx status code +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches execute alt v1 internal server error response has a 4xx status code +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create saved searches execute alt v1 internal server error response has a 5xx status code +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create saved searches execute alt v1 internal server error response a status code equal to that given +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create saved searches execute alt v1 internal server error response +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) Code() int { + return 500 +} + +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] createSavedSearchesExecuteAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] createSavedSearchesExecuteAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesExecuteAltV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/create_saved_searches_ingest_alt_v1_responses.go b/falcon/client/foundry_logscale/create_saved_searches_ingest_alt_v1_responses.go index 2ad48313..78c5328b 100644 --- a/falcon/client/foundry_logscale/create_saved_searches_ingest_alt_v1_responses.go +++ b/falcon/client/foundry_logscale/create_saved_searches_ingest_alt_v1_responses.go @@ -31,18 +31,36 @@ func (o *CreateSavedSearchesIngestAltV1Reader) ReadResponse(response runtime.Cli return nil, err } return result, nil + case 400: + result := NewCreateSavedSearchesIngestAltV1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewCreateSavedSearchesIngestAltV1Forbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewCreateSavedSearchesIngestAltV1NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewCreateSavedSearchesIngestAltV1TooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewCreateSavedSearchesIngestAltV1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches-ingest/v1] CreateSavedSearchesIngestAltV1", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *CreateSavedSearchesIngestAltV1OK) readResponse(response runtime.ClientR return nil } +// NewCreateSavedSearchesIngestAltV1BadRequest creates a CreateSavedSearchesIngestAltV1BadRequest with default headers values +func NewCreateSavedSearchesIngestAltV1BadRequest() *CreateSavedSearchesIngestAltV1BadRequest { + return &CreateSavedSearchesIngestAltV1BadRequest{} +} + +/* +CreateSavedSearchesIngestAltV1BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateSavedSearchesIngestAltV1BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches ingest alt v1 bad request response has a 2xx status code +func (o *CreateSavedSearchesIngestAltV1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches ingest alt v1 bad request response has a 3xx status code +func (o *CreateSavedSearchesIngestAltV1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches ingest alt v1 bad request response has a 4xx status code +func (o *CreateSavedSearchesIngestAltV1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create saved searches ingest alt v1 bad request response has a 5xx status code +func (o *CreateSavedSearchesIngestAltV1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create saved searches ingest alt v1 bad request response a status code equal to that given +func (o *CreateSavedSearchesIngestAltV1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create saved searches ingest alt v1 bad request response +func (o *CreateSavedSearchesIngestAltV1BadRequest) Code() int { + return 400 +} + +func (o *CreateSavedSearchesIngestAltV1BadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] createSavedSearchesIngestAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *CreateSavedSearchesIngestAltV1BadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] createSavedSearchesIngestAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *CreateSavedSearchesIngestAltV1BadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesIngestAltV1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewCreateSavedSearchesIngestAltV1Forbidden creates a CreateSavedSearchesIngestAltV1Forbidden with default headers values func NewCreateSavedSearchesIngestAltV1Forbidden() *CreateSavedSearchesIngestAltV1Forbidden { return &CreateSavedSearchesIngestAltV1Forbidden{} @@ -182,7 +310,7 @@ type CreateSavedSearchesIngestAltV1Forbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this create saved searches ingest alt v1 forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *CreateSavedSearchesIngestAltV1Forbidden) String() string { return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] createSavedSearchesIngestAltV1Forbidden %+v", 403, o.Payload) } -func (o *CreateSavedSearchesIngestAltV1Forbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *CreateSavedSearchesIngestAltV1Forbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *CreateSavedSearchesIngestAltV1Forbidden) readResponse(response runtime. o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSavedSearchesIngestAltV1NotFound creates a CreateSavedSearchesIngestAltV1NotFound with default headers values +func NewCreateSavedSearchesIngestAltV1NotFound() *CreateSavedSearchesIngestAltV1NotFound { + return &CreateSavedSearchesIngestAltV1NotFound{} +} + +/* +CreateSavedSearchesIngestAltV1NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type CreateSavedSearchesIngestAltV1NotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches ingest alt v1 not found response has a 2xx status code +func (o *CreateSavedSearchesIngestAltV1NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches ingest alt v1 not found response has a 3xx status code +func (o *CreateSavedSearchesIngestAltV1NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches ingest alt v1 not found response has a 4xx status code +func (o *CreateSavedSearchesIngestAltV1NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create saved searches ingest alt v1 not found response has a 5xx status code +func (o *CreateSavedSearchesIngestAltV1NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create saved searches ingest alt v1 not found response a status code equal to that given +func (o *CreateSavedSearchesIngestAltV1NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create saved searches ingest alt v1 not found response +func (o *CreateSavedSearchesIngestAltV1NotFound) Code() int { + return 404 +} + +func (o *CreateSavedSearchesIngestAltV1NotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] createSavedSearchesIngestAltV1NotFound %+v", 404, o.Payload) +} + +func (o *CreateSavedSearchesIngestAltV1NotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] createSavedSearchesIngestAltV1NotFound %+v", 404, o.Payload) +} + +func (o *CreateSavedSearchesIngestAltV1NotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesIngestAltV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *CreateSavedSearchesIngestAltV1TooManyRequests) readResponse(response ru return nil } + +// NewCreateSavedSearchesIngestAltV1InternalServerError creates a CreateSavedSearchesIngestAltV1InternalServerError with default headers values +func NewCreateSavedSearchesIngestAltV1InternalServerError() *CreateSavedSearchesIngestAltV1InternalServerError { + return &CreateSavedSearchesIngestAltV1InternalServerError{} +} + +/* +CreateSavedSearchesIngestAltV1InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type CreateSavedSearchesIngestAltV1InternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this create saved searches ingest alt v1 internal server error response has a 2xx status code +func (o *CreateSavedSearchesIngestAltV1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create saved searches ingest alt v1 internal server error response has a 3xx status code +func (o *CreateSavedSearchesIngestAltV1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved searches ingest alt v1 internal server error response has a 4xx status code +func (o *CreateSavedSearchesIngestAltV1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create saved searches ingest alt v1 internal server error response has a 5xx status code +func (o *CreateSavedSearchesIngestAltV1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create saved searches ingest alt v1 internal server error response a status code equal to that given +func (o *CreateSavedSearchesIngestAltV1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create saved searches ingest alt v1 internal server error response +func (o *CreateSavedSearchesIngestAltV1InternalServerError) Code() int { + return 500 +} + +func (o *CreateSavedSearchesIngestAltV1InternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] createSavedSearchesIngestAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSavedSearchesIngestAltV1InternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] createSavedSearchesIngestAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSavedSearchesIngestAltV1InternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *CreateSavedSearchesIngestAltV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/download_results_parameters.go b/falcon/client/foundry_logscale/download_results_parameters.go index 74c8a201..5a09012e 100644 --- a/falcon/client/foundry_logscale/download_results_parameters.go +++ b/falcon/client/foundry_logscale/download_results_parameters.go @@ -14,6 +14,7 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // NewDownloadResultsParams creates a new DownloadResultsParams object, @@ -61,6 +62,12 @@ DownloadResultsParams contains all the parameters to send to the API endpoint */ type DownloadResultsParams struct { + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + /* JobID. Job ID for a previously executed async query @@ -90,7 +97,18 @@ func (o *DownloadResultsParams) WithDefaults() *DownloadResultsParams { // // All values with no default are reset to their zero value. func (o *DownloadResultsParams) SetDefaults() { - // no default values defined for this parameter + var ( + inferJSONTypesDefault = bool(false) + ) + + val := DownloadResultsParams{ + InferJSONTypes: &inferJSONTypesDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val } // WithTimeout adds the timeout to the download results params @@ -126,6 +144,17 @@ func (o *DownloadResultsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithInferJSONTypes adds the inferJSONTypes to the download results params +func (o *DownloadResultsParams) WithInferJSONTypes(inferJSONTypes *bool) *DownloadResultsParams { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the download results params +func (o *DownloadResultsParams) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + // WithJobID adds the jobID to the download results params func (o *DownloadResultsParams) WithJobID(jobID string) *DownloadResultsParams { o.SetJobID(jobID) @@ -156,6 +185,23 @@ func (o *DownloadResultsParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + // query param job_id qrJobID := o.JobID qJobID := qrJobID diff --git a/falcon/client/foundry_logscale/execute_dynamic_parameters.go b/falcon/client/foundry_logscale/execute_dynamic_parameters.go index 25cae311..d60a99d4 100644 --- a/falcon/client/foundry_logscale/execute_dynamic_parameters.go +++ b/falcon/client/foundry_logscale/execute_dynamic_parameters.go @@ -85,6 +85,18 @@ type ExecuteDynamicParams struct { */ IncludeTestData *bool + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + + /* MatchResponseSchema. + + Whether to validate search results against their schema + */ + MatchResponseSchema *bool + /* Metadata. Whether to include metadata in the response @@ -119,12 +131,18 @@ func (o *ExecuteDynamicParams) SetDefaults() { includeTestDataDefault = bool(false) + inferJSONTypesDefault = bool(false) + + matchResponseSchemaDefault = bool(false) + metadataDefault = bool(false) ) val := ExecuteDynamicParams{ IncludeSchemaGeneration: &includeSchemaGenerationDefault, IncludeTestData: &includeTestDataDefault, + InferJSONTypes: &inferJSONTypesDefault, + MatchResponseSchema: &matchResponseSchemaDefault, Metadata: &metadataDefault, } @@ -211,6 +229,28 @@ func (o *ExecuteDynamicParams) SetIncludeTestData(includeTestData *bool) { o.IncludeTestData = includeTestData } +// WithInferJSONTypes adds the inferJSONTypes to the execute dynamic params +func (o *ExecuteDynamicParams) WithInferJSONTypes(inferJSONTypes *bool) *ExecuteDynamicParams { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the execute dynamic params +func (o *ExecuteDynamicParams) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + +// WithMatchResponseSchema adds the matchResponseSchema to the execute dynamic params +func (o *ExecuteDynamicParams) WithMatchResponseSchema(matchResponseSchema *bool) *ExecuteDynamicParams { + o.SetMatchResponseSchema(matchResponseSchema) + return o +} + +// SetMatchResponseSchema adds the matchResponseSchema to the execute dynamic params +func (o *ExecuteDynamicParams) SetMatchResponseSchema(matchResponseSchema *bool) { + o.MatchResponseSchema = matchResponseSchema +} + // WithMetadata adds the metadata to the execute dynamic params func (o *ExecuteDynamicParams) WithMetadata(metadata *bool) *ExecuteDynamicParams { o.SetMetadata(metadata) @@ -297,6 +337,40 @@ func (o *ExecuteDynamicParams) WriteToRequest(r runtime.ClientRequest, reg strfm } } + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + + if o.MatchResponseSchema != nil { + + // query param match_response_schema + var qrMatchResponseSchema bool + + if o.MatchResponseSchema != nil { + qrMatchResponseSchema = *o.MatchResponseSchema + } + qMatchResponseSchema := swag.FormatBool(qrMatchResponseSchema) + if qMatchResponseSchema != "" { + + if err := r.SetQueryParam("match_response_schema", qMatchResponseSchema); err != nil { + return err + } + } + } + if o.Metadata != nil { // query param metadata diff --git a/falcon/client/foundry_logscale/execute_dynamic_responses.go b/falcon/client/foundry_logscale/execute_dynamic_responses.go index 55eefd76..b799de84 100644 --- a/falcon/client/foundry_logscale/execute_dynamic_responses.go +++ b/falcon/client/foundry_logscale/execute_dynamic_responses.go @@ -31,18 +31,36 @@ func (o *ExecuteDynamicReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return result, nil + case 400: + result := NewExecuteDynamicBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewExecuteDynamicForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewExecuteDynamicNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewExecuteDynamicTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewExecuteDynamicInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1] ExecuteDynamic", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *ExecuteDynamicOK) readResponse(response runtime.ClientResponse, consume return nil } +// NewExecuteDynamicBadRequest creates a ExecuteDynamicBadRequest with default headers values +func NewExecuteDynamicBadRequest() *ExecuteDynamicBadRequest { + return &ExecuteDynamicBadRequest{} +} + +/* +ExecuteDynamicBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ExecuteDynamicBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this execute dynamic bad request response has a 2xx status code +func (o *ExecuteDynamicBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this execute dynamic bad request response has a 3xx status code +func (o *ExecuteDynamicBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this execute dynamic bad request response has a 4xx status code +func (o *ExecuteDynamicBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this execute dynamic bad request response has a 5xx status code +func (o *ExecuteDynamicBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this execute dynamic bad request response a status code equal to that given +func (o *ExecuteDynamicBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the execute dynamic bad request response +func (o *ExecuteDynamicBadRequest) Code() int { + return 400 +} + +func (o *ExecuteDynamicBadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicBadRequest %+v", 400, o.Payload) +} + +func (o *ExecuteDynamicBadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicBadRequest %+v", 400, o.Payload) +} + +func (o *ExecuteDynamicBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ExecuteDynamicBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewExecuteDynamicForbidden creates a ExecuteDynamicForbidden with default headers values func NewExecuteDynamicForbidden() *ExecuteDynamicForbidden { return &ExecuteDynamicForbidden{} @@ -182,7 +310,7 @@ type ExecuteDynamicForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this execute dynamic forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *ExecuteDynamicForbidden) String() string { return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicForbidden %+v", 403, o.Payload) } -func (o *ExecuteDynamicForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *ExecuteDynamicForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *ExecuteDynamicForbidden) readResponse(response runtime.ClientResponse, o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewExecuteDynamicNotFound creates a ExecuteDynamicNotFound with default headers values +func NewExecuteDynamicNotFound() *ExecuteDynamicNotFound { + return &ExecuteDynamicNotFound{} +} + +/* +ExecuteDynamicNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ExecuteDynamicNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this execute dynamic not found response has a 2xx status code +func (o *ExecuteDynamicNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this execute dynamic not found response has a 3xx status code +func (o *ExecuteDynamicNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this execute dynamic not found response has a 4xx status code +func (o *ExecuteDynamicNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this execute dynamic not found response has a 5xx status code +func (o *ExecuteDynamicNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this execute dynamic not found response a status code equal to that given +func (o *ExecuteDynamicNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the execute dynamic not found response +func (o *ExecuteDynamicNotFound) Code() int { + return 404 +} + +func (o *ExecuteDynamicNotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicNotFound %+v", 404, o.Payload) +} + +func (o *ExecuteDynamicNotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicNotFound %+v", 404, o.Payload) +} + +func (o *ExecuteDynamicNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ExecuteDynamicNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *ExecuteDynamicTooManyRequests) readResponse(response runtime.ClientResp return nil } + +// NewExecuteDynamicInternalServerError creates a ExecuteDynamicInternalServerError with default headers values +func NewExecuteDynamicInternalServerError() *ExecuteDynamicInternalServerError { + return &ExecuteDynamicInternalServerError{} +} + +/* +ExecuteDynamicInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ExecuteDynamicInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this execute dynamic internal server error response has a 2xx status code +func (o *ExecuteDynamicInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this execute dynamic internal server error response has a 3xx status code +func (o *ExecuteDynamicInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this execute dynamic internal server error response has a 4xx status code +func (o *ExecuteDynamicInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this execute dynamic internal server error response has a 5xx status code +func (o *ExecuteDynamicInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this execute dynamic internal server error response a status code equal to that given +func (o *ExecuteDynamicInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the execute dynamic internal server error response +func (o *ExecuteDynamicInternalServerError) Code() int { + return 500 +} + +func (o *ExecuteDynamicInternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicInternalServerError %+v", 500, o.Payload) +} + +func (o *ExecuteDynamicInternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicInternalServerError %+v", 500, o.Payload) +} + +func (o *ExecuteDynamicInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ExecuteDynamicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/execute_parameters.go b/falcon/client/foundry_logscale/execute_parameters.go index 8c772ee1..88e55efb 100644 --- a/falcon/client/foundry_logscale/execute_parameters.go +++ b/falcon/client/foundry_logscale/execute_parameters.go @@ -85,6 +85,18 @@ type ExecuteParams struct { */ IncludeTestData *bool + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + + /* MatchResponseSchema. + + Whether to validate search results against their schema + */ + MatchResponseSchema *bool + /* Metadata. Whether to include metadata in the response @@ -113,13 +125,19 @@ func (o *ExecuteParams) SetDefaults() { includeTestDataDefault = bool(false) + inferJSONTypesDefault = bool(false) + + matchResponseSchemaDefault = bool(false) + metadataDefault = bool(false) ) val := ExecuteParams{ - Detailed: &detailedDefault, - IncludeTestData: &includeTestDataDefault, - Metadata: &metadataDefault, + Detailed: &detailedDefault, + IncludeTestData: &includeTestDataDefault, + InferJSONTypes: &inferJSONTypesDefault, + MatchResponseSchema: &matchResponseSchemaDefault, + Metadata: &metadataDefault, } val.timeout = o.timeout @@ -205,6 +223,28 @@ func (o *ExecuteParams) SetIncludeTestData(includeTestData *bool) { o.IncludeTestData = includeTestData } +// WithInferJSONTypes adds the inferJSONTypes to the execute params +func (o *ExecuteParams) WithInferJSONTypes(inferJSONTypes *bool) *ExecuteParams { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the execute params +func (o *ExecuteParams) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + +// WithMatchResponseSchema adds the matchResponseSchema to the execute params +func (o *ExecuteParams) WithMatchResponseSchema(matchResponseSchema *bool) *ExecuteParams { + o.SetMatchResponseSchema(matchResponseSchema) + return o +} + +// SetMatchResponseSchema adds the matchResponseSchema to the execute params +func (o *ExecuteParams) SetMatchResponseSchema(matchResponseSchema *bool) { + o.MatchResponseSchema = matchResponseSchema +} + // WithMetadata adds the metadata to the execute params func (o *ExecuteParams) WithMetadata(metadata *bool) *ExecuteParams { o.SetMetadata(metadata) @@ -280,6 +320,40 @@ func (o *ExecuteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis } } + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + + if o.MatchResponseSchema != nil { + + // query param match_response_schema + var qrMatchResponseSchema bool + + if o.MatchResponseSchema != nil { + qrMatchResponseSchema = *o.MatchResponseSchema + } + qMatchResponseSchema := swag.FormatBool(qrMatchResponseSchema) + if qMatchResponseSchema != "" { + + if err := r.SetQueryParam("match_response_schema", qMatchResponseSchema); err != nil { + return err + } + } + } + if o.Metadata != nil { // query param metadata diff --git a/falcon/client/foundry_logscale/execute_responses.go b/falcon/client/foundry_logscale/execute_responses.go index 55799c9e..46b04e90 100644 --- a/falcon/client/foundry_logscale/execute_responses.go +++ b/falcon/client/foundry_logscale/execute_responses.go @@ -31,18 +31,36 @@ func (o *ExecuteReader) ReadResponse(response runtime.ClientResponse, consumer r return nil, err } return result, nil + case 400: + result := NewExecuteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewExecuteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewExecuteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewExecuteTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewExecuteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches/execute/v1] Execute", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *ExecuteOK) readResponse(response runtime.ClientResponse, consumer runti return nil } +// NewExecuteBadRequest creates a ExecuteBadRequest with default headers values +func NewExecuteBadRequest() *ExecuteBadRequest { + return &ExecuteBadRequest{} +} + +/* +ExecuteBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ExecuteBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this execute bad request response has a 2xx status code +func (o *ExecuteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this execute bad request response has a 3xx status code +func (o *ExecuteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this execute bad request response has a 4xx status code +func (o *ExecuteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this execute bad request response has a 5xx status code +func (o *ExecuteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this execute bad request response a status code equal to that given +func (o *ExecuteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the execute bad request response +func (o *ExecuteBadRequest) Code() int { + return 400 +} + +func (o *ExecuteBadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeBadRequest %+v", 400, o.Payload) +} + +func (o *ExecuteBadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeBadRequest %+v", 400, o.Payload) +} + +func (o *ExecuteBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ExecuteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewExecuteForbidden creates a ExecuteForbidden with default headers values func NewExecuteForbidden() *ExecuteForbidden { return &ExecuteForbidden{} @@ -182,7 +310,7 @@ type ExecuteForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this execute forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *ExecuteForbidden) String() string { return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeForbidden %+v", 403, o.Payload) } -func (o *ExecuteForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *ExecuteForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *ExecuteForbidden) readResponse(response runtime.ClientResponse, consume o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewExecuteNotFound creates a ExecuteNotFound with default headers values +func NewExecuteNotFound() *ExecuteNotFound { + return &ExecuteNotFound{} +} + +/* +ExecuteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ExecuteNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this execute not found response has a 2xx status code +func (o *ExecuteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this execute not found response has a 3xx status code +func (o *ExecuteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this execute not found response has a 4xx status code +func (o *ExecuteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this execute not found response has a 5xx status code +func (o *ExecuteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this execute not found response a status code equal to that given +func (o *ExecuteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the execute not found response +func (o *ExecuteNotFound) Code() int { + return 404 +} + +func (o *ExecuteNotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeNotFound %+v", 404, o.Payload) +} + +func (o *ExecuteNotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeNotFound %+v", 404, o.Payload) +} + +func (o *ExecuteNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ExecuteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *ExecuteTooManyRequests) readResponse(response runtime.ClientResponse, c return nil } + +// NewExecuteInternalServerError creates a ExecuteInternalServerError with default headers values +func NewExecuteInternalServerError() *ExecuteInternalServerError { + return &ExecuteInternalServerError{} +} + +/* +ExecuteInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ExecuteInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this execute internal server error response has a 2xx status code +func (o *ExecuteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this execute internal server error response has a 3xx status code +func (o *ExecuteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this execute internal server error response has a 4xx status code +func (o *ExecuteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this execute internal server error response has a 5xx status code +func (o *ExecuteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this execute internal server error response a status code equal to that given +func (o *ExecuteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the execute internal server error response +func (o *ExecuteInternalServerError) Code() int { + return 500 +} + +func (o *ExecuteInternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeInternalServerError %+v", 500, o.Payload) +} + +func (o *ExecuteInternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeInternalServerError %+v", 500, o.Payload) +} + +func (o *ExecuteInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ExecuteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/foundry_logscale_client.go b/falcon/client/foundry_logscale/foundry_logscale_client.go index 716c8fac..0452df47 100644 --- a/falcon/client/foundry_logscale/foundry_logscale_client.go +++ b/falcon/client/foundry_logscale/foundry_logscale_client.go @@ -51,6 +51,8 @@ type ClientService interface { IngestData(params *IngestDataParams, opts ...ClientOption) (*IngestDataOK, error) + IngestDataAsyncV1(params *IngestDataAsyncV1Params, opts ...ClientOption) (*IngestDataAsyncV1OK, error) + ListRepos(params *ListReposParams, opts ...ClientOption) (*ListReposOK, error) ListViews(params *ListViewsParams, opts ...ClientOption) (*ListViewsOK, error) @@ -403,7 +405,7 @@ func (a *Client) GetSearchResults(params *GetSearchResultsParams, opts ...Client } /* -IngestData ingests data into the application repository +IngestData synchronouslies ingest data into the application repository */ func (a *Client) IngestData(params *IngestDataParams, opts ...ClientOption) (*IngestDataOK, error) { // TODO: Validate the params before sending @@ -440,6 +442,44 @@ func (a *Client) IngestData(params *IngestDataParams, opts ...ClientOption) (*In panic(msg) } +/* +IngestDataAsyncV1 asynchronouslies ingest data into the application repository +*/ +func (a *Client) IngestDataAsyncV1(params *IngestDataAsyncV1Params, opts ...ClientOption) (*IngestDataAsyncV1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestDataAsyncV1Params() + } + op := &runtime.ClientOperation{ + ID: "IngestDataAsyncV1", + Method: "POST", + PathPattern: "/loggingapi/entities/data-ingestion/ingest-async/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"https"}, + Params: params, + Reader: &IngestDataAsyncV1Reader{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.(*IngestDataAsyncV1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for IngestDataAsyncV1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ListRepos lists available repositories and views */ diff --git a/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_parameters.go b/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_parameters.go index 3442774a..9f19c7b6 100644 --- a/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_parameters.go +++ b/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_parameters.go @@ -68,6 +68,12 @@ type GetSavedSearchesExecuteAltV1Params struct { */ AppID *string + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + /* JobID. Job ID for a previously executed async query @@ -80,6 +86,12 @@ type GetSavedSearchesExecuteAltV1Params struct { */ Limit *string + /* MatchResponseSchema. + + Whether to validate search results against their schema + */ + MatchResponseSchema *bool + /* Metadata. Whether to include metadata in the response @@ -110,11 +122,17 @@ func (o *GetSavedSearchesExecuteAltV1Params) WithDefaults() *GetSavedSearchesExe // All values with no default are reset to their zero value. func (o *GetSavedSearchesExecuteAltV1Params) SetDefaults() { var ( + inferJSONTypesDefault = bool(false) + + matchResponseSchemaDefault = bool(false) + metadataDefault = bool(false) ) val := GetSavedSearchesExecuteAltV1Params{ - Metadata: &metadataDefault, + InferJSONTypes: &inferJSONTypesDefault, + MatchResponseSchema: &matchResponseSchemaDefault, + Metadata: &metadataDefault, } val.timeout = o.timeout @@ -167,6 +185,17 @@ func (o *GetSavedSearchesExecuteAltV1Params) SetAppID(appID *string) { o.AppID = appID } +// WithInferJSONTypes adds the inferJSONTypes to the get saved searches execute alt v1 params +func (o *GetSavedSearchesExecuteAltV1Params) WithInferJSONTypes(inferJSONTypes *bool) *GetSavedSearchesExecuteAltV1Params { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the get saved searches execute alt v1 params +func (o *GetSavedSearchesExecuteAltV1Params) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + // WithJobID adds the jobID to the get saved searches execute alt v1 params func (o *GetSavedSearchesExecuteAltV1Params) WithJobID(jobID string) *GetSavedSearchesExecuteAltV1Params { o.SetJobID(jobID) @@ -189,6 +218,17 @@ func (o *GetSavedSearchesExecuteAltV1Params) SetLimit(limit *string) { o.Limit = limit } +// WithMatchResponseSchema adds the matchResponseSchema to the get saved searches execute alt v1 params +func (o *GetSavedSearchesExecuteAltV1Params) WithMatchResponseSchema(matchResponseSchema *bool) *GetSavedSearchesExecuteAltV1Params { + o.SetMatchResponseSchema(matchResponseSchema) + return o +} + +// SetMatchResponseSchema adds the matchResponseSchema to the get saved searches execute alt v1 params +func (o *GetSavedSearchesExecuteAltV1Params) SetMatchResponseSchema(matchResponseSchema *bool) { + o.MatchResponseSchema = matchResponseSchema +} + // WithMetadata adds the metadata to the get saved searches execute alt v1 params func (o *GetSavedSearchesExecuteAltV1Params) WithMetadata(metadata *bool) *GetSavedSearchesExecuteAltV1Params { o.SetMetadata(metadata) @@ -236,6 +276,23 @@ func (o *GetSavedSearchesExecuteAltV1Params) WriteToRequest(r runtime.ClientRequ } } + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + // query param job_id qrJobID := o.JobID qJobID := qrJobID @@ -263,6 +320,23 @@ func (o *GetSavedSearchesExecuteAltV1Params) WriteToRequest(r runtime.ClientRequ } } + if o.MatchResponseSchema != nil { + + // query param match_response_schema + var qrMatchResponseSchema bool + + if o.MatchResponseSchema != nil { + qrMatchResponseSchema = *o.MatchResponseSchema + } + qMatchResponseSchema := swag.FormatBool(qrMatchResponseSchema) + if qMatchResponseSchema != "" { + + if err := r.SetQueryParam("match_response_schema", qMatchResponseSchema); err != nil { + return err + } + } + } + if o.Metadata != nil { // query param metadata diff --git a/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_responses.go b/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_responses.go index d3bd2bf6..4dd1de94 100644 --- a/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_responses.go +++ b/falcon/client/foundry_logscale/get_saved_searches_execute_alt_v1_responses.go @@ -31,18 +31,36 @@ func (o *GetSavedSearchesExecuteAltV1Reader) ReadResponse(response runtime.Clien return nil, err } return result, nil + case 400: + result := NewGetSavedSearchesExecuteAltV1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewGetSavedSearchesExecuteAltV1Forbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewGetSavedSearchesExecuteAltV1NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewGetSavedSearchesExecuteAltV1TooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewGetSavedSearchesExecuteAltV1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[GET /loggingapi/entities/saved-searches-execute/v1] GetSavedSearchesExecuteAltV1", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *GetSavedSearchesExecuteAltV1OK) readResponse(response runtime.ClientRes return nil } +// NewGetSavedSearchesExecuteAltV1BadRequest creates a GetSavedSearchesExecuteAltV1BadRequest with default headers values +func NewGetSavedSearchesExecuteAltV1BadRequest() *GetSavedSearchesExecuteAltV1BadRequest { + return &GetSavedSearchesExecuteAltV1BadRequest{} +} + +/* +GetSavedSearchesExecuteAltV1BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetSavedSearchesExecuteAltV1BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get saved searches execute alt v1 bad request response has a 2xx status code +func (o *GetSavedSearchesExecuteAltV1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get saved searches execute alt v1 bad request response has a 3xx status code +func (o *GetSavedSearchesExecuteAltV1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get saved searches execute alt v1 bad request response has a 4xx status code +func (o *GetSavedSearchesExecuteAltV1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get saved searches execute alt v1 bad request response has a 5xx status code +func (o *GetSavedSearchesExecuteAltV1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get saved searches execute alt v1 bad request response a status code equal to that given +func (o *GetSavedSearchesExecuteAltV1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get saved searches execute alt v1 bad request response +func (o *GetSavedSearchesExecuteAltV1BadRequest) Code() int { + return 400 +} + +func (o *GetSavedSearchesExecuteAltV1BadRequest) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] getSavedSearchesExecuteAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *GetSavedSearchesExecuteAltV1BadRequest) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] getSavedSearchesExecuteAltV1BadRequest %+v", 400, o.Payload) +} + +func (o *GetSavedSearchesExecuteAltV1BadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetSavedSearchesExecuteAltV1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewGetSavedSearchesExecuteAltV1Forbidden creates a GetSavedSearchesExecuteAltV1Forbidden with default headers values func NewGetSavedSearchesExecuteAltV1Forbidden() *GetSavedSearchesExecuteAltV1Forbidden { return &GetSavedSearchesExecuteAltV1Forbidden{} @@ -182,7 +310,7 @@ type GetSavedSearchesExecuteAltV1Forbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get saved searches execute alt v1 forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *GetSavedSearchesExecuteAltV1Forbidden) String() string { return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] getSavedSearchesExecuteAltV1Forbidden %+v", 403, o.Payload) } -func (o *GetSavedSearchesExecuteAltV1Forbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetSavedSearchesExecuteAltV1Forbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *GetSavedSearchesExecuteAltV1Forbidden) readResponse(response runtime.Cl o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSavedSearchesExecuteAltV1NotFound creates a GetSavedSearchesExecuteAltV1NotFound with default headers values +func NewGetSavedSearchesExecuteAltV1NotFound() *GetSavedSearchesExecuteAltV1NotFound { + return &GetSavedSearchesExecuteAltV1NotFound{} +} + +/* +GetSavedSearchesExecuteAltV1NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type GetSavedSearchesExecuteAltV1NotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get saved searches execute alt v1 not found response has a 2xx status code +func (o *GetSavedSearchesExecuteAltV1NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get saved searches execute alt v1 not found response has a 3xx status code +func (o *GetSavedSearchesExecuteAltV1NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get saved searches execute alt v1 not found response has a 4xx status code +func (o *GetSavedSearchesExecuteAltV1NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get saved searches execute alt v1 not found response has a 5xx status code +func (o *GetSavedSearchesExecuteAltV1NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get saved searches execute alt v1 not found response a status code equal to that given +func (o *GetSavedSearchesExecuteAltV1NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get saved searches execute alt v1 not found response +func (o *GetSavedSearchesExecuteAltV1NotFound) Code() int { + return 404 +} + +func (o *GetSavedSearchesExecuteAltV1NotFound) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] getSavedSearchesExecuteAltV1NotFound %+v", 404, o.Payload) +} + +func (o *GetSavedSearchesExecuteAltV1NotFound) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] getSavedSearchesExecuteAltV1NotFound %+v", 404, o.Payload) +} + +func (o *GetSavedSearchesExecuteAltV1NotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetSavedSearchesExecuteAltV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *GetSavedSearchesExecuteAltV1TooManyRequests) readResponse(response runt return nil } + +// NewGetSavedSearchesExecuteAltV1InternalServerError creates a GetSavedSearchesExecuteAltV1InternalServerError with default headers values +func NewGetSavedSearchesExecuteAltV1InternalServerError() *GetSavedSearchesExecuteAltV1InternalServerError { + return &GetSavedSearchesExecuteAltV1InternalServerError{} +} + +/* +GetSavedSearchesExecuteAltV1InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GetSavedSearchesExecuteAltV1InternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get saved searches execute alt v1 internal server error response has a 2xx status code +func (o *GetSavedSearchesExecuteAltV1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get saved searches execute alt v1 internal server error response has a 3xx status code +func (o *GetSavedSearchesExecuteAltV1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get saved searches execute alt v1 internal server error response has a 4xx status code +func (o *GetSavedSearchesExecuteAltV1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get saved searches execute alt v1 internal server error response has a 5xx status code +func (o *GetSavedSearchesExecuteAltV1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get saved searches execute alt v1 internal server error response a status code equal to that given +func (o *GetSavedSearchesExecuteAltV1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get saved searches execute alt v1 internal server error response +func (o *GetSavedSearchesExecuteAltV1InternalServerError) Code() int { + return 500 +} + +func (o *GetSavedSearchesExecuteAltV1InternalServerError) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] getSavedSearchesExecuteAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *GetSavedSearchesExecuteAltV1InternalServerError) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] getSavedSearchesExecuteAltV1InternalServerError %+v", 500, o.Payload) +} + +func (o *GetSavedSearchesExecuteAltV1InternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetSavedSearchesExecuteAltV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/get_saved_searches_job_results_download_alt_v1_parameters.go b/falcon/client/foundry_logscale/get_saved_searches_job_results_download_alt_v1_parameters.go index 58937236..b2b24022 100644 --- a/falcon/client/foundry_logscale/get_saved_searches_job_results_download_alt_v1_parameters.go +++ b/falcon/client/foundry_logscale/get_saved_searches_job_results_download_alt_v1_parameters.go @@ -14,6 +14,7 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // NewGetSavedSearchesJobResultsDownloadAltV1Params creates a new GetSavedSearchesJobResultsDownloadAltV1Params object, @@ -61,6 +62,12 @@ GetSavedSearchesJobResultsDownloadAltV1Params contains all the parameters to sen */ type GetSavedSearchesJobResultsDownloadAltV1Params struct { + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + /* JobID. Job ID for a previously executed async query @@ -90,7 +97,18 @@ func (o *GetSavedSearchesJobResultsDownloadAltV1Params) WithDefaults() *GetSaved // // All values with no default are reset to their zero value. func (o *GetSavedSearchesJobResultsDownloadAltV1Params) SetDefaults() { - // no default values defined for this parameter + var ( + inferJSONTypesDefault = bool(false) + ) + + val := GetSavedSearchesJobResultsDownloadAltV1Params{ + InferJSONTypes: &inferJSONTypesDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val } // WithTimeout adds the timeout to the get saved searches job results download alt v1 params @@ -126,6 +144,17 @@ func (o *GetSavedSearchesJobResultsDownloadAltV1Params) SetHTTPClient(client *ht o.HTTPClient = client } +// WithInferJSONTypes adds the inferJSONTypes to the get saved searches job results download alt v1 params +func (o *GetSavedSearchesJobResultsDownloadAltV1Params) WithInferJSONTypes(inferJSONTypes *bool) *GetSavedSearchesJobResultsDownloadAltV1Params { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the get saved searches job results download alt v1 params +func (o *GetSavedSearchesJobResultsDownloadAltV1Params) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + // WithJobID adds the jobID to the get saved searches job results download alt v1 params func (o *GetSavedSearchesJobResultsDownloadAltV1Params) WithJobID(jobID string) *GetSavedSearchesJobResultsDownloadAltV1Params { o.SetJobID(jobID) @@ -156,6 +185,23 @@ func (o *GetSavedSearchesJobResultsDownloadAltV1Params) WriteToRequest(r runtime } var res []error + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + // query param job_id qrJobID := o.JobID qJobID := qrJobID diff --git a/falcon/client/foundry_logscale/get_search_results_parameters.go b/falcon/client/foundry_logscale/get_search_results_parameters.go index bed68dae..52c03bd4 100644 --- a/falcon/client/foundry_logscale/get_search_results_parameters.go +++ b/falcon/client/foundry_logscale/get_search_results_parameters.go @@ -68,6 +68,12 @@ type GetSearchResultsParams struct { */ AppID *string + /* InferJSONTypes. + + Whether to try to infer data types in json event response instead of returning map[string]string + */ + InferJSONTypes *bool + /* JobID. Job ID for a previously executed async query @@ -80,6 +86,12 @@ type GetSearchResultsParams struct { */ Limit *string + /* MatchResponseSchema. + + Whether to validate search results against their schema + */ + MatchResponseSchema *bool + /* Metadata. Whether to include metadata in the response @@ -110,11 +122,17 @@ func (o *GetSearchResultsParams) WithDefaults() *GetSearchResultsParams { // All values with no default are reset to their zero value. func (o *GetSearchResultsParams) SetDefaults() { var ( + inferJSONTypesDefault = bool(false) + + matchResponseSchemaDefault = bool(false) + metadataDefault = bool(false) ) val := GetSearchResultsParams{ - Metadata: &metadataDefault, + InferJSONTypes: &inferJSONTypesDefault, + MatchResponseSchema: &matchResponseSchemaDefault, + Metadata: &metadataDefault, } val.timeout = o.timeout @@ -167,6 +185,17 @@ func (o *GetSearchResultsParams) SetAppID(appID *string) { o.AppID = appID } +// WithInferJSONTypes adds the inferJSONTypes to the get search results params +func (o *GetSearchResultsParams) WithInferJSONTypes(inferJSONTypes *bool) *GetSearchResultsParams { + o.SetInferJSONTypes(inferJSONTypes) + return o +} + +// SetInferJSONTypes adds the inferJsonTypes to the get search results params +func (o *GetSearchResultsParams) SetInferJSONTypes(inferJSONTypes *bool) { + o.InferJSONTypes = inferJSONTypes +} + // WithJobID adds the jobID to the get search results params func (o *GetSearchResultsParams) WithJobID(jobID string) *GetSearchResultsParams { o.SetJobID(jobID) @@ -189,6 +218,17 @@ func (o *GetSearchResultsParams) SetLimit(limit *string) { o.Limit = limit } +// WithMatchResponseSchema adds the matchResponseSchema to the get search results params +func (o *GetSearchResultsParams) WithMatchResponseSchema(matchResponseSchema *bool) *GetSearchResultsParams { + o.SetMatchResponseSchema(matchResponseSchema) + return o +} + +// SetMatchResponseSchema adds the matchResponseSchema to the get search results params +func (o *GetSearchResultsParams) SetMatchResponseSchema(matchResponseSchema *bool) { + o.MatchResponseSchema = matchResponseSchema +} + // WithMetadata adds the metadata to the get search results params func (o *GetSearchResultsParams) WithMetadata(metadata *bool) *GetSearchResultsParams { o.SetMetadata(metadata) @@ -236,6 +276,23 @@ func (o *GetSearchResultsParams) WriteToRequest(r runtime.ClientRequest, reg str } } + if o.InferJSONTypes != nil { + + // query param infer_json_types + var qrInferJSONTypes bool + + if o.InferJSONTypes != nil { + qrInferJSONTypes = *o.InferJSONTypes + } + qInferJSONTypes := swag.FormatBool(qrInferJSONTypes) + if qInferJSONTypes != "" { + + if err := r.SetQueryParam("infer_json_types", qInferJSONTypes); err != nil { + return err + } + } + } + // query param job_id qrJobID := o.JobID qJobID := qrJobID @@ -263,6 +320,23 @@ func (o *GetSearchResultsParams) WriteToRequest(r runtime.ClientRequest, reg str } } + if o.MatchResponseSchema != nil { + + // query param match_response_schema + var qrMatchResponseSchema bool + + if o.MatchResponseSchema != nil { + qrMatchResponseSchema = *o.MatchResponseSchema + } + qMatchResponseSchema := swag.FormatBool(qrMatchResponseSchema) + if qMatchResponseSchema != "" { + + if err := r.SetQueryParam("match_response_schema", qMatchResponseSchema); err != nil { + return err + } + } + } + if o.Metadata != nil { // query param metadata diff --git a/falcon/client/foundry_logscale/get_search_results_responses.go b/falcon/client/foundry_logscale/get_search_results_responses.go index 01f10741..965d090b 100644 --- a/falcon/client/foundry_logscale/get_search_results_responses.go +++ b/falcon/client/foundry_logscale/get_search_results_responses.go @@ -31,18 +31,36 @@ func (o *GetSearchResultsReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return result, nil + case 400: + result := NewGetSearchResultsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewGetSearchResultsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewGetSearchResultsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewGetSearchResultsTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewGetSearchResultsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[GET /loggingapi/entities/saved-searches/execute/v1] GetSearchResults", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *GetSearchResultsOK) readResponse(response runtime.ClientResponse, consu return nil } +// NewGetSearchResultsBadRequest creates a GetSearchResultsBadRequest with default headers values +func NewGetSearchResultsBadRequest() *GetSearchResultsBadRequest { + return &GetSearchResultsBadRequest{} +} + +/* +GetSearchResultsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetSearchResultsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get search results bad request response has a 2xx status code +func (o *GetSearchResultsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get search results bad request response has a 3xx status code +func (o *GetSearchResultsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get search results bad request response has a 4xx status code +func (o *GetSearchResultsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get search results bad request response has a 5xx status code +func (o *GetSearchResultsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get search results bad request response a status code equal to that given +func (o *GetSearchResultsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get search results bad request response +func (o *GetSearchResultsBadRequest) Code() int { + return 400 +} + +func (o *GetSearchResultsBadRequest) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsBadRequest %+v", 400, o.Payload) +} + +func (o *GetSearchResultsBadRequest) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsBadRequest %+v", 400, o.Payload) +} + +func (o *GetSearchResultsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetSearchResultsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewGetSearchResultsForbidden creates a GetSearchResultsForbidden with default headers values func NewGetSearchResultsForbidden() *GetSearchResultsForbidden { return &GetSearchResultsForbidden{} @@ -182,7 +310,7 @@ type GetSearchResultsForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this get search results forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *GetSearchResultsForbidden) String() string { return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsForbidden %+v", 403, o.Payload) } -func (o *GetSearchResultsForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetSearchResultsForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *GetSearchResultsForbidden) readResponse(response runtime.ClientResponse o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSearchResultsNotFound creates a GetSearchResultsNotFound with default headers values +func NewGetSearchResultsNotFound() *GetSearchResultsNotFound { + return &GetSearchResultsNotFound{} +} + +/* +GetSearchResultsNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type GetSearchResultsNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get search results not found response has a 2xx status code +func (o *GetSearchResultsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get search results not found response has a 3xx status code +func (o *GetSearchResultsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get search results not found response has a 4xx status code +func (o *GetSearchResultsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get search results not found response has a 5xx status code +func (o *GetSearchResultsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get search results not found response a status code equal to that given +func (o *GetSearchResultsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get search results not found response +func (o *GetSearchResultsNotFound) Code() int { + return 404 +} + +func (o *GetSearchResultsNotFound) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsNotFound %+v", 404, o.Payload) +} + +func (o *GetSearchResultsNotFound) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsNotFound %+v", 404, o.Payload) +} + +func (o *GetSearchResultsNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetSearchResultsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *GetSearchResultsTooManyRequests) readResponse(response runtime.ClientRe return nil } + +// NewGetSearchResultsInternalServerError creates a GetSearchResultsInternalServerError with default headers values +func NewGetSearchResultsInternalServerError() *GetSearchResultsInternalServerError { + return &GetSearchResultsInternalServerError{} +} + +/* +GetSearchResultsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GetSearchResultsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this get search results internal server error response has a 2xx status code +func (o *GetSearchResultsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get search results internal server error response has a 3xx status code +func (o *GetSearchResultsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get search results internal server error response has a 4xx status code +func (o *GetSearchResultsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get search results internal server error response has a 5xx status code +func (o *GetSearchResultsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get search results internal server error response a status code equal to that given +func (o *GetSearchResultsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get search results internal server error response +func (o *GetSearchResultsInternalServerError) Code() int { + return 500 +} + +func (o *GetSearchResultsInternalServerError) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSearchResultsInternalServerError) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSearchResultsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *GetSearchResultsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/ingest_data_async_v1_parameters.go b/falcon/client/foundry_logscale/ingest_data_async_v1_parameters.go new file mode 100644 index 00000000..cdd799ab --- /dev/null +++ b/falcon/client/foundry_logscale/ingest_data_async_v1_parameters.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package foundry_logscale + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewIngestDataAsyncV1Params creates a new IngestDataAsyncV1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIngestDataAsyncV1Params() *IngestDataAsyncV1Params { + return &IngestDataAsyncV1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewIngestDataAsyncV1ParamsWithTimeout creates a new IngestDataAsyncV1Params object +// with the ability to set a timeout on a request. +func NewIngestDataAsyncV1ParamsWithTimeout(timeout time.Duration) *IngestDataAsyncV1Params { + return &IngestDataAsyncV1Params{ + timeout: timeout, + } +} + +// NewIngestDataAsyncV1ParamsWithContext creates a new IngestDataAsyncV1Params object +// with the ability to set a context for a request. +func NewIngestDataAsyncV1ParamsWithContext(ctx context.Context) *IngestDataAsyncV1Params { + return &IngestDataAsyncV1Params{ + Context: ctx, + } +} + +// NewIngestDataAsyncV1ParamsWithHTTPClient creates a new IngestDataAsyncV1Params object +// with the ability to set a custom HTTPClient for a request. +func NewIngestDataAsyncV1ParamsWithHTTPClient(client *http.Client) *IngestDataAsyncV1Params { + return &IngestDataAsyncV1Params{ + HTTPClient: client, + } +} + +/* +IngestDataAsyncV1Params contains all the parameters to send to the API endpoint + + for the ingest data async v1 operation. + + Typically these are written to a http.Request. +*/ +type IngestDataAsyncV1Params struct { + + /* DataFile. + + Data file to ingest + */ + DataFile runtime.NamedReadCloser + + /* Repo. + + Repository name if not part of a foundry app + */ + Repo *string + + /* Tag. + + Custom tag for ingested data in the form tag:value + */ + Tag []string + + /* TagSource. + + Tag the data with the specified source + */ + TagSource *string + + /* TestData. + + Tag the data with test-ingest + */ + TestData *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ingest data async v1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestDataAsyncV1Params) WithDefaults() *IngestDataAsyncV1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ingest data async v1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestDataAsyncV1Params) SetDefaults() { + var ( + testDataDefault = bool(false) + ) + + val := IngestDataAsyncV1Params{ + TestData: &testDataDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithTimeout(timeout time.Duration) *IngestDataAsyncV1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithContext(ctx context.Context) *IngestDataAsyncV1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithHTTPClient(client *http.Client) *IngestDataAsyncV1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDataFile adds the dataFile to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithDataFile(dataFile runtime.NamedReadCloser) *IngestDataAsyncV1Params { + o.SetDataFile(dataFile) + return o +} + +// SetDataFile adds the dataFile to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetDataFile(dataFile runtime.NamedReadCloser) { + o.DataFile = dataFile +} + +// WithRepo adds the repo to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithRepo(repo *string) *IngestDataAsyncV1Params { + o.SetRepo(repo) + return o +} + +// SetRepo adds the repo to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetRepo(repo *string) { + o.Repo = repo +} + +// WithTag adds the tag to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithTag(tag []string) *IngestDataAsyncV1Params { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetTag(tag []string) { + o.Tag = tag +} + +// WithTagSource adds the tagSource to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithTagSource(tagSource *string) *IngestDataAsyncV1Params { + o.SetTagSource(tagSource) + return o +} + +// SetTagSource adds the tagSource to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetTagSource(tagSource *string) { + o.TagSource = tagSource +} + +// WithTestData adds the testData to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) WithTestData(testData *bool) *IngestDataAsyncV1Params { + o.SetTestData(testData) + return o +} + +// SetTestData adds the testData to the ingest data async v1 params +func (o *IngestDataAsyncV1Params) SetTestData(testData *bool) { + o.TestData = testData +} + +// WriteToRequest writes these params to a swagger request +func (o *IngestDataAsyncV1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + // form file param data_file + if err := r.SetFileParam("data_file", o.DataFile); err != nil { + return err + } + + if o.Repo != nil { + + // form param repo + var frRepo string + if o.Repo != nil { + frRepo = *o.Repo + } + fRepo := frRepo + if fRepo != "" { + if err := r.SetFormParam("repo", fRepo); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // binding items for tag + joinedTag := o.bindParamTag(reg) + + // form array param tag + if err := r.SetFormParam("tag", joinedTag...); err != nil { + return err + } + } + + if o.TagSource != nil { + + // form param tag_source + var frTagSource string + if o.TagSource != nil { + frTagSource = *o.TagSource + } + fTagSource := frTagSource + if fTagSource != "" { + if err := r.SetFormParam("tag_source", fTagSource); err != nil { + return err + } + } + } + + if o.TestData != nil { + + // form param test_data + var frTestData bool + if o.TestData != nil { + frTestData = *o.TestData + } + fTestData := swag.FormatBool(frTestData) + if fTestData != "" { + if err := r.SetFormParam("test_data", fTestData); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamIngestDataAsyncV1 binds the parameter tag +func (o *IngestDataAsyncV1Params) bindParamTag(formats strfmt.Registry) []string { + tagIR := o.Tag + + var tagIC []string + for _, tagIIR := range tagIR { // explode []string + + tagIIV := tagIIR // string as string + tagIC = append(tagIC, tagIIV) + } + + // items.CollectionFormat: "" + tagIS := swag.JoinByFormat(tagIC, "") + + return tagIS +} diff --git a/falcon/client/foundry_logscale/ingest_data_async_v1_responses.go b/falcon/client/foundry_logscale/ingest_data_async_v1_responses.go new file mode 100644 index 00000000..3ac30ca8 --- /dev/null +++ b/falcon/client/foundry_logscale/ingest_data_async_v1_responses.go @@ -0,0 +1,742 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package foundry_logscale + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// IngestDataAsyncV1Reader is a Reader for the IngestDataAsyncV1 structure. +type IngestDataAsyncV1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IngestDataAsyncV1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIngestDataAsyncV1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewIngestDataAsyncV1BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewIngestDataAsyncV1Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewIngestDataAsyncV1NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewIngestDataAsyncV1TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewIngestDataAsyncV1InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /loggingapi/entities/data-ingestion/ingest-async/v1] IngestDataAsyncV1", response, response.Code()) + } +} + +// NewIngestDataAsyncV1OK creates a IngestDataAsyncV1OK with default headers values +func NewIngestDataAsyncV1OK() *IngestDataAsyncV1OK { + return &IngestDataAsyncV1OK{} +} + +/* +IngestDataAsyncV1OK describes a response with status code 200, with default header values. + +OK +*/ +type IngestDataAsyncV1OK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.ClientDataIngestResponseWrapperV1 +} + +// IsSuccess returns true when this ingest data async v1 o k response has a 2xx status code +func (o *IngestDataAsyncV1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this ingest data async v1 o k response has a 3xx status code +func (o *IngestDataAsyncV1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data async v1 o k response has a 4xx status code +func (o *IngestDataAsyncV1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this ingest data async v1 o k response has a 5xx status code +func (o *IngestDataAsyncV1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest data async v1 o k response a status code equal to that given +func (o *IngestDataAsyncV1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the ingest data async v1 o k response +func (o *IngestDataAsyncV1OK) Code() int { + return 200 +} + +func (o *IngestDataAsyncV1OK) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1OK %+v", 200, o.Payload) +} + +func (o *IngestDataAsyncV1OK) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1OK %+v", 200, o.Payload) +} + +func (o *IngestDataAsyncV1OK) GetPayload() *models.ClientDataIngestResponseWrapperV1 { + return o.Payload +} + +func (o *IngestDataAsyncV1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.ClientDataIngestResponseWrapperV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewIngestDataAsyncV1BadRequest creates a IngestDataAsyncV1BadRequest with default headers values +func NewIngestDataAsyncV1BadRequest() *IngestDataAsyncV1BadRequest { + return &IngestDataAsyncV1BadRequest{} +} + +/* +IngestDataAsyncV1BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type IngestDataAsyncV1BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this ingest data async v1 bad request response has a 2xx status code +func (o *IngestDataAsyncV1BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data async v1 bad request response has a 3xx status code +func (o *IngestDataAsyncV1BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data async v1 bad request response has a 4xx status code +func (o *IngestDataAsyncV1BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this ingest data async v1 bad request response has a 5xx status code +func (o *IngestDataAsyncV1BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest data async v1 bad request response a status code equal to that given +func (o *IngestDataAsyncV1BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the ingest data async v1 bad request response +func (o *IngestDataAsyncV1BadRequest) Code() int { + return 400 +} + +func (o *IngestDataAsyncV1BadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1BadRequest %+v", 400, o.Payload) +} + +func (o *IngestDataAsyncV1BadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1BadRequest %+v", 400, o.Payload) +} + +func (o *IngestDataAsyncV1BadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *IngestDataAsyncV1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewIngestDataAsyncV1Forbidden creates a IngestDataAsyncV1Forbidden with default headers values +func NewIngestDataAsyncV1Forbidden() *IngestDataAsyncV1Forbidden { + return &IngestDataAsyncV1Forbidden{} +} + +/* +IngestDataAsyncV1Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type IngestDataAsyncV1Forbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this ingest data async v1 forbidden response has a 2xx status code +func (o *IngestDataAsyncV1Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data async v1 forbidden response has a 3xx status code +func (o *IngestDataAsyncV1Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data async v1 forbidden response has a 4xx status code +func (o *IngestDataAsyncV1Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this ingest data async v1 forbidden response has a 5xx status code +func (o *IngestDataAsyncV1Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest data async v1 forbidden response a status code equal to that given +func (o *IngestDataAsyncV1Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the ingest data async v1 forbidden response +func (o *IngestDataAsyncV1Forbidden) Code() int { + return 403 +} + +func (o *IngestDataAsyncV1Forbidden) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1Forbidden %+v", 403, o.Payload) +} + +func (o *IngestDataAsyncV1Forbidden) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1Forbidden %+v", 403, o.Payload) +} + +func (o *IngestDataAsyncV1Forbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *IngestDataAsyncV1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewIngestDataAsyncV1NotFound creates a IngestDataAsyncV1NotFound with default headers values +func NewIngestDataAsyncV1NotFound() *IngestDataAsyncV1NotFound { + return &IngestDataAsyncV1NotFound{} +} + +/* +IngestDataAsyncV1NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type IngestDataAsyncV1NotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this ingest data async v1 not found response has a 2xx status code +func (o *IngestDataAsyncV1NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data async v1 not found response has a 3xx status code +func (o *IngestDataAsyncV1NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data async v1 not found response has a 4xx status code +func (o *IngestDataAsyncV1NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this ingest data async v1 not found response has a 5xx status code +func (o *IngestDataAsyncV1NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest data async v1 not found response a status code equal to that given +func (o *IngestDataAsyncV1NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the ingest data async v1 not found response +func (o *IngestDataAsyncV1NotFound) Code() int { + return 404 +} + +func (o *IngestDataAsyncV1NotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1NotFound %+v", 404, o.Payload) +} + +func (o *IngestDataAsyncV1NotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1NotFound %+v", 404, o.Payload) +} + +func (o *IngestDataAsyncV1NotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *IngestDataAsyncV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewIngestDataAsyncV1TooManyRequests creates a IngestDataAsyncV1TooManyRequests with default headers values +func NewIngestDataAsyncV1TooManyRequests() *IngestDataAsyncV1TooManyRequests { + return &IngestDataAsyncV1TooManyRequests{} +} + +/* +IngestDataAsyncV1TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type IngestDataAsyncV1TooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this ingest data async v1 too many requests response has a 2xx status code +func (o *IngestDataAsyncV1TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data async v1 too many requests response has a 3xx status code +func (o *IngestDataAsyncV1TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data async v1 too many requests response has a 4xx status code +func (o *IngestDataAsyncV1TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this ingest data async v1 too many requests response has a 5xx status code +func (o *IngestDataAsyncV1TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest data async v1 too many requests response a status code equal to that given +func (o *IngestDataAsyncV1TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the ingest data async v1 too many requests response +func (o *IngestDataAsyncV1TooManyRequests) Code() int { + return 429 +} + +func (o *IngestDataAsyncV1TooManyRequests) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1TooManyRequests %+v", 429, o.Payload) +} + +func (o *IngestDataAsyncV1TooManyRequests) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1TooManyRequests %+v", 429, o.Payload) +} + +func (o *IngestDataAsyncV1TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *IngestDataAsyncV1TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewIngestDataAsyncV1InternalServerError creates a IngestDataAsyncV1InternalServerError with default headers values +func NewIngestDataAsyncV1InternalServerError() *IngestDataAsyncV1InternalServerError { + return &IngestDataAsyncV1InternalServerError{} +} + +/* +IngestDataAsyncV1InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type IngestDataAsyncV1InternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this ingest data async v1 internal server error response has a 2xx status code +func (o *IngestDataAsyncV1InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data async v1 internal server error response has a 3xx status code +func (o *IngestDataAsyncV1InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data async v1 internal server error response has a 4xx status code +func (o *IngestDataAsyncV1InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this ingest data async v1 internal server error response has a 5xx status code +func (o *IngestDataAsyncV1InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this ingest data async v1 internal server error response a status code equal to that given +func (o *IngestDataAsyncV1InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the ingest data async v1 internal server error response +func (o *IngestDataAsyncV1InternalServerError) Code() int { + return 500 +} + +func (o *IngestDataAsyncV1InternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1InternalServerError %+v", 500, o.Payload) +} + +func (o *IngestDataAsyncV1InternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest-async/v1][%d] ingestDataAsyncV1InternalServerError %+v", 500, o.Payload) +} + +func (o *IngestDataAsyncV1InternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *IngestDataAsyncV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/ingest_data_responses.go b/falcon/client/foundry_logscale/ingest_data_responses.go index 423f65bd..b57de322 100644 --- a/falcon/client/foundry_logscale/ingest_data_responses.go +++ b/falcon/client/foundry_logscale/ingest_data_responses.go @@ -31,18 +31,36 @@ func (o *IngestDataReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil + case 400: + result := NewIngestDataBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewIngestDataForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewIngestDataNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewIngestDataTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewIngestDataInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[POST /loggingapi/entities/data-ingestion/ingest/v1] IngestData", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *IngestDataOK) readResponse(response runtime.ClientResponse, consumer ru return nil } +// NewIngestDataBadRequest creates a IngestDataBadRequest with default headers values +func NewIngestDataBadRequest() *IngestDataBadRequest { + return &IngestDataBadRequest{} +} + +/* +IngestDataBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type IngestDataBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this ingest data bad request response has a 2xx status code +func (o *IngestDataBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data bad request response has a 3xx status code +func (o *IngestDataBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data bad request response has a 4xx status code +func (o *IngestDataBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this ingest data bad request response has a 5xx status code +func (o *IngestDataBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest data bad request response a status code equal to that given +func (o *IngestDataBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the ingest data bad request response +func (o *IngestDataBadRequest) Code() int { + return 400 +} + +func (o *IngestDataBadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataBadRequest %+v", 400, o.Payload) +} + +func (o *IngestDataBadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataBadRequest %+v", 400, o.Payload) +} + +func (o *IngestDataBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *IngestDataBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewIngestDataForbidden creates a IngestDataForbidden with default headers values func NewIngestDataForbidden() *IngestDataForbidden { return &IngestDataForbidden{} @@ -182,7 +310,7 @@ type IngestDataForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this ingest data forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *IngestDataForbidden) String() string { return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataForbidden %+v", 403, o.Payload) } -func (o *IngestDataForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *IngestDataForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *IngestDataForbidden) readResponse(response runtime.ClientResponse, cons o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewIngestDataNotFound creates a IngestDataNotFound with default headers values +func NewIngestDataNotFound() *IngestDataNotFound { + return &IngestDataNotFound{} +} + +/* +IngestDataNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type IngestDataNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this ingest data not found response has a 2xx status code +func (o *IngestDataNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data not found response has a 3xx status code +func (o *IngestDataNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data not found response has a 4xx status code +func (o *IngestDataNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this ingest data not found response has a 5xx status code +func (o *IngestDataNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest data not found response a status code equal to that given +func (o *IngestDataNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the ingest data not found response +func (o *IngestDataNotFound) Code() int { + return 404 +} + +func (o *IngestDataNotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataNotFound %+v", 404, o.Payload) +} + +func (o *IngestDataNotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataNotFound %+v", 404, o.Payload) +} + +func (o *IngestDataNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *IngestDataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *IngestDataTooManyRequests) readResponse(response runtime.ClientResponse return nil } + +// NewIngestDataInternalServerError creates a IngestDataInternalServerError with default headers values +func NewIngestDataInternalServerError() *IngestDataInternalServerError { + return &IngestDataInternalServerError{} +} + +/* +IngestDataInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type IngestDataInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this ingest data internal server error response has a 2xx status code +func (o *IngestDataInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this ingest data internal server error response has a 3xx status code +func (o *IngestDataInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest data internal server error response has a 4xx status code +func (o *IngestDataInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this ingest data internal server error response has a 5xx status code +func (o *IngestDataInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this ingest data internal server error response a status code equal to that given +func (o *IngestDataInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the ingest data internal server error response +func (o *IngestDataInternalServerError) Code() int { + return 500 +} + +func (o *IngestDataInternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataInternalServerError %+v", 500, o.Payload) +} + +func (o *IngestDataInternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataInternalServerError %+v", 500, o.Payload) +} + +func (o *IngestDataInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *IngestDataInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/list_repos_responses.go b/falcon/client/foundry_logscale/list_repos_responses.go index 26b9674c..d6e3e07d 100644 --- a/falcon/client/foundry_logscale/list_repos_responses.go +++ b/falcon/client/foundry_logscale/list_repos_responses.go @@ -31,18 +31,36 @@ func (o *ListReposReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return result, nil + case 400: + result := NewListReposBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewListReposForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewListReposNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewListReposTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewListReposInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[GET /loggingapi/combined/repos/v1] ListRepos", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *ListReposOK) readResponse(response runtime.ClientResponse, consumer run return nil } +// NewListReposBadRequest creates a ListReposBadRequest with default headers values +func NewListReposBadRequest() *ListReposBadRequest { + return &ListReposBadRequest{} +} + +/* +ListReposBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ListReposBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this list repos bad request response has a 2xx status code +func (o *ListReposBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list repos bad request response has a 3xx status code +func (o *ListReposBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list repos bad request response has a 4xx status code +func (o *ListReposBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this list repos bad request response has a 5xx status code +func (o *ListReposBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this list repos bad request response a status code equal to that given +func (o *ListReposBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the list repos bad request response +func (o *ListReposBadRequest) Code() int { + return 400 +} + +func (o *ListReposBadRequest) Error() string { + return fmt.Sprintf("[GET /loggingapi/combined/repos/v1][%d] listReposBadRequest %+v", 400, o.Payload) +} + +func (o *ListReposBadRequest) String() string { + return fmt.Sprintf("[GET /loggingapi/combined/repos/v1][%d] listReposBadRequest %+v", 400, o.Payload) +} + +func (o *ListReposBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ListReposBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewListReposForbidden creates a ListReposForbidden with default headers values func NewListReposForbidden() *ListReposForbidden { return &ListReposForbidden{} @@ -182,7 +310,7 @@ type ListReposForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this list repos forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *ListReposForbidden) String() string { return fmt.Sprintf("[GET /loggingapi/combined/repos/v1][%d] listReposForbidden %+v", 403, o.Payload) } -func (o *ListReposForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *ListReposForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *ListReposForbidden) readResponse(response runtime.ClientResponse, consu o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListReposNotFound creates a ListReposNotFound with default headers values +func NewListReposNotFound() *ListReposNotFound { + return &ListReposNotFound{} +} + +/* +ListReposNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ListReposNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this list repos not found response has a 2xx status code +func (o *ListReposNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list repos not found response has a 3xx status code +func (o *ListReposNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list repos not found response has a 4xx status code +func (o *ListReposNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this list repos not found response has a 5xx status code +func (o *ListReposNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this list repos not found response a status code equal to that given +func (o *ListReposNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the list repos not found response +func (o *ListReposNotFound) Code() int { + return 404 +} + +func (o *ListReposNotFound) Error() string { + return fmt.Sprintf("[GET /loggingapi/combined/repos/v1][%d] listReposNotFound %+v", 404, o.Payload) +} + +func (o *ListReposNotFound) String() string { + return fmt.Sprintf("[GET /loggingapi/combined/repos/v1][%d] listReposNotFound %+v", 404, o.Payload) +} + +func (o *ListReposNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ListReposNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *ListReposTooManyRequests) readResponse(response runtime.ClientResponse, return nil } + +// NewListReposInternalServerError creates a ListReposInternalServerError with default headers values +func NewListReposInternalServerError() *ListReposInternalServerError { + return &ListReposInternalServerError{} +} + +/* +ListReposInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ListReposInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this list repos internal server error response has a 2xx status code +func (o *ListReposInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list repos internal server error response has a 3xx status code +func (o *ListReposInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list repos internal server error response has a 4xx status code +func (o *ListReposInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this list repos internal server error response has a 5xx status code +func (o *ListReposInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this list repos internal server error response a status code equal to that given +func (o *ListReposInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the list repos internal server error response +func (o *ListReposInternalServerError) Code() int { + return 500 +} + +func (o *ListReposInternalServerError) Error() string { + return fmt.Sprintf("[GET /loggingapi/combined/repos/v1][%d] listReposInternalServerError %+v", 500, o.Payload) +} + +func (o *ListReposInternalServerError) String() string { + return fmt.Sprintf("[GET /loggingapi/combined/repos/v1][%d] listReposInternalServerError %+v", 500, o.Payload) +} + +func (o *ListReposInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ListReposInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/list_views_responses.go b/falcon/client/foundry_logscale/list_views_responses.go index 21dbf145..985800a0 100644 --- a/falcon/client/foundry_logscale/list_views_responses.go +++ b/falcon/client/foundry_logscale/list_views_responses.go @@ -31,18 +31,36 @@ func (o *ListViewsReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return result, nil + case 400: + result := NewListViewsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewListViewsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewListViewsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewListViewsTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewListViewsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[GET /loggingapi/entities/views/v1] ListViews", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *ListViewsOK) readResponse(response runtime.ClientResponse, consumer run return nil } +// NewListViewsBadRequest creates a ListViewsBadRequest with default headers values +func NewListViewsBadRequest() *ListViewsBadRequest { + return &ListViewsBadRequest{} +} + +/* +ListViewsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ListViewsBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this list views bad request response has a 2xx status code +func (o *ListViewsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list views bad request response has a 3xx status code +func (o *ListViewsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list views bad request response has a 4xx status code +func (o *ListViewsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this list views bad request response has a 5xx status code +func (o *ListViewsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this list views bad request response a status code equal to that given +func (o *ListViewsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the list views bad request response +func (o *ListViewsBadRequest) Code() int { + return 400 +} + +func (o *ListViewsBadRequest) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/views/v1][%d] listViewsBadRequest %+v", 400, o.Payload) +} + +func (o *ListViewsBadRequest) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/views/v1][%d] listViewsBadRequest %+v", 400, o.Payload) +} + +func (o *ListViewsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ListViewsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewListViewsForbidden creates a ListViewsForbidden with default headers values func NewListViewsForbidden() *ListViewsForbidden { return &ListViewsForbidden{} @@ -182,7 +310,7 @@ type ListViewsForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this list views forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *ListViewsForbidden) String() string { return fmt.Sprintf("[GET /loggingapi/entities/views/v1][%d] listViewsForbidden %+v", 403, o.Payload) } -func (o *ListViewsForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *ListViewsForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *ListViewsForbidden) readResponse(response runtime.ClientResponse, consu o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListViewsNotFound creates a ListViewsNotFound with default headers values +func NewListViewsNotFound() *ListViewsNotFound { + return &ListViewsNotFound{} +} + +/* +ListViewsNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ListViewsNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this list views not found response has a 2xx status code +func (o *ListViewsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list views not found response has a 3xx status code +func (o *ListViewsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list views not found response has a 4xx status code +func (o *ListViewsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this list views not found response has a 5xx status code +func (o *ListViewsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this list views not found response a status code equal to that given +func (o *ListViewsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the list views not found response +func (o *ListViewsNotFound) Code() int { + return 404 +} + +func (o *ListViewsNotFound) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/views/v1][%d] listViewsNotFound %+v", 404, o.Payload) +} + +func (o *ListViewsNotFound) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/views/v1][%d] listViewsNotFound %+v", 404, o.Payload) +} + +func (o *ListViewsNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ListViewsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *ListViewsTooManyRequests) readResponse(response runtime.ClientResponse, return nil } + +// NewListViewsInternalServerError creates a ListViewsInternalServerError with default headers values +func NewListViewsInternalServerError() *ListViewsInternalServerError { + return &ListViewsInternalServerError{} +} + +/* +ListViewsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ListViewsInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this list views internal server error response has a 2xx status code +func (o *ListViewsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list views internal server error response has a 3xx status code +func (o *ListViewsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list views internal server error response has a 4xx status code +func (o *ListViewsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this list views internal server error response has a 5xx status code +func (o *ListViewsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this list views internal server error response a status code equal to that given +func (o *ListViewsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the list views internal server error response +func (o *ListViewsInternalServerError) Code() int { + return 500 +} + +func (o *ListViewsInternalServerError) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/views/v1][%d] listViewsInternalServerError %+v", 500, o.Payload) +} + +func (o *ListViewsInternalServerError) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/views/v1][%d] listViewsInternalServerError %+v", 500, o.Payload) +} + +func (o *ListViewsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *ListViewsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/foundry_logscale/populate_responses.go b/falcon/client/foundry_logscale/populate_responses.go index 63a6ce2d..4da90703 100644 --- a/falcon/client/foundry_logscale/populate_responses.go +++ b/falcon/client/foundry_logscale/populate_responses.go @@ -31,18 +31,36 @@ func (o *PopulateReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return result, nil + case 400: + result := NewPopulateBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 403: result := NewPopulateForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 404: + result := NewPopulateNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewPopulateTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + case 500: + result := NewPopulateInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches/ingest/v1] Populate", response, response.Code()) } @@ -158,6 +176,116 @@ func (o *PopulateOK) readResponse(response runtime.ClientResponse, consumer runt return nil } +// NewPopulateBadRequest creates a PopulateBadRequest with default headers values +func NewPopulateBadRequest() *PopulateBadRequest { + return &PopulateBadRequest{} +} + +/* +PopulateBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PopulateBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this populate bad request response has a 2xx status code +func (o *PopulateBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this populate bad request response has a 3xx status code +func (o *PopulateBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this populate bad request response has a 4xx status code +func (o *PopulateBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this populate bad request response has a 5xx status code +func (o *PopulateBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this populate bad request response a status code equal to that given +func (o *PopulateBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the populate bad request response +func (o *PopulateBadRequest) Code() int { + return 400 +} + +func (o *PopulateBadRequest) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateBadRequest %+v", 400, o.Payload) +} + +func (o *PopulateBadRequest) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateBadRequest %+v", 400, o.Payload) +} + +func (o *PopulateBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *PopulateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPopulateForbidden creates a PopulateForbidden with default headers values func NewPopulateForbidden() *PopulateForbidden { return &PopulateForbidden{} @@ -182,7 +310,7 @@ type PopulateForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaReplyMetaOnly + Payload *models.MsaspecResponseFields } // IsSuccess returns true when this populate forbidden response has a 2xx status code @@ -223,7 +351,7 @@ func (o *PopulateForbidden) String() string { return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateForbidden %+v", 403, o.Payload) } -func (o *PopulateForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *PopulateForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } @@ -258,7 +386,117 @@ func (o *PopulateForbidden) readResponse(response runtime.ClientResponse, consum o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaReplyMetaOnly) + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPopulateNotFound creates a PopulateNotFound with default headers values +func NewPopulateNotFound() *PopulateNotFound { + return &PopulateNotFound{} +} + +/* +PopulateNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PopulateNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this populate not found response has a 2xx status code +func (o *PopulateNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this populate not found response has a 3xx status code +func (o *PopulateNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this populate not found response has a 4xx status code +func (o *PopulateNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this populate not found response has a 5xx status code +func (o *PopulateNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this populate not found response a status code equal to that given +func (o *PopulateNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the populate not found response +func (o *PopulateNotFound) Code() int { + return 404 +} + +func (o *PopulateNotFound) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateNotFound %+v", 404, o.Payload) +} + +func (o *PopulateNotFound) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateNotFound %+v", 404, o.Payload) +} + +func (o *PopulateNotFound) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *PopulateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -392,3 +630,113 @@ func (o *PopulateTooManyRequests) readResponse(response runtime.ClientResponse, return nil } + +// NewPopulateInternalServerError creates a PopulateInternalServerError with default headers values +func NewPopulateInternalServerError() *PopulateInternalServerError { + return &PopulateInternalServerError{} +} + +/* +PopulateInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PopulateInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this populate internal server error response has a 2xx status code +func (o *PopulateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this populate internal server error response has a 3xx status code +func (o *PopulateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this populate internal server error response has a 4xx status code +func (o *PopulateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this populate internal server error response has a 5xx status code +func (o *PopulateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this populate internal server error response a status code equal to that given +func (o *PopulateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the populate internal server error response +func (o *PopulateInternalServerError) Code() int { + return 500 +} + +func (o *PopulateInternalServerError) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateInternalServerError %+v", 500, o.Payload) +} + +func (o *PopulateInternalServerError) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateInternalServerError %+v", 500, o.Payload) +} + +func (o *PopulateInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *PopulateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/installation_tokens/tokens_create_responses.go b/falcon/client/installation_tokens/tokens_create_responses.go index 69f9a3ab..b7700d76 100644 --- a/falcon/client/installation_tokens/tokens_create_responses.go +++ b/falcon/client/installation_tokens/tokens_create_responses.go @@ -43,6 +43,12 @@ func (o *TokensCreateReader) ReadResponse(response runtime.ClientResponse, consu return nil, err } return nil, result + case 409: + result := NewTokensCreateConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 429: result := NewTokensCreateTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -390,6 +396,116 @@ func (o *TokensCreateForbidden) readResponse(response runtime.ClientResponse, co return nil } +// NewTokensCreateConflict creates a TokensCreateConflict with default headers values +func NewTokensCreateConflict() *TokensCreateConflict { + return &TokensCreateConflict{} +} + +/* +TokensCreateConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type TokensCreateConflict struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this tokens create conflict response has a 2xx status code +func (o *TokensCreateConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this tokens create conflict response has a 3xx status code +func (o *TokensCreateConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this tokens create conflict response has a 4xx status code +func (o *TokensCreateConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this tokens create conflict response has a 5xx status code +func (o *TokensCreateConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this tokens create conflict response a status code equal to that given +func (o *TokensCreateConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the tokens create conflict response +func (o *TokensCreateConflict) Code() int { + return 409 +} + +func (o *TokensCreateConflict) Error() string { + return fmt.Sprintf("[POST /installation-tokens/entities/tokens/v1][%d] tokensCreateConflict %+v", 409, o.Payload) +} + +func (o *TokensCreateConflict) String() string { + return fmt.Sprintf("[POST /installation-tokens/entities/tokens/v1][%d] tokensCreateConflict %+v", 409, o.Payload) +} + +func (o *TokensCreateConflict) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *TokensCreateConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewTokensCreateTooManyRequests creates a TokensCreateTooManyRequests with default headers values func NewTokensCreateTooManyRequests() *TokensCreateTooManyRequests { return &TokensCreateTooManyRequests{} diff --git a/falcon/client/intel/get_latest_intel_rule_file_parameters.go b/falcon/client/intel/get_latest_intel_rule_file_parameters.go index 6276164a..e4ecbf0b 100644 --- a/falcon/client/intel/get_latest_intel_rule_file_parameters.go +++ b/falcon/client/intel/get_latest_intel_rule_file_parameters.go @@ -104,6 +104,12 @@ type GetLatestIntelRuleFileParams struct { common-event-format netwitness + + cql-master + + cql-update + + cql-changelog */ Type string diff --git a/falcon/client/intel/get_malware_entities_parameters.go b/falcon/client/intel/get_malware_entities_parameters.go new file mode 100644 index 00000000..f87d2339 --- /dev/null +++ b/falcon/client/intel/get_malware_entities_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package intel + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetMalwareEntitiesParams creates a new GetMalwareEntitiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetMalwareEntitiesParams() *GetMalwareEntitiesParams { + return &GetMalwareEntitiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetMalwareEntitiesParamsWithTimeout creates a new GetMalwareEntitiesParams object +// with the ability to set a timeout on a request. +func NewGetMalwareEntitiesParamsWithTimeout(timeout time.Duration) *GetMalwareEntitiesParams { + return &GetMalwareEntitiesParams{ + timeout: timeout, + } +} + +// NewGetMalwareEntitiesParamsWithContext creates a new GetMalwareEntitiesParams object +// with the ability to set a context for a request. +func NewGetMalwareEntitiesParamsWithContext(ctx context.Context) *GetMalwareEntitiesParams { + return &GetMalwareEntitiesParams{ + Context: ctx, + } +} + +// NewGetMalwareEntitiesParamsWithHTTPClient creates a new GetMalwareEntitiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetMalwareEntitiesParamsWithHTTPClient(client *http.Client) *GetMalwareEntitiesParams { + return &GetMalwareEntitiesParams{ + HTTPClient: client, + } +} + +/* +GetMalwareEntitiesParams contains all the parameters to send to the API endpoint + + for the get malware entities operation. + + Typically these are written to a http.Request. +*/ +type GetMalwareEntitiesParams struct { + + /* Ids. + + Malware family name in lower case with spaces, dots and slashes replaced with dashes + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get malware entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMalwareEntitiesParams) WithDefaults() *GetMalwareEntitiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get malware entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMalwareEntitiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get malware entities params +func (o *GetMalwareEntitiesParams) WithTimeout(timeout time.Duration) *GetMalwareEntitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get malware entities params +func (o *GetMalwareEntitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get malware entities params +func (o *GetMalwareEntitiesParams) WithContext(ctx context.Context) *GetMalwareEntitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get malware entities params +func (o *GetMalwareEntitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get malware entities params +func (o *GetMalwareEntitiesParams) WithHTTPClient(client *http.Client) *GetMalwareEntitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get malware entities params +func (o *GetMalwareEntitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the get malware entities params +func (o *GetMalwareEntitiesParams) WithIds(ids []string) *GetMalwareEntitiesParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the get malware entities params +func (o *GetMalwareEntitiesParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMalwareEntitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Ids != nil { + + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetMalwareEntities binds the parameter ids +func (o *GetMalwareEntitiesParams) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []string + + idsIIV := idsIIR // string as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "multi" + idsIS := swag.JoinByFormat(idsIC, "multi") + + return idsIS +} diff --git a/falcon/client/intel/get_malware_entities_responses.go b/falcon/client/intel/get_malware_entities_responses.go new file mode 100644 index 00000000..b149a243 --- /dev/null +++ b/falcon/client/intel/get_malware_entities_responses.go @@ -0,0 +1,394 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package intel + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// GetMalwareEntitiesReader is a Reader for the GetMalwareEntities structure. +type GetMalwareEntitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMalwareEntitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMalwareEntitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewGetMalwareEntitiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetMalwareEntitiesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /intel/entities/malware/v1] GetMalwareEntities", response, response.Code()) + } +} + +// NewGetMalwareEntitiesOK creates a GetMalwareEntitiesOK with default headers values +func NewGetMalwareEntitiesOK() *GetMalwareEntitiesOK { + return &GetMalwareEntitiesOK{} +} + +/* +GetMalwareEntitiesOK describes a response with status code 200, with default header values. + +OK +*/ +type GetMalwareEntitiesOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainMalwareResponse +} + +// IsSuccess returns true when this get malware entities o k response has a 2xx status code +func (o *GetMalwareEntitiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get malware entities o k response has a 3xx status code +func (o *GetMalwareEntitiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get malware entities o k response has a 4xx status code +func (o *GetMalwareEntitiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get malware entities o k response has a 5xx status code +func (o *GetMalwareEntitiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get malware entities o k response a status code equal to that given +func (o *GetMalwareEntitiesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get malware entities o k response +func (o *GetMalwareEntitiesOK) Code() int { + return 200 +} + +func (o *GetMalwareEntitiesOK) Error() string { + return fmt.Sprintf("[GET /intel/entities/malware/v1][%d] getMalwareEntitiesOK %+v", 200, o.Payload) +} + +func (o *GetMalwareEntitiesOK) String() string { + return fmt.Sprintf("[GET /intel/entities/malware/v1][%d] getMalwareEntitiesOK %+v", 200, o.Payload) +} + +func (o *GetMalwareEntitiesOK) GetPayload() *models.DomainMalwareResponse { + return o.Payload +} + +func (o *GetMalwareEntitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainMalwareResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMalwareEntitiesForbidden creates a GetMalwareEntitiesForbidden with default headers values +func NewGetMalwareEntitiesForbidden() *GetMalwareEntitiesForbidden { + return &GetMalwareEntitiesForbidden{} +} + +/* +GetMalwareEntitiesForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetMalwareEntitiesForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get malware entities forbidden response has a 2xx status code +func (o *GetMalwareEntitiesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get malware entities forbidden response has a 3xx status code +func (o *GetMalwareEntitiesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get malware entities forbidden response has a 4xx status code +func (o *GetMalwareEntitiesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get malware entities forbidden response has a 5xx status code +func (o *GetMalwareEntitiesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get malware entities forbidden response a status code equal to that given +func (o *GetMalwareEntitiesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get malware entities forbidden response +func (o *GetMalwareEntitiesForbidden) Code() int { + return 403 +} + +func (o *GetMalwareEntitiesForbidden) Error() string { + return fmt.Sprintf("[GET /intel/entities/malware/v1][%d] getMalwareEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *GetMalwareEntitiesForbidden) String() string { + return fmt.Sprintf("[GET /intel/entities/malware/v1][%d] getMalwareEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *GetMalwareEntitiesForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetMalwareEntitiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMalwareEntitiesTooManyRequests creates a GetMalwareEntitiesTooManyRequests with default headers values +func NewGetMalwareEntitiesTooManyRequests() *GetMalwareEntitiesTooManyRequests { + return &GetMalwareEntitiesTooManyRequests{} +} + +/* +GetMalwareEntitiesTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetMalwareEntitiesTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get malware entities too many requests response has a 2xx status code +func (o *GetMalwareEntitiesTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get malware entities too many requests response has a 3xx status code +func (o *GetMalwareEntitiesTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get malware entities too many requests response has a 4xx status code +func (o *GetMalwareEntitiesTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get malware entities too many requests response has a 5xx status code +func (o *GetMalwareEntitiesTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get malware entities too many requests response a status code equal to that given +func (o *GetMalwareEntitiesTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get malware entities too many requests response +func (o *GetMalwareEntitiesTooManyRequests) Code() int { + return 429 +} + +func (o *GetMalwareEntitiesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /intel/entities/malware/v1][%d] getMalwareEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetMalwareEntitiesTooManyRequests) String() string { + return fmt.Sprintf("[GET /intel/entities/malware/v1][%d] getMalwareEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *GetMalwareEntitiesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetMalwareEntitiesTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/intel/intel_client.go b/falcon/client/intel/intel_client.go index 70e8e29c..706f5741 100644 --- a/falcon/client/intel/intel_client.go +++ b/falcon/client/intel/intel_client.go @@ -45,6 +45,8 @@ type ClientService interface { GetLatestIntelRuleFile(params *GetLatestIntelRuleFileParams, writer io.Writer, opts ...ClientOption) (*GetLatestIntelRuleFileOK, error) + GetMalwareEntities(params *GetMalwareEntitiesParams, opts ...ClientOption) (*GetMalwareEntitiesOK, error) + GetMitreReport(params *GetMitreReportParams, opts ...ClientOption) (*GetMitreReportOK, error) GetVulnerabilities(params *GetVulnerabilitiesParams, opts ...ClientOption) (*GetVulnerabilitiesOK, error) @@ -65,8 +67,12 @@ type ClientService interface { QueryIntelRuleIds(params *QueryIntelRuleIdsParams, opts ...ClientOption) (*QueryIntelRuleIdsOK, error) + QueryMalware(params *QueryMalwareParams, opts ...ClientOption) (*QueryMalwareOK, error) + QueryMitreAttacks(params *QueryMitreAttacksParams, opts ...ClientOption) (*QueryMitreAttacksOK, error) + QueryMitreAttacksForMalware(params *QueryMitreAttacksForMalwareParams, opts ...ClientOption) (*QueryMitreAttacksForMalwareOK, error) + QueryVulnerabilities(params *QueryVulnerabilitiesParams, opts ...ClientOption) (*QueryVulnerabilitiesOK, error) SetTransport(transport runtime.ClientTransport) @@ -338,6 +344,44 @@ func (a *Client) GetLatestIntelRuleFile(params *GetLatestIntelRuleFileParams, wr panic(msg) } +/* +GetMalwareEntities gets malware entities for specified ids +*/ +func (a *Client) GetMalwareEntities(params *GetMalwareEntitiesParams, opts ...ClientOption) (*GetMalwareEntitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMalwareEntitiesParams() + } + op := &runtime.ClientOperation{ + ID: "GetMalwareEntities", + Method: "GET", + PathPattern: "/intel/entities/malware/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetMalwareEntitiesReader{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.(*GetMalwareEntitiesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetMalwareEntities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetMitreReport exports mitre a t t and c k information for a given actor */ @@ -718,6 +762,44 @@ func (a *Client) QueryIntelRuleIds(params *QueryIntelRuleIdsParams, opts ...Clie panic(msg) } +/* +QueryMalware gets malware family names that match provided f q l filters +*/ +func (a *Client) QueryMalware(params *QueryMalwareParams, opts ...ClientOption) (*QueryMalwareOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewQueryMalwareParams() + } + op := &runtime.ClientOperation{ + ID: "QueryMalware", + Method: "GET", + PathPattern: "/intel/queries/malware/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &QueryMalwareReader{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.(*QueryMalwareOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for QueryMalware: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* QueryMitreAttacks gets m i t r e tactics and techniques for the given actor returning concatenation of id and tactic and technique ids example fancy bear t a0011 t1071 */ @@ -756,6 +838,44 @@ func (a *Client) QueryMitreAttacks(params *QueryMitreAttacksParams, opts ...Clie panic(msg) } +/* +QueryMitreAttacksForMalware gets m i t r e tactics and techniques for the given malware +*/ +func (a *Client) QueryMitreAttacksForMalware(params *QueryMitreAttacksForMalwareParams, opts ...ClientOption) (*QueryMitreAttacksForMalwareOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewQueryMitreAttacksForMalwareParams() + } + op := &runtime.ClientOperation{ + ID: "QueryMitreAttacksForMalware", + Method: "GET", + PathPattern: "/intel/queries/mitre-malware/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &QueryMitreAttacksForMalwareReader{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.(*QueryMitreAttacksForMalwareOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for QueryMitreAttacksForMalware: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* QueryVulnerabilities gets vulnerabilities i ds */ diff --git a/falcon/client/intel/query_intel_rule_ids_parameters.go b/falcon/client/intel/query_intel_rule_ids_parameters.go index 326f6a6c..cec55492 100644 --- a/falcon/client/intel/query_intel_rule_ids_parameters.go +++ b/falcon/client/intel/query_intel_rule_ids_parameters.go @@ -137,6 +137,12 @@ type QueryIntelRuleIdsParams struct { common-event-format netwitness + + cql-master + + cql-update + + cql-changelog */ Type string diff --git a/falcon/client/intel/query_malware_parameters.go b/falcon/client/intel/query_malware_parameters.go new file mode 100644 index 00000000..2197b059 --- /dev/null +++ b/falcon/client/intel/query_malware_parameters.go @@ -0,0 +1,302 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package intel + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewQueryMalwareParams creates a new QueryMalwareParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewQueryMalwareParams() *QueryMalwareParams { + return &QueryMalwareParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewQueryMalwareParamsWithTimeout creates a new QueryMalwareParams object +// with the ability to set a timeout on a request. +func NewQueryMalwareParamsWithTimeout(timeout time.Duration) *QueryMalwareParams { + return &QueryMalwareParams{ + timeout: timeout, + } +} + +// NewQueryMalwareParamsWithContext creates a new QueryMalwareParams object +// with the ability to set a context for a request. +func NewQueryMalwareParamsWithContext(ctx context.Context) *QueryMalwareParams { + return &QueryMalwareParams{ + Context: ctx, + } +} + +// NewQueryMalwareParamsWithHTTPClient creates a new QueryMalwareParams object +// with the ability to set a custom HTTPClient for a request. +func NewQueryMalwareParamsWithHTTPClient(client *http.Client) *QueryMalwareParams { + return &QueryMalwareParams{ + HTTPClient: client, + } +} + +/* +QueryMalwareParams contains all the parameters to send to the API endpoint + + for the query malware operation. + + Typically these are written to a http.Request. +*/ +type QueryMalwareParams struct { + + /* Filter. + + Filter your query by specifying FQL filter parameters. + */ + Filter *string + + /* Limit. + + Set the number of malware IDs to return. The value must be between 1 and 5000. + */ + Limit *int64 + + /* Offset. + + Set the starting row number to return malware IDs from. Defaults to 0. + */ + Offset *int64 + + /* Q. + + Perform a generic substring search across all fields. + */ + Q *string + + /* Sort. + + Order fields in ascending or descending order. + + Ex: created_date|asc. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the query malware params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryMalwareParams) WithDefaults() *QueryMalwareParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the query malware params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryMalwareParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the query malware params +func (o *QueryMalwareParams) WithTimeout(timeout time.Duration) *QueryMalwareParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the query malware params +func (o *QueryMalwareParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the query malware params +func (o *QueryMalwareParams) WithContext(ctx context.Context) *QueryMalwareParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the query malware params +func (o *QueryMalwareParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the query malware params +func (o *QueryMalwareParams) WithHTTPClient(client *http.Client) *QueryMalwareParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the query malware params +func (o *QueryMalwareParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the query malware params +func (o *QueryMalwareParams) WithFilter(filter *string) *QueryMalwareParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the query malware params +func (o *QueryMalwareParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the query malware params +func (o *QueryMalwareParams) WithLimit(limit *int64) *QueryMalwareParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the query malware params +func (o *QueryMalwareParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the query malware params +func (o *QueryMalwareParams) WithOffset(offset *int64) *QueryMalwareParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the query malware params +func (o *QueryMalwareParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the query malware params +func (o *QueryMalwareParams) WithQ(q *string) *QueryMalwareParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the query malware params +func (o *QueryMalwareParams) SetQ(q *string) { + o.Q = q +} + +// WithSort adds the sort to the query malware params +func (o *QueryMalwareParams) WithSort(sort *string) *QueryMalwareParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the query malware params +func (o *QueryMalwareParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *QueryMalwareParams) 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.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/intel/query_malware_responses.go b/falcon/client/intel/query_malware_responses.go new file mode 100644 index 00000000..9629f310 --- /dev/null +++ b/falcon/client/intel/query_malware_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package intel + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// QueryMalwareReader is a Reader for the QueryMalware structure. +type QueryMalwareReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *QueryMalwareReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewQueryMalwareOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewQueryMalwareBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewQueryMalwareForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewQueryMalwareTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewQueryMalwareInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /intel/queries/malware/v1] QueryMalware", response, response.Code()) + } +} + +// NewQueryMalwareOK creates a QueryMalwareOK with default headers values +func NewQueryMalwareOK() *QueryMalwareOK { + return &QueryMalwareOK{} +} + +/* +QueryMalwareOK describes a response with status code 200, with default header values. + +OK +*/ +type QueryMalwareOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainQueryResponse +} + +// IsSuccess returns true when this query malware o k response has a 2xx status code +func (o *QueryMalwareOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this query malware o k response has a 3xx status code +func (o *QueryMalwareOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query malware o k response has a 4xx status code +func (o *QueryMalwareOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this query malware o k response has a 5xx status code +func (o *QueryMalwareOK) IsServerError() bool { + return false +} + +// IsCode returns true when this query malware o k response a status code equal to that given +func (o *QueryMalwareOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the query malware o k response +func (o *QueryMalwareOK) Code() int { + return 200 +} + +func (o *QueryMalwareOK) Error() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareOK %+v", 200, o.Payload) +} + +func (o *QueryMalwareOK) String() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareOK %+v", 200, o.Payload) +} + +func (o *QueryMalwareOK) GetPayload() *models.DomainQueryResponse { + return o.Payload +} + +func (o *QueryMalwareOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryMalwareBadRequest creates a QueryMalwareBadRequest with default headers values +func NewQueryMalwareBadRequest() *QueryMalwareBadRequest { + return &QueryMalwareBadRequest{} +} + +/* +QueryMalwareBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type QueryMalwareBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this query malware bad request response has a 2xx status code +func (o *QueryMalwareBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query malware bad request response has a 3xx status code +func (o *QueryMalwareBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query malware bad request response has a 4xx status code +func (o *QueryMalwareBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this query malware bad request response has a 5xx status code +func (o *QueryMalwareBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this query malware bad request response a status code equal to that given +func (o *QueryMalwareBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the query malware bad request response +func (o *QueryMalwareBadRequest) Code() int { + return 400 +} + +func (o *QueryMalwareBadRequest) Error() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareBadRequest %+v", 400, o.Payload) +} + +func (o *QueryMalwareBadRequest) String() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareBadRequest %+v", 400, o.Payload) +} + +func (o *QueryMalwareBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *QueryMalwareBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryMalwareForbidden creates a QueryMalwareForbidden with default headers values +func NewQueryMalwareForbidden() *QueryMalwareForbidden { + return &QueryMalwareForbidden{} +} + +/* +QueryMalwareForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type QueryMalwareForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query malware forbidden response has a 2xx status code +func (o *QueryMalwareForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query malware forbidden response has a 3xx status code +func (o *QueryMalwareForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query malware forbidden response has a 4xx status code +func (o *QueryMalwareForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this query malware forbidden response has a 5xx status code +func (o *QueryMalwareForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this query malware forbidden response a status code equal to that given +func (o *QueryMalwareForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the query malware forbidden response +func (o *QueryMalwareForbidden) Code() int { + return 403 +} + +func (o *QueryMalwareForbidden) Error() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareForbidden %+v", 403, o.Payload) +} + +func (o *QueryMalwareForbidden) String() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareForbidden %+v", 403, o.Payload) +} + +func (o *QueryMalwareForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryMalwareForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryMalwareTooManyRequests creates a QueryMalwareTooManyRequests with default headers values +func NewQueryMalwareTooManyRequests() *QueryMalwareTooManyRequests { + return &QueryMalwareTooManyRequests{} +} + +/* +QueryMalwareTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type QueryMalwareTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query malware too many requests response has a 2xx status code +func (o *QueryMalwareTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query malware too many requests response has a 3xx status code +func (o *QueryMalwareTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query malware too many requests response has a 4xx status code +func (o *QueryMalwareTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this query malware too many requests response has a 5xx status code +func (o *QueryMalwareTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this query malware too many requests response a status code equal to that given +func (o *QueryMalwareTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the query malware too many requests response +func (o *QueryMalwareTooManyRequests) Code() int { + return 429 +} + +func (o *QueryMalwareTooManyRequests) Error() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareTooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryMalwareTooManyRequests) String() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareTooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryMalwareTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryMalwareTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryMalwareInternalServerError creates a QueryMalwareInternalServerError with default headers values +func NewQueryMalwareInternalServerError() *QueryMalwareInternalServerError { + return &QueryMalwareInternalServerError{} +} + +/* +QueryMalwareInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type QueryMalwareInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecResponseFields +} + +// IsSuccess returns true when this query malware internal server error response has a 2xx status code +func (o *QueryMalwareInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query malware internal server error response has a 3xx status code +func (o *QueryMalwareInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query malware internal server error response has a 4xx status code +func (o *QueryMalwareInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this query malware internal server error response has a 5xx status code +func (o *QueryMalwareInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this query malware internal server error response a status code equal to that given +func (o *QueryMalwareInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the query malware internal server error response +func (o *QueryMalwareInternalServerError) Code() int { + return 500 +} + +func (o *QueryMalwareInternalServerError) Error() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareInternalServerError %+v", 500, o.Payload) +} + +func (o *QueryMalwareInternalServerError) String() string { + return fmt.Sprintf("[GET /intel/queries/malware/v1][%d] queryMalwareInternalServerError %+v", 500, o.Payload) +} + +func (o *QueryMalwareInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *QueryMalwareInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/intel/query_mitre_attacks_for_malware_parameters.go b/falcon/client/intel/query_mitre_attacks_for_malware_parameters.go new file mode 100644 index 00000000..38751bff --- /dev/null +++ b/falcon/client/intel/query_mitre_attacks_for_malware_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package intel + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewQueryMitreAttacksForMalwareParams creates a new QueryMitreAttacksForMalwareParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewQueryMitreAttacksForMalwareParams() *QueryMitreAttacksForMalwareParams { + return &QueryMitreAttacksForMalwareParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewQueryMitreAttacksForMalwareParamsWithTimeout creates a new QueryMitreAttacksForMalwareParams object +// with the ability to set a timeout on a request. +func NewQueryMitreAttacksForMalwareParamsWithTimeout(timeout time.Duration) *QueryMitreAttacksForMalwareParams { + return &QueryMitreAttacksForMalwareParams{ + timeout: timeout, + } +} + +// NewQueryMitreAttacksForMalwareParamsWithContext creates a new QueryMitreAttacksForMalwareParams object +// with the ability to set a context for a request. +func NewQueryMitreAttacksForMalwareParamsWithContext(ctx context.Context) *QueryMitreAttacksForMalwareParams { + return &QueryMitreAttacksForMalwareParams{ + Context: ctx, + } +} + +// NewQueryMitreAttacksForMalwareParamsWithHTTPClient creates a new QueryMitreAttacksForMalwareParams object +// with the ability to set a custom HTTPClient for a request. +func NewQueryMitreAttacksForMalwareParamsWithHTTPClient(client *http.Client) *QueryMitreAttacksForMalwareParams { + return &QueryMitreAttacksForMalwareParams{ + HTTPClient: client, + } +} + +/* +QueryMitreAttacksForMalwareParams contains all the parameters to send to the API endpoint + + for the query mitre attacks for malware operation. + + Typically these are written to a http.Request. +*/ +type QueryMitreAttacksForMalwareParams struct { + + /* Ids. + + Malware family name in lower case with spaces replaced with dashes + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the query mitre attacks for malware params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryMitreAttacksForMalwareParams) WithDefaults() *QueryMitreAttacksForMalwareParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the query mitre attacks for malware params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryMitreAttacksForMalwareParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) WithTimeout(timeout time.Duration) *QueryMitreAttacksForMalwareParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) WithContext(ctx context.Context) *QueryMitreAttacksForMalwareParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) WithHTTPClient(client *http.Client) *QueryMitreAttacksForMalwareParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) WithIds(ids []string) *QueryMitreAttacksForMalwareParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the query mitre attacks for malware params +func (o *QueryMitreAttacksForMalwareParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *QueryMitreAttacksForMalwareParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Ids != nil { + + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamQueryMitreAttacksForMalware binds the parameter ids +func (o *QueryMitreAttacksForMalwareParams) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []string + + idsIIV := idsIIR // string as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "multi" + idsIS := swag.JoinByFormat(idsIC, "multi") + + return idsIS +} diff --git a/falcon/client/intel/query_mitre_attacks_for_malware_responses.go b/falcon/client/intel/query_mitre_attacks_for_malware_responses.go new file mode 100644 index 00000000..d92fa6e0 --- /dev/null +++ b/falcon/client/intel/query_mitre_attacks_for_malware_responses.go @@ -0,0 +1,394 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package intel + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// QueryMitreAttacksForMalwareReader is a Reader for the QueryMitreAttacksForMalware structure. +type QueryMitreAttacksForMalwareReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *QueryMitreAttacksForMalwareReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewQueryMitreAttacksForMalwareOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewQueryMitreAttacksForMalwareForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewQueryMitreAttacksForMalwareTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /intel/queries/mitre-malware/v1] QueryMitreAttacksForMalware", response, response.Code()) + } +} + +// NewQueryMitreAttacksForMalwareOK creates a QueryMitreAttacksForMalwareOK with default headers values +func NewQueryMitreAttacksForMalwareOK() *QueryMitreAttacksForMalwareOK { + return &QueryMitreAttacksForMalwareOK{} +} + +/* +QueryMitreAttacksForMalwareOK describes a response with status code 200, with default header values. + +OK +*/ +type QueryMitreAttacksForMalwareOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainQueryResponse +} + +// IsSuccess returns true when this query mitre attacks for malware o k response has a 2xx status code +func (o *QueryMitreAttacksForMalwareOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this query mitre attacks for malware o k response has a 3xx status code +func (o *QueryMitreAttacksForMalwareOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query mitre attacks for malware o k response has a 4xx status code +func (o *QueryMitreAttacksForMalwareOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this query mitre attacks for malware o k response has a 5xx status code +func (o *QueryMitreAttacksForMalwareOK) IsServerError() bool { + return false +} + +// IsCode returns true when this query mitre attacks for malware o k response a status code equal to that given +func (o *QueryMitreAttacksForMalwareOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the query mitre attacks for malware o k response +func (o *QueryMitreAttacksForMalwareOK) Code() int { + return 200 +} + +func (o *QueryMitreAttacksForMalwareOK) Error() string { + return fmt.Sprintf("[GET /intel/queries/mitre-malware/v1][%d] queryMitreAttacksForMalwareOK %+v", 200, o.Payload) +} + +func (o *QueryMitreAttacksForMalwareOK) String() string { + return fmt.Sprintf("[GET /intel/queries/mitre-malware/v1][%d] queryMitreAttacksForMalwareOK %+v", 200, o.Payload) +} + +func (o *QueryMitreAttacksForMalwareOK) GetPayload() *models.DomainQueryResponse { + return o.Payload +} + +func (o *QueryMitreAttacksForMalwareOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryMitreAttacksForMalwareForbidden creates a QueryMitreAttacksForMalwareForbidden with default headers values +func NewQueryMitreAttacksForMalwareForbidden() *QueryMitreAttacksForMalwareForbidden { + return &QueryMitreAttacksForMalwareForbidden{} +} + +/* +QueryMitreAttacksForMalwareForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type QueryMitreAttacksForMalwareForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query mitre attacks for malware forbidden response has a 2xx status code +func (o *QueryMitreAttacksForMalwareForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query mitre attacks for malware forbidden response has a 3xx status code +func (o *QueryMitreAttacksForMalwareForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query mitre attacks for malware forbidden response has a 4xx status code +func (o *QueryMitreAttacksForMalwareForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this query mitre attacks for malware forbidden response has a 5xx status code +func (o *QueryMitreAttacksForMalwareForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this query mitre attacks for malware forbidden response a status code equal to that given +func (o *QueryMitreAttacksForMalwareForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the query mitre attacks for malware forbidden response +func (o *QueryMitreAttacksForMalwareForbidden) Code() int { + return 403 +} + +func (o *QueryMitreAttacksForMalwareForbidden) Error() string { + return fmt.Sprintf("[GET /intel/queries/mitre-malware/v1][%d] queryMitreAttacksForMalwareForbidden %+v", 403, o.Payload) +} + +func (o *QueryMitreAttacksForMalwareForbidden) String() string { + return fmt.Sprintf("[GET /intel/queries/mitre-malware/v1][%d] queryMitreAttacksForMalwareForbidden %+v", 403, o.Payload) +} + +func (o *QueryMitreAttacksForMalwareForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryMitreAttacksForMalwareForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryMitreAttacksForMalwareTooManyRequests creates a QueryMitreAttacksForMalwareTooManyRequests with default headers values +func NewQueryMitreAttacksForMalwareTooManyRequests() *QueryMitreAttacksForMalwareTooManyRequests { + return &QueryMitreAttacksForMalwareTooManyRequests{} +} + +/* +QueryMitreAttacksForMalwareTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type QueryMitreAttacksForMalwareTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this query mitre attacks for malware too many requests response has a 2xx status code +func (o *QueryMitreAttacksForMalwareTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query mitre attacks for malware too many requests response has a 3xx status code +func (o *QueryMitreAttacksForMalwareTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query mitre attacks for malware too many requests response has a 4xx status code +func (o *QueryMitreAttacksForMalwareTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this query mitre attacks for malware too many requests response has a 5xx status code +func (o *QueryMitreAttacksForMalwareTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this query mitre attacks for malware too many requests response a status code equal to that given +func (o *QueryMitreAttacksForMalwareTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the query mitre attacks for malware too many requests response +func (o *QueryMitreAttacksForMalwareTooManyRequests) Code() int { + return 429 +} + +func (o *QueryMitreAttacksForMalwareTooManyRequests) Error() string { + return fmt.Sprintf("[GET /intel/queries/mitre-malware/v1][%d] queryMitreAttacksForMalwareTooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryMitreAttacksForMalwareTooManyRequests) String() string { + return fmt.Sprintf("[GET /intel/queries/mitre-malware/v1][%d] queryMitreAttacksForMalwareTooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryMitreAttacksForMalwareTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryMitreAttacksForMalwareTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/ioa_exclusions/create_i_o_a_exclusions_v1_responses.go b/falcon/client/ioa_exclusions/create_i_o_a_exclusions_v1_responses.go index 8d4454be..887bc895 100644 --- a/falcon/client/ioa_exclusions/create_i_o_a_exclusions_v1_responses.go +++ b/falcon/client/ioa_exclusions/create_i_o_a_exclusions_v1_responses.go @@ -25,8 +25,8 @@ type CreateIOAExclusionsV1Reader struct { // ReadResponse reads a server response into the received o. func (o *CreateIOAExclusionsV1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: - result := NewCreateIOAExclusionsV1OK() + case 201: + result := NewCreateIOAExclusionsV1Created() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -60,17 +60,17 @@ func (o *CreateIOAExclusionsV1Reader) ReadResponse(response runtime.ClientRespon } } -// NewCreateIOAExclusionsV1OK creates a CreateIOAExclusionsV1OK with default headers values -func NewCreateIOAExclusionsV1OK() *CreateIOAExclusionsV1OK { - return &CreateIOAExclusionsV1OK{} +// NewCreateIOAExclusionsV1Created creates a CreateIOAExclusionsV1Created with default headers values +func NewCreateIOAExclusionsV1Created() *CreateIOAExclusionsV1Created { + return &CreateIOAExclusionsV1Created{} } /* -CreateIOAExclusionsV1OK describes a response with status code 200, with default header values. +CreateIOAExclusionsV1Created describes a response with status code 201, with default header values. OK */ -type CreateIOAExclusionsV1OK struct { +type CreateIOAExclusionsV1Created struct { /* Trace-ID: submit to support if resolving an issue */ @@ -87,49 +87,49 @@ type CreateIOAExclusionsV1OK struct { Payload *models.IoaExclusionsIoaExclusionsRespV1 } -// IsSuccess returns true when this create i o a exclusions v1 o k response has a 2xx status code -func (o *CreateIOAExclusionsV1OK) IsSuccess() bool { +// IsSuccess returns true when this create i o a exclusions v1 created response has a 2xx status code +func (o *CreateIOAExclusionsV1Created) IsSuccess() bool { return true } -// IsRedirect returns true when this create i o a exclusions v1 o k response has a 3xx status code -func (o *CreateIOAExclusionsV1OK) IsRedirect() bool { +// IsRedirect returns true when this create i o a exclusions v1 created response has a 3xx status code +func (o *CreateIOAExclusionsV1Created) IsRedirect() bool { return false } -// IsClientError returns true when this create i o a exclusions v1 o k response has a 4xx status code -func (o *CreateIOAExclusionsV1OK) IsClientError() bool { +// IsClientError returns true when this create i o a exclusions v1 created response has a 4xx status code +func (o *CreateIOAExclusionsV1Created) IsClientError() bool { return false } -// IsServerError returns true when this create i o a exclusions v1 o k response has a 5xx status code -func (o *CreateIOAExclusionsV1OK) IsServerError() bool { +// IsServerError returns true when this create i o a exclusions v1 created response has a 5xx status code +func (o *CreateIOAExclusionsV1Created) IsServerError() bool { return false } -// IsCode returns true when this create i o a exclusions v1 o k response a status code equal to that given -func (o *CreateIOAExclusionsV1OK) IsCode(code int) bool { - return code == 200 +// IsCode returns true when this create i o a exclusions v1 created response a status code equal to that given +func (o *CreateIOAExclusionsV1Created) IsCode(code int) bool { + return code == 201 } -// Code gets the status code for the create i o a exclusions v1 o k response -func (o *CreateIOAExclusionsV1OK) Code() int { - return 200 +// Code gets the status code for the create i o a exclusions v1 created response +func (o *CreateIOAExclusionsV1Created) Code() int { + return 201 } -func (o *CreateIOAExclusionsV1OK) Error() string { - return fmt.Sprintf("[POST /policy/entities/ioa-exclusions/v1][%d] createIOAExclusionsV1OK %+v", 200, o.Payload) +func (o *CreateIOAExclusionsV1Created) Error() string { + return fmt.Sprintf("[POST /policy/entities/ioa-exclusions/v1][%d] createIOAExclusionsV1Created %+v", 201, o.Payload) } -func (o *CreateIOAExclusionsV1OK) String() string { - return fmt.Sprintf("[POST /policy/entities/ioa-exclusions/v1][%d] createIOAExclusionsV1OK %+v", 200, o.Payload) +func (o *CreateIOAExclusionsV1Created) String() string { + return fmt.Sprintf("[POST /policy/entities/ioa-exclusions/v1][%d] createIOAExclusionsV1Created %+v", 201, o.Payload) } -func (o *CreateIOAExclusionsV1OK) GetPayload() *models.IoaExclusionsIoaExclusionsRespV1 { +func (o *CreateIOAExclusionsV1Created) GetPayload() *models.IoaExclusionsIoaExclusionsRespV1 { return o.Payload } -func (o *CreateIOAExclusionsV1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *CreateIOAExclusionsV1Created) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") diff --git a/falcon/client/ioa_exclusions/ioa_exclusions_client.go b/falcon/client/ioa_exclusions/ioa_exclusions_client.go index 018a3ac2..80ec1ac8 100644 --- a/falcon/client/ioa_exclusions/ioa_exclusions_client.go +++ b/falcon/client/ioa_exclusions/ioa_exclusions_client.go @@ -30,7 +30,7 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - CreateIOAExclusionsV1(params *CreateIOAExclusionsV1Params, opts ...ClientOption) (*CreateIOAExclusionsV1OK, error) + CreateIOAExclusionsV1(params *CreateIOAExclusionsV1Params, opts ...ClientOption) (*CreateIOAExclusionsV1Created, error) DeleteIOAExclusionsV1(params *DeleteIOAExclusionsV1Params, opts ...ClientOption) (*DeleteIOAExclusionsV1OK, error) @@ -46,7 +46,7 @@ type ClientService interface { /* CreateIOAExclusionsV1 creates the i o a exclusions */ -func (a *Client) CreateIOAExclusionsV1(params *CreateIOAExclusionsV1Params, opts ...ClientOption) (*CreateIOAExclusionsV1OK, error) { +func (a *Client) CreateIOAExclusionsV1(params *CreateIOAExclusionsV1Params, opts ...ClientOption) (*CreateIOAExclusionsV1Created, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateIOAExclusionsV1Params() @@ -71,7 +71,7 @@ func (a *Client) CreateIOAExclusionsV1(params *CreateIOAExclusionsV1Params, opts if err != nil { return nil, err } - success, ok := result.(*CreateIOAExclusionsV1OK) + success, ok := result.(*CreateIOAExclusionsV1Created) if ok { return success, nil } diff --git a/falcon/client/kubernetes_protection/cluster_combined_parameters.go b/falcon/client/kubernetes_protection/cluster_combined_parameters.go index 46dc9e1c..4ef2c391 100644 --- a/falcon/client/kubernetes_protection/cluster_combined_parameters.go +++ b/falcon/client/kubernetes_protection/cluster_combined_parameters.go @@ -64,7 +64,7 @@ type ClusterCombinedParams struct { /* Filter. - Search Kubernetes clusters using a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,kubernetes_version,last_seen,management_status,node_count,pod_count,tags + Search Kubernetes clusters using a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,iar_coverage,kubernetes_version,last_seen,management_status,node_count,pod_count,tags */ Filter *string diff --git a/falcon/client/kubernetes_protection/cluster_count_parameters.go b/falcon/client/kubernetes_protection/cluster_count_parameters.go index 804c4237..d7c0d009 100644 --- a/falcon/client/kubernetes_protection/cluster_count_parameters.go +++ b/falcon/client/kubernetes_protection/cluster_count_parameters.go @@ -63,7 +63,7 @@ type ClusterCountParams struct { /* Filter. - Retrieve count of Kubernetes clusters that match a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,kubernetes_version,last_seen,management_status,node_count,pod_count,tags + Retrieve count of Kubernetes clusters that match a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,iar_coverage,kubernetes_version,last_seen,management_status,node_count,pod_count,tags */ Filter *string diff --git a/falcon/client/kubernetes_protection/clusters_by_kubernetes_version_count_parameters.go b/falcon/client/kubernetes_protection/clusters_by_kubernetes_version_count_parameters.go index a1038d24..dcacdccf 100644 --- a/falcon/client/kubernetes_protection/clusters_by_kubernetes_version_count_parameters.go +++ b/falcon/client/kubernetes_protection/clusters_by_kubernetes_version_count_parameters.go @@ -63,7 +63,7 @@ type ClustersByKubernetesVersionCountParams struct { /* Filter. - Retrieve count of Kubernetes clusters that match a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,kubernetes_version,last_seen,management_status,node_count,pod_count,tags + Retrieve count of Kubernetes clusters that match a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,iar_coverage,kubernetes_version,last_seen,management_status,node_count,pod_count,tags */ Filter *string diff --git a/falcon/client/kubernetes_protection/clusters_by_status_count_parameters.go b/falcon/client/kubernetes_protection/clusters_by_status_count_parameters.go index e2091903..49407339 100644 --- a/falcon/client/kubernetes_protection/clusters_by_status_count_parameters.go +++ b/falcon/client/kubernetes_protection/clusters_by_status_count_parameters.go @@ -63,7 +63,7 @@ type ClustersByStatusCountParams struct { /* Filter. - Retrieve count of Kubernetes clusters that match a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,kubernetes_version,last_seen,management_status,node_count,pod_count,tags + Retrieve count of Kubernetes clusters that match a query in Falcon Query Language (FQL). Supported filters: access,agent_status,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,cluster_status,container_count,iar_coverage,kubernetes_version,last_seen,management_status,node_count,pod_count,tags */ Filter *string diff --git a/falcon/client/kubernetes_protection/container_enrichment_responses.go b/falcon/client/kubernetes_protection/container_enrichment_responses.go deleted file mode 100644 index 27b7300f..00000000 --- a/falcon/client/kubernetes_protection/container_enrichment_responses.go +++ /dev/null @@ -1,510 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes_protection - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/crowdstrike/gofalcon/falcon/models" -) - -// ContainerEnrichmentReader is a Reader for the ContainerEnrichment structure. -type ContainerEnrichmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ContainerEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewContainerEnrichmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewContainerEnrichmentForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewContainerEnrichmentTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewContainerEnrichmentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /container-security/aggregates/enrichment/containers/entities/v1] ContainerEnrichment", response, response.Code()) - } -} - -// NewContainerEnrichmentOK creates a ContainerEnrichmentOK with default headers values -func NewContainerEnrichmentOK() *ContainerEnrichmentOK { - return &ContainerEnrichmentOK{} -} - -/* -ContainerEnrichmentOK describes a response with status code 200, with default header values. - -OK -*/ -type ContainerEnrichmentOK struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.K8sassetsContainerEnrichmentResponse -} - -// IsSuccess returns true when this container enrichment o k response has a 2xx status code -func (o *ContainerEnrichmentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this container enrichment o k response has a 3xx status code -func (o *ContainerEnrichmentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this container enrichment o k response has a 4xx status code -func (o *ContainerEnrichmentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this container enrichment o k response has a 5xx status code -func (o *ContainerEnrichmentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this container enrichment o k response a status code equal to that given -func (o *ContainerEnrichmentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the container enrichment o k response -func (o *ContainerEnrichmentOK) Code() int { - return 200 -} - -func (o *ContainerEnrichmentOK) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentOK %+v", 200, o.Payload) -} - -func (o *ContainerEnrichmentOK) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentOK %+v", 200, o.Payload) -} - -func (o *ContainerEnrichmentOK) GetPayload() *models.K8sassetsContainerEnrichmentResponse { - return o.Payload -} - -func (o *ContainerEnrichmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.K8sassetsContainerEnrichmentResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewContainerEnrichmentForbidden creates a ContainerEnrichmentForbidden with default headers values -func NewContainerEnrichmentForbidden() *ContainerEnrichmentForbidden { - return &ContainerEnrichmentForbidden{} -} - -/* -ContainerEnrichmentForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ContainerEnrichmentForbidden struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this container enrichment forbidden response has a 2xx status code -func (o *ContainerEnrichmentForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this container enrichment forbidden response has a 3xx status code -func (o *ContainerEnrichmentForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this container enrichment forbidden response has a 4xx status code -func (o *ContainerEnrichmentForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this container enrichment forbidden response has a 5xx status code -func (o *ContainerEnrichmentForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this container enrichment forbidden response a status code equal to that given -func (o *ContainerEnrichmentForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the container enrichment forbidden response -func (o *ContainerEnrichmentForbidden) Code() int { - return 403 -} - -func (o *ContainerEnrichmentForbidden) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentForbidden %+v", 403, o.Payload) -} - -func (o *ContainerEnrichmentForbidden) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentForbidden %+v", 403, o.Payload) -} - -func (o *ContainerEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *ContainerEnrichmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewContainerEnrichmentTooManyRequests creates a ContainerEnrichmentTooManyRequests with default headers values -func NewContainerEnrichmentTooManyRequests() *ContainerEnrichmentTooManyRequests { - return &ContainerEnrichmentTooManyRequests{} -} - -/* -ContainerEnrichmentTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type ContainerEnrichmentTooManyRequests struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - /* Too many requests, retry after this time (as milliseconds since epoch) - */ - XRateLimitRetryAfter int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this container enrichment too many requests response has a 2xx status code -func (o *ContainerEnrichmentTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this container enrichment too many requests response has a 3xx status code -func (o *ContainerEnrichmentTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this container enrichment too many requests response has a 4xx status code -func (o *ContainerEnrichmentTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this container enrichment too many requests response has a 5xx status code -func (o *ContainerEnrichmentTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this container enrichment too many requests response a status code equal to that given -func (o *ContainerEnrichmentTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the container enrichment too many requests response -func (o *ContainerEnrichmentTooManyRequests) Code() int { - return 429 -} - -func (o *ContainerEnrichmentTooManyRequests) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentTooManyRequests %+v", 429, o.Payload) -} - -func (o *ContainerEnrichmentTooManyRequests) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentTooManyRequests %+v", 429, o.Payload) -} - -func (o *ContainerEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *ContainerEnrichmentTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - // hydrates response header X-RateLimit-RetryAfter - hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") - - if hdrXRateLimitRetryAfter != "" { - valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) - if err != nil { - return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) - } - o.XRateLimitRetryAfter = valxRateLimitRetryAfter - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewContainerEnrichmentInternalServerError creates a ContainerEnrichmentInternalServerError with default headers values -func NewContainerEnrichmentInternalServerError() *ContainerEnrichmentInternalServerError { - return &ContainerEnrichmentInternalServerError{} -} - -/* -ContainerEnrichmentInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ContainerEnrichmentInternalServerError struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.CoreEntitiesResponse -} - -// IsSuccess returns true when this container enrichment internal server error response has a 2xx status code -func (o *ContainerEnrichmentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this container enrichment internal server error response has a 3xx status code -func (o *ContainerEnrichmentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this container enrichment internal server error response has a 4xx status code -func (o *ContainerEnrichmentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this container enrichment internal server error response has a 5xx status code -func (o *ContainerEnrichmentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this container enrichment internal server error response a status code equal to that given -func (o *ContainerEnrichmentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the container enrichment internal server error response -func (o *ContainerEnrichmentInternalServerError) Code() int { - return 500 -} - -func (o *ContainerEnrichmentInternalServerError) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentInternalServerError %+v", 500, o.Payload) -} - -func (o *ContainerEnrichmentInternalServerError) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] containerEnrichmentInternalServerError %+v", 500, o.Payload) -} - -func (o *ContainerEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { - return o.Payload -} - -func (o *ContainerEnrichmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.CoreEntitiesResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/falcon/client/kubernetes_protection/deployment_enrichment_responses.go b/falcon/client/kubernetes_protection/deployment_enrichment_responses.go deleted file mode 100644 index f435b804..00000000 --- a/falcon/client/kubernetes_protection/deployment_enrichment_responses.go +++ /dev/null @@ -1,510 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes_protection - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/crowdstrike/gofalcon/falcon/models" -) - -// DeploymentEnrichmentReader is a Reader for the DeploymentEnrichment structure. -type DeploymentEnrichmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeploymentEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeploymentEnrichmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewDeploymentEnrichmentForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewDeploymentEnrichmentTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeploymentEnrichmentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /container-security/aggregates/enrichment/deployments/entities/v1] DeploymentEnrichment", response, response.Code()) - } -} - -// NewDeploymentEnrichmentOK creates a DeploymentEnrichmentOK with default headers values -func NewDeploymentEnrichmentOK() *DeploymentEnrichmentOK { - return &DeploymentEnrichmentOK{} -} - -/* -DeploymentEnrichmentOK describes a response with status code 200, with default header values. - -OK -*/ -type DeploymentEnrichmentOK struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.K8sassetsDeploymentEnrichmentResponse -} - -// IsSuccess returns true when this deployment enrichment o k response has a 2xx status code -func (o *DeploymentEnrichmentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this deployment enrichment o k response has a 3xx status code -func (o *DeploymentEnrichmentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deployment enrichment o k response has a 4xx status code -func (o *DeploymentEnrichmentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this deployment enrichment o k response has a 5xx status code -func (o *DeploymentEnrichmentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this deployment enrichment o k response a status code equal to that given -func (o *DeploymentEnrichmentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the deployment enrichment o k response -func (o *DeploymentEnrichmentOK) Code() int { - return 200 -} - -func (o *DeploymentEnrichmentOK) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentOK %+v", 200, o.Payload) -} - -func (o *DeploymentEnrichmentOK) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentOK %+v", 200, o.Payload) -} - -func (o *DeploymentEnrichmentOK) GetPayload() *models.K8sassetsDeploymentEnrichmentResponse { - return o.Payload -} - -func (o *DeploymentEnrichmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.K8sassetsDeploymentEnrichmentResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeploymentEnrichmentForbidden creates a DeploymentEnrichmentForbidden with default headers values -func NewDeploymentEnrichmentForbidden() *DeploymentEnrichmentForbidden { - return &DeploymentEnrichmentForbidden{} -} - -/* -DeploymentEnrichmentForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeploymentEnrichmentForbidden struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this deployment enrichment forbidden response has a 2xx status code -func (o *DeploymentEnrichmentForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deployment enrichment forbidden response has a 3xx status code -func (o *DeploymentEnrichmentForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deployment enrichment forbidden response has a 4xx status code -func (o *DeploymentEnrichmentForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this deployment enrichment forbidden response has a 5xx status code -func (o *DeploymentEnrichmentForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this deployment enrichment forbidden response a status code equal to that given -func (o *DeploymentEnrichmentForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the deployment enrichment forbidden response -func (o *DeploymentEnrichmentForbidden) Code() int { - return 403 -} - -func (o *DeploymentEnrichmentForbidden) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentForbidden %+v", 403, o.Payload) -} - -func (o *DeploymentEnrichmentForbidden) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentForbidden %+v", 403, o.Payload) -} - -func (o *DeploymentEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeploymentEnrichmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeploymentEnrichmentTooManyRequests creates a DeploymentEnrichmentTooManyRequests with default headers values -func NewDeploymentEnrichmentTooManyRequests() *DeploymentEnrichmentTooManyRequests { - return &DeploymentEnrichmentTooManyRequests{} -} - -/* -DeploymentEnrichmentTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type DeploymentEnrichmentTooManyRequests struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - /* Too many requests, retry after this time (as milliseconds since epoch) - */ - XRateLimitRetryAfter int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this deployment enrichment too many requests response has a 2xx status code -func (o *DeploymentEnrichmentTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deployment enrichment too many requests response has a 3xx status code -func (o *DeploymentEnrichmentTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deployment enrichment too many requests response has a 4xx status code -func (o *DeploymentEnrichmentTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this deployment enrichment too many requests response has a 5xx status code -func (o *DeploymentEnrichmentTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this deployment enrichment too many requests response a status code equal to that given -func (o *DeploymentEnrichmentTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the deployment enrichment too many requests response -func (o *DeploymentEnrichmentTooManyRequests) Code() int { - return 429 -} - -func (o *DeploymentEnrichmentTooManyRequests) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeploymentEnrichmentTooManyRequests) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeploymentEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeploymentEnrichmentTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - // hydrates response header X-RateLimit-RetryAfter - hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") - - if hdrXRateLimitRetryAfter != "" { - valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) - if err != nil { - return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) - } - o.XRateLimitRetryAfter = valxRateLimitRetryAfter - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeploymentEnrichmentInternalServerError creates a DeploymentEnrichmentInternalServerError with default headers values -func NewDeploymentEnrichmentInternalServerError() *DeploymentEnrichmentInternalServerError { - return &DeploymentEnrichmentInternalServerError{} -} - -/* -DeploymentEnrichmentInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type DeploymentEnrichmentInternalServerError struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.CoreEntitiesResponse -} - -// IsSuccess returns true when this deployment enrichment internal server error response has a 2xx status code -func (o *DeploymentEnrichmentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deployment enrichment internal server error response has a 3xx status code -func (o *DeploymentEnrichmentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deployment enrichment internal server error response has a 4xx status code -func (o *DeploymentEnrichmentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this deployment enrichment internal server error response has a 5xx status code -func (o *DeploymentEnrichmentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this deployment enrichment internal server error response a status code equal to that given -func (o *DeploymentEnrichmentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the deployment enrichment internal server error response -func (o *DeploymentEnrichmentInternalServerError) Code() int { - return 500 -} - -func (o *DeploymentEnrichmentInternalServerError) Error() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentInternalServerError %+v", 500, o.Payload) -} - -func (o *DeploymentEnrichmentInternalServerError) String() string { - return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] deploymentEnrichmentInternalServerError %+v", 500, o.Payload) -} - -func (o *DeploymentEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { - return o.Payload -} - -func (o *DeploymentEnrichmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.CoreEntitiesResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/falcon/client/kubernetes_protection/kubernetes_iom_by_date_range_parameters.go b/falcon/client/kubernetes_protection/kubernetes_iom_by_date_range_parameters.go index bfbdb85c..97535a11 100644 --- a/falcon/client/kubernetes_protection/kubernetes_iom_by_date_range_parameters.go +++ b/falcon/client/kubernetes_protection/kubernetes_iom_by_date_range_parameters.go @@ -63,7 +63,7 @@ type KubernetesIomByDateRangeParams struct { /* Filter. - Filter images using a query in Falcon Query Language (FQL). Supported filters: cid,created_timestamp,detect_timestamp,severity + Filter images using a query in Falcon Query Language (FQL). Supported filters: cid,created_timestamp,detect_timestamp,prevented,severity */ Filter *string diff --git a/falcon/client/kubernetes_protection/kubernetes_iom_count_parameters.go b/falcon/client/kubernetes_protection/kubernetes_iom_count_parameters.go index 8c0759f3..b593ffb1 100644 --- a/falcon/client/kubernetes_protection/kubernetes_iom_count_parameters.go +++ b/falcon/client/kubernetes_protection/kubernetes_iom_count_parameters.go @@ -63,7 +63,7 @@ type KubernetesIomCountParams struct { /* Filter. - Filter images using a query in Falcon Query Language (FQL). Supported filters: cid,created_timestamp,detect_timestamp,severity + Filter images using a query in Falcon Query Language (FQL). Supported filters: cid,created_timestamp,detect_timestamp,prevented,severity */ Filter *string diff --git a/falcon/client/kubernetes_protection/kubernetes_iom_entities_combined_parameters.go b/falcon/client/kubernetes_protection/kubernetes_iom_entities_combined_parameters.go index e2d5cbdc..b4aeeb99 100644 --- a/falcon/client/kubernetes_protection/kubernetes_iom_entities_combined_parameters.go +++ b/falcon/client/kubernetes_protection/kubernetes_iom_entities_combined_parameters.go @@ -64,7 +64,7 @@ type KubernetesIomEntitiesCombinedParams struct { /* Filter. - Search Kubernetes IOMs using a query in Falcon Query Language (FQL). Supported filters: cid,cis_id,cluster_id,cluster_name,containers_impacted_count,containers_impacted_ids,detection_type,name,namespace,resource_id,resource_name,resource_type,severity + Search Kubernetes IOMs using a query in Falcon Query Language (FQL). Supported filters: cid,cis_id,cluster_id,cluster_name,containers_impacted_count,containers_impacted_ids,detection_type,name,namespace,prevented,resource_id,resource_name,resource_type,severity */ Filter *string diff --git a/falcon/client/kubernetes_protection/kubernetes_protection_client.go b/falcon/client/kubernetes_protection/kubernetes_protection_client.go index bf29c5f9..212a9221 100644 --- a/falcon/client/kubernetes_protection/kubernetes_protection_client.go +++ b/falcon/client/kubernetes_protection/kubernetes_protection_client.go @@ -48,8 +48,6 @@ type ClientService interface { ContainerCountByRegistry(params *ContainerCountByRegistryParams, opts ...ClientOption) (*ContainerCountByRegistryOK, error) - ContainerEnrichment(params *ContainerEnrichmentParams, opts ...ClientOption) (*ContainerEnrichmentOK, error) - ContainerImageDetectionsCountByDate(params *ContainerImageDetectionsCountByDateParams, opts ...ClientOption) (*ContainerImageDetectionsCountByDateOK, error) ContainerImagesByMostUsed(params *ContainerImagesByMostUsedParams, opts ...ClientOption) (*ContainerImagesByMostUsedOK, error) @@ -74,8 +72,6 @@ type ClientService interface { DeploymentCount(params *DeploymentCountParams, opts ...ClientOption) (*DeploymentCountOK, error) - DeploymentEnrichment(params *DeploymentEnrichmentParams, opts ...ClientOption) (*DeploymentEnrichmentOK, error) - DeploymentsByDateRangeCount(params *DeploymentsByDateRangeCountParams, opts ...ClientOption) (*DeploymentsByDateRangeCountOK, error) DistinctContainerImageCount(params *DistinctContainerImageCountParams, opts ...ClientOption) (*DistinctContainerImageCountOK, error) @@ -132,8 +128,6 @@ type ClientService interface { PodCount(params *PodCountParams, opts ...ClientOption) (*PodCountOK, error) - PodEnrichment(params *PodEnrichmentParams, opts ...ClientOption) (*PodEnrichmentOK, error) - PodsByDateRangeCount(params *PodsByDateRangeCountParams, opts ...ClientOption) (*PodsByDateRangeCountOK, error) QueryKubernetesIoms(params *QueryKubernetesIomsParams, opts ...ClientOption) (*QueryKubernetesIomsOK, error) @@ -493,44 +487,6 @@ func (a *Client) ContainerCountByRegistry(params *ContainerCountByRegistryParams panic(msg) } -/* -ContainerEnrichment retrieves container enrichment data -*/ -func (a *Client) ContainerEnrichment(params *ContainerEnrichmentParams, opts ...ClientOption) (*ContainerEnrichmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewContainerEnrichmentParams() - } - op := &runtime.ClientOperation{ - ID: "ContainerEnrichment", - Method: "GET", - PathPattern: "/container-security/aggregates/enrichment/containers/entities/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ContainerEnrichmentReader{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.(*ContainerEnrichmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ContainerEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* ContainerImageDetectionsCountByDate retrieves count of image assessment detections on running containers over a period of time */ @@ -991,44 +947,6 @@ func (a *Client) DeploymentCount(params *DeploymentCountParams, opts ...ClientOp panic(msg) } -/* -DeploymentEnrichment retrieves deployment enrichment data -*/ -func (a *Client) DeploymentEnrichment(params *DeploymentEnrichmentParams, opts ...ClientOption) (*DeploymentEnrichmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeploymentEnrichmentParams() - } - op := &runtime.ClientOperation{ - ID: "DeploymentEnrichment", - Method: "GET", - PathPattern: "/container-security/aggregates/enrichment/deployments/entities/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeploymentEnrichmentReader{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.(*DeploymentEnrichmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeploymentEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* DeploymentsByDateRangeCount retrieves deployments by date range counts */ @@ -2103,44 +2021,6 @@ func (a *Client) PodCount(params *PodCountParams, opts ...ClientOption) (*PodCou panic(msg) } -/* -PodEnrichment retrieves pod enrichment data -*/ -func (a *Client) PodEnrichment(params *PodEnrichmentParams, opts ...ClientOption) (*PodEnrichmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPodEnrichmentParams() - } - op := &runtime.ClientOperation{ - ID: "PodEnrichment", - Method: "GET", - PathPattern: "/container-security/aggregates/enrichment/pods/entities/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PodEnrichmentReader{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.(*PodEnrichmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for PodEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* PodsByDateRangeCount retrieves pods by date range counts */ diff --git a/falcon/client/kubernetes_protection/query_kubernetes_ioms_parameters.go b/falcon/client/kubernetes_protection/query_kubernetes_ioms_parameters.go index 186b6d7c..182e4e5d 100644 --- a/falcon/client/kubernetes_protection/query_kubernetes_ioms_parameters.go +++ b/falcon/client/kubernetes_protection/query_kubernetes_ioms_parameters.go @@ -64,7 +64,7 @@ type QueryKubernetesIomsParams struct { /* Filter. - Search Kubernetes IOMs using a query in Falcon Query Language (FQL). Supported filters: cid,cis_id,cluster_id,cluster_name,containers_impacted_count,containers_impacted_ids,detection_type,name,namespace,resource_id,resource_name,resource_type,severity + Search Kubernetes IOMs using a query in Falcon Query Language (FQL). Supported filters: cid,cis_id,cluster_id,cluster_name,containers_impacted_count,containers_impacted_ids,detection_type,name,namespace,prevented,resource_id,resource_name,resource_type,severity */ Filter *string diff --git a/falcon/client/kubernetes_protection/container_enrichment_parameters.go b/falcon/client/operations/container_enrichment_parameters.go similarity index 66% rename from falcon/client/kubernetes_protection/container_enrichment_parameters.go rename to falcon/client/operations/container_enrichment_parameters.go index d751dc9f..589548c9 100644 --- a/falcon/client/kubernetes_protection/container_enrichment_parameters.go +++ b/falcon/client/operations/container_enrichment_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package kubernetes_protection +package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -14,7 +14,6 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" ) // NewContainerEnrichmentParams creates a new ContainerEnrichmentParams object, @@ -61,19 +60,6 @@ ContainerEnrichmentParams contains all the parameters to send to the API endpoin Typically these are written to a http.Request. */ type ContainerEnrichmentParams struct { - - /* ContainerID. - - One or more container ids for which to retrieve enrichment info - */ - ContainerID []string - - /* Filter. - - Supported filters: last_seen - */ - Filter *string - timeout time.Duration Context context.Context HTTPClient *http.Client @@ -127,28 +113,6 @@ func (o *ContainerEnrichmentParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithContainerID adds the containerID to the container enrichment params -func (o *ContainerEnrichmentParams) WithContainerID(containerID []string) *ContainerEnrichmentParams { - o.SetContainerID(containerID) - return o -} - -// SetContainerID adds the containerId to the container enrichment params -func (o *ContainerEnrichmentParams) SetContainerID(containerID []string) { - o.ContainerID = containerID -} - -// WithFilter adds the filter to the container enrichment params -func (o *ContainerEnrichmentParams) WithFilter(filter *string) *ContainerEnrichmentParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the container enrichment params -func (o *ContainerEnrichmentParams) SetFilter(filter *string) { - o.Filter = filter -} - // WriteToRequest writes these params to a swagger request func (o *ContainerEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -157,53 +121,8 @@ func (o *ContainerEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error - if o.ContainerID != nil { - - // binding items for container_id - joinedContainerID := o.bindParamContainerID(reg) - - // query array param container_id - if err := r.SetQueryParam("container_id", joinedContainerID...); err != nil { - return err - } - } - - 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 len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } - -// bindParamContainerEnrichment binds the parameter container_id -func (o *ContainerEnrichmentParams) bindParamContainerID(formats strfmt.Registry) []string { - containerIDIR := o.ContainerID - - var containerIDIC []string - for _, containerIDIIR := range containerIDIR { // explode []string - - containerIDIIV := containerIDIIR // string as string - containerIDIC = append(containerIDIC, containerIDIIV) - } - - // items.CollectionFormat: "csv" - containerIDIS := swag.JoinByFormat(containerIDIC, "csv") - - return containerIDIS -} diff --git a/falcon/client/operations/container_enrichment_responses.go b/falcon/client/operations/container_enrichment_responses.go new file mode 100644 index 00000000..551d8bf1 --- /dev/null +++ b/falcon/client/operations/container_enrichment_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ContainerEnrichmentReader is a Reader for the ContainerEnrichment structure. +type ContainerEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ContainerEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewContainerEnrichmentDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewContainerEnrichmentDefault creates a ContainerEnrichmentDefault with default headers values +func NewContainerEnrichmentDefault(code int) *ContainerEnrichmentDefault { + return &ContainerEnrichmentDefault{ + _statusCode: code, + } +} + +/* +ContainerEnrichmentDefault describes a response with status code -1, with default header values. + +ContainerEnrichmentDefault container enrichment default +*/ +type ContainerEnrichmentDefault struct { + _statusCode int +} + +// IsSuccess returns true when this container enrichment default response has a 2xx status code +func (o *ContainerEnrichmentDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this container enrichment default response has a 3xx status code +func (o *ContainerEnrichmentDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this container enrichment default response has a 4xx status code +func (o *ContainerEnrichmentDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this container enrichment default response has a 5xx status code +func (o *ContainerEnrichmentDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this container enrichment default response a status code equal to that given +func (o *ContainerEnrichmentDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the container enrichment default response +func (o *ContainerEnrichmentDefault) Code() int { + return o._statusCode +} + +func (o *ContainerEnrichmentDefault) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] ContainerEnrichment default ", o._statusCode) +} + +func (o *ContainerEnrichmentDefault) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] ContainerEnrichment default ", o._statusCode) +} + +func (o *ContainerEnrichmentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/falcon/client/kubernetes_protection/deployment_enrichment_parameters.go b/falcon/client/operations/deployment_enrichment_parameters.go similarity index 66% rename from falcon/client/kubernetes_protection/deployment_enrichment_parameters.go rename to falcon/client/operations/deployment_enrichment_parameters.go index c546bb08..18a70276 100644 --- a/falcon/client/kubernetes_protection/deployment_enrichment_parameters.go +++ b/falcon/client/operations/deployment_enrichment_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package kubernetes_protection +package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -14,7 +14,6 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" ) // NewDeploymentEnrichmentParams creates a new DeploymentEnrichmentParams object, @@ -61,19 +60,6 @@ DeploymentEnrichmentParams contains all the parameters to send to the API endpoi Typically these are written to a http.Request. */ type DeploymentEnrichmentParams struct { - - /* DeploymentID. - - One or more deployment ids for which to retrieve enrichment info - */ - DeploymentID []string - - /* Filter. - - Supported filters: last_seen - */ - Filter *string - timeout time.Duration Context context.Context HTTPClient *http.Client @@ -127,28 +113,6 @@ func (o *DeploymentEnrichmentParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithDeploymentID adds the deploymentID to the deployment enrichment params -func (o *DeploymentEnrichmentParams) WithDeploymentID(deploymentID []string) *DeploymentEnrichmentParams { - o.SetDeploymentID(deploymentID) - return o -} - -// SetDeploymentID adds the deploymentId to the deployment enrichment params -func (o *DeploymentEnrichmentParams) SetDeploymentID(deploymentID []string) { - o.DeploymentID = deploymentID -} - -// WithFilter adds the filter to the deployment enrichment params -func (o *DeploymentEnrichmentParams) WithFilter(filter *string) *DeploymentEnrichmentParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the deployment enrichment params -func (o *DeploymentEnrichmentParams) SetFilter(filter *string) { - o.Filter = filter -} - // WriteToRequest writes these params to a swagger request func (o *DeploymentEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -157,53 +121,8 @@ func (o *DeploymentEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error - if o.DeploymentID != nil { - - // binding items for deployment_id - joinedDeploymentID := o.bindParamDeploymentID(reg) - - // query array param deployment_id - if err := r.SetQueryParam("deployment_id", joinedDeploymentID...); err != nil { - return err - } - } - - 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 len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } - -// bindParamDeploymentEnrichment binds the parameter deployment_id -func (o *DeploymentEnrichmentParams) bindParamDeploymentID(formats strfmt.Registry) []string { - deploymentIDIR := o.DeploymentID - - var deploymentIDIC []string - for _, deploymentIDIIR := range deploymentIDIR { // explode []string - - deploymentIDIIV := deploymentIDIIR // string as string - deploymentIDIC = append(deploymentIDIC, deploymentIDIIV) - } - - // items.CollectionFormat: "csv" - deploymentIDIS := swag.JoinByFormat(deploymentIDIC, "csv") - - return deploymentIDIS -} diff --git a/falcon/client/operations/deployment_enrichment_responses.go b/falcon/client/operations/deployment_enrichment_responses.go new file mode 100644 index 00000000..3b46bc29 --- /dev/null +++ b/falcon/client/operations/deployment_enrichment_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeploymentEnrichmentReader is a Reader for the DeploymentEnrichment structure. +type DeploymentEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeploymentEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewDeploymentEnrichmentDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewDeploymentEnrichmentDefault creates a DeploymentEnrichmentDefault with default headers values +func NewDeploymentEnrichmentDefault(code int) *DeploymentEnrichmentDefault { + return &DeploymentEnrichmentDefault{ + _statusCode: code, + } +} + +/* +DeploymentEnrichmentDefault describes a response with status code -1, with default header values. + +DeploymentEnrichmentDefault deployment enrichment default +*/ +type DeploymentEnrichmentDefault struct { + _statusCode int +} + +// IsSuccess returns true when this deployment enrichment default response has a 2xx status code +func (o *DeploymentEnrichmentDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this deployment enrichment default response has a 3xx status code +func (o *DeploymentEnrichmentDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this deployment enrichment default response has a 4xx status code +func (o *DeploymentEnrichmentDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this deployment enrichment default response has a 5xx status code +func (o *DeploymentEnrichmentDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this deployment enrichment default response a status code equal to that given +func (o *DeploymentEnrichmentDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the deployment enrichment default response +func (o *DeploymentEnrichmentDefault) Code() int { + return o._statusCode +} + +func (o *DeploymentEnrichmentDefault) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] DeploymentEnrichment default ", o._statusCode) +} + +func (o *DeploymentEnrichmentDefault) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] DeploymentEnrichment default ", o._statusCode) +} + +func (o *DeploymentEnrichmentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/falcon/client/operations/operations_client.go b/falcon/client/operations/operations_client.go new file mode 100644 index 00000000..ecbb08c0 --- /dev/null +++ b/falcon/client/operations/operations_client.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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 ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new operations API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for operations 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 { + ContainerEnrichment(params *ContainerEnrichmentParams, opts ...ClientOption) error + + DeploymentEnrichment(params *DeploymentEnrichmentParams, opts ...ClientOption) error + + PodEnrichment(params *PodEnrichmentParams, opts ...ClientOption) error + + SetTransport(transport runtime.ClientTransport) +} + +/* +ContainerEnrichment container enrichment API +*/ +func (a *Client) ContainerEnrichment(params *ContainerEnrichmentParams, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewContainerEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "ContainerEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/containers/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ContainerEnrichmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +DeploymentEnrichment deployment enrichment API +*/ +func (a *Client) DeploymentEnrichment(params *DeploymentEnrichmentParams, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewDeploymentEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "DeploymentEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/deployments/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeploymentEnrichmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* +PodEnrichment pod enrichment API +*/ +func (a *Client) PodEnrichment(params *PodEnrichmentParams, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewPodEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "PodEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/pods/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PodEnrichmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/falcon/client/kubernetes_protection/pod_enrichment_parameters.go b/falcon/client/operations/pod_enrichment_parameters.go similarity index 68% rename from falcon/client/kubernetes_protection/pod_enrichment_parameters.go rename to falcon/client/operations/pod_enrichment_parameters.go index 50ed4f95..4b49677e 100644 --- a/falcon/client/kubernetes_protection/pod_enrichment_parameters.go +++ b/falcon/client/operations/pod_enrichment_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package kubernetes_protection +package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -14,7 +14,6 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" ) // NewPodEnrichmentParams creates a new PodEnrichmentParams object, @@ -61,19 +60,6 @@ PodEnrichmentParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type PodEnrichmentParams struct { - - /* Filter. - - Supported filters: last_seen - */ - Filter *string - - /* PodID. - - One or more pod ids for which to retrieve enrichment info - */ - PodID []string - timeout time.Duration Context context.Context HTTPClient *http.Client @@ -127,28 +113,6 @@ func (o *PodEnrichmentParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithFilter adds the filter to the pod enrichment params -func (o *PodEnrichmentParams) WithFilter(filter *string) *PodEnrichmentParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the pod enrichment params -func (o *PodEnrichmentParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithPodID adds the podID to the pod enrichment params -func (o *PodEnrichmentParams) WithPodID(podID []string) *PodEnrichmentParams { - o.SetPodID(podID) - return o -} - -// SetPodID adds the podId to the pod enrichment params -func (o *PodEnrichmentParams) SetPodID(podID []string) { - o.PodID = podID -} - // WriteToRequest writes these params to a swagger request func (o *PodEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -157,53 +121,8 @@ func (o *PodEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } 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.PodID != nil { - - // binding items for pod_id - joinedPodID := o.bindParamPodID(reg) - - // query array param pod_id - if err := r.SetQueryParam("pod_id", joinedPodID...); err != nil { - return err - } - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } - -// bindParamPodEnrichment binds the parameter pod_id -func (o *PodEnrichmentParams) bindParamPodID(formats strfmt.Registry) []string { - podIDIR := o.PodID - - var podIDIC []string - for _, podIDIIR := range podIDIR { // explode []string - - podIDIIV := podIDIIR // string as string - podIDIC = append(podIDIC, podIDIIV) - } - - // items.CollectionFormat: "csv" - podIDIS := swag.JoinByFormat(podIDIC, "csv") - - return podIDIS -} diff --git a/falcon/client/operations/pod_enrichment_responses.go b/falcon/client/operations/pod_enrichment_responses.go new file mode 100644 index 00000000..b7ae7538 --- /dev/null +++ b/falcon/client/operations/pod_enrichment_responses.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PodEnrichmentReader is a Reader for the PodEnrichment structure. +type PodEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PodEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + result := NewPodEnrichmentDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result +} + +// NewPodEnrichmentDefault creates a PodEnrichmentDefault with default headers values +func NewPodEnrichmentDefault(code int) *PodEnrichmentDefault { + return &PodEnrichmentDefault{ + _statusCode: code, + } +} + +/* +PodEnrichmentDefault describes a response with status code -1, with default header values. + +PodEnrichmentDefault pod enrichment default +*/ +type PodEnrichmentDefault struct { + _statusCode int +} + +// IsSuccess returns true when this pod enrichment default response has a 2xx status code +func (o *PodEnrichmentDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this pod enrichment default response has a 3xx status code +func (o *PodEnrichmentDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this pod enrichment default response has a 4xx status code +func (o *PodEnrichmentDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this pod enrichment default response has a 5xx status code +func (o *PodEnrichmentDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this pod enrichment default response a status code equal to that given +func (o *PodEnrichmentDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the pod enrichment default response +func (o *PodEnrichmentDefault) Code() int { + return o._statusCode +} + +func (o *PodEnrichmentDefault) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] PodEnrichment default ", o._statusCode) +} + +func (o *PodEnrichmentDefault) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] PodEnrichment default ", o._statusCode) +} + +func (o *PodEnrichmentDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/falcon/client/provision/provision_client.go b/falcon/client/provision/provision_client.go deleted file mode 100644 index a7474857..00000000 --- a/falcon/client/provision/provision_client.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package provision - -// 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 provision API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for provision 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 { - GetCredentialsMixin0(params *GetCredentialsMixin0Params, opts ...ClientOption) (*GetCredentialsMixin0OK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -GetCredentialsMixin0 gets the registry credentials -*/ -func (a *Client) GetCredentialsMixin0(params *GetCredentialsMixin0Params, opts ...ClientOption) (*GetCredentialsMixin0OK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCredentialsMixin0Params() - } - op := &runtime.ClientOperation{ - ID: "GetCredentialsMixin0", - Method: "GET", - PathPattern: "/snapshots/entities/image-registry-credentials/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetCredentialsMixin0Reader{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.(*GetCredentialsMixin0OK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetCredentialsMixin0: 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/falcon/client/real_time_response/batch_active_responder_cmd_parameters.go b/falcon/client/real_time_response/batch_active_responder_cmd_parameters.go index 22819a62..64f1f791 100644 --- a/falcon/client/real_time_response/batch_active_responder_cmd_parameters.go +++ b/falcon/client/real_time_response/batch_active_responder_cmd_parameters.go @@ -66,7 +66,7 @@ type BatchActiveResponderCmdParams struct { /* Body. - Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): + Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/documentation/page/b8c1738c/real-time-response-and-network-containment#k893b7c0): - `cat` - `cd` - `clear` diff --git a/falcon/client/real_time_response/batch_cmd_parameters.go b/falcon/client/real_time_response/batch_cmd_parameters.go index 711832ea..a8d14935 100644 --- a/falcon/client/real_time_response/batch_cmd_parameters.go +++ b/falcon/client/real_time_response/batch_cmd_parameters.go @@ -66,7 +66,7 @@ type BatchCmdParams struct { /* Body. - Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): + Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/documentation/page/b8c1738c/real-time-response-and-network-containment#k893b7c0): - `cat` - `cd` - `clear` diff --git a/falcon/client/real_time_response/r_t_r_delete_queued_session_responses.go b/falcon/client/real_time_response/r_t_r_delete_queued_session_responses.go index 9dae0748..416d8f54 100644 --- a/falcon/client/real_time_response/r_t_r_delete_queued_session_responses.go +++ b/falcon/client/real_time_response/r_t_r_delete_queued_session_responses.go @@ -25,6 +25,12 @@ type RTRDeleteQueuedSessionReader struct { // ReadResponse reads a server response into the received o. func (o *RTRDeleteQueuedSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { + case 200: + result := NewRTRDeleteQueuedSessionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil case 204: result := NewRTRDeleteQueuedSessionNoContent() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -60,6 +66,116 @@ func (o *RTRDeleteQueuedSessionReader) ReadResponse(response runtime.ClientRespo } } +// NewRTRDeleteQueuedSessionOK creates a RTRDeleteQueuedSessionOK with default headers values +func NewRTRDeleteQueuedSessionOK() *RTRDeleteQueuedSessionOK { + return &RTRDeleteQueuedSessionOK{} +} + +/* +RTRDeleteQueuedSessionOK describes a response with status code 200, with default header values. + +OK +*/ +type RTRDeleteQueuedSessionOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this r t r delete queued session o k response has a 2xx status code +func (o *RTRDeleteQueuedSessionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this r t r delete queued session o k response has a 3xx status code +func (o *RTRDeleteQueuedSessionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this r t r delete queued session o k response has a 4xx status code +func (o *RTRDeleteQueuedSessionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this r t r delete queued session o k response has a 5xx status code +func (o *RTRDeleteQueuedSessionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this r t r delete queued session o k response a status code equal to that given +func (o *RTRDeleteQueuedSessionOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the r t r delete queued session o k response +func (o *RTRDeleteQueuedSessionOK) Code() int { + return 200 +} + +func (o *RTRDeleteQueuedSessionOK) Error() string { + return fmt.Sprintf("[DELETE /real-time-response/entities/queued-sessions/command/v1][%d] rTRDeleteQueuedSessionOK %+v", 200, o.Payload) +} + +func (o *RTRDeleteQueuedSessionOK) String() string { + return fmt.Sprintf("[DELETE /real-time-response/entities/queued-sessions/command/v1][%d] rTRDeleteQueuedSessionOK %+v", 200, o.Payload) +} + +func (o *RTRDeleteQueuedSessionOK) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *RTRDeleteQueuedSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewRTRDeleteQueuedSessionNoContent creates a RTRDeleteQueuedSessionNoContent with default headers values func NewRTRDeleteQueuedSessionNoContent() *RTRDeleteQueuedSessionNoContent { return &RTRDeleteQueuedSessionNoContent{} diff --git a/falcon/client/real_time_response/r_t_r_execute_active_responder_command_parameters.go b/falcon/client/real_time_response/r_t_r_execute_active_responder_command_parameters.go index 20907720..39d0f7be 100644 --- a/falcon/client/real_time_response/r_t_r_execute_active_responder_command_parameters.go +++ b/falcon/client/real_time_response/r_t_r_execute_active_responder_command_parameters.go @@ -65,7 +65,7 @@ type RTRExecuteActiveResponderCommandParams struct { /* Body. - Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): + Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/documentation/page/b8c1738c/real-time-response-and-network-containment#k893b7c0): - `cat` - `cd` - `clear` diff --git a/falcon/client/real_time_response/r_t_r_execute_command_parameters.go b/falcon/client/real_time_response/r_t_r_execute_command_parameters.go index 04a18f55..770f0511 100644 --- a/falcon/client/real_time_response/r_t_r_execute_command_parameters.go +++ b/falcon/client/real_time_response/r_t_r_execute_command_parameters.go @@ -65,7 +65,7 @@ type RTRExecuteCommandParams struct { /* Body. - Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): + Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/documentation/page/b8c1738c/real-time-response-and-network-containment#k893b7c0): - `cat` - `cd` - `clear` diff --git a/falcon/client/real_time_response/r_t_r_list_all_sessions_parameters.go b/falcon/client/real_time_response/r_t_r_list_all_sessions_parameters.go index 4ecaeca3..e6ea2d81 100644 --- a/falcon/client/real_time_response/r_t_r_list_all_sessions_parameters.go +++ b/falcon/client/real_time_response/r_t_r_list_all_sessions_parameters.go @@ -64,7 +64,7 @@ type RTRListAllSessionsParams struct { /* Filter. - Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](https://falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide). “user_id” can accept a special value ‘@me’ which will restrict results to records with current user’s ID. + Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](https://falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide). “user_id” can accept a special value ‘@me’ which will restrict results to records with current user’s ID. */ Filter *string diff --git a/falcon/client/real_time_response/real_time_response_client.go b/falcon/client/real_time_response/real_time_response_client.go index 0ee7c582..5dc0e5f5 100644 --- a/falcon/client/real_time_response/real_time_response_client.go +++ b/falcon/client/real_time_response/real_time_response_client.go @@ -53,7 +53,7 @@ type ClientService interface { RTRDeleteFileV2(params *RTRDeleteFileV2Params, opts ...ClientOption) (*RTRDeleteFileV2NoContent, error) - RTRDeleteQueuedSession(params *RTRDeleteQueuedSessionParams, opts ...ClientOption) (*RTRDeleteQueuedSessionNoContent, error) + RTRDeleteQueuedSession(params *RTRDeleteQueuedSessionParams, opts ...ClientOption) (*RTRDeleteQueuedSessionOK, *RTRDeleteQueuedSessionNoContent, error) RTRDeleteSession(params *RTRDeleteSessionParams, opts ...ClientOption) (*RTRDeleteSessionNoContent, error) @@ -501,7 +501,7 @@ func (a *Client) RTRDeleteFileV2(params *RTRDeleteFileV2Params, opts ...ClientOp /* RTRDeleteQueuedSession deletes a queued session command */ -func (a *Client) RTRDeleteQueuedSession(params *RTRDeleteQueuedSessionParams, opts ...ClientOption) (*RTRDeleteQueuedSessionNoContent, error) { +func (a *Client) RTRDeleteQueuedSession(params *RTRDeleteQueuedSessionParams, opts ...ClientOption) (*RTRDeleteQueuedSessionOK, *RTRDeleteQueuedSessionNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewRTRDeleteQueuedSessionParams() @@ -524,15 +524,16 @@ func (a *Client) RTRDeleteQueuedSession(params *RTRDeleteQueuedSessionParams, op result, err := a.transport.Submit(op) if err != nil { - return nil, err + return nil, nil, err } - success, ok := result.(*RTRDeleteQueuedSessionNoContent) - if ok { - return success, nil + switch value := result.(type) { + case *RTRDeleteQueuedSessionOK: + return value, nil, nil + case *RTRDeleteQueuedSessionNoContent: + return nil, value, nil } - // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for RTR-DeleteQueuedSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for real_time_response: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/falcon/client/real_time_response_admin/batch_admin_cmd_parameters.go b/falcon/client/real_time_response_admin/batch_admin_cmd_parameters.go index 758d5b8c..8690dc00 100644 --- a/falcon/client/real_time_response_admin/batch_admin_cmd_parameters.go +++ b/falcon/client/real_time_response_admin/batch_admin_cmd_parameters.go @@ -66,7 +66,7 @@ type BatchAdminCmdParams struct { /* Body. - Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): + Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/documentation/page/b8c1738c/real-time-response-and-network-containment#k893b7c0): - `cat` - `cd` - `clear` diff --git a/falcon/client/real_time_response_admin/r_t_r_execute_admin_command_parameters.go b/falcon/client/real_time_response_admin/r_t_r_execute_admin_command_parameters.go index 4752c635..8c0feadd 100644 --- a/falcon/client/real_time_response_admin/r_t_r_execute_admin_command_parameters.go +++ b/falcon/client/real_time_response_admin/r_t_r_execute_admin_command_parameters.go @@ -65,7 +65,7 @@ type RTRExecuteAdminCommandParams struct { /* Body. - Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): + Use this endpoint to run these [real time response commands](https://falcon.crowdstrike.com/documentation/page/b8c1738c/real-time-response-and-network-containment#k893b7c0): - `cat` - `cd` - `clear` diff --git a/falcon/client/real_time_response_admin/r_t_r_update_scripts_responses.go b/falcon/client/real_time_response_admin/r_t_r_update_scripts_responses.go index 6e03b9fa..24772757 100644 --- a/falcon/client/real_time_response_admin/r_t_r_update_scripts_responses.go +++ b/falcon/client/real_time_response_admin/r_t_r_update_scripts_responses.go @@ -25,8 +25,8 @@ type RTRUpdateScriptsReader struct { // ReadResponse reads a server response into the received o. func (o *RTRUpdateScriptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: - result := NewRTRUpdateScriptsOK() + case 202: + result := NewRTRUpdateScriptsAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -54,17 +54,17 @@ func (o *RTRUpdateScriptsReader) ReadResponse(response runtime.ClientResponse, c } } -// NewRTRUpdateScriptsOK creates a RTRUpdateScriptsOK with default headers values -func NewRTRUpdateScriptsOK() *RTRUpdateScriptsOK { - return &RTRUpdateScriptsOK{} +// NewRTRUpdateScriptsAccepted creates a RTRUpdateScriptsAccepted with default headers values +func NewRTRUpdateScriptsAccepted() *RTRUpdateScriptsAccepted { + return &RTRUpdateScriptsAccepted{} } /* -RTRUpdateScriptsOK describes a response with status code 200, with default header values. +RTRUpdateScriptsAccepted describes a response with status code 202, with default header values. OK */ -type RTRUpdateScriptsOK struct { +type RTRUpdateScriptsAccepted struct { /* Trace-ID: submit to support if resolving an issue */ @@ -81,49 +81,49 @@ type RTRUpdateScriptsOK struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this r t r update scripts o k response has a 2xx status code -func (o *RTRUpdateScriptsOK) IsSuccess() bool { +// IsSuccess returns true when this r t r update scripts accepted response has a 2xx status code +func (o *RTRUpdateScriptsAccepted) IsSuccess() bool { return true } -// IsRedirect returns true when this r t r update scripts o k response has a 3xx status code -func (o *RTRUpdateScriptsOK) IsRedirect() bool { +// IsRedirect returns true when this r t r update scripts accepted response has a 3xx status code +func (o *RTRUpdateScriptsAccepted) IsRedirect() bool { return false } -// IsClientError returns true when this r t r update scripts o k response has a 4xx status code -func (o *RTRUpdateScriptsOK) IsClientError() bool { +// IsClientError returns true when this r t r update scripts accepted response has a 4xx status code +func (o *RTRUpdateScriptsAccepted) IsClientError() bool { return false } -// IsServerError returns true when this r t r update scripts o k response has a 5xx status code -func (o *RTRUpdateScriptsOK) IsServerError() bool { +// IsServerError returns true when this r t r update scripts accepted response has a 5xx status code +func (o *RTRUpdateScriptsAccepted) IsServerError() bool { return false } -// IsCode returns true when this r t r update scripts o k response a status code equal to that given -func (o *RTRUpdateScriptsOK) IsCode(code int) bool { - return code == 200 +// IsCode returns true when this r t r update scripts accepted response a status code equal to that given +func (o *RTRUpdateScriptsAccepted) IsCode(code int) bool { + return code == 202 } -// Code gets the status code for the r t r update scripts o k response -func (o *RTRUpdateScriptsOK) Code() int { - return 200 +// Code gets the status code for the r t r update scripts accepted response +func (o *RTRUpdateScriptsAccepted) Code() int { + return 202 } -func (o *RTRUpdateScriptsOK) Error() string { - return fmt.Sprintf("[PATCH /real-time-response/entities/scripts/v1][%d] rTRUpdateScriptsOK %+v", 200, o.Payload) +func (o *RTRUpdateScriptsAccepted) Error() string { + return fmt.Sprintf("[PATCH /real-time-response/entities/scripts/v1][%d] rTRUpdateScriptsAccepted %+v", 202, o.Payload) } -func (o *RTRUpdateScriptsOK) String() string { - return fmt.Sprintf("[PATCH /real-time-response/entities/scripts/v1][%d] rTRUpdateScriptsOK %+v", 200, o.Payload) +func (o *RTRUpdateScriptsAccepted) String() string { + return fmt.Sprintf("[PATCH /real-time-response/entities/scripts/v1][%d] rTRUpdateScriptsAccepted %+v", 202, o.Payload) } -func (o *RTRUpdateScriptsOK) GetPayload() *models.MsaReplyMetaOnly { +func (o *RTRUpdateScriptsAccepted) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *RTRUpdateScriptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *RTRUpdateScriptsAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") diff --git a/falcon/client/real_time_response_admin/real_time_response_admin_client.go b/falcon/client/real_time_response_admin/real_time_response_admin_client.go index 88561347..3cdd1bed 100644 --- a/falcon/client/real_time_response_admin/real_time_response_admin_client.go +++ b/falcon/client/real_time_response_admin/real_time_response_admin_client.go @@ -60,7 +60,7 @@ type ClientService interface { RTRListScripts(params *RTRListScriptsParams, opts ...ClientOption) (*RTRListScriptsOK, error) - RTRUpdateScripts(params *RTRUpdateScriptsParams, opts ...ClientOption) (*RTRUpdateScriptsOK, error) + RTRUpdateScripts(params *RTRUpdateScriptsParams, opts ...ClientOption) (*RTRUpdateScriptsAccepted, error) SetTransport(transport runtime.ClientTransport) } @@ -638,7 +638,7 @@ func (a *Client) RTRListScripts(params *RTRListScriptsParams, opts ...ClientOpti /* RTRUpdateScripts uploads a new scripts to replace an existing one */ -func (a *Client) RTRUpdateScripts(params *RTRUpdateScriptsParams, opts ...ClientOption) (*RTRUpdateScriptsOK, error) { +func (a *Client) RTRUpdateScripts(params *RTRUpdateScriptsParams, opts ...ClientOption) (*RTRUpdateScriptsAccepted, error) { // TODO: Validate the params before sending if params == nil { params = NewRTRUpdateScriptsParams() @@ -663,7 +663,7 @@ func (a *Client) RTRUpdateScripts(params *RTRUpdateScriptsParams, opts ...Client if err != nil { return nil, err } - success, ok := result.(*RTRUpdateScriptsOK) + success, ok := result.(*RTRUpdateScriptsAccepted) if ok { return success, nil } diff --git a/falcon/client/sensor_download/download_sensor_installer_by_id_v2_parameters.go b/falcon/client/sensor_download/download_sensor_installer_by_id_v2_parameters.go new file mode 100644 index 00000000..0821f248 --- /dev/null +++ b/falcon/client/sensor_download/download_sensor_installer_by_id_v2_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDownloadSensorInstallerByIDV2Params creates a new DownloadSensorInstallerByIDV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDownloadSensorInstallerByIDV2Params() *DownloadSensorInstallerByIDV2Params { + return &DownloadSensorInstallerByIDV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewDownloadSensorInstallerByIDV2ParamsWithTimeout creates a new DownloadSensorInstallerByIDV2Params object +// with the ability to set a timeout on a request. +func NewDownloadSensorInstallerByIDV2ParamsWithTimeout(timeout time.Duration) *DownloadSensorInstallerByIDV2Params { + return &DownloadSensorInstallerByIDV2Params{ + timeout: timeout, + } +} + +// NewDownloadSensorInstallerByIDV2ParamsWithContext creates a new DownloadSensorInstallerByIDV2Params object +// with the ability to set a context for a request. +func NewDownloadSensorInstallerByIDV2ParamsWithContext(ctx context.Context) *DownloadSensorInstallerByIDV2Params { + return &DownloadSensorInstallerByIDV2Params{ + Context: ctx, + } +} + +// NewDownloadSensorInstallerByIDV2ParamsWithHTTPClient creates a new DownloadSensorInstallerByIDV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewDownloadSensorInstallerByIDV2ParamsWithHTTPClient(client *http.Client) *DownloadSensorInstallerByIDV2Params { + return &DownloadSensorInstallerByIDV2Params{ + HTTPClient: client, + } +} + +/* +DownloadSensorInstallerByIDV2Params contains all the parameters to send to the API endpoint + + for the download sensor installer by Id v2 operation. + + Typically these are written to a http.Request. +*/ +type DownloadSensorInstallerByIDV2Params struct { + + /* ID. + + SHA256 of the installer to download + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the download sensor installer by Id v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadSensorInstallerByIDV2Params) WithDefaults() *DownloadSensorInstallerByIDV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download sensor installer by Id v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadSensorInstallerByIDV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) WithTimeout(timeout time.Duration) *DownloadSensorInstallerByIDV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) WithContext(ctx context.Context) *DownloadSensorInstallerByIDV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) WithHTTPClient(client *http.Client) *DownloadSensorInstallerByIDV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) WithID(id string) *DownloadSensorInstallerByIDV2Params { + o.SetID(id) + return o +} + +// SetID adds the id to the download sensor installer by Id v2 params +func (o *DownloadSensorInstallerByIDV2Params) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DownloadSensorInstallerByIDV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param id + qrID := o.ID + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/sensor_download/download_sensor_installer_by_id_v2_responses.go b/falcon/client/sensor_download/download_sensor_installer_by_id_v2_responses.go new file mode 100644 index 00000000..48a566bb --- /dev/null +++ b/falcon/client/sensor_download/download_sensor_installer_by_id_v2_responses.go @@ -0,0 +1,628 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// DownloadSensorInstallerByIDV2Reader is a Reader for the DownloadSensorInstallerByIDV2 structure. +type DownloadSensorInstallerByIDV2Reader struct { + formats strfmt.Registry + writer io.Writer +} + +// ReadResponse reads a server response into the received o. +func (o *DownloadSensorInstallerByIDV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDownloadSensorInstallerByIDV2OK(o.writer) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDownloadSensorInstallerByIDV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDownloadSensorInstallerByIDV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDownloadSensorInstallerByIDV2NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewDownloadSensorInstallerByIDV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /sensors/entities/download-installer/v2] DownloadSensorInstallerByIdV2", response, response.Code()) + } +} + +// NewDownloadSensorInstallerByIDV2OK creates a DownloadSensorInstallerByIDV2OK with default headers values +func NewDownloadSensorInstallerByIDV2OK(writer io.Writer) *DownloadSensorInstallerByIDV2OK { + return &DownloadSensorInstallerByIDV2OK{ + + Payload: writer, + } +} + +/* +DownloadSensorInstallerByIDV2OK describes a response with status code 200, with default header values. + +OK +*/ +type DownloadSensorInstallerByIDV2OK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload io.Writer +} + +// IsSuccess returns true when this download sensor installer by Id v2 o k response has a 2xx status code +func (o *DownloadSensorInstallerByIDV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this download sensor installer by Id v2 o k response has a 3xx status code +func (o *DownloadSensorInstallerByIDV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download sensor installer by Id v2 o k response has a 4xx status code +func (o *DownloadSensorInstallerByIDV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this download sensor installer by Id v2 o k response has a 5xx status code +func (o *DownloadSensorInstallerByIDV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this download sensor installer by Id v2 o k response a status code equal to that given +func (o *DownloadSensorInstallerByIDV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the download sensor installer by Id v2 o k response +func (o *DownloadSensorInstallerByIDV2OK) Code() int { + return 200 +} + +func (o *DownloadSensorInstallerByIDV2OK) Error() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2OK %+v", 200, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2OK) String() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2OK %+v", 200, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2OK) GetPayload() io.Writer { + return o.Payload +} + +func (o *DownloadSensorInstallerByIDV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadSensorInstallerByIDV2BadRequest creates a DownloadSensorInstallerByIDV2BadRequest with default headers values +func NewDownloadSensorInstallerByIDV2BadRequest() *DownloadSensorInstallerByIDV2BadRequest { + return &DownloadSensorInstallerByIDV2BadRequest{} +} + +/* +DownloadSensorInstallerByIDV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type DownloadSensorInstallerByIDV2BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this download sensor installer by Id v2 bad request response has a 2xx status code +func (o *DownloadSensorInstallerByIDV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download sensor installer by Id v2 bad request response has a 3xx status code +func (o *DownloadSensorInstallerByIDV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download sensor installer by Id v2 bad request response has a 4xx status code +func (o *DownloadSensorInstallerByIDV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this download sensor installer by Id v2 bad request response has a 5xx status code +func (o *DownloadSensorInstallerByIDV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this download sensor installer by Id v2 bad request response a status code equal to that given +func (o *DownloadSensorInstallerByIDV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the download sensor installer by Id v2 bad request response +func (o *DownloadSensorInstallerByIDV2BadRequest) Code() int { + return 400 +} + +func (o *DownloadSensorInstallerByIDV2BadRequest) Error() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2BadRequest %+v", 400, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2BadRequest) String() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2BadRequest %+v", 400, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2BadRequest) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *DownloadSensorInstallerByIDV2BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadSensorInstallerByIDV2Forbidden creates a DownloadSensorInstallerByIDV2Forbidden with default headers values +func NewDownloadSensorInstallerByIDV2Forbidden() *DownloadSensorInstallerByIDV2Forbidden { + return &DownloadSensorInstallerByIDV2Forbidden{} +} + +/* +DownloadSensorInstallerByIDV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DownloadSensorInstallerByIDV2Forbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this download sensor installer by Id v2 forbidden response has a 2xx status code +func (o *DownloadSensorInstallerByIDV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download sensor installer by Id v2 forbidden response has a 3xx status code +func (o *DownloadSensorInstallerByIDV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download sensor installer by Id v2 forbidden response has a 4xx status code +func (o *DownloadSensorInstallerByIDV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this download sensor installer by Id v2 forbidden response has a 5xx status code +func (o *DownloadSensorInstallerByIDV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this download sensor installer by Id v2 forbidden response a status code equal to that given +func (o *DownloadSensorInstallerByIDV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the download sensor installer by Id v2 forbidden response +func (o *DownloadSensorInstallerByIDV2Forbidden) Code() int { + return 403 +} + +func (o *DownloadSensorInstallerByIDV2Forbidden) Error() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2Forbidden %+v", 403, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2Forbidden) String() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2Forbidden %+v", 403, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *DownloadSensorInstallerByIDV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadSensorInstallerByIDV2NotFound creates a DownloadSensorInstallerByIDV2NotFound with default headers values +func NewDownloadSensorInstallerByIDV2NotFound() *DownloadSensorInstallerByIDV2NotFound { + return &DownloadSensorInstallerByIDV2NotFound{} +} + +/* +DownloadSensorInstallerByIDV2NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type DownloadSensorInstallerByIDV2NotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this download sensor installer by Id v2 not found response has a 2xx status code +func (o *DownloadSensorInstallerByIDV2NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download sensor installer by Id v2 not found response has a 3xx status code +func (o *DownloadSensorInstallerByIDV2NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download sensor installer by Id v2 not found response has a 4xx status code +func (o *DownloadSensorInstallerByIDV2NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this download sensor installer by Id v2 not found response has a 5xx status code +func (o *DownloadSensorInstallerByIDV2NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this download sensor installer by Id v2 not found response a status code equal to that given +func (o *DownloadSensorInstallerByIDV2NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the download sensor installer by Id v2 not found response +func (o *DownloadSensorInstallerByIDV2NotFound) Code() int { + return 404 +} + +func (o *DownloadSensorInstallerByIDV2NotFound) Error() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2NotFound %+v", 404, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2NotFound) String() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2NotFound %+v", 404, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2NotFound) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *DownloadSensorInstallerByIDV2NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadSensorInstallerByIDV2TooManyRequests creates a DownloadSensorInstallerByIDV2TooManyRequests with default headers values +func NewDownloadSensorInstallerByIDV2TooManyRequests() *DownloadSensorInstallerByIDV2TooManyRequests { + return &DownloadSensorInstallerByIDV2TooManyRequests{} +} + +/* +DownloadSensorInstallerByIDV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type DownloadSensorInstallerByIDV2TooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this download sensor installer by Id v2 too many requests response has a 2xx status code +func (o *DownloadSensorInstallerByIDV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download sensor installer by Id v2 too many requests response has a 3xx status code +func (o *DownloadSensorInstallerByIDV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download sensor installer by Id v2 too many requests response has a 4xx status code +func (o *DownloadSensorInstallerByIDV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this download sensor installer by Id v2 too many requests response has a 5xx status code +func (o *DownloadSensorInstallerByIDV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this download sensor installer by Id v2 too many requests response a status code equal to that given +func (o *DownloadSensorInstallerByIDV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the download sensor installer by Id v2 too many requests response +func (o *DownloadSensorInstallerByIDV2TooManyRequests) Code() int { + return 429 +} + +func (o *DownloadSensorInstallerByIDV2TooManyRequests) Error() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2TooManyRequests) String() string { + return fmt.Sprintf("[GET /sensors/entities/download-installer/v2][%d] downloadSensorInstallerByIdV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *DownloadSensorInstallerByIDV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *DownloadSensorInstallerByIDV2TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_parameters.go b/falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_parameters.go new file mode 100644 index 00000000..ab2157b6 --- /dev/null +++ b/falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_parameters.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetCombinedSensorInstallersByQueryV2Params creates a new GetCombinedSensorInstallersByQueryV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCombinedSensorInstallersByQueryV2Params() *GetCombinedSensorInstallersByQueryV2Params { + return &GetCombinedSensorInstallersByQueryV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCombinedSensorInstallersByQueryV2ParamsWithTimeout creates a new GetCombinedSensorInstallersByQueryV2Params object +// with the ability to set a timeout on a request. +func NewGetCombinedSensorInstallersByQueryV2ParamsWithTimeout(timeout time.Duration) *GetCombinedSensorInstallersByQueryV2Params { + return &GetCombinedSensorInstallersByQueryV2Params{ + timeout: timeout, + } +} + +// NewGetCombinedSensorInstallersByQueryV2ParamsWithContext creates a new GetCombinedSensorInstallersByQueryV2Params object +// with the ability to set a context for a request. +func NewGetCombinedSensorInstallersByQueryV2ParamsWithContext(ctx context.Context) *GetCombinedSensorInstallersByQueryV2Params { + return &GetCombinedSensorInstallersByQueryV2Params{ + Context: ctx, + } +} + +// NewGetCombinedSensorInstallersByQueryV2ParamsWithHTTPClient creates a new GetCombinedSensorInstallersByQueryV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetCombinedSensorInstallersByQueryV2ParamsWithHTTPClient(client *http.Client) *GetCombinedSensorInstallersByQueryV2Params { + return &GetCombinedSensorInstallersByQueryV2Params{ + HTTPClient: client, + } +} + +/* +GetCombinedSensorInstallersByQueryV2Params contains all the parameters to send to the API endpoint + + for the get combined sensor installers by query v2 operation. + + Typically these are written to a http.Request. +*/ +type GetCombinedSensorInstallersByQueryV2Params struct { + + /* Filter. + + Filter items using a query in Falcon Query Language (FQL). An asterisk wildcard * includes all results. + + Common filter options include: + + */ + Filter *string + + /* Limit. + + The number of items to return in this response (default: 100, max: 500). Use with the offset parameter to manage pagination of results. + */ + Limit *int64 + + /* Offset. + + The first item to return, where 0 is the latest item. Use with the limit parameter to manage pagination of results. + */ + Offset *int64 + + /* Sort. + + Sort items using their properties. Common sort options include: + + + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get combined sensor installers by query v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCombinedSensorInstallersByQueryV2Params) WithDefaults() *GetCombinedSensorInstallersByQueryV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get combined sensor installers by query v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCombinedSensorInstallersByQueryV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) WithTimeout(timeout time.Duration) *GetCombinedSensorInstallersByQueryV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) WithContext(ctx context.Context) *GetCombinedSensorInstallersByQueryV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) WithHTTPClient(client *http.Client) *GetCombinedSensorInstallersByQueryV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) WithFilter(filter *string) *GetCombinedSensorInstallersByQueryV2Params { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) WithLimit(limit *int64) *GetCombinedSensorInstallersByQueryV2Params { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) WithOffset(offset *int64) *GetCombinedSensorInstallersByQueryV2Params { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) WithSort(sort *string) *GetCombinedSensorInstallersByQueryV2Params { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the get combined sensor installers by query v2 params +func (o *GetCombinedSensorInstallersByQueryV2Params) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCombinedSensorInstallersByQueryV2Params) 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.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_responses.go b/falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_responses.go new file mode 100644 index 00000000..24cacfd7 --- /dev/null +++ b/falcon/client/sensor_download/get_combined_sensor_installers_by_query_v2_responses.go @@ -0,0 +1,510 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// GetCombinedSensorInstallersByQueryV2Reader is a Reader for the GetCombinedSensorInstallersByQueryV2 structure. +type GetCombinedSensorInstallersByQueryV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCombinedSensorInstallersByQueryV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCombinedSensorInstallersByQueryV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetCombinedSensorInstallersByQueryV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCombinedSensorInstallersByQueryV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetCombinedSensorInstallersByQueryV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /sensors/combined/installers/v2] GetCombinedSensorInstallersByQueryV2", response, response.Code()) + } +} + +// NewGetCombinedSensorInstallersByQueryV2OK creates a GetCombinedSensorInstallersByQueryV2OK with default headers values +func NewGetCombinedSensorInstallersByQueryV2OK() *GetCombinedSensorInstallersByQueryV2OK { + return &GetCombinedSensorInstallersByQueryV2OK{} +} + +/* +GetCombinedSensorInstallersByQueryV2OK describes a response with status code 200, with default header values. + +OK +*/ +type GetCombinedSensorInstallersByQueryV2OK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainSensorInstallersV2 +} + +// IsSuccess returns true when this get combined sensor installers by query v2 o k response has a 2xx status code +func (o *GetCombinedSensorInstallersByQueryV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get combined sensor installers by query v2 o k response has a 3xx status code +func (o *GetCombinedSensorInstallersByQueryV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get combined sensor installers by query v2 o k response has a 4xx status code +func (o *GetCombinedSensorInstallersByQueryV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get combined sensor installers by query v2 o k response has a 5xx status code +func (o *GetCombinedSensorInstallersByQueryV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get combined sensor installers by query v2 o k response a status code equal to that given +func (o *GetCombinedSensorInstallersByQueryV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get combined sensor installers by query v2 o k response +func (o *GetCombinedSensorInstallersByQueryV2OK) Code() int { + return 200 +} + +func (o *GetCombinedSensorInstallersByQueryV2OK) Error() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2OK %+v", 200, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2OK) String() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2OK %+v", 200, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2OK) GetPayload() *models.DomainSensorInstallersV2 { + return o.Payload +} + +func (o *GetCombinedSensorInstallersByQueryV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainSensorInstallersV2) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCombinedSensorInstallersByQueryV2BadRequest creates a GetCombinedSensorInstallersByQueryV2BadRequest with default headers values +func NewGetCombinedSensorInstallersByQueryV2BadRequest() *GetCombinedSensorInstallersByQueryV2BadRequest { + return &GetCombinedSensorInstallersByQueryV2BadRequest{} +} + +/* +GetCombinedSensorInstallersByQueryV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetCombinedSensorInstallersByQueryV2BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this get combined sensor installers by query v2 bad request response has a 2xx status code +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get combined sensor installers by query v2 bad request response has a 3xx status code +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get combined sensor installers by query v2 bad request response has a 4xx status code +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get combined sensor installers by query v2 bad request response has a 5xx status code +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get combined sensor installers by query v2 bad request response a status code equal to that given +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get combined sensor installers by query v2 bad request response +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) Code() int { + return 400 +} + +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) Error() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) String() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *GetCombinedSensorInstallersByQueryV2BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCombinedSensorInstallersByQueryV2Forbidden creates a GetCombinedSensorInstallersByQueryV2Forbidden with default headers values +func NewGetCombinedSensorInstallersByQueryV2Forbidden() *GetCombinedSensorInstallersByQueryV2Forbidden { + return &GetCombinedSensorInstallersByQueryV2Forbidden{} +} + +/* +GetCombinedSensorInstallersByQueryV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetCombinedSensorInstallersByQueryV2Forbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get combined sensor installers by query v2 forbidden response has a 2xx status code +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get combined sensor installers by query v2 forbidden response has a 3xx status code +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get combined sensor installers by query v2 forbidden response has a 4xx status code +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get combined sensor installers by query v2 forbidden response has a 5xx status code +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get combined sensor installers by query v2 forbidden response a status code equal to that given +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get combined sensor installers by query v2 forbidden response +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) Code() int { + return 403 +} + +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) Error() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) String() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetCombinedSensorInstallersByQueryV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCombinedSensorInstallersByQueryV2TooManyRequests creates a GetCombinedSensorInstallersByQueryV2TooManyRequests with default headers values +func NewGetCombinedSensorInstallersByQueryV2TooManyRequests() *GetCombinedSensorInstallersByQueryV2TooManyRequests { + return &GetCombinedSensorInstallersByQueryV2TooManyRequests{} +} + +/* +GetCombinedSensorInstallersByQueryV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetCombinedSensorInstallersByQueryV2TooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get combined sensor installers by query v2 too many requests response has a 2xx status code +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get combined sensor installers by query v2 too many requests response has a 3xx status code +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get combined sensor installers by query v2 too many requests response has a 4xx status code +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get combined sensor installers by query v2 too many requests response has a 5xx status code +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get combined sensor installers by query v2 too many requests response a status code equal to that given +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get combined sensor installers by query v2 too many requests response +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) Code() int { + return 429 +} + +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) Error() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) String() string { + return fmt.Sprintf("[GET /sensors/combined/installers/v2][%d] getCombinedSensorInstallersByQueryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetCombinedSensorInstallersByQueryV2TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/sensor_download/get_sensor_installers_by_query_v2_parameters.go b/falcon/client/sensor_download/get_sensor_installers_by_query_v2_parameters.go new file mode 100644 index 00000000..2b57b581 --- /dev/null +++ b/falcon/client/sensor_download/get_sensor_installers_by_query_v2_parameters.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetSensorInstallersByQueryV2Params creates a new GetSensorInstallersByQueryV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSensorInstallersByQueryV2Params() *GetSensorInstallersByQueryV2Params { + return &GetSensorInstallersByQueryV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSensorInstallersByQueryV2ParamsWithTimeout creates a new GetSensorInstallersByQueryV2Params object +// with the ability to set a timeout on a request. +func NewGetSensorInstallersByQueryV2ParamsWithTimeout(timeout time.Duration) *GetSensorInstallersByQueryV2Params { + return &GetSensorInstallersByQueryV2Params{ + timeout: timeout, + } +} + +// NewGetSensorInstallersByQueryV2ParamsWithContext creates a new GetSensorInstallersByQueryV2Params object +// with the ability to set a context for a request. +func NewGetSensorInstallersByQueryV2ParamsWithContext(ctx context.Context) *GetSensorInstallersByQueryV2Params { + return &GetSensorInstallersByQueryV2Params{ + Context: ctx, + } +} + +// NewGetSensorInstallersByQueryV2ParamsWithHTTPClient creates a new GetSensorInstallersByQueryV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetSensorInstallersByQueryV2ParamsWithHTTPClient(client *http.Client) *GetSensorInstallersByQueryV2Params { + return &GetSensorInstallersByQueryV2Params{ + HTTPClient: client, + } +} + +/* +GetSensorInstallersByQueryV2Params contains all the parameters to send to the API endpoint + + for the get sensor installers by query v2 operation. + + Typically these are written to a http.Request. +*/ +type GetSensorInstallersByQueryV2Params struct { + + /* Filter. + + Filter items using a query in Falcon Query Language (FQL). An asterisk wildcard * includes all results. + + Common filter options include: + + */ + Filter *string + + /* Limit. + + The number of items to return in this response (default: 100, max: 500). Use with the offset parameter to manage pagination of results. + */ + Limit *int64 + + /* Offset. + + The first item to return, where 0 is the latest item. Use with the limit parameter to manage pagination of results. + */ + Offset *int64 + + /* Sort. + + Sort items using their properties. Common sort options include: + + + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get sensor installers by query v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSensorInstallersByQueryV2Params) WithDefaults() *GetSensorInstallersByQueryV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get sensor installers by query v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSensorInstallersByQueryV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) WithTimeout(timeout time.Duration) *GetSensorInstallersByQueryV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) WithContext(ctx context.Context) *GetSensorInstallersByQueryV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) WithHTTPClient(client *http.Client) *GetSensorInstallersByQueryV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) WithFilter(filter *string) *GetSensorInstallersByQueryV2Params { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) WithLimit(limit *int64) *GetSensorInstallersByQueryV2Params { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) WithOffset(offset *int64) *GetSensorInstallersByQueryV2Params { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) WithSort(sort *string) *GetSensorInstallersByQueryV2Params { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the get sensor installers by query v2 params +func (o *GetSensorInstallersByQueryV2Params) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSensorInstallersByQueryV2Params) 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.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/sensor_download/get_sensor_installers_by_query_v2_responses.go b/falcon/client/sensor_download/get_sensor_installers_by_query_v2_responses.go new file mode 100644 index 00000000..d36eec72 --- /dev/null +++ b/falcon/client/sensor_download/get_sensor_installers_by_query_v2_responses.go @@ -0,0 +1,510 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// GetSensorInstallersByQueryV2Reader is a Reader for the GetSensorInstallersByQueryV2 structure. +type GetSensorInstallersByQueryV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSensorInstallersByQueryV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSensorInstallersByQueryV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetSensorInstallersByQueryV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSensorInstallersByQueryV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetSensorInstallersByQueryV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /sensors/queries/installers/v2] GetSensorInstallersByQueryV2", response, response.Code()) + } +} + +// NewGetSensorInstallersByQueryV2OK creates a GetSensorInstallersByQueryV2OK with default headers values +func NewGetSensorInstallersByQueryV2OK() *GetSensorInstallersByQueryV2OK { + return &GetSensorInstallersByQueryV2OK{} +} + +/* +GetSensorInstallersByQueryV2OK describes a response with status code 200, with default header values. + +OK +*/ +type GetSensorInstallersByQueryV2OK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this get sensor installers by query v2 o k response has a 2xx status code +func (o *GetSensorInstallersByQueryV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get sensor installers by query v2 o k response has a 3xx status code +func (o *GetSensorInstallersByQueryV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers by query v2 o k response has a 4xx status code +func (o *GetSensorInstallersByQueryV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get sensor installers by query v2 o k response has a 5xx status code +func (o *GetSensorInstallersByQueryV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers by query v2 o k response a status code equal to that given +func (o *GetSensorInstallersByQueryV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get sensor installers by query v2 o k response +func (o *GetSensorInstallersByQueryV2OK) Code() int { + return 200 +} + +func (o *GetSensorInstallersByQueryV2OK) Error() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2OK %+v", 200, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2OK) String() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2OK %+v", 200, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2OK) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *GetSensorInstallersByQueryV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersByQueryV2BadRequest creates a GetSensorInstallersByQueryV2BadRequest with default headers values +func NewGetSensorInstallersByQueryV2BadRequest() *GetSensorInstallersByQueryV2BadRequest { + return &GetSensorInstallersByQueryV2BadRequest{} +} + +/* +GetSensorInstallersByQueryV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetSensorInstallersByQueryV2BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this get sensor installers by query v2 bad request response has a 2xx status code +func (o *GetSensorInstallersByQueryV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get sensor installers by query v2 bad request response has a 3xx status code +func (o *GetSensorInstallersByQueryV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers by query v2 bad request response has a 4xx status code +func (o *GetSensorInstallersByQueryV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get sensor installers by query v2 bad request response has a 5xx status code +func (o *GetSensorInstallersByQueryV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers by query v2 bad request response a status code equal to that given +func (o *GetSensorInstallersByQueryV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get sensor installers by query v2 bad request response +func (o *GetSensorInstallersByQueryV2BadRequest) Code() int { + return 400 +} + +func (o *GetSensorInstallersByQueryV2BadRequest) Error() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2BadRequest) String() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2BadRequest) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *GetSensorInstallersByQueryV2BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersByQueryV2Forbidden creates a GetSensorInstallersByQueryV2Forbidden with default headers values +func NewGetSensorInstallersByQueryV2Forbidden() *GetSensorInstallersByQueryV2Forbidden { + return &GetSensorInstallersByQueryV2Forbidden{} +} + +/* +GetSensorInstallersByQueryV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetSensorInstallersByQueryV2Forbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get sensor installers by query v2 forbidden response has a 2xx status code +func (o *GetSensorInstallersByQueryV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get sensor installers by query v2 forbidden response has a 3xx status code +func (o *GetSensorInstallersByQueryV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers by query v2 forbidden response has a 4xx status code +func (o *GetSensorInstallersByQueryV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get sensor installers by query v2 forbidden response has a 5xx status code +func (o *GetSensorInstallersByQueryV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers by query v2 forbidden response a status code equal to that given +func (o *GetSensorInstallersByQueryV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get sensor installers by query v2 forbidden response +func (o *GetSensorInstallersByQueryV2Forbidden) Code() int { + return 403 +} + +func (o *GetSensorInstallersByQueryV2Forbidden) Error() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2Forbidden) String() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetSensorInstallersByQueryV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersByQueryV2TooManyRequests creates a GetSensorInstallersByQueryV2TooManyRequests with default headers values +func NewGetSensorInstallersByQueryV2TooManyRequests() *GetSensorInstallersByQueryV2TooManyRequests { + return &GetSensorInstallersByQueryV2TooManyRequests{} +} + +/* +GetSensorInstallersByQueryV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetSensorInstallersByQueryV2TooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get sensor installers by query v2 too many requests response has a 2xx status code +func (o *GetSensorInstallersByQueryV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get sensor installers by query v2 too many requests response has a 3xx status code +func (o *GetSensorInstallersByQueryV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers by query v2 too many requests response has a 4xx status code +func (o *GetSensorInstallersByQueryV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get sensor installers by query v2 too many requests response has a 5xx status code +func (o *GetSensorInstallersByQueryV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers by query v2 too many requests response a status code equal to that given +func (o *GetSensorInstallersByQueryV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get sensor installers by query v2 too many requests response +func (o *GetSensorInstallersByQueryV2TooManyRequests) Code() int { + return 429 +} + +func (o *GetSensorInstallersByQueryV2TooManyRequests) Error() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2TooManyRequests) String() string { + return fmt.Sprintf("[GET /sensors/queries/installers/v2][%d] getSensorInstallersByQueryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetSensorInstallersByQueryV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetSensorInstallersByQueryV2TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/sensor_download/get_sensor_installers_entities_v2_parameters.go b/falcon/client/sensor_download/get_sensor_installers_entities_v2_parameters.go new file mode 100644 index 00000000..7701413f --- /dev/null +++ b/falcon/client/sensor_download/get_sensor_installers_entities_v2_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetSensorInstallersEntitiesV2Params creates a new GetSensorInstallersEntitiesV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSensorInstallersEntitiesV2Params() *GetSensorInstallersEntitiesV2Params { + return &GetSensorInstallersEntitiesV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSensorInstallersEntitiesV2ParamsWithTimeout creates a new GetSensorInstallersEntitiesV2Params object +// with the ability to set a timeout on a request. +func NewGetSensorInstallersEntitiesV2ParamsWithTimeout(timeout time.Duration) *GetSensorInstallersEntitiesV2Params { + return &GetSensorInstallersEntitiesV2Params{ + timeout: timeout, + } +} + +// NewGetSensorInstallersEntitiesV2ParamsWithContext creates a new GetSensorInstallersEntitiesV2Params object +// with the ability to set a context for a request. +func NewGetSensorInstallersEntitiesV2ParamsWithContext(ctx context.Context) *GetSensorInstallersEntitiesV2Params { + return &GetSensorInstallersEntitiesV2Params{ + Context: ctx, + } +} + +// NewGetSensorInstallersEntitiesV2ParamsWithHTTPClient creates a new GetSensorInstallersEntitiesV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetSensorInstallersEntitiesV2ParamsWithHTTPClient(client *http.Client) *GetSensorInstallersEntitiesV2Params { + return &GetSensorInstallersEntitiesV2Params{ + HTTPClient: client, + } +} + +/* +GetSensorInstallersEntitiesV2Params contains all the parameters to send to the API endpoint + + for the get sensor installers entities v2 operation. + + Typically these are written to a http.Request. +*/ +type GetSensorInstallersEntitiesV2Params struct { + + /* Ids. + + The IDs of the installers + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get sensor installers entities v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSensorInstallersEntitiesV2Params) WithDefaults() *GetSensorInstallersEntitiesV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get sensor installers entities v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSensorInstallersEntitiesV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) WithTimeout(timeout time.Duration) *GetSensorInstallersEntitiesV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) WithContext(ctx context.Context) *GetSensorInstallersEntitiesV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) WithHTTPClient(client *http.Client) *GetSensorInstallersEntitiesV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) WithIds(ids []string) *GetSensorInstallersEntitiesV2Params { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the get sensor installers entities v2 params +func (o *GetSensorInstallersEntitiesV2Params) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSensorInstallersEntitiesV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Ids != nil { + + // binding items for ids + joinedIds := o.bindParamIds(reg) + + // query array param ids + if err := r.SetQueryParam("ids", joinedIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetSensorInstallersEntitiesV2 binds the parameter ids +func (o *GetSensorInstallersEntitiesV2Params) bindParamIds(formats strfmt.Registry) []string { + idsIR := o.Ids + + var idsIC []string + for _, idsIIR := range idsIR { // explode []string + + idsIIV := idsIIR // string as string + idsIC = append(idsIC, idsIIV) + } + + // items.CollectionFormat: "multi" + idsIS := swag.JoinByFormat(idsIC, "multi") + + return idsIS +} diff --git a/falcon/client/sensor_download/get_sensor_installers_entities_v2_responses.go b/falcon/client/sensor_download/get_sensor_installers_entities_v2_responses.go new file mode 100644 index 00000000..49cbacbb --- /dev/null +++ b/falcon/client/sensor_download/get_sensor_installers_entities_v2_responses.go @@ -0,0 +1,742 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package sensor_download + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// GetSensorInstallersEntitiesV2Reader is a Reader for the GetSensorInstallersEntitiesV2 structure. +type GetSensorInstallersEntitiesV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSensorInstallersEntitiesV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSensorInstallersEntitiesV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 207: + result := NewGetSensorInstallersEntitiesV2MultiStatus() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetSensorInstallersEntitiesV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSensorInstallersEntitiesV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSensorInstallersEntitiesV2NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetSensorInstallersEntitiesV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /sensors/entities/installers/v2] GetSensorInstallersEntitiesV2", response, response.Code()) + } +} + +// NewGetSensorInstallersEntitiesV2OK creates a GetSensorInstallersEntitiesV2OK with default headers values +func NewGetSensorInstallersEntitiesV2OK() *GetSensorInstallersEntitiesV2OK { + return &GetSensorInstallersEntitiesV2OK{} +} + +/* +GetSensorInstallersEntitiesV2OK describes a response with status code 200, with default header values. + +OK +*/ +type GetSensorInstallersEntitiesV2OK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainSensorInstallersV2 +} + +// IsSuccess returns true when this get sensor installers entities v2 o k response has a 2xx status code +func (o *GetSensorInstallersEntitiesV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get sensor installers entities v2 o k response has a 3xx status code +func (o *GetSensorInstallersEntitiesV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers entities v2 o k response has a 4xx status code +func (o *GetSensorInstallersEntitiesV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get sensor installers entities v2 o k response has a 5xx status code +func (o *GetSensorInstallersEntitiesV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers entities v2 o k response a status code equal to that given +func (o *GetSensorInstallersEntitiesV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get sensor installers entities v2 o k response +func (o *GetSensorInstallersEntitiesV2OK) Code() int { + return 200 +} + +func (o *GetSensorInstallersEntitiesV2OK) Error() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2OK %+v", 200, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2OK) String() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2OK %+v", 200, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2OK) GetPayload() *models.DomainSensorInstallersV2 { + return o.Payload +} + +func (o *GetSensorInstallersEntitiesV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainSensorInstallersV2) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersEntitiesV2MultiStatus creates a GetSensorInstallersEntitiesV2MultiStatus with default headers values +func NewGetSensorInstallersEntitiesV2MultiStatus() *GetSensorInstallersEntitiesV2MultiStatus { + return &GetSensorInstallersEntitiesV2MultiStatus{} +} + +/* +GetSensorInstallersEntitiesV2MultiStatus describes a response with status code 207, with default header values. + +Multi-Status +*/ +type GetSensorInstallersEntitiesV2MultiStatus struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.DomainSensorInstallersV1 +} + +// IsSuccess returns true when this get sensor installers entities v2 multi status response has a 2xx status code +func (o *GetSensorInstallersEntitiesV2MultiStatus) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get sensor installers entities v2 multi status response has a 3xx status code +func (o *GetSensorInstallersEntitiesV2MultiStatus) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers entities v2 multi status response has a 4xx status code +func (o *GetSensorInstallersEntitiesV2MultiStatus) IsClientError() bool { + return false +} + +// IsServerError returns true when this get sensor installers entities v2 multi status response has a 5xx status code +func (o *GetSensorInstallersEntitiesV2MultiStatus) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers entities v2 multi status response a status code equal to that given +func (o *GetSensorInstallersEntitiesV2MultiStatus) IsCode(code int) bool { + return code == 207 +} + +// Code gets the status code for the get sensor installers entities v2 multi status response +func (o *GetSensorInstallersEntitiesV2MultiStatus) Code() int { + return 207 +} + +func (o *GetSensorInstallersEntitiesV2MultiStatus) Error() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2MultiStatus %+v", 207, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2MultiStatus) String() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2MultiStatus %+v", 207, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2MultiStatus) GetPayload() *models.DomainSensorInstallersV1 { + return o.Payload +} + +func (o *GetSensorInstallersEntitiesV2MultiStatus) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.DomainSensorInstallersV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersEntitiesV2BadRequest creates a GetSensorInstallersEntitiesV2BadRequest with default headers values +func NewGetSensorInstallersEntitiesV2BadRequest() *GetSensorInstallersEntitiesV2BadRequest { + return &GetSensorInstallersEntitiesV2BadRequest{} +} + +/* +GetSensorInstallersEntitiesV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetSensorInstallersEntitiesV2BadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this get sensor installers entities v2 bad request response has a 2xx status code +func (o *GetSensorInstallersEntitiesV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get sensor installers entities v2 bad request response has a 3xx status code +func (o *GetSensorInstallersEntitiesV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers entities v2 bad request response has a 4xx status code +func (o *GetSensorInstallersEntitiesV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get sensor installers entities v2 bad request response has a 5xx status code +func (o *GetSensorInstallersEntitiesV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers entities v2 bad request response a status code equal to that given +func (o *GetSensorInstallersEntitiesV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get sensor installers entities v2 bad request response +func (o *GetSensorInstallersEntitiesV2BadRequest) Code() int { + return 400 +} + +func (o *GetSensorInstallersEntitiesV2BadRequest) Error() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2BadRequest) String() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2BadRequest) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *GetSensorInstallersEntitiesV2BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersEntitiesV2Forbidden creates a GetSensorInstallersEntitiesV2Forbidden with default headers values +func NewGetSensorInstallersEntitiesV2Forbidden() *GetSensorInstallersEntitiesV2Forbidden { + return &GetSensorInstallersEntitiesV2Forbidden{} +} + +/* +GetSensorInstallersEntitiesV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetSensorInstallersEntitiesV2Forbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get sensor installers entities v2 forbidden response has a 2xx status code +func (o *GetSensorInstallersEntitiesV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get sensor installers entities v2 forbidden response has a 3xx status code +func (o *GetSensorInstallersEntitiesV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers entities v2 forbidden response has a 4xx status code +func (o *GetSensorInstallersEntitiesV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get sensor installers entities v2 forbidden response has a 5xx status code +func (o *GetSensorInstallersEntitiesV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers entities v2 forbidden response a status code equal to that given +func (o *GetSensorInstallersEntitiesV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get sensor installers entities v2 forbidden response +func (o *GetSensorInstallersEntitiesV2Forbidden) Code() int { + return 403 +} + +func (o *GetSensorInstallersEntitiesV2Forbidden) Error() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2Forbidden) String() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetSensorInstallersEntitiesV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersEntitiesV2NotFound creates a GetSensorInstallersEntitiesV2NotFound with default headers values +func NewGetSensorInstallersEntitiesV2NotFound() *GetSensorInstallersEntitiesV2NotFound { + return &GetSensorInstallersEntitiesV2NotFound{} +} + +/* +GetSensorInstallersEntitiesV2NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type GetSensorInstallersEntitiesV2NotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaspecQueryResponse +} + +// IsSuccess returns true when this get sensor installers entities v2 not found response has a 2xx status code +func (o *GetSensorInstallersEntitiesV2NotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get sensor installers entities v2 not found response has a 3xx status code +func (o *GetSensorInstallersEntitiesV2NotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers entities v2 not found response has a 4xx status code +func (o *GetSensorInstallersEntitiesV2NotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get sensor installers entities v2 not found response has a 5xx status code +func (o *GetSensorInstallersEntitiesV2NotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers entities v2 not found response a status code equal to that given +func (o *GetSensorInstallersEntitiesV2NotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get sensor installers entities v2 not found response +func (o *GetSensorInstallersEntitiesV2NotFound) Code() int { + return 404 +} + +func (o *GetSensorInstallersEntitiesV2NotFound) Error() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2NotFound %+v", 404, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2NotFound) String() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2NotFound %+v", 404, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2NotFound) GetPayload() *models.MsaspecQueryResponse { + return o.Payload +} + +func (o *GetSensorInstallersEntitiesV2NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaspecQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSensorInstallersEntitiesV2TooManyRequests creates a GetSensorInstallersEntitiesV2TooManyRequests with default headers values +func NewGetSensorInstallersEntitiesV2TooManyRequests() *GetSensorInstallersEntitiesV2TooManyRequests { + return &GetSensorInstallersEntitiesV2TooManyRequests{} +} + +/* +GetSensorInstallersEntitiesV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetSensorInstallersEntitiesV2TooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this get sensor installers entities v2 too many requests response has a 2xx status code +func (o *GetSensorInstallersEntitiesV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get sensor installers entities v2 too many requests response has a 3xx status code +func (o *GetSensorInstallersEntitiesV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sensor installers entities v2 too many requests response has a 4xx status code +func (o *GetSensorInstallersEntitiesV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get sensor installers entities v2 too many requests response has a 5xx status code +func (o *GetSensorInstallersEntitiesV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get sensor installers entities v2 too many requests response a status code equal to that given +func (o *GetSensorInstallersEntitiesV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get sensor installers entities v2 too many requests response +func (o *GetSensorInstallersEntitiesV2TooManyRequests) Code() int { + return 429 +} + +func (o *GetSensorInstallersEntitiesV2TooManyRequests) Error() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2TooManyRequests) String() string { + return fmt.Sprintf("[GET /sensors/entities/installers/v2][%d] getSensorInstallersEntitiesV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetSensorInstallersEntitiesV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetSensorInstallersEntitiesV2TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/sensor_download/sensor_download_client.go b/falcon/client/sensor_download/sensor_download_client.go index a348d456..b8c7b772 100644 --- a/falcon/client/sensor_download/sensor_download_client.go +++ b/falcon/client/sensor_download/sensor_download_client.go @@ -33,14 +33,22 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { DownloadSensorInstallerByID(params *DownloadSensorInstallerByIDParams, writer io.Writer, opts ...ClientOption) (*DownloadSensorInstallerByIDOK, error) + DownloadSensorInstallerByIDV2(params *DownloadSensorInstallerByIDV2Params, writer io.Writer, opts ...ClientOption) (*DownloadSensorInstallerByIDV2OK, error) + GetCombinedSensorInstallersByQuery(params *GetCombinedSensorInstallersByQueryParams, opts ...ClientOption) (*GetCombinedSensorInstallersByQueryOK, error) + GetCombinedSensorInstallersByQueryV2(params *GetCombinedSensorInstallersByQueryV2Params, opts ...ClientOption) (*GetCombinedSensorInstallersByQueryV2OK, error) + GetSensorInstallersByQuery(params *GetSensorInstallersByQueryParams, opts ...ClientOption) (*GetSensorInstallersByQueryOK, error) + GetSensorInstallersByQueryV2(params *GetSensorInstallersByQueryV2Params, opts ...ClientOption) (*GetSensorInstallersByQueryV2OK, error) + GetSensorInstallersCCIDByQuery(params *GetSensorInstallersCCIDByQueryParams, opts ...ClientOption) (*GetSensorInstallersCCIDByQueryOK, error) GetSensorInstallersEntities(params *GetSensorInstallersEntitiesParams, opts ...ClientOption) (*GetSensorInstallersEntitiesOK, *GetSensorInstallersEntitiesMultiStatus, error) + GetSensorInstallersEntitiesV2(params *GetSensorInstallersEntitiesV2Params, opts ...ClientOption) (*GetSensorInstallersEntitiesV2OK, *GetSensorInstallersEntitiesV2MultiStatus, error) + SetTransport(transport runtime.ClientTransport) } @@ -82,6 +90,44 @@ func (a *Client) DownloadSensorInstallerByID(params *DownloadSensorInstallerByID panic(msg) } +/* +DownloadSensorInstallerByIDV2 downloads sensor installer by s h a256 ID +*/ +func (a *Client) DownloadSensorInstallerByIDV2(params *DownloadSensorInstallerByIDV2Params, writer io.Writer, opts ...ClientOption) (*DownloadSensorInstallerByIDV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDownloadSensorInstallerByIDV2Params() + } + op := &runtime.ClientOperation{ + ID: "DownloadSensorInstallerByIdV2", + Method: "GET", + PathPattern: "/sensors/entities/download-installer/v2", + ProducesMediaTypes: []string{"application/json", "application/octet-stream"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DownloadSensorInstallerByIDV2Reader{formats: a.formats, writer: writer}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DownloadSensorInstallerByIDV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DownloadSensorInstallerByIdV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetCombinedSensorInstallersByQuery gets sensor installer details by provided query */ @@ -120,6 +166,44 @@ func (a *Client) GetCombinedSensorInstallersByQuery(params *GetCombinedSensorIns panic(msg) } +/* +GetCombinedSensorInstallersByQueryV2 gets sensor installer details by provided query +*/ +func (a *Client) GetCombinedSensorInstallersByQueryV2(params *GetCombinedSensorInstallersByQueryV2Params, opts ...ClientOption) (*GetCombinedSensorInstallersByQueryV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCombinedSensorInstallersByQueryV2Params() + } + op := &runtime.ClientOperation{ + ID: "GetCombinedSensorInstallersByQueryV2", + Method: "GET", + PathPattern: "/sensors/combined/installers/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetCombinedSensorInstallersByQueryV2Reader{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.(*GetCombinedSensorInstallersByQueryV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetCombinedSensorInstallersByQueryV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetSensorInstallersByQuery gets sensor installer i ds by provided query */ @@ -158,6 +242,44 @@ func (a *Client) GetSensorInstallersByQuery(params *GetSensorInstallersByQueryPa panic(msg) } +/* +GetSensorInstallersByQueryV2 gets sensor installer i ds by provided query +*/ +func (a *Client) GetSensorInstallersByQueryV2(params *GetSensorInstallersByQueryV2Params, opts ...ClientOption) (*GetSensorInstallersByQueryV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSensorInstallersByQueryV2Params() + } + op := &runtime.ClientOperation{ + ID: "GetSensorInstallersByQueryV2", + Method: "GET", + PathPattern: "/sensors/queries/installers/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSensorInstallersByQueryV2Reader{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.(*GetSensorInstallersByQueryV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetSensorInstallersByQueryV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetSensorInstallersCCIDByQuery gets c c ID to use with sensor installers */ @@ -235,6 +357,45 @@ func (a *Client) GetSensorInstallersEntities(params *GetSensorInstallersEntities panic(msg) } +/* +GetSensorInstallersEntitiesV2 gets sensor installer details by provided s h a256 i ds +*/ +func (a *Client) GetSensorInstallersEntitiesV2(params *GetSensorInstallersEntitiesV2Params, opts ...ClientOption) (*GetSensorInstallersEntitiesV2OK, *GetSensorInstallersEntitiesV2MultiStatus, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSensorInstallersEntitiesV2Params() + } + op := &runtime.ClientOperation{ + ID: "GetSensorInstallersEntitiesV2", + Method: "GET", + PathPattern: "/sensors/entities/installers/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSensorInstallersEntitiesV2Reader{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, nil, err + } + switch value := result.(type) { + case *GetSensorInstallersEntitiesV2OK: + return value, nil, nil + case *GetSensorInstallersEntitiesV2MultiStatus: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for sensor_download: 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/falcon/client/workflows/workflow_definitions_create_parameters.go b/falcon/client/workflows/workflow_definitions_create_parameters.go deleted file mode 100644 index 79037cd2..00000000 --- a/falcon/client/workflows/workflow_definitions_create_parameters.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflows - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" - - "github.com/crowdstrike/gofalcon/falcon/models" -) - -// NewWorkflowDefinitionsCreateParams creates a new WorkflowDefinitionsCreateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewWorkflowDefinitionsCreateParams() *WorkflowDefinitionsCreateParams { - return &WorkflowDefinitionsCreateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewWorkflowDefinitionsCreateParamsWithTimeout creates a new WorkflowDefinitionsCreateParams object -// with the ability to set a timeout on a request. -func NewWorkflowDefinitionsCreateParamsWithTimeout(timeout time.Duration) *WorkflowDefinitionsCreateParams { - return &WorkflowDefinitionsCreateParams{ - timeout: timeout, - } -} - -// NewWorkflowDefinitionsCreateParamsWithContext creates a new WorkflowDefinitionsCreateParams object -// with the ability to set a context for a request. -func NewWorkflowDefinitionsCreateParamsWithContext(ctx context.Context) *WorkflowDefinitionsCreateParams { - return &WorkflowDefinitionsCreateParams{ - Context: ctx, - } -} - -// NewWorkflowDefinitionsCreateParamsWithHTTPClient creates a new WorkflowDefinitionsCreateParams object -// with the ability to set a custom HTTPClient for a request. -func NewWorkflowDefinitionsCreateParamsWithHTTPClient(client *http.Client) *WorkflowDefinitionsCreateParams { - return &WorkflowDefinitionsCreateParams{ - HTTPClient: client, - } -} - -/* -WorkflowDefinitionsCreateParams contains all the parameters to send to the API endpoint - - for the workflow definitions create operation. - - Typically these are written to a http.Request. -*/ -type WorkflowDefinitionsCreateParams struct { - - // Body. - Body *models.ModelsDefinitionCreateRequestV2 - - /* ValidateOnly. - - When enabled, prevents saving workflow after validating - */ - ValidateOnly *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the workflow definitions create params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WorkflowDefinitionsCreateParams) WithDefaults() *WorkflowDefinitionsCreateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the workflow definitions create params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WorkflowDefinitionsCreateParams) SetDefaults() { - var ( - validateOnlyDefault = bool(false) - ) - - val := WorkflowDefinitionsCreateParams{ - ValidateOnly: &validateOnlyDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) WithTimeout(timeout time.Duration) *WorkflowDefinitionsCreateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) WithContext(ctx context.Context) *WorkflowDefinitionsCreateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) WithHTTPClient(client *http.Client) *WorkflowDefinitionsCreateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) WithBody(body *models.ModelsDefinitionCreateRequestV2) *WorkflowDefinitionsCreateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) SetBody(body *models.ModelsDefinitionCreateRequestV2) { - o.Body = body -} - -// WithValidateOnly adds the validateOnly to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) WithValidateOnly(validateOnly *bool) *WorkflowDefinitionsCreateParams { - o.SetValidateOnly(validateOnly) - return o -} - -// SetValidateOnly adds the validateOnly to the workflow definitions create params -func (o *WorkflowDefinitionsCreateParams) SetValidateOnly(validateOnly *bool) { - o.ValidateOnly = validateOnly -} - -// WriteToRequest writes these params to a swagger request -func (o *WorkflowDefinitionsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if o.ValidateOnly != nil { - - // query param validate_only - var qrValidateOnly bool - - if o.ValidateOnly != nil { - qrValidateOnly = *o.ValidateOnly - } - qValidateOnly := swag.FormatBool(qrValidateOnly) - if qValidateOnly != "" { - - if err := r.SetQueryParam("validate_only", qValidateOnly); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/workflows/workflow_definitions_create_responses.go b/falcon/client/workflows/workflow_definitions_create_responses.go deleted file mode 100644 index 2c3fd6e3..00000000 --- a/falcon/client/workflows/workflow_definitions_create_responses.go +++ /dev/null @@ -1,742 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package workflows - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/crowdstrike/gofalcon/falcon/models" -) - -// WorkflowDefinitionsCreateReader is a Reader for the WorkflowDefinitionsCreate structure. -type WorkflowDefinitionsCreateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *WorkflowDefinitionsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewWorkflowDefinitionsCreateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewWorkflowDefinitionsCreateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewWorkflowDefinitionsCreateForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewWorkflowDefinitionsCreateNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewWorkflowDefinitionsCreateTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewWorkflowDefinitionsCreateInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /workflows/entities/definitions/v1] WorkflowDefinitionsCreate", response, response.Code()) - } -} - -// NewWorkflowDefinitionsCreateOK creates a WorkflowDefinitionsCreateOK with default headers values -func NewWorkflowDefinitionsCreateOK() *WorkflowDefinitionsCreateOK { - return &WorkflowDefinitionsCreateOK{} -} - -/* -WorkflowDefinitionsCreateOK describes a response with status code 200, with default header values. - -OK -*/ -type WorkflowDefinitionsCreateOK struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.APIResourceIDsResponse -} - -// IsSuccess returns true when this workflow definitions create o k response has a 2xx status code -func (o *WorkflowDefinitionsCreateOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this workflow definitions create o k response has a 3xx status code -func (o *WorkflowDefinitionsCreateOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this workflow definitions create o k response has a 4xx status code -func (o *WorkflowDefinitionsCreateOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this workflow definitions create o k response has a 5xx status code -func (o *WorkflowDefinitionsCreateOK) IsServerError() bool { - return false -} - -// IsCode returns true when this workflow definitions create o k response a status code equal to that given -func (o *WorkflowDefinitionsCreateOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the workflow definitions create o k response -func (o *WorkflowDefinitionsCreateOK) Code() int { - return 200 -} - -func (o *WorkflowDefinitionsCreateOK) Error() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateOK %+v", 200, o.Payload) -} - -func (o *WorkflowDefinitionsCreateOK) String() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateOK %+v", 200, o.Payload) -} - -func (o *WorkflowDefinitionsCreateOK) GetPayload() *models.APIResourceIDsResponse { - return o.Payload -} - -func (o *WorkflowDefinitionsCreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.APIResourceIDsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewWorkflowDefinitionsCreateBadRequest creates a WorkflowDefinitionsCreateBadRequest with default headers values -func NewWorkflowDefinitionsCreateBadRequest() *WorkflowDefinitionsCreateBadRequest { - return &WorkflowDefinitionsCreateBadRequest{} -} - -/* -WorkflowDefinitionsCreateBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type WorkflowDefinitionsCreateBadRequest struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.APIResourceIDsResponse -} - -// IsSuccess returns true when this workflow definitions create bad request response has a 2xx status code -func (o *WorkflowDefinitionsCreateBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this workflow definitions create bad request response has a 3xx status code -func (o *WorkflowDefinitionsCreateBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this workflow definitions create bad request response has a 4xx status code -func (o *WorkflowDefinitionsCreateBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this workflow definitions create bad request response has a 5xx status code -func (o *WorkflowDefinitionsCreateBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this workflow definitions create bad request response a status code equal to that given -func (o *WorkflowDefinitionsCreateBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the workflow definitions create bad request response -func (o *WorkflowDefinitionsCreateBadRequest) Code() int { - return 400 -} - -func (o *WorkflowDefinitionsCreateBadRequest) Error() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateBadRequest %+v", 400, o.Payload) -} - -func (o *WorkflowDefinitionsCreateBadRequest) String() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateBadRequest %+v", 400, o.Payload) -} - -func (o *WorkflowDefinitionsCreateBadRequest) GetPayload() *models.APIResourceIDsResponse { - return o.Payload -} - -func (o *WorkflowDefinitionsCreateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.APIResourceIDsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewWorkflowDefinitionsCreateForbidden creates a WorkflowDefinitionsCreateForbidden with default headers values -func NewWorkflowDefinitionsCreateForbidden() *WorkflowDefinitionsCreateForbidden { - return &WorkflowDefinitionsCreateForbidden{} -} - -/* -WorkflowDefinitionsCreateForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type WorkflowDefinitionsCreateForbidden struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this workflow definitions create forbidden response has a 2xx status code -func (o *WorkflowDefinitionsCreateForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this workflow definitions create forbidden response has a 3xx status code -func (o *WorkflowDefinitionsCreateForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this workflow definitions create forbidden response has a 4xx status code -func (o *WorkflowDefinitionsCreateForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this workflow definitions create forbidden response has a 5xx status code -func (o *WorkflowDefinitionsCreateForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this workflow definitions create forbidden response a status code equal to that given -func (o *WorkflowDefinitionsCreateForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the workflow definitions create forbidden response -func (o *WorkflowDefinitionsCreateForbidden) Code() int { - return 403 -} - -func (o *WorkflowDefinitionsCreateForbidden) Error() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateForbidden %+v", 403, o.Payload) -} - -func (o *WorkflowDefinitionsCreateForbidden) String() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateForbidden %+v", 403, o.Payload) -} - -func (o *WorkflowDefinitionsCreateForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *WorkflowDefinitionsCreateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewWorkflowDefinitionsCreateNotFound creates a WorkflowDefinitionsCreateNotFound with default headers values -func NewWorkflowDefinitionsCreateNotFound() *WorkflowDefinitionsCreateNotFound { - return &WorkflowDefinitionsCreateNotFound{} -} - -/* -WorkflowDefinitionsCreateNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type WorkflowDefinitionsCreateNotFound struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.APIResourceIDsResponse -} - -// IsSuccess returns true when this workflow definitions create not found response has a 2xx status code -func (o *WorkflowDefinitionsCreateNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this workflow definitions create not found response has a 3xx status code -func (o *WorkflowDefinitionsCreateNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this workflow definitions create not found response has a 4xx status code -func (o *WorkflowDefinitionsCreateNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this workflow definitions create not found response has a 5xx status code -func (o *WorkflowDefinitionsCreateNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this workflow definitions create not found response a status code equal to that given -func (o *WorkflowDefinitionsCreateNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the workflow definitions create not found response -func (o *WorkflowDefinitionsCreateNotFound) Code() int { - return 404 -} - -func (o *WorkflowDefinitionsCreateNotFound) Error() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateNotFound %+v", 404, o.Payload) -} - -func (o *WorkflowDefinitionsCreateNotFound) String() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateNotFound %+v", 404, o.Payload) -} - -func (o *WorkflowDefinitionsCreateNotFound) GetPayload() *models.APIResourceIDsResponse { - return o.Payload -} - -func (o *WorkflowDefinitionsCreateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.APIResourceIDsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewWorkflowDefinitionsCreateTooManyRequests creates a WorkflowDefinitionsCreateTooManyRequests with default headers values -func NewWorkflowDefinitionsCreateTooManyRequests() *WorkflowDefinitionsCreateTooManyRequests { - return &WorkflowDefinitionsCreateTooManyRequests{} -} - -/* -WorkflowDefinitionsCreateTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type WorkflowDefinitionsCreateTooManyRequests struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - /* Too many requests, retry after this time (as milliseconds since epoch) - */ - XRateLimitRetryAfter int64 - - Payload *models.MsaReplyMetaOnly -} - -// IsSuccess returns true when this workflow definitions create too many requests response has a 2xx status code -func (o *WorkflowDefinitionsCreateTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this workflow definitions create too many requests response has a 3xx status code -func (o *WorkflowDefinitionsCreateTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this workflow definitions create too many requests response has a 4xx status code -func (o *WorkflowDefinitionsCreateTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this workflow definitions create too many requests response has a 5xx status code -func (o *WorkflowDefinitionsCreateTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this workflow definitions create too many requests response a status code equal to that given -func (o *WorkflowDefinitionsCreateTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the workflow definitions create too many requests response -func (o *WorkflowDefinitionsCreateTooManyRequests) Code() int { - return 429 -} - -func (o *WorkflowDefinitionsCreateTooManyRequests) Error() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateTooManyRequests %+v", 429, o.Payload) -} - -func (o *WorkflowDefinitionsCreateTooManyRequests) String() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateTooManyRequests %+v", 429, o.Payload) -} - -func (o *WorkflowDefinitionsCreateTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *WorkflowDefinitionsCreateTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - // hydrates response header X-RateLimit-RetryAfter - hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") - - if hdrXRateLimitRetryAfter != "" { - valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) - if err != nil { - return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) - } - o.XRateLimitRetryAfter = valxRateLimitRetryAfter - } - - o.Payload = new(models.MsaReplyMetaOnly) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewWorkflowDefinitionsCreateInternalServerError creates a WorkflowDefinitionsCreateInternalServerError with default headers values -func NewWorkflowDefinitionsCreateInternalServerError() *WorkflowDefinitionsCreateInternalServerError { - return &WorkflowDefinitionsCreateInternalServerError{} -} - -/* -WorkflowDefinitionsCreateInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type WorkflowDefinitionsCreateInternalServerError struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.APIResourceIDsResponse -} - -// IsSuccess returns true when this workflow definitions create internal server error response has a 2xx status code -func (o *WorkflowDefinitionsCreateInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this workflow definitions create internal server error response has a 3xx status code -func (o *WorkflowDefinitionsCreateInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this workflow definitions create internal server error response has a 4xx status code -func (o *WorkflowDefinitionsCreateInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this workflow definitions create internal server error response has a 5xx status code -func (o *WorkflowDefinitionsCreateInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this workflow definitions create internal server error response a status code equal to that given -func (o *WorkflowDefinitionsCreateInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the workflow definitions create internal server error response -func (o *WorkflowDefinitionsCreateInternalServerError) Code() int { - return 500 -} - -func (o *WorkflowDefinitionsCreateInternalServerError) Error() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateInternalServerError %+v", 500, o.Payload) -} - -func (o *WorkflowDefinitionsCreateInternalServerError) String() string { - return fmt.Sprintf("[POST /workflows/entities/definitions/v1][%d] workflowDefinitionsCreateInternalServerError %+v", 500, o.Payload) -} - -func (o *WorkflowDefinitionsCreateInternalServerError) GetPayload() *models.APIResourceIDsResponse { - return o.Payload -} - -func (o *WorkflowDefinitionsCreateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.APIResourceIDsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/falcon/client/workflows/workflow_definitions_export_parameters.go b/falcon/client/workflows/workflow_definitions_export_parameters.go index 35a92651..86186551 100644 --- a/falcon/client/workflows/workflow_definitions_export_parameters.go +++ b/falcon/client/workflows/workflow_definitions_export_parameters.go @@ -14,6 +14,7 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // NewWorkflowDefinitionsExportParams creates a new WorkflowDefinitionsExportParams object, @@ -67,6 +68,14 @@ type WorkflowDefinitionsExportParams struct { */ ID string + /* Sanitize. + + whether or not to sanitize PII from workflow before it's exported + + Default: true + */ + Sanitize *bool + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -84,7 +93,18 @@ func (o *WorkflowDefinitionsExportParams) WithDefaults() *WorkflowDefinitionsExp // // All values with no default are reset to their zero value. func (o *WorkflowDefinitionsExportParams) SetDefaults() { - // no default values defined for this parameter + var ( + sanitizeDefault = bool(true) + ) + + val := WorkflowDefinitionsExportParams{ + Sanitize: &sanitizeDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val } // WithTimeout adds the timeout to the workflow definitions export params @@ -131,6 +151,17 @@ func (o *WorkflowDefinitionsExportParams) SetID(id string) { o.ID = id } +// WithSanitize adds the sanitize to the workflow definitions export params +func (o *WorkflowDefinitionsExportParams) WithSanitize(sanitize *bool) *WorkflowDefinitionsExportParams { + o.SetSanitize(sanitize) + return o +} + +// SetSanitize adds the sanitize to the workflow definitions export params +func (o *WorkflowDefinitionsExportParams) SetSanitize(sanitize *bool) { + o.Sanitize = sanitize +} + // WriteToRequest writes these params to a swagger request func (o *WorkflowDefinitionsExportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -149,6 +180,23 @@ func (o *WorkflowDefinitionsExportParams) WriteToRequest(r runtime.ClientRequest } } + if o.Sanitize != nil { + + // query param sanitize + var qrSanitize bool + + if o.Sanitize != nil { + qrSanitize = *o.Sanitize + } + qSanitize := swag.FormatBool(qrSanitize) + if qSanitize != "" { + + if err := r.SetQueryParam("sanitize", qSanitize); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/falcon/client/workflows/workflow_execute_internal_parameters.go b/falcon/client/workflows/workflow_execute_internal_parameters.go new file mode 100644 index 00000000..81570490 --- /dev/null +++ b/falcon/client/workflows/workflow_execute_internal_parameters.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package workflows + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// NewWorkflowExecuteInternalParams creates a new WorkflowExecuteInternalParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWorkflowExecuteInternalParams() *WorkflowExecuteInternalParams { + return &WorkflowExecuteInternalParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWorkflowExecuteInternalParamsWithTimeout creates a new WorkflowExecuteInternalParams object +// with the ability to set a timeout on a request. +func NewWorkflowExecuteInternalParamsWithTimeout(timeout time.Duration) *WorkflowExecuteInternalParams { + return &WorkflowExecuteInternalParams{ + timeout: timeout, + } +} + +// NewWorkflowExecuteInternalParamsWithContext creates a new WorkflowExecuteInternalParams object +// with the ability to set a context for a request. +func NewWorkflowExecuteInternalParamsWithContext(ctx context.Context) *WorkflowExecuteInternalParams { + return &WorkflowExecuteInternalParams{ + Context: ctx, + } +} + +// NewWorkflowExecuteInternalParamsWithHTTPClient creates a new WorkflowExecuteInternalParams object +// with the ability to set a custom HTTPClient for a request. +func NewWorkflowExecuteInternalParamsWithHTTPClient(client *http.Client) *WorkflowExecuteInternalParams { + return &WorkflowExecuteInternalParams{ + HTTPClient: client, + } +} + +/* +WorkflowExecuteInternalParams contains all the parameters to send to the API endpoint + + for the workflow execute internal operation. + + Typically these are written to a http.Request. +*/ +type WorkflowExecuteInternalParams struct { + + /* BatchSize. + + Used to set the batchSize, if unset the default batchSize is used + */ + BatchSize *int64 + + // Body. + Body models.MapStringInterface + + /* DefinitionID. + + Definition ID to execute, either a name or an ID can be specified. + */ + DefinitionID []string + + /* Depth. + + Used to record the execution depth to help limit execution loops when a workflow triggers another. The maximum depth is 4. + */ + Depth *int64 + + /* ExecutionCid. + + CID(s) to execute on. This can be a child if this is a flight control enabled definition. If unset the definition CID is used. + */ + ExecutionCid []string + + /* Key. + + Key used to help deduplicate executions, if unset a new UUID is used + */ + Key *string + + /* Name. + + Workflow name to execute, either a name or an ID can be specified. + */ + Name *string + + /* SourceEventURL. + + Used to record a URL to the source that led to triggering this workflow + */ + SourceEventURL *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the workflow execute internal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WorkflowExecuteInternalParams) WithDefaults() *WorkflowExecuteInternalParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the workflow execute internal params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WorkflowExecuteInternalParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithTimeout(timeout time.Duration) *WorkflowExecuteInternalParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithContext(ctx context.Context) *WorkflowExecuteInternalParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithHTTPClient(client *http.Client) *WorkflowExecuteInternalParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBatchSize adds the batchSize to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithBatchSize(batchSize *int64) *WorkflowExecuteInternalParams { + o.SetBatchSize(batchSize) + return o +} + +// SetBatchSize adds the batchSize to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetBatchSize(batchSize *int64) { + o.BatchSize = batchSize +} + +// WithBody adds the body to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithBody(body models.MapStringInterface) *WorkflowExecuteInternalParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetBody(body models.MapStringInterface) { + o.Body = body +} + +// WithDefinitionID adds the definitionID to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithDefinitionID(definitionID []string) *WorkflowExecuteInternalParams { + o.SetDefinitionID(definitionID) + return o +} + +// SetDefinitionID adds the definitionId to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetDefinitionID(definitionID []string) { + o.DefinitionID = definitionID +} + +// WithDepth adds the depth to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithDepth(depth *int64) *WorkflowExecuteInternalParams { + o.SetDepth(depth) + return o +} + +// SetDepth adds the depth to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetDepth(depth *int64) { + o.Depth = depth +} + +// WithExecutionCid adds the executionCid to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithExecutionCid(executionCid []string) *WorkflowExecuteInternalParams { + o.SetExecutionCid(executionCid) + return o +} + +// SetExecutionCid adds the executionCid to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetExecutionCid(executionCid []string) { + o.ExecutionCid = executionCid +} + +// WithKey adds the key to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithKey(key *string) *WorkflowExecuteInternalParams { + o.SetKey(key) + return o +} + +// SetKey adds the key to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetKey(key *string) { + o.Key = key +} + +// WithName adds the name to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithName(name *string) *WorkflowExecuteInternalParams { + o.SetName(name) + return o +} + +// SetName adds the name to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetName(name *string) { + o.Name = name +} + +// WithSourceEventURL adds the sourceEventURL to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) WithSourceEventURL(sourceEventURL *string) *WorkflowExecuteInternalParams { + o.SetSourceEventURL(sourceEventURL) + return o +} + +// SetSourceEventURL adds the sourceEventUrl to the workflow execute internal params +func (o *WorkflowExecuteInternalParams) SetSourceEventURL(sourceEventURL *string) { + o.SourceEventURL = sourceEventURL +} + +// WriteToRequest writes these params to a swagger request +func (o *WorkflowExecuteInternalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BatchSize != nil { + + // query param batch_size + var qrBatchSize int64 + + if o.BatchSize != nil { + qrBatchSize = *o.BatchSize + } + qBatchSize := swag.FormatInt64(qrBatchSize) + if qBatchSize != "" { + + if err := r.SetQueryParam("batch_size", qBatchSize); err != nil { + return err + } + } + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.DefinitionID != nil { + + // binding items for definition_id + joinedDefinitionID := o.bindParamDefinitionID(reg) + + // query array param definition_id + if err := r.SetQueryParam("definition_id", joinedDefinitionID...); err != nil { + return err + } + } + + if o.Depth != nil { + + // query param depth + var qrDepth int64 + + if o.Depth != nil { + qrDepth = *o.Depth + } + qDepth := swag.FormatInt64(qrDepth) + if qDepth != "" { + + if err := r.SetQueryParam("depth", qDepth); err != nil { + return err + } + } + } + + if o.ExecutionCid != nil { + + // binding items for execution_cid + joinedExecutionCid := o.bindParamExecutionCid(reg) + + // query array param execution_cid + if err := r.SetQueryParam("execution_cid", joinedExecutionCid...); err != nil { + return err + } + } + + if o.Key != nil { + + // query param key + var qrKey string + + if o.Key != nil { + qrKey = *o.Key + } + qKey := qrKey + if qKey != "" { + + if err := r.SetQueryParam("key", qKey); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.SourceEventURL != nil { + + // query param source_event_url + var qrSourceEventURL string + + if o.SourceEventURL != nil { + qrSourceEventURL = *o.SourceEventURL + } + qSourceEventURL := qrSourceEventURL + if qSourceEventURL != "" { + + if err := r.SetQueryParam("source_event_url", qSourceEventURL); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamWorkflowExecuteInternal binds the parameter definition_id +func (o *WorkflowExecuteInternalParams) bindParamDefinitionID(formats strfmt.Registry) []string { + definitionIDIR := o.DefinitionID + + var definitionIDIC []string + for _, definitionIDIIR := range definitionIDIR { // explode []string + + definitionIDIIV := definitionIDIIR // string as string + definitionIDIC = append(definitionIDIC, definitionIDIIV) + } + + // items.CollectionFormat: "csv" + definitionIDIS := swag.JoinByFormat(definitionIDIC, "csv") + + return definitionIDIS +} + +// bindParamWorkflowExecuteInternal binds the parameter execution_cid +func (o *WorkflowExecuteInternalParams) bindParamExecutionCid(formats strfmt.Registry) []string { + executionCidIR := o.ExecutionCid + + var executionCidIC []string + for _, executionCidIIR := range executionCidIR { // explode []string + + executionCidIIV := executionCidIIR // string as string + executionCidIC = append(executionCidIC, executionCidIIV) + } + + // items.CollectionFormat: "csv" + executionCidIS := swag.JoinByFormat(executionCidIC, "csv") + + return executionCidIS +} diff --git a/falcon/client/workflows/workflow_execute_internal_responses.go b/falcon/client/workflows/workflow_execute_internal_responses.go new file mode 100644 index 00000000..5de2afe1 --- /dev/null +++ b/falcon/client/workflows/workflow_execute_internal_responses.go @@ -0,0 +1,742 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package workflows + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// WorkflowExecuteInternalReader is a Reader for the WorkflowExecuteInternal structure. +type WorkflowExecuteInternalReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WorkflowExecuteInternalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWorkflowExecuteInternalOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewWorkflowExecuteInternalBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewWorkflowExecuteInternalForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewWorkflowExecuteInternalNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewWorkflowExecuteInternalTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewWorkflowExecuteInternalInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /workflows/entities/execute/internal/v1] WorkflowExecuteInternal", response, response.Code()) + } +} + +// NewWorkflowExecuteInternalOK creates a WorkflowExecuteInternalOK with default headers values +func NewWorkflowExecuteInternalOK() *WorkflowExecuteInternalOK { + return &WorkflowExecuteInternalOK{} +} + +/* +WorkflowExecuteInternalOK describes a response with status code 200, with default header values. + +OK +*/ +type WorkflowExecuteInternalOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow execute internal o k response has a 2xx status code +func (o *WorkflowExecuteInternalOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this workflow execute internal o k response has a 3xx status code +func (o *WorkflowExecuteInternalOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow execute internal o k response has a 4xx status code +func (o *WorkflowExecuteInternalOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this workflow execute internal o k response has a 5xx status code +func (o *WorkflowExecuteInternalOK) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow execute internal o k response a status code equal to that given +func (o *WorkflowExecuteInternalOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the workflow execute internal o k response +func (o *WorkflowExecuteInternalOK) Code() int { + return 200 +} + +func (o *WorkflowExecuteInternalOK) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalOK %+v", 200, o.Payload) +} + +func (o *WorkflowExecuteInternalOK) String() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalOK %+v", 200, o.Payload) +} + +func (o *WorkflowExecuteInternalOK) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowExecuteInternalOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowExecuteInternalBadRequest creates a WorkflowExecuteInternalBadRequest with default headers values +func NewWorkflowExecuteInternalBadRequest() *WorkflowExecuteInternalBadRequest { + return &WorkflowExecuteInternalBadRequest{} +} + +/* +WorkflowExecuteInternalBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type WorkflowExecuteInternalBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow execute internal bad request response has a 2xx status code +func (o *WorkflowExecuteInternalBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow execute internal bad request response has a 3xx status code +func (o *WorkflowExecuteInternalBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow execute internal bad request response has a 4xx status code +func (o *WorkflowExecuteInternalBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow execute internal bad request response has a 5xx status code +func (o *WorkflowExecuteInternalBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow execute internal bad request response a status code equal to that given +func (o *WorkflowExecuteInternalBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the workflow execute internal bad request response +func (o *WorkflowExecuteInternalBadRequest) Code() int { + return 400 +} + +func (o *WorkflowExecuteInternalBadRequest) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalBadRequest %+v", 400, o.Payload) +} + +func (o *WorkflowExecuteInternalBadRequest) String() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalBadRequest %+v", 400, o.Payload) +} + +func (o *WorkflowExecuteInternalBadRequest) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowExecuteInternalBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowExecuteInternalForbidden creates a WorkflowExecuteInternalForbidden with default headers values +func NewWorkflowExecuteInternalForbidden() *WorkflowExecuteInternalForbidden { + return &WorkflowExecuteInternalForbidden{} +} + +/* +WorkflowExecuteInternalForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type WorkflowExecuteInternalForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this workflow execute internal forbidden response has a 2xx status code +func (o *WorkflowExecuteInternalForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow execute internal forbidden response has a 3xx status code +func (o *WorkflowExecuteInternalForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow execute internal forbidden response has a 4xx status code +func (o *WorkflowExecuteInternalForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow execute internal forbidden response has a 5xx status code +func (o *WorkflowExecuteInternalForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow execute internal forbidden response a status code equal to that given +func (o *WorkflowExecuteInternalForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the workflow execute internal forbidden response +func (o *WorkflowExecuteInternalForbidden) Code() int { + return 403 +} + +func (o *WorkflowExecuteInternalForbidden) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalForbidden %+v", 403, o.Payload) +} + +func (o *WorkflowExecuteInternalForbidden) String() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalForbidden %+v", 403, o.Payload) +} + +func (o *WorkflowExecuteInternalForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *WorkflowExecuteInternalForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowExecuteInternalNotFound creates a WorkflowExecuteInternalNotFound with default headers values +func NewWorkflowExecuteInternalNotFound() *WorkflowExecuteInternalNotFound { + return &WorkflowExecuteInternalNotFound{} +} + +/* +WorkflowExecuteInternalNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type WorkflowExecuteInternalNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow execute internal not found response has a 2xx status code +func (o *WorkflowExecuteInternalNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow execute internal not found response has a 3xx status code +func (o *WorkflowExecuteInternalNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow execute internal not found response has a 4xx status code +func (o *WorkflowExecuteInternalNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow execute internal not found response has a 5xx status code +func (o *WorkflowExecuteInternalNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow execute internal not found response a status code equal to that given +func (o *WorkflowExecuteInternalNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the workflow execute internal not found response +func (o *WorkflowExecuteInternalNotFound) Code() int { + return 404 +} + +func (o *WorkflowExecuteInternalNotFound) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalNotFound %+v", 404, o.Payload) +} + +func (o *WorkflowExecuteInternalNotFound) String() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalNotFound %+v", 404, o.Payload) +} + +func (o *WorkflowExecuteInternalNotFound) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowExecuteInternalNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowExecuteInternalTooManyRequests creates a WorkflowExecuteInternalTooManyRequests with default headers values +func NewWorkflowExecuteInternalTooManyRequests() *WorkflowExecuteInternalTooManyRequests { + return &WorkflowExecuteInternalTooManyRequests{} +} + +/* +WorkflowExecuteInternalTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type WorkflowExecuteInternalTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this workflow execute internal too many requests response has a 2xx status code +func (o *WorkflowExecuteInternalTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow execute internal too many requests response has a 3xx status code +func (o *WorkflowExecuteInternalTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow execute internal too many requests response has a 4xx status code +func (o *WorkflowExecuteInternalTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow execute internal too many requests response has a 5xx status code +func (o *WorkflowExecuteInternalTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow execute internal too many requests response a status code equal to that given +func (o *WorkflowExecuteInternalTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the workflow execute internal too many requests response +func (o *WorkflowExecuteInternalTooManyRequests) Code() int { + return 429 +} + +func (o *WorkflowExecuteInternalTooManyRequests) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalTooManyRequests %+v", 429, o.Payload) +} + +func (o *WorkflowExecuteInternalTooManyRequests) String() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalTooManyRequests %+v", 429, o.Payload) +} + +func (o *WorkflowExecuteInternalTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *WorkflowExecuteInternalTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowExecuteInternalInternalServerError creates a WorkflowExecuteInternalInternalServerError with default headers values +func NewWorkflowExecuteInternalInternalServerError() *WorkflowExecuteInternalInternalServerError { + return &WorkflowExecuteInternalInternalServerError{} +} + +/* +WorkflowExecuteInternalInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type WorkflowExecuteInternalInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow execute internal internal server error response has a 2xx status code +func (o *WorkflowExecuteInternalInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow execute internal internal server error response has a 3xx status code +func (o *WorkflowExecuteInternalInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow execute internal internal server error response has a 4xx status code +func (o *WorkflowExecuteInternalInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this workflow execute internal internal server error response has a 5xx status code +func (o *WorkflowExecuteInternalInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this workflow execute internal internal server error response a status code equal to that given +func (o *WorkflowExecuteInternalInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the workflow execute internal internal server error response +func (o *WorkflowExecuteInternalInternalServerError) Code() int { + return 500 +} + +func (o *WorkflowExecuteInternalInternalServerError) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalInternalServerError %+v", 500, o.Payload) +} + +func (o *WorkflowExecuteInternalInternalServerError) String() string { + return fmt.Sprintf("[POST /workflows/entities/execute/internal/v1][%d] workflowExecuteInternalInternalServerError %+v", 500, o.Payload) +} + +func (o *WorkflowExecuteInternalInternalServerError) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowExecuteInternalInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/workflows/workflow_mock_execute_parameters.go b/falcon/client/workflows/workflow_mock_execute_parameters.go new file mode 100644 index 00000000..437a0142 --- /dev/null +++ b/falcon/client/workflows/workflow_mock_execute_parameters.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package workflows + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// NewWorkflowMockExecuteParams creates a new WorkflowMockExecuteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWorkflowMockExecuteParams() *WorkflowMockExecuteParams { + return &WorkflowMockExecuteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWorkflowMockExecuteParamsWithTimeout creates a new WorkflowMockExecuteParams object +// with the ability to set a timeout on a request. +func NewWorkflowMockExecuteParamsWithTimeout(timeout time.Duration) *WorkflowMockExecuteParams { + return &WorkflowMockExecuteParams{ + timeout: timeout, + } +} + +// NewWorkflowMockExecuteParamsWithContext creates a new WorkflowMockExecuteParams object +// with the ability to set a context for a request. +func NewWorkflowMockExecuteParamsWithContext(ctx context.Context) *WorkflowMockExecuteParams { + return &WorkflowMockExecuteParams{ + Context: ctx, + } +} + +// NewWorkflowMockExecuteParamsWithHTTPClient creates a new WorkflowMockExecuteParams object +// with the ability to set a custom HTTPClient for a request. +func NewWorkflowMockExecuteParamsWithHTTPClient(client *http.Client) *WorkflowMockExecuteParams { + return &WorkflowMockExecuteParams{ + HTTPClient: client, + } +} + +/* +WorkflowMockExecuteParams contains all the parameters to send to the API endpoint + + for the workflow mock execute operation. + + Typically these are written to a http.Request. +*/ +type WorkflowMockExecuteParams struct { + + // Body. + Body *models.ModelsMockExecutionCreateRequestV1 + + /* DefinitionID. + + Definition ID to execute, either a name or an ID, or the definition itself in the request body, can be specified. + */ + DefinitionID *string + + /* Depth. + + Used to record the execution depth to help limit execution loops when a workflow triggers another. The maximum depth is 4. + */ + Depth *int64 + + /* ExecutionCid. + + CID(s) to execute on. This can be a child if this is a flight control enabled definition. If unset the definition CID is used. + */ + ExecutionCid []string + + /* Key. + + Key used to help deduplicate executions, if unset a new UUID is used + */ + Key *string + + /* Name. + + Workflow name to execute, either a name or an ID, or the definition itself in the request body, can be specified. + */ + Name *string + + /* SourceEventURL. + + Used to record a URL to the source that led to triggering this workflow + */ + SourceEventURL *string + + /* ValidateOnly. + + When enabled, prevents execution after validating mocks against definition + */ + ValidateOnly *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the workflow mock execute params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WorkflowMockExecuteParams) WithDefaults() *WorkflowMockExecuteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the workflow mock execute params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WorkflowMockExecuteParams) SetDefaults() { + var ( + validateOnlyDefault = bool(false) + ) + + val := WorkflowMockExecuteParams{ + ValidateOnly: &validateOnlyDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithTimeout(timeout time.Duration) *WorkflowMockExecuteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithContext(ctx context.Context) *WorkflowMockExecuteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithHTTPClient(client *http.Client) *WorkflowMockExecuteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithBody(body *models.ModelsMockExecutionCreateRequestV1) *WorkflowMockExecuteParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetBody(body *models.ModelsMockExecutionCreateRequestV1) { + o.Body = body +} + +// WithDefinitionID adds the definitionID to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithDefinitionID(definitionID *string) *WorkflowMockExecuteParams { + o.SetDefinitionID(definitionID) + return o +} + +// SetDefinitionID adds the definitionId to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetDefinitionID(definitionID *string) { + o.DefinitionID = definitionID +} + +// WithDepth adds the depth to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithDepth(depth *int64) *WorkflowMockExecuteParams { + o.SetDepth(depth) + return o +} + +// SetDepth adds the depth to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetDepth(depth *int64) { + o.Depth = depth +} + +// WithExecutionCid adds the executionCid to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithExecutionCid(executionCid []string) *WorkflowMockExecuteParams { + o.SetExecutionCid(executionCid) + return o +} + +// SetExecutionCid adds the executionCid to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetExecutionCid(executionCid []string) { + o.ExecutionCid = executionCid +} + +// WithKey adds the key to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithKey(key *string) *WorkflowMockExecuteParams { + o.SetKey(key) + return o +} + +// SetKey adds the key to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetKey(key *string) { + o.Key = key +} + +// WithName adds the name to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithName(name *string) *WorkflowMockExecuteParams { + o.SetName(name) + return o +} + +// SetName adds the name to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetName(name *string) { + o.Name = name +} + +// WithSourceEventURL adds the sourceEventURL to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithSourceEventURL(sourceEventURL *string) *WorkflowMockExecuteParams { + o.SetSourceEventURL(sourceEventURL) + return o +} + +// SetSourceEventURL adds the sourceEventUrl to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetSourceEventURL(sourceEventURL *string) { + o.SourceEventURL = sourceEventURL +} + +// WithValidateOnly adds the validateOnly to the workflow mock execute params +func (o *WorkflowMockExecuteParams) WithValidateOnly(validateOnly *bool) *WorkflowMockExecuteParams { + o.SetValidateOnly(validateOnly) + return o +} + +// SetValidateOnly adds the validateOnly to the workflow mock execute params +func (o *WorkflowMockExecuteParams) SetValidateOnly(validateOnly *bool) { + o.ValidateOnly = validateOnly +} + +// WriteToRequest writes these params to a swagger request +func (o *WorkflowMockExecuteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if o.DefinitionID != nil { + + // query param definition_id + var qrDefinitionID string + + if o.DefinitionID != nil { + qrDefinitionID = *o.DefinitionID + } + qDefinitionID := qrDefinitionID + if qDefinitionID != "" { + + if err := r.SetQueryParam("definition_id", qDefinitionID); err != nil { + return err + } + } + } + + if o.Depth != nil { + + // query param depth + var qrDepth int64 + + if o.Depth != nil { + qrDepth = *o.Depth + } + qDepth := swag.FormatInt64(qrDepth) + if qDepth != "" { + + if err := r.SetQueryParam("depth", qDepth); err != nil { + return err + } + } + } + + if o.ExecutionCid != nil { + + // binding items for execution_cid + joinedExecutionCid := o.bindParamExecutionCid(reg) + + // query array param execution_cid + if err := r.SetQueryParam("execution_cid", joinedExecutionCid...); err != nil { + return err + } + } + + if o.Key != nil { + + // query param key + var qrKey string + + if o.Key != nil { + qrKey = *o.Key + } + qKey := qrKey + if qKey != "" { + + if err := r.SetQueryParam("key", qKey); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.SourceEventURL != nil { + + // query param source_event_url + var qrSourceEventURL string + + if o.SourceEventURL != nil { + qrSourceEventURL = *o.SourceEventURL + } + qSourceEventURL := qrSourceEventURL + if qSourceEventURL != "" { + + if err := r.SetQueryParam("source_event_url", qSourceEventURL); err != nil { + return err + } + } + } + + if o.ValidateOnly != nil { + + // query param validate_only + var qrValidateOnly bool + + if o.ValidateOnly != nil { + qrValidateOnly = *o.ValidateOnly + } + qValidateOnly := swag.FormatBool(qrValidateOnly) + if qValidateOnly != "" { + + if err := r.SetQueryParam("validate_only", qValidateOnly); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamWorkflowMockExecute binds the parameter execution_cid +func (o *WorkflowMockExecuteParams) bindParamExecutionCid(formats strfmt.Registry) []string { + executionCidIR := o.ExecutionCid + + var executionCidIC []string + for _, executionCidIIR := range executionCidIR { // explode []string + + executionCidIIV := executionCidIIR // string as string + executionCidIC = append(executionCidIC, executionCidIIV) + } + + // items.CollectionFormat: "csv" + executionCidIS := swag.JoinByFormat(executionCidIC, "csv") + + return executionCidIS +} diff --git a/falcon/client/workflows/workflow_mock_execute_responses.go b/falcon/client/workflows/workflow_mock_execute_responses.go new file mode 100644 index 00000000..d2b6b1e1 --- /dev/null +++ b/falcon/client/workflows/workflow_mock_execute_responses.go @@ -0,0 +1,742 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package workflows + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// WorkflowMockExecuteReader is a Reader for the WorkflowMockExecute structure. +type WorkflowMockExecuteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WorkflowMockExecuteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWorkflowMockExecuteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewWorkflowMockExecuteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewWorkflowMockExecuteForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewWorkflowMockExecuteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewWorkflowMockExecuteTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewWorkflowMockExecuteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /workflows/entities/mock-executions/v1] WorkflowMockExecute", response, response.Code()) + } +} + +// NewWorkflowMockExecuteOK creates a WorkflowMockExecuteOK with default headers values +func NewWorkflowMockExecuteOK() *WorkflowMockExecuteOK { + return &WorkflowMockExecuteOK{} +} + +/* +WorkflowMockExecuteOK describes a response with status code 200, with default header values. + +OK +*/ +type WorkflowMockExecuteOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow mock execute o k response has a 2xx status code +func (o *WorkflowMockExecuteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this workflow mock execute o k response has a 3xx status code +func (o *WorkflowMockExecuteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow mock execute o k response has a 4xx status code +func (o *WorkflowMockExecuteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this workflow mock execute o k response has a 5xx status code +func (o *WorkflowMockExecuteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow mock execute o k response a status code equal to that given +func (o *WorkflowMockExecuteOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the workflow mock execute o k response +func (o *WorkflowMockExecuteOK) Code() int { + return 200 +} + +func (o *WorkflowMockExecuteOK) Error() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteOK %+v", 200, o.Payload) +} + +func (o *WorkflowMockExecuteOK) String() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteOK %+v", 200, o.Payload) +} + +func (o *WorkflowMockExecuteOK) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowMockExecuteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowMockExecuteBadRequest creates a WorkflowMockExecuteBadRequest with default headers values +func NewWorkflowMockExecuteBadRequest() *WorkflowMockExecuteBadRequest { + return &WorkflowMockExecuteBadRequest{} +} + +/* +WorkflowMockExecuteBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type WorkflowMockExecuteBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow mock execute bad request response has a 2xx status code +func (o *WorkflowMockExecuteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow mock execute bad request response has a 3xx status code +func (o *WorkflowMockExecuteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow mock execute bad request response has a 4xx status code +func (o *WorkflowMockExecuteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow mock execute bad request response has a 5xx status code +func (o *WorkflowMockExecuteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow mock execute bad request response a status code equal to that given +func (o *WorkflowMockExecuteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the workflow mock execute bad request response +func (o *WorkflowMockExecuteBadRequest) Code() int { + return 400 +} + +func (o *WorkflowMockExecuteBadRequest) Error() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteBadRequest %+v", 400, o.Payload) +} + +func (o *WorkflowMockExecuteBadRequest) String() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteBadRequest %+v", 400, o.Payload) +} + +func (o *WorkflowMockExecuteBadRequest) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowMockExecuteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowMockExecuteForbidden creates a WorkflowMockExecuteForbidden with default headers values +func NewWorkflowMockExecuteForbidden() *WorkflowMockExecuteForbidden { + return &WorkflowMockExecuteForbidden{} +} + +/* +WorkflowMockExecuteForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type WorkflowMockExecuteForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this workflow mock execute forbidden response has a 2xx status code +func (o *WorkflowMockExecuteForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow mock execute forbidden response has a 3xx status code +func (o *WorkflowMockExecuteForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow mock execute forbidden response has a 4xx status code +func (o *WorkflowMockExecuteForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow mock execute forbidden response has a 5xx status code +func (o *WorkflowMockExecuteForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow mock execute forbidden response a status code equal to that given +func (o *WorkflowMockExecuteForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the workflow mock execute forbidden response +func (o *WorkflowMockExecuteForbidden) Code() int { + return 403 +} + +func (o *WorkflowMockExecuteForbidden) Error() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteForbidden %+v", 403, o.Payload) +} + +func (o *WorkflowMockExecuteForbidden) String() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteForbidden %+v", 403, o.Payload) +} + +func (o *WorkflowMockExecuteForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *WorkflowMockExecuteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowMockExecuteNotFound creates a WorkflowMockExecuteNotFound with default headers values +func NewWorkflowMockExecuteNotFound() *WorkflowMockExecuteNotFound { + return &WorkflowMockExecuteNotFound{} +} + +/* +WorkflowMockExecuteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type WorkflowMockExecuteNotFound struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow mock execute not found response has a 2xx status code +func (o *WorkflowMockExecuteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow mock execute not found response has a 3xx status code +func (o *WorkflowMockExecuteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow mock execute not found response has a 4xx status code +func (o *WorkflowMockExecuteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow mock execute not found response has a 5xx status code +func (o *WorkflowMockExecuteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow mock execute not found response a status code equal to that given +func (o *WorkflowMockExecuteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the workflow mock execute not found response +func (o *WorkflowMockExecuteNotFound) Code() int { + return 404 +} + +func (o *WorkflowMockExecuteNotFound) Error() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteNotFound %+v", 404, o.Payload) +} + +func (o *WorkflowMockExecuteNotFound) String() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteNotFound %+v", 404, o.Payload) +} + +func (o *WorkflowMockExecuteNotFound) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowMockExecuteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowMockExecuteTooManyRequests creates a WorkflowMockExecuteTooManyRequests with default headers values +func NewWorkflowMockExecuteTooManyRequests() *WorkflowMockExecuteTooManyRequests { + return &WorkflowMockExecuteTooManyRequests{} +} + +/* +WorkflowMockExecuteTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type WorkflowMockExecuteTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +// IsSuccess returns true when this workflow mock execute too many requests response has a 2xx status code +func (o *WorkflowMockExecuteTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow mock execute too many requests response has a 3xx status code +func (o *WorkflowMockExecuteTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow mock execute too many requests response has a 4xx status code +func (o *WorkflowMockExecuteTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this workflow mock execute too many requests response has a 5xx status code +func (o *WorkflowMockExecuteTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this workflow mock execute too many requests response a status code equal to that given +func (o *WorkflowMockExecuteTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the workflow mock execute too many requests response +func (o *WorkflowMockExecuteTooManyRequests) Code() int { + return 429 +} + +func (o *WorkflowMockExecuteTooManyRequests) Error() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteTooManyRequests %+v", 429, o.Payload) +} + +func (o *WorkflowMockExecuteTooManyRequests) String() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteTooManyRequests %+v", 429, o.Payload) +} + +func (o *WorkflowMockExecuteTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *WorkflowMockExecuteTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewWorkflowMockExecuteInternalServerError creates a WorkflowMockExecuteInternalServerError with default headers values +func NewWorkflowMockExecuteInternalServerError() *WorkflowMockExecuteInternalServerError { + return &WorkflowMockExecuteInternalServerError{} +} + +/* +WorkflowMockExecuteInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type WorkflowMockExecuteInternalServerError struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIResourceIDsResponse +} + +// IsSuccess returns true when this workflow mock execute internal server error response has a 2xx status code +func (o *WorkflowMockExecuteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this workflow mock execute internal server error response has a 3xx status code +func (o *WorkflowMockExecuteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this workflow mock execute internal server error response has a 4xx status code +func (o *WorkflowMockExecuteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this workflow mock execute internal server error response has a 5xx status code +func (o *WorkflowMockExecuteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this workflow mock execute internal server error response a status code equal to that given +func (o *WorkflowMockExecuteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the workflow mock execute internal server error response +func (o *WorkflowMockExecuteInternalServerError) Code() int { + return 500 +} + +func (o *WorkflowMockExecuteInternalServerError) Error() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteInternalServerError %+v", 500, o.Payload) +} + +func (o *WorkflowMockExecuteInternalServerError) String() string { + return fmt.Sprintf("[POST /workflows/entities/mock-executions/v1][%d] workflowMockExecuteInternalServerError %+v", 500, o.Payload) +} + +func (o *WorkflowMockExecuteInternalServerError) GetPayload() *models.APIResourceIDsResponse { + return o.Payload +} + +func (o *WorkflowMockExecuteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIResourceIDsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/workflows/workflows_client.go b/falcon/client/workflows/workflows_client.go index 06c0c2e8..cc322c21 100644 --- a/falcon/client/workflows/workflows_client.go +++ b/falcon/client/workflows/workflows_client.go @@ -44,18 +44,20 @@ type ClientService interface { WorkflowDefinitionsCombined(params *WorkflowDefinitionsCombinedParams, opts ...ClientOption) (*WorkflowDefinitionsCombinedOK, error) - WorkflowDefinitionsCreate(params *WorkflowDefinitionsCreateParams, opts ...ClientOption) (*WorkflowDefinitionsCreateOK, error) - WorkflowDefinitionsExport(params *WorkflowDefinitionsExportParams, opts ...ClientOption) (*WorkflowDefinitionsExportOK, *WorkflowDefinitionsExportStatus299, error) WorkflowDefinitionsImport(params *WorkflowDefinitionsImportParams, opts ...ClientOption) (*WorkflowDefinitionsImportOK, error) WorkflowDefinitionsUpdate(params *WorkflowDefinitionsUpdateParams, opts ...ClientOption) (*WorkflowDefinitionsUpdateOK, error) + WorkflowExecuteInternal(params *WorkflowExecuteInternalParams, opts ...ClientOption) (*WorkflowExecuteInternalOK, error) + WorkflowExecutionsCombined(params *WorkflowExecutionsCombinedParams, opts ...ClientOption) (*WorkflowExecutionsCombinedOK, error) WorkflowGetHumanInputV1(params *WorkflowGetHumanInputV1Params, opts ...ClientOption) (*WorkflowGetHumanInputV1OK, error) + WorkflowMockExecute(params *WorkflowMockExecuteParams, opts ...ClientOption) (*WorkflowMockExecuteOK, error) + WorkflowUpdateHumanInputV1(params *WorkflowUpdateHumanInputV1Params, opts ...ClientOption) (*WorkflowUpdateHumanInputV1OK, error) SetTransport(transport runtime.ClientTransport) @@ -301,7 +303,7 @@ func (a *Client) WorkflowDefinitionsCombined(params *WorkflowDefinitionsCombined ID: "WorkflowDefinitionsCombined", Method: "GET", PathPattern: "/workflows/combined/definitions/v1", - ProducesMediaTypes: []string{"application/json"}, + ProducesMediaTypes: []string{"application/json", "application/yaml"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, @@ -327,44 +329,6 @@ func (a *Client) WorkflowDefinitionsCombined(params *WorkflowDefinitionsCombined panic(msg) } -/* -WorkflowDefinitionsCreate creates a workflow definition based on the provided model -*/ -func (a *Client) WorkflowDefinitionsCreate(params *WorkflowDefinitionsCreateParams, opts ...ClientOption) (*WorkflowDefinitionsCreateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewWorkflowDefinitionsCreateParams() - } - op := &runtime.ClientOperation{ - ID: "WorkflowDefinitionsCreate", - Method: "POST", - PathPattern: "/workflows/entities/definitions/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/yaml"}, - Schemes: []string{"https"}, - Params: params, - Reader: &WorkflowDefinitionsCreateReader{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.(*WorkflowDefinitionsCreateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for WorkflowDefinitionsCreate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* WorkflowDefinitionsExport exports a workflow definition for the given definition ID */ @@ -480,6 +444,44 @@ func (a *Client) WorkflowDefinitionsUpdate(params *WorkflowDefinitionsUpdatePara panic(msg) } +/* +WorkflowExecuteInternal executes an on demand workflow internal workflows permitted the body is JSON used to trigger the execution the response the execution ID s +*/ +func (a *Client) WorkflowExecuteInternal(params *WorkflowExecuteInternalParams, opts ...ClientOption) (*WorkflowExecuteInternalOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWorkflowExecuteInternalParams() + } + op := &runtime.ClientOperation{ + ID: "WorkflowExecuteInternal", + Method: "POST", + PathPattern: "/workflows/entities/execute/internal/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &WorkflowExecuteInternalReader{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.(*WorkflowExecuteInternalOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for WorkflowExecuteInternal: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* WorkflowExecutionsCombined searches workflow executions based on the provided filter */ @@ -556,6 +558,44 @@ func (a *Client) WorkflowGetHumanInputV1(params *WorkflowGetHumanInputV1Params, panic(msg) } +/* +WorkflowMockExecute executes a workflow definition with mocks +*/ +func (a *Client) WorkflowMockExecute(params *WorkflowMockExecuteParams, opts ...ClientOption) (*WorkflowMockExecuteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWorkflowMockExecuteParams() + } + op := &runtime.ClientOperation{ + ID: "WorkflowMockExecute", + Method: "POST", + PathPattern: "/workflows/entities/mock-executions/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &WorkflowMockExecuteReader{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.(*WorkflowMockExecuteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for WorkflowMockExecute: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* WorkflowUpdateHumanInputV1 provides an input in response to a human input action depending on action configuration one or more of approve decline and or escalate are permitted */ diff --git a/falcon/client/zero_trust_assessment/get_assessment_v1_responses.go b/falcon/client/zero_trust_assessment/get_assessment_v1_responses.go index c330812c..b94f588a 100644 --- a/falcon/client/zero_trust_assessment/get_assessment_v1_responses.go +++ b/falcon/client/zero_trust_assessment/get_assessment_v1_responses.go @@ -43,12 +43,6 @@ func (o *GetAssessmentV1Reader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - case 404: - result := NewGetAssessmentV1NotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result case 429: result := NewGetAssessmentV1TooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -390,116 +384,6 @@ func (o *GetAssessmentV1Forbidden) readResponse(response runtime.ClientResponse, return nil } -// NewGetAssessmentV1NotFound creates a GetAssessmentV1NotFound with default headers values -func NewGetAssessmentV1NotFound() *GetAssessmentV1NotFound { - return &GetAssessmentV1NotFound{} -} - -/* -GetAssessmentV1NotFound describes a response with status code 404, with default header values. - -One or more of the specified agent IDs is not found. -*/ -type GetAssessmentV1NotFound struct { - - /* Trace-ID: submit to support if resolving an issue - */ - XCSTRACEID string - - /* Request limit per minute. - */ - XRateLimitLimit int64 - - /* The number of requests remaining for the sliding one minute window. - */ - XRateLimitRemaining int64 - - Payload *models.DomainAssessmentsResponse -} - -// IsSuccess returns true when this get assessment v1 not found response has a 2xx status code -func (o *GetAssessmentV1NotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get assessment v1 not found response has a 3xx status code -func (o *GetAssessmentV1NotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get assessment v1 not found response has a 4xx status code -func (o *GetAssessmentV1NotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get assessment v1 not found response has a 5xx status code -func (o *GetAssessmentV1NotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get assessment v1 not found response a status code equal to that given -func (o *GetAssessmentV1NotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get assessment v1 not found response -func (o *GetAssessmentV1NotFound) Code() int { - return 404 -} - -func (o *GetAssessmentV1NotFound) Error() string { - return fmt.Sprintf("[GET /zero-trust-assessment/entities/assessments/v1][%d] getAssessmentV1NotFound %+v", 404, o.Payload) -} - -func (o *GetAssessmentV1NotFound) String() string { - return fmt.Sprintf("[GET /zero-trust-assessment/entities/assessments/v1][%d] getAssessmentV1NotFound %+v", 404, o.Payload) -} - -func (o *GetAssessmentV1NotFound) GetPayload() *models.DomainAssessmentsResponse { - return o.Payload -} - -func (o *GetAssessmentV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header X-CS-TRACEID - hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") - - if hdrXCSTRACEID != "" { - o.XCSTRACEID = hdrXCSTRACEID - } - - // hydrates response header X-RateLimit-Limit - hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") - - if hdrXRateLimitLimit != "" { - valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) - if err != nil { - return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) - } - o.XRateLimitLimit = valxRateLimitLimit - } - - // hydrates response header X-RateLimit-Remaining - hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") - - if hdrXRateLimitRemaining != "" { - valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) - if err != nil { - return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) - } - o.XRateLimitRemaining = valxRateLimitRemaining - } - - o.Payload = new(models.DomainAssessmentsResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - // NewGetAssessmentV1TooManyRequests creates a GetAssessmentV1TooManyRequests with default headers values func NewGetAssessmentV1TooManyRequests() *GetAssessmentV1TooManyRequests { return &GetAssessmentV1TooManyRequests{} diff --git a/falcon/models/api_indicator_create_req_v1.go b/falcon/models/api_indicator_create_req_v1.go index fbaab7f9..e4949d0f 100644 --- a/falcon/models/api_indicator_create_req_v1.go +++ b/falcon/models/api_indicator_create_req_v1.go @@ -31,7 +31,7 @@ type APIIndicatorCreateReqV1 struct { // expiration // Format: date-time - Expiration strfmt.DateTime `json:"expiration,omitempty"` + Expiration *strfmt.DateTime `json:"expiration,omitempty"` // host groups HostGroups []string `json:"host_groups"` diff --git a/falcon/models/api_response_pagination.go b/falcon/models/api_response_pagination.go index 015cbf7b..bc4e9e55 100644 --- a/falcon/models/api_response_pagination.go +++ b/falcon/models/api_response_pagination.go @@ -20,7 +20,7 @@ import ( type APIResponsePagination struct { // Encoded state used for pagination - Offset APIResponsePaginationOffset `json:"offset,omitempty"` + Offset string `json:"offset,omitempty"` // The total number of elements // Required: true diff --git a/falcon/models/api_rule_update_v2.go b/falcon/models/api_rule_update_v2.go new file mode 100644 index 00000000..d76abc44 --- /dev/null +++ b/falcon/models/api_rule_update_v2.go @@ -0,0 +1,243 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// APIRuleUpdateV2 api rule update v2 +// +// swagger:model api.RuleUpdateV2 +type APIRuleUpdateV2 struct { + + // description + // Required: true + Description *string `json:"description"` + + // disposition id + // Required: true + DispositionID *int32 `json:"disposition_id"` + + // enabled + // Required: true + Enabled *bool `json:"enabled"` + + // field values + // Required: true + FieldValues []*DomainFieldValue `json:"field_values"` + + // instance id + // Required: true + InstanceID *string `json:"instance_id"` + + // name + // Required: true + Name *string `json:"name"` + + // pattern severity + // Required: true + PatternSeverity *string `json:"pattern_severity"` + + // rulegroup version + // Required: true + RulegroupVersion *int64 `json:"rulegroup_version"` +} + +// Validate validates this api rule update v2 +func (m *APIRuleUpdateV2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDispositionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnabled(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFieldValues(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePatternSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRulegroupVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIRuleUpdateV2) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdateV2) validateDispositionID(formats strfmt.Registry) error { + + if err := validate.Required("disposition_id", "body", m.DispositionID); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdateV2) validateEnabled(formats strfmt.Registry) error { + + if err := validate.Required("enabled", "body", m.Enabled); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdateV2) validateFieldValues(formats strfmt.Registry) error { + + if err := validate.Required("field_values", "body", m.FieldValues); err != nil { + return err + } + + for i := 0; i < len(m.FieldValues); i++ { + if swag.IsZero(m.FieldValues[i]) { // not required + continue + } + + if m.FieldValues[i] != nil { + if err := m.FieldValues[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("field_values" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("field_values" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *APIRuleUpdateV2) validateInstanceID(formats strfmt.Registry) error { + + if err := validate.Required("instance_id", "body", m.InstanceID); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdateV2) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdateV2) validatePatternSeverity(formats strfmt.Registry) error { + + if err := validate.Required("pattern_severity", "body", m.PatternSeverity); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdateV2) validateRulegroupVersion(formats strfmt.Registry) error { + + if err := validate.Required("rulegroup_version", "body", m.RulegroupVersion); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this api rule update v2 based on the context it is used +func (m *APIRuleUpdateV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFieldValues(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIRuleUpdateV2) contextValidateFieldValues(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.FieldValues); i++ { + + if m.FieldValues[i] != nil { + + if swag.IsZero(m.FieldValues[i]) { // not required + return nil + } + + if err := m.FieldValues[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("field_values" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("field_values" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *APIRuleUpdateV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIRuleUpdateV2) UnmarshalBinary(b []byte) error { + var res APIRuleUpdateV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_rule_updates_request_v2.go b/falcon/models/api_rule_updates_request_v2.go new file mode 100644 index 00000000..9e76cee1 --- /dev/null +++ b/falcon/models/api_rule_updates_request_v2.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// APIRuleUpdatesRequestV2 api rule updates request v2 +// +// swagger:model api.RuleUpdatesRequestV2 +type APIRuleUpdatesRequestV2 struct { + + // comment + // Required: true + Comment *string `json:"comment"` + + // rule updates + // Required: true + RuleUpdates []*APIRuleUpdateV2 `json:"rule_updates"` + + // rulegroup id + // Required: true + RulegroupID *string `json:"rulegroup_id"` + + // rulegroup version + // Required: true + RulegroupVersion *int64 `json:"rulegroup_version"` +} + +// Validate validates this api rule updates request v2 +func (m *APIRuleUpdatesRequestV2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateComment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRuleUpdates(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRulegroupID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRulegroupVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIRuleUpdatesRequestV2) validateComment(formats strfmt.Registry) error { + + if err := validate.Required("comment", "body", m.Comment); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdatesRequestV2) validateRuleUpdates(formats strfmt.Registry) error { + + if err := validate.Required("rule_updates", "body", m.RuleUpdates); err != nil { + return err + } + + for i := 0; i < len(m.RuleUpdates); i++ { + if swag.IsZero(m.RuleUpdates[i]) { // not required + continue + } + + if m.RuleUpdates[i] != nil { + if err := m.RuleUpdates[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule_updates" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule_updates" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *APIRuleUpdatesRequestV2) validateRulegroupID(formats strfmt.Registry) error { + + if err := validate.Required("rulegroup_id", "body", m.RulegroupID); err != nil { + return err + } + + return nil +} + +func (m *APIRuleUpdatesRequestV2) validateRulegroupVersion(formats strfmt.Registry) error { + + if err := validate.Required("rulegroup_version", "body", m.RulegroupVersion); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this api rule updates request v2 based on the context it is used +func (m *APIRuleUpdatesRequestV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRuleUpdates(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIRuleUpdatesRequestV2) contextValidateRuleUpdates(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.RuleUpdates); i++ { + + if m.RuleUpdates[i] != nil { + + if swag.IsZero(m.RuleUpdates[i]) { // not required + return nil + } + + if err := m.RuleUpdates[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule_updates" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule_updates" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *APIRuleUpdatesRequestV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIRuleUpdatesRequestV2) UnmarshalBinary(b []byte) error { + var res APIRuleUpdatesRequestV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_token_create_request_v1.go b/falcon/models/api_token_create_request_v1.go index 04c21a39..ea01f264 100644 --- a/falcon/models/api_token_create_request_v1.go +++ b/falcon/models/api_token_create_request_v1.go @@ -16,7 +16,7 @@ import ( // APITokenCreateRequestV1 api token create request v1 // -// swagger:model api.tokenCreateRequestV1 +// swagger:model api.TokenCreateRequestV1 type APITokenCreateRequestV1 struct { // The token's expiration time (RFC-3339). Null, if the token never expires. diff --git a/falcon/models/api_token_details_response_v1.go b/falcon/models/api_token_details_response_v1.go index e52db7ca..af365400 100644 --- a/falcon/models/api_token_details_response_v1.go +++ b/falcon/models/api_token_details_response_v1.go @@ -17,7 +17,7 @@ import ( // APITokenDetailsResponseV1 api token details response v1 // -// swagger:model api.tokenDetailsResponseV1 +// swagger:model api.TokenDetailsResponseV1 type APITokenDetailsResponseV1 struct { // errors diff --git a/falcon/models/apidomain_query_response_v1.go b/falcon/models/apidomain_query_response_v1.go index 4fe55df3..c97e0fcb 100644 --- a/falcon/models/apidomain_query_response_v1.go +++ b/falcon/models/apidomain_query_response_v1.go @@ -31,6 +31,10 @@ type ApidomainQueryResponseV1 struct { // fields Fields []*ClientField `json:"fields"` + // filtered event count + // Required: true + FilteredEventCount *int32 `json:"filtered_event_count"` + // job status JobStatus *ClientJobStatus `json:"job_status,omitempty"` @@ -57,6 +61,10 @@ func (m *ApidomainQueryResponseV1) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateFilteredEventCount(formats); err != nil { + res = append(res, err) + } + if err := m.validateJobStatus(formats); err != nil { res = append(res, err) } @@ -119,6 +127,15 @@ func (m *ApidomainQueryResponseV1) validateFields(formats strfmt.Registry) error return nil } +func (m *ApidomainQueryResponseV1) validateFilteredEventCount(formats strfmt.Registry) error { + + if err := validate.Required("filtered_event_count", "body", m.FilteredEventCount); err != nil { + return err + } + + return nil +} + func (m *ApidomainQueryResponseV1) validateJobStatus(formats strfmt.Registry) error { if swag.IsZero(m.JobStatus) { // not required return nil diff --git a/falcon/models/apidomain_saved_search_execute_request_v1.go b/falcon/models/apidomain_saved_search_execute_request_v1.go index c0055ed8..3fff0ce6 100644 --- a/falcon/models/apidomain_saved_search_execute_request_v1.go +++ b/falcon/models/apidomain_saved_search_execute_request_v1.go @@ -12,6 +12,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // ApidomainSavedSearchExecuteRequestV1 apidomain saved search execute request v1 @@ -19,9 +20,33 @@ import ( // swagger:model apidomain.SavedSearchExecuteRequestV1 type ApidomainSavedSearchExecuteRequestV1 struct { + // extra rename + // Required: true + ExtraRename *string `json:"ExtraRename"` + + // extra search + // Required: true + ExtraSearch *string `json:"ExtraSearch"` + + // extra sort + // Required: true + ExtraSort *string `json:"ExtraSort"` + + // extra where + // Required: true + ExtraWhere *string `json:"ExtraWhere"` + + // parameters + // Required: true + Parameters map[string]string `json:"Parameters"` + // end End string `json:"end,omitempty"` + // fql statements + // Required: true + FqlStatements map[string]ClientFQLStatement `json:"fql_statements"` + // id ID string `json:"id,omitempty"` @@ -31,9 +56,6 @@ type ApidomainSavedSearchExecuteRequestV1 struct { // name Name string `json:"name,omitempty"` - // parameters - Parameters interface{} `json:"parameters,omitempty"` - // start Start string `json:"start,omitempty"` @@ -57,6 +79,30 @@ type ApidomainSavedSearchExecuteRequestV1 struct { func (m *ApidomainSavedSearchExecuteRequestV1) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateExtraRename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExtraSearch(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExtraSort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExtraWhere(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParameters(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFqlStatements(formats); err != nil { + res = append(res, err) + } + if err := m.validateWithIn(formats); err != nil { res = append(res, err) } @@ -79,6 +125,78 @@ func (m *ApidomainSavedSearchExecuteRequestV1) Validate(formats strfmt.Registry) return nil } +func (m *ApidomainSavedSearchExecuteRequestV1) validateExtraRename(formats strfmt.Registry) error { + + if err := validate.Required("ExtraRename", "body", m.ExtraRename); err != nil { + return err + } + + return nil +} + +func (m *ApidomainSavedSearchExecuteRequestV1) validateExtraSearch(formats strfmt.Registry) error { + + if err := validate.Required("ExtraSearch", "body", m.ExtraSearch); err != nil { + return err + } + + return nil +} + +func (m *ApidomainSavedSearchExecuteRequestV1) validateExtraSort(formats strfmt.Registry) error { + + if err := validate.Required("ExtraSort", "body", m.ExtraSort); err != nil { + return err + } + + return nil +} + +func (m *ApidomainSavedSearchExecuteRequestV1) validateExtraWhere(formats strfmt.Registry) error { + + if err := validate.Required("ExtraWhere", "body", m.ExtraWhere); err != nil { + return err + } + + return nil +} + +func (m *ApidomainSavedSearchExecuteRequestV1) validateParameters(formats strfmt.Registry) error { + + if err := validate.Required("Parameters", "body", m.Parameters); err != nil { + return err + } + + return nil +} + +func (m *ApidomainSavedSearchExecuteRequestV1) validateFqlStatements(formats strfmt.Registry) error { + + if err := validate.Required("fql_statements", "body", m.FqlStatements); err != nil { + return err + } + + for k := range m.FqlStatements { + + if err := validate.Required("fql_statements"+"."+k, "body", m.FqlStatements[k]); err != nil { + return err + } + if val, ok := m.FqlStatements[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fql_statements" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fql_statements" + "." + k) + } + return err + } + } + + } + + return nil +} + func (m *ApidomainSavedSearchExecuteRequestV1) validateWithIn(formats strfmt.Registry) error { if swag.IsZero(m.WithIn) { // not required return nil @@ -166,6 +284,10 @@ func (m *ApidomainSavedSearchExecuteRequestV1) validateWithSort(formats strfmt.R func (m *ApidomainSavedSearchExecuteRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateFqlStatements(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateWithIn(ctx, formats); err != nil { res = append(res, err) } @@ -188,6 +310,25 @@ func (m *ApidomainSavedSearchExecuteRequestV1) ContextValidate(ctx context.Conte return nil } +func (m *ApidomainSavedSearchExecuteRequestV1) contextValidateFqlStatements(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.Required("fql_statements", "body", m.FqlStatements); err != nil { + return err + } + + for k := range m.FqlStatements { + + if val, ok := m.FqlStatements[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + func (m *ApidomainSavedSearchExecuteRequestV1) contextValidateWithIn(ctx context.Context, formats strfmt.Registry) error { if m.WithIn != nil { diff --git a/falcon/models/changes_change.go b/falcon/models/changes_change.go index 16b71505..d083834f 100644 --- a/falcon/models/changes_change.go +++ b/falcon/models/changes_change.go @@ -57,6 +57,10 @@ type ChangesChange struct { // Required: true EntityType *string `json:"entity_type"` + // file size + // Required: true + FileSize *int64 `json:"file_size"` + // grandparent process image file name GrandparentProcessImageFileName string `json:"grandparent_process_image_file_name,omitempty"` @@ -72,7 +76,8 @@ type ChangesChange struct { IngestionTimestamp *string `json:"ingestion_timestamp"` // is from different mount namespace - IsFromDifferentMountNamespace bool `json:"is_from_different_mount_namespace,omitempty"` + // Required: true + IsFromDifferentMountNamespace *bool `json:"is_from_different_mount_namespace"` // is suppressed // Required: true @@ -90,6 +95,9 @@ type ChangesChange struct { // permissions lin PermissionsLin *ChangesPermissionsLin `json:"permissions_lin,omitempty"` + // permissions mac + PermissionsMac *ChangesPermissionsMac `json:"permissions_mac,omitempty"` + // platform name // Required: true PlatformName *string `json:"platform_name"` @@ -167,6 +175,10 @@ func (m *ChangesChange) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateFileSize(formats); err != nil { + res = append(res, err) + } + if err := m.validateHost(formats); err != nil { res = append(res, err) } @@ -179,6 +191,10 @@ func (m *ChangesChange) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateIsFromDifferentMountNamespace(formats); err != nil { + res = append(res, err) + } + if err := m.validateIsSuppressed(formats); err != nil { res = append(res, err) } @@ -191,6 +207,10 @@ func (m *ChangesChange) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validatePermissionsMac(formats); err != nil { + res = append(res, err) + } + if err := m.validatePlatformName(formats); err != nil { res = append(res, err) } @@ -341,6 +361,15 @@ func (m *ChangesChange) validateEntityType(formats strfmt.Registry) error { return nil } +func (m *ChangesChange) validateFileSize(formats strfmt.Registry) error { + + if err := validate.Required("file_size", "body", m.FileSize); err != nil { + return err + } + + return nil +} + func (m *ChangesChange) validateHost(formats strfmt.Registry) error { if swag.IsZero(m.Host) { // not required return nil @@ -378,6 +407,15 @@ func (m *ChangesChange) validateIngestionTimestamp(formats strfmt.Registry) erro return nil } +func (m *ChangesChange) validateIsFromDifferentMountNamespace(formats strfmt.Registry) error { + + if err := validate.Required("is_from_different_mount_namespace", "body", m.IsFromDifferentMountNamespace); err != nil { + return err + } + + return nil +} + func (m *ChangesChange) validateIsSuppressed(formats strfmt.Registry) error { if err := validate.Required("is_suppressed", "body", m.IsSuppressed); err != nil { @@ -425,6 +463,25 @@ func (m *ChangesChange) validatePermissionsLin(formats strfmt.Registry) error { return nil } +func (m *ChangesChange) validatePermissionsMac(formats strfmt.Registry) error { + if swag.IsZero(m.PermissionsMac) { // not required + return nil + } + + if m.PermissionsMac != nil { + if err := m.PermissionsMac.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permissions_mac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permissions_mac") + } + return err + } + } + + return nil +} + func (m *ChangesChange) validatePlatformName(formats strfmt.Registry) error { if err := validate.Required("platform_name", "body", m.PlatformName); err != nil { @@ -567,6 +624,10 @@ func (m *ChangesChange) ContextValidate(ctx context.Context, formats strfmt.Regi res = append(res, err) } + if err := m.contextValidatePermissionsMac(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidatePolicy(ctx, formats); err != nil { res = append(res, err) } @@ -694,6 +755,27 @@ func (m *ChangesChange) contextValidatePermissionsLin(ctx context.Context, forma return nil } +func (m *ChangesChange) contextValidatePermissionsMac(ctx context.Context, formats strfmt.Registry) error { + + if m.PermissionsMac != nil { + + if swag.IsZero(m.PermissionsMac) { // not required + return nil + } + + if err := m.PermissionsMac.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permissions_mac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permissions_mac") + } + return err + } + } + + return nil +} + func (m *ChangesChange) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if m.Policy != nil { diff --git a/falcon/models/changes_host.go b/falcon/models/changes_host.go index 514b8fa2..0d527fb7 100644 --- a/falcon/models/changes_host.go +++ b/falcon/models/changes_host.go @@ -39,6 +39,9 @@ type ChangesHost struct { // os version OsVersion string `json:"os_version,omitempty"` + + // tags + Tags []string `json:"tags"` } // Validate validates this changes host diff --git a/falcon/models/changes_permissions_mac.go b/falcon/models/changes_permissions_mac.go new file mode 100644 index 00000000..5da389fa --- /dev/null +++ b/falcon/models/changes_permissions_mac.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ChangesPermissionsMac changes permissions mac +// +// swagger:model changes.PermissionsMac +type ChangesPermissionsMac struct { + + // acl + ACL bool `json:"acl,omitempty"` + + // basic + Basic []*ChangesBasic `json:"basic"` + + // common attributes + CommonAttributes []string `json:"common_attributes"` + + // group + Group *ChangesGroup `json:"group,omitempty"` + + // owner + Owner *ChangesOwner `json:"owner,omitempty"` + + // security info + SecurityInfo int32 `json:"security_info,omitempty"` +} + +// Validate validates this changes permissions mac +func (m *ChangesPermissionsMac) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBasic(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ChangesPermissionsMac) validateBasic(formats strfmt.Registry) error { + if swag.IsZero(m.Basic) { // not required + return nil + } + + for i := 0; i < len(m.Basic); i++ { + if swag.IsZero(m.Basic[i]) { // not required + continue + } + + if m.Basic[i] != nil { + if err := m.Basic[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("basic" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ChangesPermissionsMac) validateGroup(formats strfmt.Registry) error { + if swag.IsZero(m.Group) { // not required + return nil + } + + if m.Group != nil { + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *ChangesPermissionsMac) validateOwner(formats strfmt.Registry) error { + if swag.IsZero(m.Owner) { // not required + return nil + } + + if m.Owner != nil { + if err := m.Owner.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +// ContextValidate validate this changes permissions mac based on the context it is used +func (m *ChangesPermissionsMac) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBasic(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGroup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ChangesPermissionsMac) contextValidateBasic(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Basic); i++ { + + if m.Basic[i] != nil { + + if swag.IsZero(m.Basic[i]) { // not required + return nil + } + + if err := m.Basic[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("basic" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ChangesPermissionsMac) contextValidateGroup(ctx context.Context, formats strfmt.Registry) error { + + if m.Group != nil { + + if swag.IsZero(m.Group) { // not required + return nil + } + + if err := m.Group.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *ChangesPermissionsMac) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + + if swag.IsZero(m.Owner) { // not required + return nil + } + + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ChangesPermissionsMac) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ChangesPermissionsMac) UnmarshalBinary(b []byte) error { + var res ChangesPermissionsMac + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/client_f_q_l_statement.go b/falcon/models/client_f_q_l_statement.go new file mode 100644 index 00000000..f09d3e8e --- /dev/null +++ b/falcon/models/client_f_q_l_statement.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClientFQLStatement client f q l statement +// +// swagger:model client.FQLStatement +type ClientFQLStatement struct { + + // op + // Required: true + Op *string `json:"op"` + + // prop + // Required: true + Prop *string `json:"prop"` + + // value + // Required: true + Value ClientFQLStatementValue `json:"value"` +} + +// Validate validates this client f q l statement +func (m *ClientFQLStatement) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClientFQLStatement) validateOp(formats strfmt.Registry) error { + + if err := validate.Required("op", "body", m.Op); err != nil { + return err + } + + return nil +} + +func (m *ClientFQLStatement) validateProp(formats strfmt.Registry) error { + + if err := validate.Required("prop", "body", m.Prop); err != nil { + return err + } + + return nil +} + +func (m *ClientFQLStatement) validateValue(formats strfmt.Registry) error { + + if m.Value == nil { + return errors.Required("value", "body", nil) + } + + return nil +} + +// ContextValidate validates this client f q l statement based on context it is used +func (m *ClientFQLStatement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ClientFQLStatement) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClientFQLStatement) UnmarshalBinary(b []byte) error { + var res ClientFQLStatement + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_response_pagination_offset.go b/falcon/models/client_f_q_l_statement_value.go similarity index 56% rename from falcon/models/api_response_pagination_offset.go rename to falcon/models/client_f_q_l_statement_value.go index 19f5ffca..b9412553 100644 --- a/falcon/models/api_response_pagination_offset.go +++ b/falcon/models/client_f_q_l_statement_value.go @@ -5,7 +5,7 @@ package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command -// APIResponsePaginationOffset api response pagination offset +// ClientFQLStatementValue client f q l statement value // -// swagger:model api.ResponsePagination.offset -type APIResponsePaginationOffset interface{} +// swagger:model client.FQLStatement.value +type ClientFQLStatementValue interface{} diff --git a/falcon/models/client_job_status.go b/falcon/models/client_job_status.go index c67e1d56..da93e859 100644 --- a/falcon/models/client_job_status.go +++ b/falcon/models/client_job_status.go @@ -34,6 +34,9 @@ type ClientJobStatus struct { // file link FileLink string `json:"file_link,omitempty"` + // filtered event count + FilteredEventCount int64 `json:"filtered_event_count,omitempty"` + // job id // Required: true JobID *string `json:"job_id"` diff --git a/falcon/models/k8sassets_deployment_enrichment_response.go b/falcon/models/deployments_entity_response.go similarity index 58% rename from falcon/models/k8sassets_deployment_enrichment_response.go rename to falcon/models/deployments_entity_response.go index 2d6f9bd1..58e39ddb 100644 --- a/falcon/models/k8sassets_deployment_enrichment_response.go +++ b/falcon/models/deployments_entity_response.go @@ -15,14 +15,10 @@ import ( "github.com/go-openapi/validate" ) -// K8sassetsDeploymentEnrichmentResponse k8sassets deployment enrichment response +// DeploymentsEntityResponse deployments entity response // -// swagger:model k8sassets.DeploymentEnrichmentResponse -type K8sassetsDeploymentEnrichmentResponse struct { - - // enrichment data - // Required: true - EnrichmentData []*K8sassetsDeploymentEnrichmentEntry `json:"EnrichmentData"` +// swagger:model deployments.EntityResponse +type DeploymentsEntityResponse struct { // errors Errors []*MsaAPIError `json:"errors"` @@ -30,21 +26,25 @@ type K8sassetsDeploymentEnrichmentResponse struct { // meta // Required: true Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsDeployment `json:"resources"` } -// Validate validates this k8sassets deployment enrichment response -func (m *K8sassetsDeploymentEnrichmentResponse) Validate(formats strfmt.Registry) error { +// Validate validates this deployments entity response +func (m *DeploymentsEntityResponse) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateEnrichmentData(formats); err != nil { + if err := m.validateErrors(formats); err != nil { res = append(res, err) } - if err := m.validateErrors(formats); err != nil { + if err := m.validateMeta(formats); err != nil { res = append(res, err) } - if err := m.validateMeta(formats); err != nil { + if err := m.validateResources(formats); err != nil { res = append(res, err) } @@ -54,34 +54,7 @@ func (m *K8sassetsDeploymentEnrichmentResponse) Validate(formats strfmt.Registry return nil } -func (m *K8sassetsDeploymentEnrichmentResponse) validateEnrichmentData(formats strfmt.Registry) error { - - if err := validate.Required("EnrichmentData", "body", m.EnrichmentData); err != nil { - return err - } - - for i := 0; i < len(m.EnrichmentData); i++ { - if swag.IsZero(m.EnrichmentData[i]) { // not required - continue - } - - if m.EnrichmentData[i] != nil { - if err := m.EnrichmentData[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *K8sassetsDeploymentEnrichmentResponse) validateErrors(formats strfmt.Registry) error { +func (m *DeploymentsEntityResponse) validateErrors(formats strfmt.Registry) error { if swag.IsZero(m.Errors) { // not required return nil } @@ -107,7 +80,7 @@ func (m *K8sassetsDeploymentEnrichmentResponse) validateErrors(formats strfmt.Re return nil } -func (m *K8sassetsDeploymentEnrichmentResponse) validateMeta(formats strfmt.Registry) error { +func (m *DeploymentsEntityResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -127,54 +100,56 @@ func (m *K8sassetsDeploymentEnrichmentResponse) validateMeta(formats strfmt.Regi return nil } -// ContextValidate validate this k8sassets deployment enrichment response based on the context it is used -func (m *K8sassetsDeploymentEnrichmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +func (m *DeploymentsEntityResponse) validateResources(formats strfmt.Registry) error { - if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { - res = append(res, err) + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err } - if err := m.contextValidateErrors(ctx, formats); err != nil { - res = append(res, err) - } + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } - if len(res) > 0 { - return errors.CompositeValidationError(res...) } + return nil } -func (m *K8sassetsDeploymentEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.EnrichmentData); i++ { - - if m.EnrichmentData[i] != nil { +// ContextValidate validate this deployments entity response based on the context it is used +func (m *DeploymentsEntityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(m.EnrichmentData[i]) { // not required - return nil - } + if err := m.contextValidateErrors(ctx, formats); err != nil { + res = append(res, err) + } - if err := m.EnrichmentData[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } - return err - } - } + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -func (m *K8sassetsDeploymentEnrichmentResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *DeploymentsEntityResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -199,7 +174,7 @@ func (m *K8sassetsDeploymentEnrichmentResponse) contextValidateErrors(ctx contex return nil } -func (m *K8sassetsDeploymentEnrichmentResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *DeploymentsEntityResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -216,8 +191,33 @@ func (m *K8sassetsDeploymentEnrichmentResponse) contextValidateMeta(ctx context. return nil } +func (m *DeploymentsEntityResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation -func (m *K8sassetsDeploymentEnrichmentResponse) MarshalBinary() ([]byte, error) { +func (m *DeploymentsEntityResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -225,8 +225,8 @@ func (m *K8sassetsDeploymentEnrichmentResponse) MarshalBinary() ([]byte, error) } // UnmarshalBinary interface implementation -func (m *K8sassetsDeploymentEnrichmentResponse) UnmarshalBinary(b []byte) error { - var res K8sassetsDeploymentEnrichmentResponse +func (m *DeploymentsEntityResponse) UnmarshalBinary(b []byte) error { + var res DeploymentsEntityResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/detects_alert.go b/falcon/models/detects_alert.go index 251ea42f..9f7de3a5 100644 --- a/falcon/models/detects_alert.go +++ b/falcon/models/detects_alert.go @@ -22,8 +22,9 @@ type DetectsAlert struct { // Device or sensor ID for which the Alert was generated AgentID string `json:"agent_id,omitempty"` - // Common linkage between multiple Alerts that belong so the same detection bouquet - AggregateID string `json:"aggregate_id,omitempty"` + // Common linkage between multiple Alerts that belong to the same detection bouquet + // Required: true + AggregateID *string `json:"aggregate_id"` // Name of the person this Alert is assigned to AssignedToName string `json:"assigned_to_name,omitempty"` @@ -102,9 +103,21 @@ type DetectsAlert struct { // Product specifies the SKU that this Alert belongs to e.g. mobile, idp, epp Product string `json:"product,omitempty"` + // indicates when the Alert was marked as 'Resolved' + // Format: date-time + ResolvedTimestamp strfmt.DateTime `json:"resolved_timestamp,omitempty"` + // Scenario was used pre-Handrails to display additional killchain context for UI alerts. With handrails, this field is mostly obsolete in favor of tactic/technique. Still, it can be useful for determining specific pattern types that are not straightforward to distinguish from other fields alone Scenario string `json:"scenario,omitempty"` + // Seconds To Resolved represents the seconds elapsed since this alert has been resolved + // Required: true + SecondsToResolved *int64 `json:"seconds_to_resolved"` + + // Seconds To Triage represents the seconds elapsed since this alert has been triaged + // Required: true + SecondsToTriaged *int64 `json:"seconds_to_triaged"` + // Severity is also a 1-100 integer value, but unlike confidence severity impacts how a Alert is displayed in the UI Severity int64 `json:"severity,omitempty"` @@ -152,6 +165,10 @@ type DetectsAlert struct { func (m *DetectsAlert) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAggregateID(formats); err != nil { + res = append(res, err) + } + if err := m.validateCrawledTimestamp(formats); err != nil { res = append(res, err) } @@ -160,6 +177,18 @@ func (m *DetectsAlert) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateResolvedTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondsToResolved(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondsToTriaged(formats); err != nil { + res = append(res, err) + } + if err := m.validateTimestamp(formats); err != nil { res = append(res, err) } @@ -178,6 +207,15 @@ func (m *DetectsAlert) Validate(formats strfmt.Registry) error { return nil } +func (m *DetectsAlert) validateAggregateID(formats strfmt.Registry) error { + + if err := validate.Required("aggregate_id", "body", m.AggregateID); err != nil { + return err + } + + return nil +} + func (m *DetectsAlert) validateCrawledTimestamp(formats strfmt.Registry) error { if swag.IsZero(m.CrawledTimestamp) { // not required return nil @@ -202,6 +240,36 @@ func (m *DetectsAlert) validateCreatedTimestamp(formats strfmt.Registry) error { return nil } +func (m *DetectsAlert) validateResolvedTimestamp(formats strfmt.Registry) error { + if swag.IsZero(m.ResolvedTimestamp) { // not required + return nil + } + + if err := validate.FormatOf("resolved_timestamp", "body", "date-time", m.ResolvedTimestamp.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DetectsAlert) validateSecondsToResolved(formats strfmt.Registry) error { + + if err := validate.Required("seconds_to_resolved", "body", m.SecondsToResolved); err != nil { + return err + } + + return nil +} + +func (m *DetectsAlert) validateSecondsToTriaged(formats strfmt.Registry) error { + + if err := validate.Required("seconds_to_triaged", "body", m.SecondsToTriaged); err != nil { + return err + } + + return nil +} + func (m *DetectsAlert) validateTimestamp(formats strfmt.Registry) error { if swag.IsZero(m.Timestamp) { // not required return nil diff --git a/falcon/models/device_device.go b/falcon/models/device_device.go index 370207bb..243a2a5e 100644 --- a/falcon/models/device_device.go +++ b/falcon/models/device_device.go @@ -29,6 +29,9 @@ type DeviceDevice struct { // agent version AgentVersion string `json:"agent_version,omitempty"` + // base image version + BaseImageVersion string `json:"base_image_version,omitempty"` + // bios manufacturer BiosManufacturer string `json:"bios_manufacturer,omitempty"` @@ -66,6 +69,9 @@ type DeviceDevice struct { // cpu signature CPUSignature string `json:"cpu_signature,omitempty"` + // cpu vendor + CPUVendor string `json:"cpu_vendor,omitempty"` + // default gateway ip DefaultGatewayIP string `json:"default_gateway_ip,omitempty"` @@ -169,6 +175,9 @@ type DeviceDevice struct { // meta Meta *DeviceDeviceMeta `json:"meta,omitempty"` + // migration completed time + MigrationCompletedTime string `json:"migration_completed_time,omitempty"` + // minor version MinorVersion string `json:"minor_version,omitempty"` @@ -250,6 +259,9 @@ type DeviceDevice struct { // release group ReleaseGroup string `json:"release_group,omitempty"` + // rtr state + RtrState string `json:"rtr_state,omitempty"` + // serial number SerialNumber string `json:"serial_number,omitempty"` diff --git a/falcon/models/device_mapped_device_policies.go b/falcon/models/device_mapped_device_policies.go index 489c9837..62c25b06 100644 --- a/falcon/models/device_mapped_device_policies.go +++ b/falcon/models/device_mapped_device_policies.go @@ -75,6 +75,9 @@ type DeviceMappedDevicePolicies struct { // system tray SystemTray *DeviceDevicePolicy `json:"system-tray,omitempty"` + // vulnerability management + VulnerabilityManagement *DeviceDevicePolicy `json:"vulnerability-management,omitempty"` + // ztl Ztl *DeviceDevicePolicy `json:"ztl,omitempty"` } @@ -159,6 +162,10 @@ func (m *DeviceMappedDevicePolicies) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVulnerabilityManagement(formats); err != nil { + res = append(res, err) + } + if err := m.validateZtl(formats); err != nil { res = append(res, err) } @@ -530,6 +537,25 @@ func (m *DeviceMappedDevicePolicies) validateSystemTray(formats strfmt.Registry) return nil } +func (m *DeviceMappedDevicePolicies) validateVulnerabilityManagement(formats strfmt.Registry) error { + if swag.IsZero(m.VulnerabilityManagement) { // not required + return nil + } + + if m.VulnerabilityManagement != nil { + if err := m.VulnerabilityManagement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vulnerability-management") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vulnerability-management") + } + return err + } + } + + return nil +} + func (m *DeviceMappedDevicePolicies) validateZtl(formats strfmt.Registry) error { if swag.IsZero(m.Ztl) { // not required return nil @@ -629,6 +655,10 @@ func (m *DeviceMappedDevicePolicies) ContextValidate(ctx context.Context, format res = append(res, err) } + if err := m.contextValidateVulnerabilityManagement(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateZtl(ctx, formats); err != nil { res = append(res, err) } @@ -1038,6 +1068,27 @@ func (m *DeviceMappedDevicePolicies) contextValidateSystemTray(ctx context.Conte return nil } +func (m *DeviceMappedDevicePolicies) contextValidateVulnerabilityManagement(ctx context.Context, formats strfmt.Registry) error { + + if m.VulnerabilityManagement != nil { + + if swag.IsZero(m.VulnerabilityManagement) { // not required + return nil + } + + if err := m.VulnerabilityManagement.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vulnerability-management") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vulnerability-management") + } + return err + } + } + + return nil +} + func (m *DeviceMappedDevicePolicies) contextValidateZtl(ctx context.Context, formats strfmt.Registry) error { if m.Ztl != nil { diff --git a/falcon/models/deviceapi_device_swagger.go b/falcon/models/deviceapi_device_swagger.go index 499b3b05..74758b05 100644 --- a/falcon/models/deviceapi_device_swagger.go +++ b/falcon/models/deviceapi_device_swagger.go @@ -29,6 +29,9 @@ type DeviceapiDeviceSwagger struct { // agent version AgentVersion string `json:"agent_version,omitempty"` + // base image version + BaseImageVersion string `json:"base_image_version,omitempty"` + // bios manufacturer BiosManufacturer string `json:"bios_manufacturer,omitempty"` @@ -169,6 +172,9 @@ type DeviceapiDeviceSwagger struct { // meta Meta *DeviceDeviceMeta `json:"meta,omitempty"` + // migration completed time + MigrationCompletedTime string `json:"migration_completed_time,omitempty"` + // minor version MinorVersion string `json:"minor_version,omitempty"` @@ -250,6 +256,9 @@ type DeviceapiDeviceSwagger struct { // release group ReleaseGroup string `json:"release_group,omitempty"` + // rtr state + RtrState string `json:"rtr_state,omitempty"` + // serial number SerialNumber string `json:"serial_number,omitempty"` diff --git a/falcon/models/domain_a_w_s_account_v2.go b/falcon/models/domain_a_w_s_account_v2.go index 9e7e86ac..c10f76a2 100644 --- a/falcon/models/domain_a_w_s_account_v2.go +++ b/falcon/models/domain_a_w_s_account_v2.go @@ -103,6 +103,10 @@ type DomainAWSAccountV2 struct { // intermediate role arn IntermediateRoleArn string `json:"intermediate_role_arn,omitempty"` + // inventory filter + // Required: true + InventoryFilter []*DomainAWSInventoryFilterSetting `json:"inventory_filter"` + // Is CSPM Lite enabled. IsCspmLite bool `json:"is_cspm_lite,omitempty"` @@ -145,6 +149,9 @@ type DomainAWSAccountV2 struct { // Account registration status. Status string `json:"status,omitempty"` + // target ous + TargetOus []string `json:"target_ous"` + // use existing cloudtrail UseExistingCloudtrail bool `json:"use_existing_cloudtrail,omitempty"` @@ -188,6 +195,10 @@ func (m *DomainAWSAccountV2) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateInventoryFilter(formats); err != nil { + res = append(res, err) + } + if err := m.validateIsCustomRolename(formats); err != nil { res = append(res, err) } @@ -352,6 +363,33 @@ func (m *DomainAWSAccountV2) validateD4c(formats strfmt.Registry) error { return nil } +func (m *DomainAWSAccountV2) validateInventoryFilter(formats strfmt.Registry) error { + + if err := validate.Required("inventory_filter", "body", m.InventoryFilter); err != nil { + return err + } + + for i := 0; i < len(m.InventoryFilter); i++ { + if swag.IsZero(m.InventoryFilter[i]) { // not required + continue + } + + if m.InventoryFilter[i] != nil { + if err := m.InventoryFilter[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("inventory_filter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("inventory_filter" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainAWSAccountV2) validateIsCustomRolename(formats strfmt.Registry) error { if err := validate.Required("is_custom_rolename", "body", m.IsCustomRolename); err != nil { @@ -402,6 +440,10 @@ func (m *DomainAWSAccountV2) ContextValidate(ctx context.Context, formats strfmt res = append(res, err) } + if err := m.contextValidateInventoryFilter(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -504,6 +546,31 @@ func (m *DomainAWSAccountV2) contextValidateD4c(ctx context.Context, formats str return nil } +func (m *DomainAWSAccountV2) contextValidateInventoryFilter(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.InventoryFilter); i++ { + + if m.InventoryFilter[i] != nil { + + if swag.IsZero(m.InventoryFilter[i]) { // not required + return nil + } + + if err := m.InventoryFilter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("inventory_filter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("inventory_filter" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *DomainAWSAccountV2) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/domain_a_w_s_inventory_filter_setting.go b/falcon/models/domain_a_w_s_inventory_filter_setting.go new file mode 100644 index 00000000..ec6d20e4 --- /dev/null +++ b/falcon/models/domain_a_w_s_inventory_filter_setting.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainAWSInventoryFilterSetting domain a w s inventory filter setting +// +// swagger:model domain.AWSInventoryFilterSetting +type DomainAWSInventoryFilterSetting struct { + + // account id + // Required: true + AccountID *string `json:"account_id"` + + // regions + // Required: true + Regions []string `json:"regions"` + + // service + // Required: true + Service *string `json:"service"` +} + +// Validate validates this domain a w s inventory filter setting +func (m *DomainAWSInventoryFilterSetting) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccountID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateService(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainAWSInventoryFilterSetting) validateAccountID(formats strfmt.Registry) error { + + if err := validate.Required("account_id", "body", m.AccountID); err != nil { + return err + } + + return nil +} + +func (m *DomainAWSInventoryFilterSetting) validateRegions(formats strfmt.Registry) error { + + if err := validate.Required("regions", "body", m.Regions); err != nil { + return err + } + + return nil +} + +func (m *DomainAWSInventoryFilterSetting) validateService(formats strfmt.Registry) error { + + if err := validate.Required("service", "body", m.Service); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain a w s inventory filter setting based on context it is used +func (m *DomainAWSInventoryFilterSetting) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainAWSInventoryFilterSetting) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainAWSInventoryFilterSetting) UnmarshalBinary(b []byte) error { + var res DomainAWSInventoryFilterSetting + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_actor_document.go b/falcon/models/domain_actor_document.go index a6435a23..bb16619c 100644 --- a/falcon/models/domain_actor_document.go +++ b/falcon/models/domain_actor_document.go @@ -29,10 +29,10 @@ type DomainActorDocument struct { // actor's capabilities, some examples: RAT,Ransomware,Spearphishing,Downloader,Backdoor,InformationStealer,exploit,CredentialHarvesting,dropper,DenialOfService,Loader,Phishing // Required: true - Capabilities []*DomainEntity `json:"capabilities"` + Capabilities []DomainEntity `json:"capabilities"` // Capability of actor's activity, one of: Below Average, Average, Above average - Capability *DomainEntity `json:"capability,omitempty"` + Capability DomainEntity `json:"capability,omitempty"` // Actor's document creation date when it was added to the Falcon portal in unix timestamp format // Required: true @@ -54,14 +54,14 @@ type DomainActorDocument struct { EcrimeKillChain *DomainECrimeKillChain `json:"ecrime_kill_chain,omitempty"` // Field used to filter user's access to actor documents - Entitlements []*DomainEntity `json:"entitlements"` + Entitlements []DomainEntity `json:"entitlements"` // Actor's first activity observed date in unix timestamp format // Required: true FirstActivityDate *int64 `json:"first_activity_date"` // Deprecated, unused field - Group *DomainEntity `json:"group,omitempty"` + Group DomainEntity `json:"group,omitempty"` // has subgroup HasSubgroup []*DomainActorEntity `json:"has_subgroup"` @@ -123,7 +123,7 @@ type DomainActorDocument struct { // Actor's activity motivation, one of: State-Sponsored, Criminal, Hacktivism // Required: true - Motivations []*DomainEntity `json:"motivations"` + Motivations []DomainEntity `json:"motivations"` // Actor's name, composed of 2 words Name string `json:"name,omitempty"` @@ -134,17 +134,17 @@ type DomainActorDocument struct { // Actor's activity objectives, one of: IntelligenceGathering, FinancialGain, IntellectualPropertyTheft, defacement, Destruction, DenialOfService // Required: true - Objectives []*DomainEntity `json:"objectives"` + Objectives []DomainEntity `json:"objectives"` // represents origin of actor's activity and/or members, some examples: China,Russian Federation,Eastern Europe,Iran,East Asia, South Asia // Required: true - Origins []*DomainEntity `json:"origins"` + Origins []DomainEntity `json:"origins"` // Recent CrowdStrike's finished intelligence alerting date in unix timestamp format RecentAlerting int64 `json:"recent_alerting,omitempty"` // Deprecated, unused field - Region *DomainEntity `json:"region,omitempty"` + Region DomainEntity `json:"region,omitempty"` // Rich text version of the description field RichTextDescription string `json:"rich_text_description,omitempty"` @@ -174,15 +174,15 @@ type DomainActorDocument struct { // Target countries of actor's activity and attacks, slug value is a 2 characters code for the country value, some examples: United States,United Kingdom,Germany,India,Japan,France,Australia,Canada,China // Required: true - TargetCountries []*DomainEntity `json:"target_countries"` + TargetCountries []DomainEntity `json:"target_countries"` // Target economical industries of actor's activity and attacks. List of available values: Government, Financial Services, Technology, Telecommunications, Healthcare, Energy, Academic, Media, Aerospace, NGO, Manufacturing, Industrials and Engineering, Retail, Hospitality, Consulting and Professional Services, Opportunistic, Aviation, Defense, Transportation, Oil and Gas, Legal, Pharmaceutical, Logistics, Military, Automotive, Food and Beverage, Consumer Goods, Real Estate, Insurance, Agriculture, Chemicals, Utilities, Maritime, Extractive, Travel, Dissident, Cryptocurrency, Entertainment, National Government, Law Enforcement, Think Tanks, Local Government, Sports Organizations, Computer Gaming, Biomedical, Nonprofit, Financial Management & Hedge Funds, Political Parties, Architectural and Engineering, Emergency Services, Social Media, International Government, Nuclear, Research Entities, Vocational and Higher-Level Education, eCommerce // Required: true - TargetIndustries []*DomainEntity `json:"target_industries"` + TargetIndustries []DomainEntity `json:"target_industries"` // Target geographic regions of actor's activity and attacks. List of available values: North America, Western Europe, Southeast Asia, Middle East, Eastern Europe, South Asia, South America, Oceania, East Asia, Central Africa, Northern Europe, Southern Europe, North Africa, Southern Africa, Central America, Central Asia, East Africa, West Africa, Caribbean // Required: true - TargetRegions []*DomainEntity `json:"target_regions"` + TargetRegions []DomainEntity `json:"target_regions"` // Thumbnail image used in UI Thumbnail *DomainImage `json:"thumbnail,omitempty"` @@ -227,10 +227,6 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateCapability(formats); err != nil { - res = append(res, err) - } - if err := m.validateCreatedDate(formats); err != nil { res = append(res, err) } @@ -243,18 +239,10 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateEntitlements(formats); err != nil { - res = append(res, err) - } - if err := m.validateFirstActivityDate(formats); err != nil { res = append(res, err) } - if err := m.validateGroup(formats); err != nil { - res = append(res, err) - } - if err := m.validateHasSubgroup(formats); err != nil { res = append(res, err) } @@ -319,10 +307,6 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateRegion(formats); err != nil { - res = append(res, err) - } - if err := m.validateSellsThreats(formats); err != nil { res = append(res, err) } @@ -380,43 +364,6 @@ func (m *DomainActorDocument) validateCapabilities(formats strfmt.Registry) erro return err } - for i := 0; i < len(m.Capabilities); i++ { - if swag.IsZero(m.Capabilities[i]) { // not required - continue - } - - if m.Capabilities[i] != nil { - if err := m.Capabilities[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) validateCapability(formats strfmt.Registry) error { - if swag.IsZero(m.Capability) { // not required - return nil - } - - if m.Capability != nil { - if err := m.Capability.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capability") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capability") - } - return err - } - } - return nil } @@ -474,32 +421,6 @@ func (m *DomainActorDocument) validateEcrimeKillChain(formats strfmt.Registry) e return nil } -func (m *DomainActorDocument) validateEntitlements(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlements) { // not required - return nil - } - - for i := 0; i < len(m.Entitlements); i++ { - if swag.IsZero(m.Entitlements[i]) { // not required - continue - } - - if m.Entitlements[i] != nil { - if err := m.Entitlements[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - func (m *DomainActorDocument) validateFirstActivityDate(formats strfmt.Registry) error { if err := validate.Required("first_activity_date", "body", m.FirstActivityDate); err != nil { @@ -509,25 +430,6 @@ func (m *DomainActorDocument) validateFirstActivityDate(formats strfmt.Registry) return nil } -func (m *DomainActorDocument) validateGroup(formats strfmt.Registry) error { - if swag.IsZero(m.Group) { // not required - return nil - } - - if m.Group != nil { - if err := m.Group.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("group") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("group") - } - return err - } - } - - return nil -} - func (m *DomainActorDocument) validateHasSubgroup(formats strfmt.Registry) error { if swag.IsZero(m.HasSubgroup) { // not required return nil @@ -764,24 +666,6 @@ func (m *DomainActorDocument) validateMotivations(formats strfmt.Registry) error return err } - for i := 0; i < len(m.Motivations); i++ { - if swag.IsZero(m.Motivations[i]) { // not required - continue - } - - if m.Motivations[i] != nil { - if err := m.Motivations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("motivations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("motivations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -800,24 +684,6 @@ func (m *DomainActorDocument) validateObjectives(formats strfmt.Registry) error return err } - for i := 0; i < len(m.Objectives); i++ { - if swag.IsZero(m.Objectives[i]) { // not required - continue - } - - if m.Objectives[i] != nil { - if err := m.Objectives[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("objectives" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("objectives" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -827,43 +693,6 @@ func (m *DomainActorDocument) validateOrigins(formats strfmt.Registry) error { return err } - for i := 0; i < len(m.Origins); i++ { - if swag.IsZero(m.Origins[i]) { // not required - continue - } - - if m.Origins[i] != nil { - if err := m.Origins[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origins" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origins" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) validateRegion(formats strfmt.Registry) error { - if swag.IsZero(m.Region) { // not required - return nil - } - - if m.Region != nil { - if err := m.Region.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("region") - } - return err - } - } - return nil } @@ -943,24 +772,6 @@ func (m *DomainActorDocument) validateTargetCountries(formats strfmt.Registry) e return err } - for i := 0; i < len(m.TargetCountries); i++ { - if swag.IsZero(m.TargetCountries[i]) { // not required - continue - } - - if m.TargetCountries[i] != nil { - if err := m.TargetCountries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -970,24 +781,6 @@ func (m *DomainActorDocument) validateTargetIndustries(formats strfmt.Registry) return err } - for i := 0; i < len(m.TargetIndustries); i++ { - if swag.IsZero(m.TargetIndustries[i]) { // not required - continue - } - - if m.TargetIndustries[i] != nil { - if err := m.TargetIndustries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -997,24 +790,6 @@ func (m *DomainActorDocument) validateTargetRegions(formats strfmt.Registry) err return err } - for i := 0; i < len(m.TargetRegions); i++ { - if swag.IsZero(m.TargetRegions[i]) { // not required - continue - } - - if m.TargetRegions[i] != nil { - if err := m.TargetRegions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_regions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_regions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -1067,14 +842,6 @@ func (m *DomainActorDocument) validateUsesThreats(formats strfmt.Registry) error func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateCapabilities(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCapability(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateDevelopsThreats(ctx, formats); err != nil { res = append(res, err) } @@ -1083,14 +850,6 @@ func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } - if err := m.contextValidateEntitlements(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGroup(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateHasSubgroup(ctx, formats); err != nil { res = append(res, err) } @@ -1123,22 +882,6 @@ func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } - if err := m.contextValidateMotivations(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateObjectives(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrigins(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRegion(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateSellsThreats(ctx, formats); err != nil { res = append(res, err) } @@ -1147,18 +890,6 @@ func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } - if err := m.contextValidateTargetCountries(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTargetIndustries(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTargetRegions(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateThumbnail(ctx, formats); err != nil { res = append(res, err) } @@ -1173,52 +904,6 @@ func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfm return nil } -func (m *DomainActorDocument) contextValidateCapabilities(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Capabilities); i++ { - - if m.Capabilities[i] != nil { - - if swag.IsZero(m.Capabilities[i]) { // not required - return nil - } - - if err := m.Capabilities[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) contextValidateCapability(ctx context.Context, formats strfmt.Registry) error { - - if m.Capability != nil { - - if swag.IsZero(m.Capability) { // not required - return nil - } - - if err := m.Capability.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capability") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capability") - } - return err - } - } - - return nil -} - func (m *DomainActorDocument) contextValidateDevelopsThreats(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.DevelopsThreats); i++ { @@ -1265,52 +950,6 @@ func (m *DomainActorDocument) contextValidateEcrimeKillChain(ctx context.Context return nil } -func (m *DomainActorDocument) contextValidateEntitlements(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Entitlements); i++ { - - if m.Entitlements[i] != nil { - - if swag.IsZero(m.Entitlements[i]) { // not required - return nil - } - - if err := m.Entitlements[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) contextValidateGroup(ctx context.Context, formats strfmt.Registry) error { - - if m.Group != nil { - - if swag.IsZero(m.Group) { // not required - return nil - } - - if err := m.Group.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("group") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("group") - } - return err - } - } - - return nil -} - func (m *DomainActorDocument) contextValidateHasSubgroup(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.HasSubgroup); i++ { @@ -1503,102 +1142,6 @@ func (m *DomainActorDocument) contextValidateKillChain(ctx context.Context, form return nil } -func (m *DomainActorDocument) contextValidateMotivations(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Motivations); i++ { - - if m.Motivations[i] != nil { - - if swag.IsZero(m.Motivations[i]) { // not required - return nil - } - - if err := m.Motivations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("motivations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("motivations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) contextValidateObjectives(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Objectives); i++ { - - if m.Objectives[i] != nil { - - if swag.IsZero(m.Objectives[i]) { // not required - return nil - } - - if err := m.Objectives[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("objectives" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("objectives" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) contextValidateOrigins(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Origins); i++ { - - if m.Origins[i] != nil { - - if swag.IsZero(m.Origins[i]) { // not required - return nil - } - - if err := m.Origins[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origins" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origins" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { - - if m.Region != nil { - - if swag.IsZero(m.Region) { // not required - return nil - } - - if err := m.Region.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("region") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("region") - } - return err - } - } - - return nil -} - func (m *DomainActorDocument) contextValidateSellsThreats(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.SellsThreats); i++ { @@ -1649,81 +1192,6 @@ func (m *DomainActorDocument) contextValidateSupports(ctx context.Context, forma return nil } -func (m *DomainActorDocument) contextValidateTargetCountries(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TargetCountries); i++ { - - if m.TargetCountries[i] != nil { - - if swag.IsZero(m.TargetCountries[i]) { // not required - return nil - } - - if err := m.TargetCountries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) contextValidateTargetIndustries(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TargetIndustries); i++ { - - if m.TargetIndustries[i] != nil { - - if swag.IsZero(m.TargetIndustries[i]) { // not required - return nil - } - - if err := m.TargetIndustries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainActorDocument) contextValidateTargetRegions(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TargetRegions); i++ { - - if m.TargetRegions[i] != nil { - - if swag.IsZero(m.TargetRegions[i]) { // not required - return nil - } - - if err := m.TargetRegions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_regions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_regions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - func (m *DomainActorDocument) contextValidateThumbnail(ctx context.Context, formats strfmt.Registry) error { if m.Thumbnail != nil { diff --git a/falcon/models/domain_api_entity_matched_v1.go b/falcon/models/domain_api_entity_matched_v1.go deleted file mode 100644 index 264d52c3..00000000 --- a/falcon/models/domain_api_entity_matched_v1.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DomainAPIEntityMatchedV1 domain API entity matched v1 -// -// swagger:model domain.APIEntityMatchedV1 -type DomainAPIEntityMatchedV1 struct { - - // asset id - AssetID string `json:"asset_id,omitempty"` - - // data provider - DataProvider string `json:"data_provider,omitempty"` - - // provider asset id - ProviderAssetID string `json:"provider_asset_id,omitempty"` -} - -// Validate validates this domain API entity matched v1 -func (m *DomainAPIEntityMatchedV1) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this domain API entity matched v1 based on context it is used -func (m *DomainAPIEntityMatchedV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainAPIEntityMatchedV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainAPIEntityMatchedV1) UnmarshalBinary(b []byte) error { - var res DomainAPIEntityMatchedV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_api_evaluation_logic_host_info_v1.go b/falcon/models/domain_api_evaluation_logic_host_info_v1.go deleted file mode 100644 index bec6676c..00000000 --- a/falcon/models/domain_api_evaluation_logic_host_info_v1.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DomainAPIEvaluationLogicHostInfoV1 domain API evaluation logic host info v1 -// -// swagger:model domain.APIEvaluationLogicHostInfoV1 -type DomainAPIEvaluationLogicHostInfoV1 struct { - - // Refers to all the entities that were matched together during entity resolution process - // Required: true - EntitiesMatched []*DomainAPIEntityMatchedV1 `json:"entities_matched"` -} - -// Validate validates this domain API evaluation logic host info v1 -func (m *DomainAPIEvaluationLogicHostInfoV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEntitiesMatched(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainAPIEvaluationLogicHostInfoV1) validateEntitiesMatched(formats strfmt.Registry) error { - - if err := validate.Required("entities_matched", "body", m.EntitiesMatched); err != nil { - return err - } - - for i := 0; i < len(m.EntitiesMatched); i++ { - if swag.IsZero(m.EntitiesMatched[i]) { // not required - continue - } - - if m.EntitiesMatched[i] != nil { - if err := m.EntitiesMatched[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entities_matched" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entities_matched" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this domain API evaluation logic host info v1 based on the context it is used -func (m *DomainAPIEvaluationLogicHostInfoV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEntitiesMatched(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainAPIEvaluationLogicHostInfoV1) contextValidateEntitiesMatched(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.EntitiesMatched); i++ { - - if m.EntitiesMatched[i] != nil { - - if swag.IsZero(m.EntitiesMatched[i]) { // not required - return nil - } - - if err := m.EntitiesMatched[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entities_matched" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entities_matched" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DomainAPIEvaluationLogicHostInfoV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainAPIEvaluationLogicHostInfoV1) UnmarshalBinary(b []byte) error { - var res DomainAPIEvaluationLogicHostInfoV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_api_evaluation_logic_item_v1.go b/falcon/models/domain_api_evaluation_logic_item_v1.go index 14d0ca8d..129ae08a 100644 --- a/falcon/models/domain_api_evaluation_logic_item_v1.go +++ b/falcon/models/domain_api_evaluation_logic_item_v1.go @@ -26,9 +26,6 @@ type DomainAPIEvaluationLogicItemV1 struct { // comparisons Comparisons *DomainAPIEvaluationLogicComparisonsV1 `json:"comparisons,omitempty"` - // description - Description string `json:"description,omitempty"` - // determined by comparison DeterminedByComparison bool `json:"determined_by_comparison,omitempty"` @@ -44,6 +41,10 @@ type DomainAPIEvaluationLogicItemV1 struct { // negate Negate bool `json:"negate,omitempty"` + // status + // Required: true + Status *string `json:"status"` + // title // Required: true Title *string `json:"title"` @@ -61,6 +62,10 @@ func (m *DomainAPIEvaluationLogicItemV1) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + if err := m.validateTitle(formats); err != nil { res = append(res, err) } @@ -94,6 +99,15 @@ func (m *DomainAPIEvaluationLogicItemV1) validateComparisons(formats strfmt.Regi return nil } +func (m *DomainAPIEvaluationLogicItemV1) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + func (m *DomainAPIEvaluationLogicItemV1) validateTitle(formats strfmt.Registry) error { if err := validate.Required("title", "body", m.Title); err != nil { diff --git a/falcon/models/domain_api_evaluation_logic_v1.go b/falcon/models/domain_api_evaluation_logic_v1.go index bc988bc7..7bbbb7de 100644 --- a/falcon/models/domain_api_evaluation_logic_v1.go +++ b/falcon/models/domain_api_evaluation_logic_v1.go @@ -20,32 +20,26 @@ import ( // swagger:model domain.APIEvaluationLogicV1 type DomainAPIEvaluationLogicV1 struct { - // Refers to an asset identifier + // aid Aid string `json:"aid,omitempty"` - // Refers to a customer identifier + // cid Cid string `json:"cid,omitempty"` - // Refers to a point in time when evaluation logic data was created in the system - CreatedTimestamp string `json:"created_timestamp,omitempty"` - - // Refers to a label given to the entity that provided this data - DataProvider string `json:"data_provider,omitempty"` + // complex check operator + ComplexCheckOperator string `json:"complex_check_operator,omitempty"` - // Refers back to the asset for which vulnerability was detected - contains only relevant information for working with evaluation logic data - HostInfo *DomainAPIEvaluationLogicHostInfoV1 `json:"host_info,omitempty"` + // created timestamp + CreatedTimestamp string `json:"created_timestamp,omitempty"` - // Contains a unique identifier for the evaluation logic + // id // Required: true ID *string `json:"id"` - // Refers to the actual evaluation logic data + // logic Logic []*DomainAPIEvaluationLogicItemV1 `json:"logic"` - // Refers to the identifier of the scanner that generated the evaluation logic - ScannerID string `json:"scanner_id,omitempty"` - - // Refers to a point in time when evaluation logic data was updated in the system + // updated timestamp UpdatedTimestamp string `json:"updated_timestamp,omitempty"` } @@ -53,10 +47,6 @@ type DomainAPIEvaluationLogicV1 struct { func (m *DomainAPIEvaluationLogicV1) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateHostInfo(formats); err != nil { - res = append(res, err) - } - if err := m.validateID(formats); err != nil { res = append(res, err) } @@ -71,25 +61,6 @@ func (m *DomainAPIEvaluationLogicV1) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainAPIEvaluationLogicV1) validateHostInfo(formats strfmt.Registry) error { - if swag.IsZero(m.HostInfo) { // not required - return nil - } - - if m.HostInfo != nil { - if err := m.HostInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("host_info") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("host_info") - } - return err - } - } - - return nil -} - func (m *DomainAPIEvaluationLogicV1) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { @@ -129,10 +100,6 @@ func (m *DomainAPIEvaluationLogicV1) validateLogic(formats strfmt.Registry) erro func (m *DomainAPIEvaluationLogicV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateHostInfo(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateLogic(ctx, formats); err != nil { res = append(res, err) } @@ -143,27 +110,6 @@ func (m *DomainAPIEvaluationLogicV1) ContextValidate(ctx context.Context, format return nil } -func (m *DomainAPIEvaluationLogicV1) contextValidateHostInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.HostInfo != nil { - - if swag.IsZero(m.HostInfo) { // not required - return nil - } - - if err := m.HostInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("host_info") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("host_info") - } - return err - } - } - - return nil -} - func (m *DomainAPIEvaluationLogicV1) contextValidateLogic(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Logic); i++ { diff --git a/falcon/models/domain_api_vulnerability_c_v_e_details_facet_v2.go b/falcon/models/domain_api_vulnerability_c_v_e_details_facet_v2.go index 693bf171..a052efc3 100644 --- a/falcon/models/domain_api_vulnerability_c_v_e_details_facet_v2.go +++ b/falcon/models/domain_api_vulnerability_c_v_e_details_facet_v2.go @@ -28,6 +28,9 @@ type DomainAPIVulnerabilityCVEDetailsFacetV2 struct { // CISA_info encompasses cybersecurity alerts and guidance provided by the Cybersecurity and Infrastructure Security Agency (CISA) for enhancing critical infrastructure resilience CisaInfo *DomainAPIVulnerabilityCVECISAInfo `json:"cisa_info,omitempty"` + // The CWE ids corresponding to this vulnerability instance + Cwes []string `json:"cwes"` + // Refers to description of the vulnerability Description string `json:"description,omitempty"` diff --git a/falcon/models/domain_api_vulnerability_host_facet_v2.go b/falcon/models/domain_api_vulnerability_host_facet_v2.go index 94dfc733..21f98ded 100644 --- a/falcon/models/domain_api_vulnerability_host_facet_v2.go +++ b/falcon/models/domain_api_vulnerability_host_facet_v2.go @@ -26,6 +26,9 @@ type DomainAPIVulnerabilityHostFacetV2 struct { // Refers to one or more roles that have been assigned to the assets AssetRoles []string `json:"asset_roles"` + // Confidence level of the asset association to the CID + ConfidenceLabel string `json:"confidence_label,omitempty"` + // Refers to a logic grouping of assets Groups []*DomainAPIHostGroup `json:"groups"` @@ -80,6 +83,9 @@ type DomainAPIVulnerabilityHostFacetV2 struct { // Required: true SiteName *string `json:"site_name"` + // The list of subsidiaries associated with the asset + Subsidiaries []string `json:"subsidiaries"` + // Refers to the company or organization that designed and produced the hardware system or device // Required: true SystemManufacturer *string `json:"system_manufacturer"` diff --git a/falcon/models/domain_api_vulnerability_service_v2.go b/falcon/models/domain_api_vulnerability_service_v2.go new file mode 100644 index 00000000..a574cb46 --- /dev/null +++ b/falcon/models/domain_api_vulnerability_service_v2.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainAPIVulnerabilityServiceV2 domain API vulnerability service v2 +// +// swagger:model domain.APIVulnerabilityServiceV2 +type DomainAPIVulnerabilityServiceV2 struct { + + // Represents the service's exposed port + Port int32 `json:"port,omitempty"` + + // Represents the service's protocol + Protocol string `json:"protocol,omitempty"` + + // Represents the service's transport + Transport string `json:"transport,omitempty"` +} + +// Validate validates this domain API vulnerability service v2 +func (m *DomainAPIVulnerabilityServiceV2) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain API vulnerability service v2 based on context it is used +func (m *DomainAPIVulnerabilityServiceV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainAPIVulnerabilityServiceV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainAPIVulnerabilityServiceV2) UnmarshalBinary(b []byte) error { + var res DomainAPIVulnerabilityServiceV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_api_vulnerability_v2.go b/falcon/models/domain_api_vulnerability_v2.go index 3ccc989f..57b7e53d 100644 --- a/falcon/models/domain_api_vulnerability_v2.go +++ b/falcon/models/domain_api_vulnerability_v2.go @@ -37,6 +37,9 @@ type DomainAPIVulnerabilityV2 struct { // A timestamp corresponding to the point in time when the vulnerability has no longer been detected (eg: it got fixed) ClosedTimestamp string `json:"closed_timestamp,omitempty"` + // Represents the confidence level of a vulnerability + Confidence string `json:"confidence,omitempty"` + // A timestamp corresponding to the point in time when the vulnerability has been created (detected) in our system // Required: true CreatedTimestamp *string `json:"created_timestamp"` @@ -57,6 +60,9 @@ type DomainAPIVulnerabilityV2 struct { // remediation Remediation *DomainAPIVulnerabilityRemediationFacetV2 `json:"remediation,omitempty"` + // Contains details about the vulnerable services + Services []*DomainAPIVulnerabilityServiceV2 `json:"services"` + // Current status of a vulnerability (open, closed, reopen) // Required: true Status *string `json:"status"` @@ -116,6 +122,10 @@ func (m *DomainAPIVulnerabilityV2) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateServices(formats); err != nil { + res = append(res, err) + } + if err := m.validateStatus(formats); err != nil { res = append(res, err) } @@ -298,6 +308,32 @@ func (m *DomainAPIVulnerabilityV2) validateRemediation(formats strfmt.Registry) return nil } +func (m *DomainAPIVulnerabilityV2) validateServices(formats strfmt.Registry) error { + if swag.IsZero(m.Services) { // not required + return nil + } + + for i := 0; i < len(m.Services); i++ { + if swag.IsZero(m.Services[i]) { // not required + continue + } + + if m.Services[i] != nil { + if err := m.Services[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainAPIVulnerabilityV2) validateStatus(formats strfmt.Registry) error { if err := validate.Required("status", "body", m.Status); err != nil { @@ -363,6 +399,10 @@ func (m *DomainAPIVulnerabilityV2) ContextValidate(ctx context.Context, formats res = append(res, err) } + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSuppressionInfo(ctx, formats); err != nil { res = append(res, err) } @@ -507,6 +547,31 @@ func (m *DomainAPIVulnerabilityV2) contextValidateRemediation(ctx context.Contex return nil } +func (m *DomainAPIVulnerabilityV2) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + + if swag.IsZero(m.Services[i]) { // not required + return nil + } + + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainAPIVulnerabilityV2) contextValidateSuppressionInfo(ctx context.Context, formats strfmt.Registry) error { if m.SuppressionInfo != nil { diff --git a/falcon/models/domain_assessment_paging.go b/falcon/models/domain_assessment_paging.go new file mode 100644 index 00000000..712748a8 --- /dev/null +++ b/falcon/models/domain_assessment_paging.go @@ -0,0 +1,94 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainAssessmentPaging domain assessment paging +// +// swagger:model domain.AssessmentPaging +type DomainAssessmentPaging struct { + + // expires at + ExpiresAt int64 `json:"expires_at,omitempty"` + + // limit + Limit int32 `json:"limit,omitempty"` + + // offset + // Required: true + Offset *string `json:"offset"` + + // total + // Required: true + Total *int64 `json:"total"` +} + +// Validate validates this domain assessment paging +func (m *DomainAssessmentPaging) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOffset(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainAssessmentPaging) validateOffset(formats strfmt.Registry) error { + + if err := validate.Required("offset", "body", m.Offset); err != nil { + return err + } + + return nil +} + +func (m *DomainAssessmentPaging) validateTotal(formats strfmt.Registry) error { + + if err := validate.Required("total", "body", m.Total); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain assessment paging based on context it is used +func (m *DomainAssessmentPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainAssessmentPaging) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainAssessmentPaging) UnmarshalBinary(b []byte) error { + var res DomainAssessmentPaging + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_base_api_vulnerability_v2.go b/falcon/models/domain_base_api_vulnerability_v2.go index 3088a868..2a0eccc8 100644 --- a/falcon/models/domain_base_api_vulnerability_v2.go +++ b/falcon/models/domain_base_api_vulnerability_v2.go @@ -37,6 +37,9 @@ type DomainBaseAPIVulnerabilityV2 struct { // A timestamp corresponding to the point in time when the vulnerability has no longer been detected (eg: it got fixed) ClosedTimestamp string `json:"closed_timestamp,omitempty"` + // Represents the confidence level of a vulnerability + Confidence string `json:"confidence,omitempty"` + // A timestamp corresponding to the point in time when the vulnerability has been created (detected) in our system // Required: true CreatedTimestamp *string `json:"created_timestamp"` @@ -57,6 +60,9 @@ type DomainBaseAPIVulnerabilityV2 struct { // Contains details about the remediation steps needed to fix the vulnerability Remediation *DomainAPIVulnerabilityRemediationFacetV2 `json:"remediation,omitempty"` + // Contains details about the vulnerable services + Services []*DomainAPIVulnerabilityServiceV2 `json:"services"` + // Current status of a vulnerability (open, closed, reopen) // Required: true Status *string `json:"status"` @@ -116,6 +122,10 @@ func (m *DomainBaseAPIVulnerabilityV2) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateServices(formats); err != nil { + res = append(res, err) + } + if err := m.validateStatus(formats); err != nil { res = append(res, err) } @@ -298,6 +308,32 @@ func (m *DomainBaseAPIVulnerabilityV2) validateRemediation(formats strfmt.Regist return nil } +func (m *DomainBaseAPIVulnerabilityV2) validateServices(formats strfmt.Registry) error { + if swag.IsZero(m.Services) { // not required + return nil + } + + for i := 0; i < len(m.Services); i++ { + if swag.IsZero(m.Services[i]) { // not required + continue + } + + if m.Services[i] != nil { + if err := m.Services[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainBaseAPIVulnerabilityV2) validateStatus(formats strfmt.Registry) error { if err := validate.Required("status", "body", m.Status); err != nil { @@ -363,6 +399,10 @@ func (m *DomainBaseAPIVulnerabilityV2) ContextValidate(ctx context.Context, form res = append(res, err) } + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSuppressionInfo(ctx, formats); err != nil { res = append(res, err) } @@ -507,6 +547,31 @@ func (m *DomainBaseAPIVulnerabilityV2) contextValidateRemediation(ctx context.Co return nil } +func (m *DomainBaseAPIVulnerabilityV2) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + + if swag.IsZero(m.Services[i]) { // not required + return nil + } + + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainBaseAPIVulnerabilityV2) contextValidateSuppressionInfo(ctx context.Context, formats strfmt.Registry) error { if m.SuppressionInfo != nil { diff --git a/falcon/models/domain_behavior.go b/falcon/models/domain_behavior.go index d0229120..80a394b8 100644 --- a/falcon/models/domain_behavior.go +++ b/falcon/models/domain_behavior.go @@ -52,6 +52,9 @@ type DomainBehavior struct { // filepath Filepath string `json:"filepath,omitempty"` + // grouping ids + GroupingIds []string `json:"grouping_ids"` + // incident id IncidentID string `json:"incident_id,omitempty"` diff --git a/falcon/models/domain_botnet_config_source.go b/falcon/models/domain_botnet_config_source.go deleted file mode 100644 index 90de6c82..00000000 --- a/falcon/models/domain_botnet_config_source.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DomainBotnetConfigSource domain botnet config source -// -// swagger:model domain.BotnetConfigSource -type DomainBotnetConfigSource struct { - - // Populated for action botnets. List of action key value pairs, defined as the action and its type - // Required: true - Actions []*DomainKeyValuePair `json:"actions"` - - // Populated for spam botnets. The body of the spam template. If this contains replaceable variables, keep the variable names in the template as they appear in the raw config - // Required: true - Body *string `json:"body"` - - // The botnet's name - // Required: true - Botnet *string `json:"botnet"` - - // The type of botnet: `action`, `inject`, or `spam` - // Required: true - ConfigType *string `json:"config_type"` - - // Populated for inject botnets. List of inject targets and their data - // Required: true - Injects []*DomainBotnetInject `json:"injects"` - - // Optional sub-botnet differentiator - // Required: true - SubBotnet *string `json:"sub_botnet"` - - // Populated for spam botnets. The subject of the spam template. If this contains replaceable variables, keep the variable names in the template as they appear in the raw config - // Required: true - Subject *string `json:"subject"` - - // Populated for spam botnets. List of key value pairs for any replaceable variables in the spam template - // Required: true - Variables []*DomainKeyValuePair `json:"variables"` -} - -// Validate validates this domain botnet config source -func (m *DomainBotnetConfigSource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBody(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBotnet(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfigType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInjects(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubBotnet(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVariables(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainBotnetConfigSource) validateActions(formats strfmt.Registry) error { - - if err := validate.Required("actions", "body", m.Actions); err != nil { - return err - } - - for i := 0; i < len(m.Actions); i++ { - if swag.IsZero(m.Actions[i]) { // not required - continue - } - - if m.Actions[i] != nil { - if err := m.Actions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainBotnetConfigSource) validateBody(formats strfmt.Registry) error { - - if err := validate.Required("body", "body", m.Body); err != nil { - return err - } - - return nil -} - -func (m *DomainBotnetConfigSource) validateBotnet(formats strfmt.Registry) error { - - if err := validate.Required("botnet", "body", m.Botnet); err != nil { - return err - } - - return nil -} - -func (m *DomainBotnetConfigSource) validateConfigType(formats strfmt.Registry) error { - - if err := validate.Required("config_type", "body", m.ConfigType); err != nil { - return err - } - - return nil -} - -func (m *DomainBotnetConfigSource) validateInjects(formats strfmt.Registry) error { - - if err := validate.Required("injects", "body", m.Injects); err != nil { - return err - } - - for i := 0; i < len(m.Injects); i++ { - if swag.IsZero(m.Injects[i]) { // not required - continue - } - - if m.Injects[i] != nil { - if err := m.Injects[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("injects" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("injects" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainBotnetConfigSource) validateSubBotnet(formats strfmt.Registry) error { - - if err := validate.Required("sub_botnet", "body", m.SubBotnet); err != nil { - return err - } - - return nil -} - -func (m *DomainBotnetConfigSource) validateSubject(formats strfmt.Registry) error { - - if err := validate.Required("subject", "body", m.Subject); err != nil { - return err - } - - return nil -} - -func (m *DomainBotnetConfigSource) validateVariables(formats strfmt.Registry) error { - - if err := validate.Required("variables", "body", m.Variables); err != nil { - return err - } - - for i := 0; i < len(m.Variables); i++ { - if swag.IsZero(m.Variables[i]) { // not required - continue - } - - if m.Variables[i] != nil { - if err := m.Variables[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("variables" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("variables" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this domain botnet config source based on the context it is used -func (m *DomainBotnetConfigSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateInjects(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVariables(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainBotnetConfigSource) contextValidateActions(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Actions); i++ { - - if m.Actions[i] != nil { - - if swag.IsZero(m.Actions[i]) { // not required - return nil - } - - if err := m.Actions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actions" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainBotnetConfigSource) contextValidateInjects(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Injects); i++ { - - if m.Injects[i] != nil { - - if swag.IsZero(m.Injects[i]) { // not required - return nil - } - - if err := m.Injects[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("injects" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("injects" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainBotnetConfigSource) contextValidateVariables(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Variables); i++ { - - if m.Variables[i] != nil { - - if swag.IsZero(m.Variables[i]) { // not required - return nil - } - - if err := m.Variables[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("variables" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("variables" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DomainBotnetConfigSource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainBotnetConfigSource) UnmarshalBinary(b []byte) error { - var res DomainBotnetConfigSource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_botnet_inject.go b/falcon/models/domain_botnet_inject.go deleted file mode 100644 index abf55a2e..00000000 --- a/falcon/models/domain_botnet_inject.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DomainBotnetInject domain botnet inject -// -// swagger:model domain.BotnetInject -type DomainBotnetInject struct { - - // The injected data. Populated for inject botnets - // Required: true - Inject *string `json:"inject"` - - // The targeted pattern of data. Populated for inject botnets - // Required: true - Pattern *string `json:"pattern"` -} - -// Validate validates this domain botnet inject -func (m *DomainBotnetInject) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateInject(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePattern(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainBotnetInject) validateInject(formats strfmt.Registry) error { - - if err := validate.Required("inject", "body", m.Inject); err != nil { - return err - } - - return nil -} - -func (m *DomainBotnetInject) validatePattern(formats strfmt.Registry) error { - - if err := validate.Required("pattern", "body", m.Pattern); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this domain botnet inject based on context it is used -func (m *DomainBotnetInject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainBotnetInject) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainBotnetInject) UnmarshalBinary(b []byte) error { - var res DomainBotnetInject - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_c_i_s_a_known_exploited_vulnerabilities_info.go b/falcon/models/domain_c_i_s_a_known_exploited_vulnerabilities_info.go new file mode 100644 index 00000000..f701e280 --- /dev/null +++ b/falcon/models/domain_c_i_s_a_known_exploited_vulnerabilities_info.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCISAKnownExploitedVulnerabilitiesInfo domain c i s a known exploited vulnerabilities info +// +// swagger:model domain.CISAKnownExploitedVulnerabilitiesInfo +type DomainCISAKnownExploitedVulnerabilitiesInfo struct { + + // due date + // Required: true + // Format: date-time + DueDate *strfmt.DateTime `json:"due_date"` + + // is cisa kev + // Required: true + IsCisaKev *bool `json:"is_cisa_kev"` +} + +// Validate validates this domain c i s a known exploited vulnerabilities info +func (m *DomainCISAKnownExploitedVulnerabilitiesInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDueDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsCisaKev(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCISAKnownExploitedVulnerabilitiesInfo) validateDueDate(formats strfmt.Registry) error { + + if err := validate.Required("due_date", "body", m.DueDate); err != nil { + return err + } + + if err := validate.FormatOf("due_date", "body", "date-time", m.DueDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainCISAKnownExploitedVulnerabilitiesInfo) validateIsCisaKev(formats strfmt.Registry) error { + + if err := validate.Required("is_cisa_kev", "body", m.IsCisaKev); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain c i s a known exploited vulnerabilities info based on context it is used +func (m *DomainCISAKnownExploitedVulnerabilitiesInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCISAKnownExploitedVulnerabilitiesInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCISAKnownExploitedVulnerabilitiesInfo) UnmarshalBinary(b []byte) error { + var res DomainCISAKnownExploitedVulnerabilitiesInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_id_group.go b/falcon/models/domain_c_id_group.go index 345713f0..d94c8f73 100644 --- a/falcon/models/domain_c_id_group.go +++ b/falcon/models/domain_c_id_group.go @@ -23,14 +23,11 @@ type DomainCIDGroup struct { Cid string `json:"cid,omitempty"` // cid group id - // Required: true - CidGroupID *string `json:"cid_group_id"` + CidGroupID string `json:"cid_group_id,omitempty"` // description - Description string `json:"description,omitempty"` - - // is default - IsDefault bool `json:"is_default,omitempty"` + // Required: true + Description *string `json:"description"` // name // Required: true @@ -41,7 +38,7 @@ type DomainCIDGroup struct { func (m *DomainCIDGroup) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateCidGroupID(formats); err != nil { + if err := m.validateDescription(formats); err != nil { res = append(res, err) } @@ -55,9 +52,9 @@ func (m *DomainCIDGroup) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainCIDGroup) validateCidGroupID(formats strfmt.Registry) error { +func (m *DomainCIDGroup) validateDescription(formats strfmt.Registry) error { - if err := validate.Required("cid_group_id", "body", m.CidGroupID); err != nil { + if err := validate.Required("description", "body", m.Description); err != nil { return err } diff --git a/falcon/models/domain_c_p_s_rating.go b/falcon/models/domain_c_p_s_rating.go new file mode 100644 index 00000000..f490ae15 --- /dev/null +++ b/falcon/models/domain_c_p_s_rating.go @@ -0,0 +1,350 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCPSRating domain c p s rating +// +// swagger:model domain.CPSRating +type DomainCPSRating struct { + + // current rating + // Required: true + CurrentRating *DomainCPSRatingHistoryEntry `json:"CurrentRating"` + + // highest rating + // Required: true + HighestRating *DomainCPSRatingHistoryEntry `json:"HighestRating"` + + // negative indicators + // Required: true + NegativeIndicators []*DomainCPSRatingIndicator `json:"NegativeIndicators"` + + // positive indicators + // Required: true + PositiveIndicators []*DomainCPSRatingIndicator `json:"PositiveIndicators"` + + // rating history + // Required: true + RatingHistory []*DomainCPSRatingHistoryEntry `json:"RatingHistory"` +} + +// Validate validates this domain c p s rating +func (m *DomainCPSRating) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCurrentRating(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHighestRating(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNegativeIndicators(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePositiveIndicators(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRatingHistory(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCPSRating) validateCurrentRating(formats strfmt.Registry) error { + + if err := validate.Required("CurrentRating", "body", m.CurrentRating); err != nil { + return err + } + + if m.CurrentRating != nil { + if err := m.CurrentRating.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CurrentRating") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CurrentRating") + } + return err + } + } + + return nil +} + +func (m *DomainCPSRating) validateHighestRating(formats strfmt.Registry) error { + + if err := validate.Required("HighestRating", "body", m.HighestRating); err != nil { + return err + } + + if m.HighestRating != nil { + if err := m.HighestRating.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("HighestRating") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("HighestRating") + } + return err + } + } + + return nil +} + +func (m *DomainCPSRating) validateNegativeIndicators(formats strfmt.Registry) error { + + if err := validate.Required("NegativeIndicators", "body", m.NegativeIndicators); err != nil { + return err + } + + for i := 0; i < len(m.NegativeIndicators); i++ { + if swag.IsZero(m.NegativeIndicators[i]) { // not required + continue + } + + if m.NegativeIndicators[i] != nil { + if err := m.NegativeIndicators[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("NegativeIndicators" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("NegativeIndicators" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCPSRating) validatePositiveIndicators(formats strfmt.Registry) error { + + if err := validate.Required("PositiveIndicators", "body", m.PositiveIndicators); err != nil { + return err + } + + for i := 0; i < len(m.PositiveIndicators); i++ { + if swag.IsZero(m.PositiveIndicators[i]) { // not required + continue + } + + if m.PositiveIndicators[i] != nil { + if err := m.PositiveIndicators[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("PositiveIndicators" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("PositiveIndicators" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCPSRating) validateRatingHistory(formats strfmt.Registry) error { + + if err := validate.Required("RatingHistory", "body", m.RatingHistory); err != nil { + return err + } + + for i := 0; i < len(m.RatingHistory); i++ { + if swag.IsZero(m.RatingHistory[i]) { // not required + continue + } + + if m.RatingHistory[i] != nil { + if err := m.RatingHistory[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RatingHistory" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RatingHistory" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain c p s rating based on the context it is used +func (m *DomainCPSRating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCurrentRating(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHighestRating(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNegativeIndicators(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePositiveIndicators(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRatingHistory(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCPSRating) contextValidateCurrentRating(ctx context.Context, formats strfmt.Registry) error { + + if m.CurrentRating != nil { + + if err := m.CurrentRating.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CurrentRating") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CurrentRating") + } + return err + } + } + + return nil +} + +func (m *DomainCPSRating) contextValidateHighestRating(ctx context.Context, formats strfmt.Registry) error { + + if m.HighestRating != nil { + + if err := m.HighestRating.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("HighestRating") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("HighestRating") + } + return err + } + } + + return nil +} + +func (m *DomainCPSRating) contextValidateNegativeIndicators(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NegativeIndicators); i++ { + + if m.NegativeIndicators[i] != nil { + + if swag.IsZero(m.NegativeIndicators[i]) { // not required + return nil + } + + if err := m.NegativeIndicators[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("NegativeIndicators" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("NegativeIndicators" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCPSRating) contextValidatePositiveIndicators(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PositiveIndicators); i++ { + + if m.PositiveIndicators[i] != nil { + + if swag.IsZero(m.PositiveIndicators[i]) { // not required + return nil + } + + if err := m.PositiveIndicators[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("PositiveIndicators" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("PositiveIndicators" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCPSRating) contextValidateRatingHistory(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.RatingHistory); i++ { + + if m.RatingHistory[i] != nil { + + if swag.IsZero(m.RatingHistory[i]) { // not required + return nil + } + + if err := m.RatingHistory[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RatingHistory" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RatingHistory" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCPSRating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCPSRating) UnmarshalBinary(b []byte) error { + var res DomainCPSRating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_p_s_rating_history_entry.go b/falcon/models/domain_c_p_s_rating_history_entry.go new file mode 100644 index 00000000..1ac04e1d --- /dev/null +++ b/falcon/models/domain_c_p_s_rating_history_entry.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCPSRatingHistoryEntry domain c p s rating history entry +// +// swagger:model domain.CPSRatingHistoryEntry +type DomainCPSRatingHistoryEntry struct { + + // date recorded + // Required: true + // Format: date-time + DateRecorded *strfmt.DateTime `json:"DateRecorded"` + + // rating + // Required: true + Rating *string `json:"Rating"` +} + +// Validate validates this domain c p s rating history entry +func (m *DomainCPSRatingHistoryEntry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDateRecorded(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRating(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCPSRatingHistoryEntry) validateDateRecorded(formats strfmt.Registry) error { + + if err := validate.Required("DateRecorded", "body", m.DateRecorded); err != nil { + return err + } + + if err := validate.FormatOf("DateRecorded", "body", "date-time", m.DateRecorded.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainCPSRatingHistoryEntry) validateRating(formats strfmt.Registry) error { + + if err := validate.Required("Rating", "body", m.Rating); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain c p s rating history entry based on context it is used +func (m *DomainCPSRatingHistoryEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCPSRatingHistoryEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCPSRatingHistoryEntry) UnmarshalBinary(b []byte) error { + var res DomainCPSRatingHistoryEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_p_s_rating_indicator.go b/falcon/models/domain_c_p_s_rating_indicator.go new file mode 100644 index 00000000..c8707c0f --- /dev/null +++ b/falcon/models/domain_c_p_s_rating_indicator.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCPSRatingIndicator domain c p s rating indicator +// +// swagger:model domain.CPSRatingIndicator +type DomainCPSRatingIndicator struct { + + // description + // Required: true + Description *string `json:"Description"` + + // name + // Required: true + Name *string `json:"Name"` + + // value + // Required: true + Value *string `json:"Value"` +} + +// Validate validates this domain c p s rating indicator +func (m *DomainCPSRatingIndicator) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCPSRatingIndicator) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("Description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *DomainCPSRatingIndicator) validateName(formats strfmt.Registry) error { + + if err := validate.Required("Name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *DomainCPSRatingIndicator) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("Value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain c p s rating indicator based on context it is used +func (m *DomainCPSRatingIndicator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCPSRatingIndicator) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCPSRatingIndicator) UnmarshalBinary(b []byte) error { + var res DomainCPSRatingIndicator + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_v_e.go b/falcon/models/domain_c_v_e.go new file mode 100644 index 00000000..e3e13bf0 --- /dev/null +++ b/falcon/models/domain_c_v_e.go @@ -0,0 +1,697 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCVE domain c v e +// +// swagger:model domain.CVE +type DomainCVE struct { + + // actors + // Required: true + Actors []string `json:"actors"` + + // additional info + AdditionalInfo string `json:"additional_info,omitempty"` + + // base score + // Required: true + BaseScore *float64 `json:"base_score"` + + // cisa kev info + // Required: true + CisaKevInfo *DomainCISAKnownExploitedVulnerabilitiesInfo `json:"cisa_kev_info"` + + // content packages + ContentPackages []*DomainContentPackage `json:"content_packages"` + + // cps rating + // Required: true + CpsRating *DomainCPSRating `json:"cps_rating"` + + // cvss v2 score + CvssV2Score *DomainCVSSv2 `json:"cvss_v2_score,omitempty"` + + // cvss v3 score + CvssV3Score *DomainCVSSv3 `json:"cvss_v3_score,omitempty"` + + // cvss version + // Required: true + CvssVersion *string `json:"cvss_version"` + + // description + Description string `json:"description,omitempty"` + + // exploitability score + ExploitabilityScore float64 `json:"exploitability_score,omitempty"` + + // exploited + Exploited *DomainCVEExploit `json:"exploited,omitempty"` + + // id + // Required: true + ID *string `json:"id"` + + // impact score + ImpactScore float64 `json:"impact_score,omitempty"` + + // is supported + // Required: true + IsSupported *bool `json:"is_supported"` + + // metadata hash + // Required: true + MetadataHash *int64 `json:"metadata_hash"` + + // name + // Required: true + Name *string `json:"name"` + + // published date + // Required: true + // Format: date-time + PublishedDate *strfmt.DateTime `json:"published_date"` + + // references + // Required: true + References []*DomainReference `json:"references"` + + // severity + // Required: true + Severity *string `json:"severity"` + + // source + // Required: true + Source *string `json:"source"` + + // source type + // Required: true + SourceType *string `json:"source_type"` + + // spotlight published date + // Required: true + // Format: date-time + SpotlightPublishedDate *strfmt.DateTime `json:"spotlight_published_date"` + + // types + // Required: true + Types []string `json:"types"` + + // vector + // Required: true + Vector *string `json:"vector"` +} + +// Validate validates this domain c v e +func (m *DomainCVE) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBaseScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCisaKevInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentPackages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCpsRating(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssV2Score(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssV3Score(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploited(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsSupported(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMetadataHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePublishedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReferences(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSourceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSpotlightPublishedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTypes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVector(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVE) validateActors(formats strfmt.Registry) error { + + if err := validate.Required("actors", "body", m.Actors); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateBaseScore(formats strfmt.Registry) error { + + if err := validate.Required("base_score", "body", m.BaseScore); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateCisaKevInfo(formats strfmt.Registry) error { + + if err := validate.Required("cisa_kev_info", "body", m.CisaKevInfo); err != nil { + return err + } + + if m.CisaKevInfo != nil { + if err := m.CisaKevInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cisa_kev_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cisa_kev_info") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) validateContentPackages(formats strfmt.Registry) error { + if swag.IsZero(m.ContentPackages) { // not required + return nil + } + + for i := 0; i < len(m.ContentPackages); i++ { + if swag.IsZero(m.ContentPackages[i]) { // not required + continue + } + + if m.ContentPackages[i] != nil { + if err := m.ContentPackages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content_packages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("content_packages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCVE) validateCpsRating(formats strfmt.Registry) error { + + if err := validate.Required("cps_rating", "body", m.CpsRating); err != nil { + return err + } + + if m.CpsRating != nil { + if err := m.CpsRating.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cps_rating") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cps_rating") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) validateCvssV2Score(formats strfmt.Registry) error { + if swag.IsZero(m.CvssV2Score) { // not required + return nil + } + + if m.CvssV2Score != nil { + if err := m.CvssV2Score.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cvss_v2_score") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cvss_v2_score") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) validateCvssV3Score(formats strfmt.Registry) error { + if swag.IsZero(m.CvssV3Score) { // not required + return nil + } + + if m.CvssV3Score != nil { + if err := m.CvssV3Score.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cvss_v3_score") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cvss_v3_score") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) validateCvssVersion(formats strfmt.Registry) error { + + if err := validate.Required("cvss_version", "body", m.CvssVersion); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateExploited(formats strfmt.Registry) error { + if swag.IsZero(m.Exploited) { // not required + return nil + } + + if m.Exploited != nil { + if err := m.Exploited.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("exploited") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("exploited") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateIsSupported(formats strfmt.Registry) error { + + if err := validate.Required("is_supported", "body", m.IsSupported); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateMetadataHash(formats strfmt.Registry) error { + + if err := validate.Required("metadata_hash", "body", m.MetadataHash); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validatePublishedDate(formats strfmt.Registry) error { + + if err := validate.Required("published_date", "body", m.PublishedDate); err != nil { + return err + } + + if err := validate.FormatOf("published_date", "body", "date-time", m.PublishedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateReferences(formats strfmt.Registry) error { + + if err := validate.Required("references", "body", m.References); err != nil { + return err + } + + for i := 0; i < len(m.References); i++ { + if swag.IsZero(m.References[i]) { // not required + continue + } + + if m.References[i] != nil { + if err := m.References[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCVE) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateSource(formats strfmt.Registry) error { + + if err := validate.Required("source", "body", m.Source); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateSourceType(formats strfmt.Registry) error { + + if err := validate.Required("source_type", "body", m.SourceType); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateSpotlightPublishedDate(formats strfmt.Registry) error { + + if err := validate.Required("spotlight_published_date", "body", m.SpotlightPublishedDate); err != nil { + return err + } + + if err := validate.FormatOf("spotlight_published_date", "body", "date-time", m.SpotlightPublishedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateTypes(formats strfmt.Registry) error { + + if err := validate.Required("types", "body", m.Types); err != nil { + return err + } + + return nil +} + +func (m *DomainCVE) validateVector(formats strfmt.Registry) error { + + if err := validate.Required("vector", "body", m.Vector); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain c v e based on the context it is used +func (m *DomainCVE) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCisaKevInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentPackages(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCpsRating(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCvssV2Score(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCvssV3Score(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExploited(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReferences(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVE) contextValidateCisaKevInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.CisaKevInfo != nil { + + if err := m.CisaKevInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cisa_kev_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cisa_kev_info") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) contextValidateContentPackages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ContentPackages); i++ { + + if m.ContentPackages[i] != nil { + + if swag.IsZero(m.ContentPackages[i]) { // not required + return nil + } + + if err := m.ContentPackages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("content_packages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("content_packages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCVE) contextValidateCpsRating(ctx context.Context, formats strfmt.Registry) error { + + if m.CpsRating != nil { + + if err := m.CpsRating.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cps_rating") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cps_rating") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) contextValidateCvssV2Score(ctx context.Context, formats strfmt.Registry) error { + + if m.CvssV2Score != nil { + + if swag.IsZero(m.CvssV2Score) { // not required + return nil + } + + if err := m.CvssV2Score.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cvss_v2_score") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cvss_v2_score") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) contextValidateCvssV3Score(ctx context.Context, formats strfmt.Registry) error { + + if m.CvssV3Score != nil { + + if swag.IsZero(m.CvssV3Score) { // not required + return nil + } + + if err := m.CvssV3Score.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cvss_v3_score") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cvss_v3_score") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) contextValidateExploited(ctx context.Context, formats strfmt.Registry) error { + + if m.Exploited != nil { + + if swag.IsZero(m.Exploited) { // not required + return nil + } + + if err := m.Exploited.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("exploited") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("exploited") + } + return err + } + } + + return nil +} + +func (m *DomainCVE) contextValidateReferences(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.References); i++ { + + if m.References[i] != nil { + + if swag.IsZero(m.References[i]) { // not required + return nil + } + + if err := m.References[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCVE) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCVE) UnmarshalBinary(b []byte) error { + var res DomainCVE + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_v_e_exploit.go b/falcon/models/domain_c_v_e_exploit.go new file mode 100644 index 00000000..8fdbba59 --- /dev/null +++ b/falcon/models/domain_c_v_e_exploit.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCVEExploit domain c v e exploit +// +// swagger:model domain.CVEExploit +type DomainCVEExploit struct { + + // date recorded + // Required: true + // Format: date-time + DateRecorded *strfmt.DateTime `json:"date_recorded"` + + // sources + // Required: true + Sources []*DomainCVEExploitSource `json:"sources"` + + // status + // Required: true + Status *int64 `json:"status"` + + // updated timestamp + // Required: true + // Format: date-time + UpdatedTimestamp *strfmt.DateTime `json:"updated_timestamp"` +} + +// Validate validates this domain c v e exploit +func (m *DomainCVEExploit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDateRecorded(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedTimestamp(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVEExploit) validateDateRecorded(formats strfmt.Registry) error { + + if err := validate.Required("date_recorded", "body", m.DateRecorded); err != nil { + return err + } + + if err := validate.FormatOf("date_recorded", "body", "date-time", m.DateRecorded.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainCVEExploit) validateSources(formats strfmt.Registry) error { + + if err := validate.Required("sources", "body", m.Sources); err != nil { + return err + } + + for i := 0; i < len(m.Sources); i++ { + if swag.IsZero(m.Sources[i]) { // not required + continue + } + + if m.Sources[i] != nil { + if err := m.Sources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCVEExploit) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *DomainCVEExploit) validateUpdatedTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("updated_timestamp", "body", m.UpdatedTimestamp); err != nil { + return err + } + + if err := validate.FormatOf("updated_timestamp", "body", "date-time", m.UpdatedTimestamp.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain c v e exploit based on the context it is used +func (m *DomainCVEExploit) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVEExploit) contextValidateSources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Sources); i++ { + + if m.Sources[i] != nil { + + if swag.IsZero(m.Sources[i]) { // not required + return nil + } + + if err := m.Sources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCVEExploit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCVEExploit) UnmarshalBinary(b []byte) error { + var res DomainCVEExploit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_v_e_exploit_reference.go b/falcon/models/domain_c_v_e_exploit_reference.go new file mode 100644 index 00000000..888dd29e --- /dev/null +++ b/falcon/models/domain_c_v_e_exploit_reference.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCVEExploitReference domain c v e exploit reference +// +// swagger:model domain.CVEExploitReference +type DomainCVEExploitReference struct { + + // kind + // Required: true + Kind *int32 `json:"kind"` + + // label + // Required: true + Label *string `json:"label"` + + // url + // Required: true + URL *string `json:"url"` +} + +// Validate validates this domain c v e exploit reference +func (m *DomainCVEExploitReference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateKind(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVEExploitReference) validateKind(formats strfmt.Registry) error { + + if err := validate.Required("kind", "body", m.Kind); err != nil { + return err + } + + return nil +} + +func (m *DomainCVEExploitReference) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DomainCVEExploitReference) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain c v e exploit reference based on context it is used +func (m *DomainCVEExploitReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCVEExploitReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCVEExploitReference) UnmarshalBinary(b []byte) error { + var res DomainCVEExploitReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_v_e_exploit_source.go b/falcon/models/domain_c_v_e_exploit_source.go new file mode 100644 index 00000000..f2f351bd --- /dev/null +++ b/falcon/models/domain_c_v_e_exploit_source.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCVEExploitSource domain c v e exploit source +// +// swagger:model domain.CVEExploitSource +type DomainCVEExploitSource struct { + + // is flat + // Required: true + IsFlat *bool `json:"is_flat"` + + // label + // Required: true + Label *string `json:"label"` + + // references + // Required: true + References []*DomainCVEExploitReference `json:"references"` + + // source + // Required: true + Source *string `json:"source"` +} + +// Validate validates this domain c v e exploit source +func (m *DomainCVEExploitSource) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIsFlat(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReferences(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVEExploitSource) validateIsFlat(formats strfmt.Registry) error { + + if err := validate.Required("is_flat", "body", m.IsFlat); err != nil { + return err + } + + return nil +} + +func (m *DomainCVEExploitSource) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DomainCVEExploitSource) validateReferences(formats strfmt.Registry) error { + + if err := validate.Required("references", "body", m.References); err != nil { + return err + } + + for i := 0; i < len(m.References); i++ { + if swag.IsZero(m.References[i]) { // not required + continue + } + + if m.References[i] != nil { + if err := m.References[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainCVEExploitSource) validateSource(formats strfmt.Registry) error { + + if err := validate.Required("source", "body", m.Source); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain c v e exploit source based on the context it is used +func (m *DomainCVEExploitSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateReferences(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVEExploitSource) contextValidateReferences(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.References); i++ { + + if m.References[i] != nil { + + if swag.IsZero(m.References[i]) { // not required + return nil + } + + if err := m.References[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCVEExploitSource) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCVEExploitSource) UnmarshalBinary(b []byte) error { + var res DomainCVEExploitSource + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_v_s_sv2.go b/falcon/models/domain_c_v_s_sv2.go new file mode 100644 index 00000000..ed2822cd --- /dev/null +++ b/falcon/models/domain_c_v_s_sv2.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCVSSv2 domain c v s sv2 +// +// swagger:model domain.CVSSv2 +type DomainCVSSv2 struct { + + // base score + // Required: true + BaseScore *float64 `json:"base_score"` + + // exploitability score + ExploitabilityScore float64 `json:"exploitability_score,omitempty"` + + // impact score + ImpactScore float64 `json:"impact_score,omitempty"` + + // severity + Severity string `json:"severity,omitempty"` + + // vector + // Required: true + Vector *string `json:"vector"` +} + +// Validate validates this domain c v s sv2 +func (m *DomainCVSSv2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBaseScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVector(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVSSv2) validateBaseScore(formats strfmt.Registry) error { + + if err := validate.Required("base_score", "body", m.BaseScore); err != nil { + return err + } + + return nil +} + +func (m *DomainCVSSv2) validateVector(formats strfmt.Registry) error { + + if err := validate.Required("vector", "body", m.Vector); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain c v s sv2 based on context it is used +func (m *DomainCVSSv2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCVSSv2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCVSSv2) UnmarshalBinary(b []byte) error { + var res DomainCVSSv2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_c_v_s_sv3.go b/falcon/models/domain_c_v_s_sv3.go new file mode 100644 index 00000000..6f13551c --- /dev/null +++ b/falcon/models/domain_c_v_s_sv3.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainCVSSv3 domain c v s sv3 +// +// swagger:model domain.CVSSv3 +type DomainCVSSv3 struct { + + // attack complexity + AttackComplexity string `json:"attack_complexity,omitempty"` + + // attack vector + AttackVector string `json:"attack_vector,omitempty"` + + // availability impact + AvailabilityImpact string `json:"availability_impact,omitempty"` + + // base score + // Required: true + BaseScore *float64 `json:"base_score"` + + // confidentiality impact + ConfidentialityImpact string `json:"confidentiality_impact,omitempty"` + + // exploitability score + ExploitabilityScore float64 `json:"exploitability_score,omitempty"` + + // impact score + ImpactScore float64 `json:"impact_score,omitempty"` + + // integrity impact + IntegrityImpact string `json:"integrity_impact,omitempty"` + + // privileges required + PrivilegesRequired string `json:"privileges_required,omitempty"` + + // scope + Scope string `json:"scope,omitempty"` + + // severity + Severity string `json:"severity,omitempty"` + + // user interaction + UserInteraction string `json:"user_interaction,omitempty"` + + // vector + // Required: true + Vector *string `json:"vector"` +} + +// Validate validates this domain c v s sv3 +func (m *DomainCVSSv3) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBaseScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVector(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCVSSv3) validateBaseScore(formats strfmt.Registry) error { + + if err := validate.Required("base_score", "body", m.BaseScore); err != nil { + return err + } + + return nil +} + +func (m *DomainCVSSv3) validateVector(formats strfmt.Registry) error { + + if err := validate.Required("vector", "body", m.Vector); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain c v s sv3 based on context it is used +func (m *DomainCVSSv3) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCVSSv3) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCVSSv3) UnmarshalBinary(b []byte) error { + var res DomainCVSSv3 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_cipher.go b/falcon/models/domain_cipher.go new file mode 100644 index 00000000..f4dd812a --- /dev/null +++ b/falcon/models/domain_cipher.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainCipher domain cipher +// +// swagger:model domain.Cipher +type DomainCipher struct { + + // bits + Bits int32 `json:"bits,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // version + Version string `json:"version,omitempty"` +} + +// Validate validates this domain cipher +func (m *DomainCipher) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain cipher based on context it is used +func (m *DomainCipher) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCipher) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCipher) UnmarshalBinary(b []byte) error { + var res DomainCipher + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_compliance.go b/falcon/models/domain_compliance.go new file mode 100644 index 00000000..e9238025 --- /dev/null +++ b/falcon/models/domain_compliance.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainCompliance domain compliance +// +// swagger:model domain.Compliance +type DomainCompliance struct { + + // benchmarks + Benchmarks []string `json:"benchmarks"` + + // frameworks + Frameworks []string `json:"frameworks"` + + // requirements + Requirements []string `json:"requirements"` + + // sections + Sections []string `json:"sections"` + + // versions + Versions []string `json:"versions"` +} + +// Validate validates this domain compliance +func (m *DomainCompliance) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain compliance based on context it is used +func (m *DomainCompliance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCompliance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCompliance) UnmarshalBinary(b []byte) error { + var res DomainCompliance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_condition.go b/falcon/models/domain_condition.go index 8e713391..755fc9db 100644 --- a/falcon/models/domain_condition.go +++ b/falcon/models/domain_condition.go @@ -19,6 +19,14 @@ import ( // swagger:model domain.Condition type DomainCondition struct { + // feature + // Required: true + Feature *string `json:"feature"` + + // is visible + // Required: true + IsVisible *bool `json:"is_visible"` + // last transition // Required: true // Format: date-time @@ -43,6 +51,14 @@ type DomainCondition struct { func (m *DomainCondition) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateFeature(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsVisible(formats); err != nil { + res = append(res, err) + } + if err := m.validateLastTransition(formats); err != nil { res = append(res, err) } @@ -61,6 +77,24 @@ func (m *DomainCondition) Validate(formats strfmt.Registry) error { return nil } +func (m *DomainCondition) validateFeature(formats strfmt.Registry) error { + + if err := validate.Required("feature", "body", m.Feature); err != nil { + return err + } + + return nil +} + +func (m *DomainCondition) validateIsVisible(formats strfmt.Registry) error { + + if err := validate.Required("is_visible", "body", m.IsVisible); err != nil { + return err + } + + return nil +} + func (m *DomainCondition) validateLastTransition(formats strfmt.Registry) error { if err := validate.Required("last_transition", "body", m.LastTransition); err != nil { diff --git a/falcon/models/domain_content_package.go b/falcon/models/domain_content_package.go new file mode 100644 index 00000000..07653497 --- /dev/null +++ b/falcon/models/domain_content_package.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainContentPackage domain content package +// +// swagger:model domain.ContentPackage +type DomainContentPackage struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this domain content package +func (m *DomainContentPackage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainContentPackage) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain content package based on context it is used +func (m *DomainContentPackage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainContentPackage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainContentPackage) UnmarshalBinary(b []byte) error { + var res DomainContentPackage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_d_d_o_s_attack_source.go b/falcon/models/domain_d_d_o_s_attack_source.go deleted file mode 100644 index 6443b4f7..00000000 --- a/falcon/models/domain_d_d_o_s_attack_source.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DomainDDOSAttackSource domain d d o s attack source -// -// swagger:model domain.DDOSAttackSource -type DomainDDOSAttackSource struct { - - // The type of attack. One of `Amplification`, `Botnet`, `Other` - // Required: true - AttackType *string `json:"attack_type"` - - // The confidence level. One of `Low`, `Medium`, `High` - // Required: true - Confidence *string `json:"confidence"` - - // The duration of the attack in seconds - // Required: true - Duration *int64 `json:"duration"` - - // The hash over target and date - // Required: true - Key *string `json:"key"` - - // The network protocol used. One of `TCP`, `UDP`, `ICMP`, `Other` - // Required: true - NetworkProtocol *string `json:"network_protocol"` - - // The protocols used in the attack - // Required: true - Protocols []string `json:"protocols"` - - // The number of requests against the target - // Required: true - Requests *int64 `json:"requests"` - - // The ISO-8601 date for the attack start time - // Required: true - StartTime *string `json:"start_time"` - - // The target's IPv4/6 address or hostname - // Required: true - Target *string `json:"target"` - - // target details - // Required: true - TargetDetails *DomainDDOSTargetDetails `json:"target_details"` - - // The target's domain - // Required: true - TargetDomain *string `json:"target_domain"` - - // The target's IPv4/6 address - // Required: true - TargetIP *string `json:"target_ip"` - - // List of ports where the attack took place - // Required: true - TargetPorts []int64 `json:"target_ports"` -} - -// Validate validates this domain d d o s attack source -func (m *DomainDDOSAttackSource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAttackType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfidence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDuration(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNetworkProtocol(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProtocols(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequests(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTarget(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetDetails(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetDomain(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetIP(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTargetPorts(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainDDOSAttackSource) validateAttackType(formats strfmt.Registry) error { - - if err := validate.Required("attack_type", "body", m.AttackType); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateConfidence(formats strfmt.Registry) error { - - if err := validate.Required("confidence", "body", m.Confidence); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateDuration(formats strfmt.Registry) error { - - if err := validate.Required("duration", "body", m.Duration); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateKey(formats strfmt.Registry) error { - - if err := validate.Required("key", "body", m.Key); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateNetworkProtocol(formats strfmt.Registry) error { - - if err := validate.Required("network_protocol", "body", m.NetworkProtocol); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateProtocols(formats strfmt.Registry) error { - - if err := validate.Required("protocols", "body", m.Protocols); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateRequests(formats strfmt.Registry) error { - - if err := validate.Required("requests", "body", m.Requests); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateStartTime(formats strfmt.Registry) error { - - if err := validate.Required("start_time", "body", m.StartTime); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateTarget(formats strfmt.Registry) error { - - if err := validate.Required("target", "body", m.Target); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateTargetDetails(formats strfmt.Registry) error { - - if err := validate.Required("target_details", "body", m.TargetDetails); err != nil { - return err - } - - if m.TargetDetails != nil { - if err := m.TargetDetails.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_details") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_details") - } - return err - } - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateTargetDomain(formats strfmt.Registry) error { - - if err := validate.Required("target_domain", "body", m.TargetDomain); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateTargetIP(formats strfmt.Registry) error { - - if err := validate.Required("target_ip", "body", m.TargetIP); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSAttackSource) validateTargetPorts(formats strfmt.Registry) error { - - if err := validate.Required("target_ports", "body", m.TargetPorts); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this domain d d o s attack source based on the context it is used -func (m *DomainDDOSAttackSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTargetDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainDDOSAttackSource) contextValidateTargetDetails(ctx context.Context, formats strfmt.Registry) error { - - if m.TargetDetails != nil { - - if err := m.TargetDetails.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_details") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_details") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DomainDDOSAttackSource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainDDOSAttackSource) UnmarshalBinary(b []byte) error { - var res DomainDDOSAttackSource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_d_d_o_s_target_details.go b/falcon/models/domain_d_d_o_s_target_details.go deleted file mode 100644 index 626b5732..00000000 --- a/falcon/models/domain_d_d_o_s_target_details.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DomainDDOSTargetDetails domain d d o s target details -// -// swagger:model domain.DDOSTargetDetails -type DomainDDOSTargetDetails struct { - - // The autonomous system number of the target - // Required: true - Asn *int32 `json:"asn"` - - // The autonomous system name of the target - // Required: true - AsnName *string `json:"asn_name"` - - // The CIDR of the IP address - // Required: true - Cidr *string `json:"cidr"` - - // The target's city - // Required: true - City *string `json:"city"` - - // The name of the company who has registered the IP address - // Required: true - CompanyName *string `json:"company_name"` - - // The connection type of the target - // Required: true - ConnectionType *string `json:"connection_type"` - - // The target's country - // Required: true - Country *string `json:"country"` - - // country code - // Required: true - CountryCode *string `json:"country_code"` - - // The passive DNS of the target - // Required: true - Pdns []string `json:"pdns"` - - // The reverse DNS hostname of the target's IP address - // Required: true - Rdns *string `json:"rdns"` -} - -// Validate validates this domain d d o s target details -func (m *DomainDDOSTargetDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAsn(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAsnName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCidr(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCompanyName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConnectionType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCountry(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCountryCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePdns(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRdns(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainDDOSTargetDetails) validateAsn(formats strfmt.Registry) error { - - if err := validate.Required("asn", "body", m.Asn); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateAsnName(formats strfmt.Registry) error { - - if err := validate.Required("asn_name", "body", m.AsnName); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateCidr(formats strfmt.Registry) error { - - if err := validate.Required("cidr", "body", m.Cidr); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateCity(formats strfmt.Registry) error { - - if err := validate.Required("city", "body", m.City); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateCompanyName(formats strfmt.Registry) error { - - if err := validate.Required("company_name", "body", m.CompanyName); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateConnectionType(formats strfmt.Registry) error { - - if err := validate.Required("connection_type", "body", m.ConnectionType); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateCountry(formats strfmt.Registry) error { - - if err := validate.Required("country", "body", m.Country); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateCountryCode(formats strfmt.Registry) error { - - if err := validate.Required("country_code", "body", m.CountryCode); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validatePdns(formats strfmt.Registry) error { - - if err := validate.Required("pdns", "body", m.Pdns); err != nil { - return err - } - - return nil -} - -func (m *DomainDDOSTargetDetails) validateRdns(formats strfmt.Registry) error { - - if err := validate.Required("rdns", "body", m.Rdns); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this domain d d o s target details based on context it is used -func (m *DomainDDOSTargetDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainDDOSTargetDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainDDOSTargetDetails) UnmarshalBinary(b []byte) error { - var res DomainDDOSTargetDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_denormalized_adversary_reference.go b/falcon/models/domain_denormalized_adversary_reference.go new file mode 100644 index 00000000..23afad2f --- /dev/null +++ b/falcon/models/domain_denormalized_adversary_reference.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDenormalizedAdversaryReference domain denormalized adversary reference +// +// swagger:model domain.DenormalizedAdversaryReference +type DomainDenormalizedAdversaryReference struct { + + // id + // Required: true + ID *string `json:"id"` + + // name + Name string `json:"name,omitempty"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this domain denormalized adversary reference +func (m *DomainDenormalizedAdversaryReference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDenormalizedAdversaryReference) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain denormalized adversary reference based on context it is used +func (m *DomainDenormalizedAdversaryReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDenormalizedAdversaryReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDenormalizedAdversaryReference) UnmarshalBinary(b []byte) error { + var res DomainDenormalizedAdversaryReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_key_value_pair.go b/falcon/models/domain_denormalized_country.go similarity index 51% rename from falcon/models/domain_key_value_pair.go rename to falcon/models/domain_denormalized_country.go index 3dee315e..0261f193 100644 --- a/falcon/models/domain_key_value_pair.go +++ b/falcon/models/domain_denormalized_country.go @@ -14,29 +14,29 @@ import ( "github.com/go-openapi/validate" ) -// DomainKeyValuePair domain key value pair +// DomainDenormalizedCountry domain denormalized country // -// swagger:model domain.KeyValuePair -type DomainKeyValuePair struct { +// swagger:model domain.DenormalizedCountry +type DomainDenormalizedCountry struct { - // name + // code // Required: true - Name *string `json:"name"` + Code *string `json:"code"` - // value + // name // Required: true - Value *string `json:"value"` + Name *string `json:"name"` } -// Validate validates this domain key value pair -func (m *DomainKeyValuePair) Validate(formats strfmt.Registry) error { +// Validate validates this domain denormalized country +func (m *DomainDenormalizedCountry) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateName(formats); err != nil { + if err := m.validateCode(formats); err != nil { res = append(res, err) } - if err := m.validateValue(formats); err != nil { + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -46,31 +46,31 @@ func (m *DomainKeyValuePair) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainKeyValuePair) validateName(formats strfmt.Registry) error { +func (m *DomainDenormalizedCountry) validateCode(formats strfmt.Registry) error { - if err := validate.Required("name", "body", m.Name); err != nil { + if err := validate.Required("code", "body", m.Code); err != nil { return err } return nil } -func (m *DomainKeyValuePair) validateValue(formats strfmt.Registry) error { +func (m *DomainDenormalizedCountry) validateName(formats strfmt.Registry) error { - if err := validate.Required("value", "body", m.Value); err != nil { + if err := validate.Required("name", "body", m.Name); err != nil { return err } return nil } -// ContextValidate validates this domain key value pair based on context it is used -func (m *DomainKeyValuePair) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this domain denormalized country based on context it is used +func (m *DomainDenormalizedCountry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *DomainKeyValuePair) MarshalBinary() ([]byte, error) { +func (m *DomainDenormalizedCountry) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -78,8 +78,8 @@ func (m *DomainKeyValuePair) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *DomainKeyValuePair) UnmarshalBinary(b []byte) error { - var res DomainKeyValuePair +func (m *DomainDenormalizedCountry) UnmarshalBinary(b []byte) error { + var res DomainDenormalizedCountry if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/domain_denormalized_customer_target.go b/falcon/models/domain_denormalized_customer_target.go new file mode 100644 index 00000000..7fdbdfd2 --- /dev/null +++ b/falcon/models/domain_denormalized_customer_target.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDenormalizedCustomerTarget domain denormalized customer target +// +// swagger:model domain.DenormalizedCustomerTarget +type DomainDenormalizedCustomerTarget struct { + + // customer target + // Required: true + CustomerTarget *string `json:"customer_target"` +} + +// Validate validates this domain denormalized customer target +func (m *DomainDenormalizedCustomerTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomerTarget(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDenormalizedCustomerTarget) validateCustomerTarget(formats strfmt.Registry) error { + + if err := validate.Required("customer_target", "body", m.CustomerTarget); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain denormalized customer target based on context it is used +func (m *DomainDenormalizedCustomerTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDenormalizedCustomerTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDenormalizedCustomerTarget) UnmarshalBinary(b []byte) error { + var res DomainDenormalizedCustomerTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_denormalized_report_reference.go b/falcon/models/domain_denormalized_report_reference.go new file mode 100644 index 00000000..dde120cf --- /dev/null +++ b/falcon/models/domain_denormalized_report_reference.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDenormalizedReportReference domain denormalized report reference +// +// swagger:model domain.DenormalizedReportReference +type DomainDenormalizedReportReference struct { + + // publish date + PublishDate string `json:"publish_date,omitempty"` + + // report id + // Required: true + ReportID *string `json:"report_id"` + + // title + Title string `json:"title,omitempty"` +} + +// Validate validates this domain denormalized report reference +func (m *DomainDenormalizedReportReference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReportID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDenormalizedReportReference) validateReportID(formats strfmt.Registry) error { + + if err := validate.Required("report_id", "body", m.ReportID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain denormalized report reference based on context it is used +func (m *DomainDenormalizedReportReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDenormalizedReportReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDenormalizedReportReference) UnmarshalBinary(b []byte) error { + var res DomainDenormalizedReportReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_container_info.go b/falcon/models/domain_denormalized_sector.go similarity index 61% rename from falcon/models/k8sassets_container_info.go rename to falcon/models/domain_denormalized_sector.go index 6aa78ee7..25a42e91 100644 --- a/falcon/models/k8sassets_container_info.go +++ b/falcon/models/domain_denormalized_sector.go @@ -14,10 +14,10 @@ import ( "github.com/go-openapi/validate" ) -// K8sassetsContainerInfo k8sassets container info +// DomainDenormalizedSector domain denormalized sector // -// swagger:model k8sassets.ContainerInfo -type K8sassetsContainerInfo struct { +// swagger:model domain.DenormalizedSector +type DomainDenormalizedSector struct { // id // Required: true @@ -28,8 +28,8 @@ type K8sassetsContainerInfo struct { Name *string `json:"name"` } -// Validate validates this k8sassets container info -func (m *K8sassetsContainerInfo) Validate(formats strfmt.Registry) error { +// Validate validates this domain denormalized sector +func (m *DomainDenormalizedSector) Validate(formats strfmt.Registry) error { var res []error if err := m.validateID(formats); err != nil { @@ -46,7 +46,7 @@ func (m *K8sassetsContainerInfo) Validate(formats strfmt.Registry) error { return nil } -func (m *K8sassetsContainerInfo) validateID(formats strfmt.Registry) error { +func (m *DomainDenormalizedSector) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { return err @@ -55,7 +55,7 @@ func (m *K8sassetsContainerInfo) validateID(formats strfmt.Registry) error { return nil } -func (m *K8sassetsContainerInfo) validateName(formats strfmt.Registry) error { +func (m *DomainDenormalizedSector) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -64,13 +64,13 @@ func (m *K8sassetsContainerInfo) validateName(formats strfmt.Registry) error { return nil } -// ContextValidate validates this k8sassets container info based on context it is used -func (m *K8sassetsContainerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this domain denormalized sector based on context it is used +func (m *DomainDenormalizedSector) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *K8sassetsContainerInfo) MarshalBinary() ([]byte, error) { +func (m *DomainDenormalizedSector) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -78,8 +78,8 @@ func (m *K8sassetsContainerInfo) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *K8sassetsContainerInfo) UnmarshalBinary(b []byte) error { - var res K8sassetsContainerInfo +func (m *DomainDenormalizedSector) UnmarshalBinary(b []byte) error { + var res DomainDenormalizedSector if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/domain_denormalized_threat_reference.go b/falcon/models/domain_denormalized_threat_reference.go new file mode 100644 index 00000000..20b9f1ea --- /dev/null +++ b/falcon/models/domain_denormalized_threat_reference.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDenormalizedThreatReference domain denormalized threat reference +// +// swagger:model domain.DenormalizedThreatReference +type DomainDenormalizedThreatReference struct { + + // name + Name string `json:"name,omitempty"` + + // slug + // Required: true + Slug *string `json:"slug"` +} + +// Validate validates this domain denormalized threat reference +func (m *DomainDenormalizedThreatReference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDenormalizedThreatReference) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain denormalized threat reference based on context it is used +func (m *DomainDenormalizedThreatReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDenormalizedThreatReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDenormalizedThreatReference) UnmarshalBinary(b []byte) error { + var res DomainDenormalizedThreatReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_denormalized_threat_used_mitre.go b/falcon/models/domain_denormalized_threat_used_mitre.go new file mode 100644 index 00000000..c56b45c9 --- /dev/null +++ b/falcon/models/domain_denormalized_threat_used_mitre.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainDenormalizedThreatUsedMitre domain denormalized threat used mitre +// +// swagger:model domain.DenormalizedThreatUsedMitre +type DomainDenormalizedThreatUsedMitre struct { + + // attack id + AttackID string `json:"attack_id,omitempty"` + + // observables + Observables []string `json:"observables"` + + // reports + Reports []*DomainDenormalizedReportReference `json:"reports"` + + // tactic id + TacticID string `json:"tactic_id,omitempty"` + + // tactic name + TacticName string `json:"tactic_name,omitempty"` + + // technique id + TechniqueID string `json:"technique_id,omitempty"` + + // technique name + TechniqueName string `json:"technique_name,omitempty"` +} + +// Validate validates this domain denormalized threat used mitre +func (m *DomainDenormalizedThreatUsedMitre) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReports(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDenormalizedThreatUsedMitre) validateReports(formats strfmt.Registry) error { + if swag.IsZero(m.Reports) { // not required + return nil + } + + for i := 0; i < len(m.Reports); i++ { + if swag.IsZero(m.Reports[i]) { // not required + continue + } + + if m.Reports[i] != nil { + if err := m.Reports[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain denormalized threat used mitre based on the context it is used +func (m *DomainDenormalizedThreatUsedMitre) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateReports(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDenormalizedThreatUsedMitre) contextValidateReports(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Reports); i++ { + + if m.Reports[i] != nil { + + if swag.IsZero(m.Reports[i]) { // not required + return nil + } + + if err := m.Reports[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDenormalizedThreatUsedMitre) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDenormalizedThreatUsedMitre) UnmarshalBinary(b []byte) error { + var res DomainDenormalizedThreatUsedMitre + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_device.go b/falcon/models/domain_device.go index c69a1614..66426b31 100644 --- a/falcon/models/domain_device.go +++ b/falcon/models/domain_device.go @@ -19,9 +19,9 @@ import ( // swagger:model domain.Device type DomainDevice struct { - // platform ID numeric + // // Required: true - PlatformIDNumeric *int32 `json:"PlatformIDNumeric"` + Nr *int32 `json:"_"` // agent version AgentVersion string `json:"agent_version,omitempty"` @@ -131,7 +131,7 @@ type DomainDevice struct { func (m *DomainDevice) Validate(formats strfmt.Registry) error { var res []error - if err := m.validatePlatformIDNumeric(formats); err != nil { + if err := m.validateNr(formats); err != nil { res = append(res, err) } @@ -149,9 +149,9 @@ func (m *DomainDevice) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainDevice) validatePlatformIDNumeric(formats strfmt.Registry) error { +func (m *DomainDevice) validateNr(formats strfmt.Registry) error { - if err := validate.Required("PlatformIDNumeric", "body", m.PlatformIDNumeric); err != nil { + if err := validate.Required("_", "body", m.Nr); err != nil { return err } diff --git a/falcon/models/domain_discover_api_application.go b/falcon/models/domain_discover_api_application.go index abc71079..08bab8c2 100644 --- a/falcon/models/domain_discover_api_application.go +++ b/falcon/models/domain_discover_api_application.go @@ -22,6 +22,9 @@ type DomainDiscoverAPIApplication struct { // Represents the application architectures (x86 / x64). Architectures []string `json:"architectures"` + // Details about the browser extension. Populated for applications of a browser extension type + BrowserExtension *DomainDiscoverAPIApplicationBrowserExtension `json:"browser_extension,omitempty"` + // The category of the application. Category string `json:"category,omitempty"` @@ -81,6 +84,9 @@ type DomainDiscoverAPIApplication struct { // The combined field on which we will be able to group by app + version. NameVendorVersion string `json:"name_vendor_version,omitempty"` + // The type of software of the application. + SoftwareType string `json:"software_type,omitempty"` + // The name the application's vendor. Vendor string `json:"vendor,omitempty"` @@ -95,6 +101,10 @@ type DomainDiscoverAPIApplication struct { func (m *DomainDiscoverAPIApplication) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBrowserExtension(formats); err != nil { + res = append(res, err) + } + if err := m.validateCid(formats); err != nil { res = append(res, err) } @@ -113,6 +123,25 @@ func (m *DomainDiscoverAPIApplication) Validate(formats strfmt.Registry) error { return nil } +func (m *DomainDiscoverAPIApplication) validateBrowserExtension(formats strfmt.Registry) error { + if swag.IsZero(m.BrowserExtension) { // not required + return nil + } + + if m.BrowserExtension != nil { + if err := m.BrowserExtension.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("browser_extension") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("browser_extension") + } + return err + } + } + + return nil +} + func (m *DomainDiscoverAPIApplication) validateCid(formats strfmt.Registry) error { if err := validate.Required("cid", "body", m.Cid); err != nil { @@ -154,6 +183,10 @@ func (m *DomainDiscoverAPIApplication) validateID(formats strfmt.Registry) error func (m *DomainDiscoverAPIApplication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateBrowserExtension(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateHost(ctx, formats); err != nil { res = append(res, err) } @@ -164,6 +197,27 @@ func (m *DomainDiscoverAPIApplication) ContextValidate(ctx context.Context, form return nil } +func (m *DomainDiscoverAPIApplication) contextValidateBrowserExtension(ctx context.Context, formats strfmt.Registry) error { + + if m.BrowserExtension != nil { + + if swag.IsZero(m.BrowserExtension) { // not required + return nil + } + + if err := m.BrowserExtension.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("browser_extension") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("browser_extension") + } + return err + } + } + + return nil +} + func (m *DomainDiscoverAPIApplication) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { if m.Host != nil { diff --git a/falcon/models/domain_discover_api_application_browser_extension.go b/falcon/models/domain_discover_api_application_browser_extension.go new file mode 100644 index 00000000..7fc90dd2 --- /dev/null +++ b/falcon/models/domain_discover_api_application_browser_extension.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDiscoverAPIApplicationBrowserExtension Uniquely identifies a browser extension. +// +// swagger:model domain.DiscoverAPIApplicationBrowserExtension +type DomainDiscoverAPIApplicationBrowserExtension struct { + + // The name of the browser that's running the extension + BrowserName string `json:"browser_name,omitempty"` + + // Describes if the extension is enabled on the host on at least one browser profile + // Required: true + Enabled *bool `json:"enabled"` + + // The unique ID of the browser extension. + // Required: true + ID *string `json:"id"` + + // The installations of this browser extension for each browser profile + Installations []*DomainDiscoverAPIApplicationBrowserExtensionInstallation `json:"installations"` + + // The computed serverity of all permissions requested by the browser extension + PermissionSeverity string `json:"permission_severity,omitempty"` + + // The browser permissions the extension requires to run + Permissions []string `json:"permissions"` + + // The calculated browser webstore URL for this extension + StoreURL string `json:"store_url,omitempty"` +} + +// Validate validates this domain discover API application browser extension +func (m *DomainDiscoverAPIApplicationBrowserExtension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnabled(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstallations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDiscoverAPIApplicationBrowserExtension) validateEnabled(formats strfmt.Registry) error { + + if err := validate.Required("enabled", "body", m.Enabled); err != nil { + return err + } + + return nil +} + +func (m *DomainDiscoverAPIApplicationBrowserExtension) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainDiscoverAPIApplicationBrowserExtension) validateInstallations(formats strfmt.Registry) error { + if swag.IsZero(m.Installations) { // not required + return nil + } + + for i := 0; i < len(m.Installations); i++ { + if swag.IsZero(m.Installations[i]) { // not required + continue + } + + if m.Installations[i] != nil { + if err := m.Installations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("installations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("installations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain discover API application browser extension based on the context it is used +func (m *DomainDiscoverAPIApplicationBrowserExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateInstallations(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDiscoverAPIApplicationBrowserExtension) contextValidateInstallations(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Installations); i++ { + + if m.Installations[i] != nil { + + if swag.IsZero(m.Installations[i]) { // not required + return nil + } + + if err := m.Installations[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("installations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("installations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDiscoverAPIApplicationBrowserExtension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDiscoverAPIApplicationBrowserExtension) UnmarshalBinary(b []byte) error { + var res DomainDiscoverAPIApplicationBrowserExtension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_discover_api_application_browser_extension_installation.go b/falcon/models/domain_discover_api_application_browser_extension_installation.go new file mode 100644 index 00000000..3d85783b --- /dev/null +++ b/falcon/models/domain_discover_api_application_browser_extension_installation.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDiscoverAPIApplicationBrowserExtensionInstallation domain discover API application browser extension installation +// +// swagger:model domain.DiscoverAPIApplicationBrowserExtensionInstallation +type DomainDiscoverAPIApplicationBrowserExtensionInstallation struct { + + // The browser profile ID of this installation + BrowserProfileID string `json:"browser_profile_id,omitempty"` + + // The browser profile name of this installation + BrowserProfileName string `json:"browser_profile_name,omitempty"` + + // The version of the browser running this extension + BrowserVersion string `json:"browser_version,omitempty"` + + // Describes if the extension is enabled on this browser profile installation + // Required: true + Enabled *bool `json:"enabled"` + + // The method that was used to install the browser extension + Method string `json:"method,omitempty"` + + // The file path location of the browser extension + Path string `json:"path,omitempty"` + + // The role of the account that installed the extension + Role string `json:"role,omitempty"` + + // The host user SID for which the extension was installed + UserSid string `json:"user_sid,omitempty"` + + // The host username for which the extension was installed + Username string `json:"username,omitempty"` +} + +// Validate validates this domain discover API application browser extension installation +func (m *DomainDiscoverAPIApplicationBrowserExtensionInstallation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnabled(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDiscoverAPIApplicationBrowserExtensionInstallation) validateEnabled(formats strfmt.Registry) error { + + if err := validate.Required("enabled", "body", m.Enabled); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain discover API application browser extension installation based on context it is used +func (m *DomainDiscoverAPIApplicationBrowserExtensionInstallation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDiscoverAPIApplicationBrowserExtensionInstallation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDiscoverAPIApplicationBrowserExtensionInstallation) UnmarshalBinary(b []byte) error { + var res DomainDiscoverAPIApplicationBrowserExtensionInstallation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_discover_api_host.go b/falcon/models/domain_discover_api_host.go index 84ec49ea..bd012797 100644 --- a/falcon/models/domain_discover_api_host.go +++ b/falcon/models/domain_discover_api_host.go @@ -15,7 +15,7 @@ import ( "github.com/go-openapi/validate" ) -// DomainDiscoverAPIHost Represents information about a managed, an unmanaged or an unsupported asset. +// DomainDiscoverAPIHost domain discover API host // // swagger:model domain.DiscoverAPIHost type DomainDiscoverAPIHost struct { @@ -68,6 +68,9 @@ type DomainDiscoverAPIHost struct { // The asset's BIOS version. BiosVersion string `json:"bios_version,omitempty"` + // The business criticality of the IoT asset. + BusinessCriticality string `json:"business_criticality,omitempty"` + // The asset's customer ID. // Required: true Cid *string `json:"cid"` @@ -75,6 +78,9 @@ type DomainDiscoverAPIHost struct { // The name of the city where the asset is located. City string `json:"city,omitempty"` + // The external ID of the IoT Device in 3rd Party System(Claroty). + ClarotyID string `json:"claroty_id,omitempty"` + // How the server is classified, such as production, development, disaster recovery, or user acceptance testing. Classification string `json:"classification,omitempty"` @@ -156,6 +162,18 @@ type DomainDiscoverAPIHost struct { // The descriptions of the asset in Active Directory (Cannot be used for filtering, sorting, or querying). Descriptions []string `json:"descriptions"` + // The Device Class of IoT Asset + DeviceClass string `json:"device_class,omitempty"` + + // The Device Family of IoT Asset + DeviceFamily string `json:"device_family,omitempty"` + + // The slots of IoT Asset + DeviceSlots []*DomainDiscoverAPIDeviceSlot `json:"device_slots"` + + // The Device Type of IoT Asset + DeviceType string `json:"device_type,omitempty"` + // The agent IDs of the Falcon sensors installed on the sources that discovered the asset. DiscovererAids []string `json:"discoverer_aids"` @@ -168,6 +186,9 @@ type DomainDiscoverAPIHost struct { // The hostnames of the sources that discovered the asset. DiscovererHostnames []string `json:"discoverer_hostnames"` + // A list of agent IDs of the Falcon sensors installed on the source hosts that discovered the asset via ICS Asset discovery mechanism + DiscovererIcsCollectorIds []string `json:"discoverer_ics_collector_ids"` + // The platform names of the sources that discovered the asset. DiscovererPlatformNames []string `json:"discoverer_platform_names"` @@ -183,6 +204,9 @@ type DomainDiscoverAPIHost struct { // The names and sizes of the disks on the asset DiskSizes []*DomainDiscoverAPIDiskSize `json:"disk_sizes"` + // The ID generated by dragos asset discovery mechanism + DragosID string `json:"dragos_id,omitempty"` + // The email of the asset as listed in Active Directory. Email string `json:"email,omitempty"` @@ -222,6 +246,9 @@ type DomainDiscoverAPIHost struct { // The asset's hostname. Hostname string `json:"hostname,omitempty"` + // The ID generated by ICS collector asset discovery mechanism + IcsID string `json:"ics_id,omitempty"` + // The unique ID of the asset. // Required: true ID *string `json:"id"` @@ -247,6 +274,9 @@ type DomainDiscoverAPIHost struct { // The hostname of the last source that discovered the asset. LastDiscovererHostname string `json:"last_discoverer_hostname,omitempty"` + // The agent ID of the Falcon sensor installed on the source host that most recently discovered the asset via ICS Asset discovery mechanism + LastDiscovererIcsCollectorID string `json:"last_discoverer_ics_collector_id,omitempty"` + // The most recent time the asset was seen in your environment. LastSeenTimestamp string `json:"last_seen_timestamp,omitempty"` @@ -280,9 +310,15 @@ type DomainDiscoverAPIHost struct { // The max processor usage in the last 15 minutes on the host MaxProcessorUsage int32 `json:"max_processor_usage,omitempty"` + // The Total memory. + MemoryTotal int64 `json:"memory_total,omitempty"` + // The path, used and available space on mounted disks MountStorageInfo []*DomainDiscoverAPIMountStorageInfo `json:"mount_storage_info"` + // The network ID to which device is connected. + NetworkID string `json:"network_id,omitempty"` + // The asset's network interfaces (Cannot be used for filtering, sorting, or querying). NetworkInterfaces []*DomainDiscoverAPINetworkInterface `json:"network_interfaces"` @@ -307,6 +343,15 @@ type DomainDiscoverAPIHost struct { // The OS version of the asset. OsVersion string `json:"os_version,omitempty"` + // A list of sources through which host is discovered + OtInformationSources []string `json:"ot_information_sources"` + + // A list of network ids to which host belongs + OtNetworkIds []string `json:"ot_network_ids"` + + // A list of ot serial numbers that discovered with host + OtSerialNumbers []string `json:"ot_serial_numbers"` + // The organizational unit of the asset. Ou string `json:"ou,omitempty"` @@ -337,6 +382,12 @@ type DomainDiscoverAPIHost struct { // The product type of the asset (Workstation, Domain Controller, Server). ProductTypeDesc string `json:"product_type_desc,omitempty"` + // The list of protocols supported by the device + Protocols []string `json:"protocols"` + + // The purdue level of IoT Asset + PurdueLevel string `json:"purdue_level,omitempty"` + // Whether the asset is in reduced functionality mode (Yes or No). ReducedFunctionalityMode string `json:"reduced_functionality_mode,omitempty"` @@ -349,6 +400,9 @@ type DomainDiscoverAPIHost struct { // The name of the U.S. state where the asset is located. State string `json:"state,omitempty"` + // The subnet to which device is connected. + Subnet string `json:"subnet,omitempty"` + // The asset's system manufacturer. SystemManufacturer string `json:"system_manufacturer,omitempty"` @@ -396,6 +450,15 @@ type DomainDiscoverAPIHost struct { // The internet exposure manually assigned to the asset UserInternetExposure string `json:"user_internet_exposure,omitempty"` + + // The Virtual Zone name in which device is installed. + VirtualZone string `json:"virtual_zone,omitempty"` + + // The VLAN IDs to which device is connected. + Vlan []string `json:"vlan"` + + // The external ID of the IoT Device in 3rd Party System(Claroty Xdome) + XdomeID string `json:"xdome_id,omitempty"` } // Validate validates this domain discover API host @@ -414,6 +477,10 @@ func (m *DomainDiscoverAPIHost) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeviceSlots(formats); err != nil { + res = append(res, err) + } + if err := m.validateDiskSizes(formats); err != nil { res = append(res, err) } @@ -502,6 +569,32 @@ func (m *DomainDiscoverAPIHost) validateCid(formats strfmt.Registry) error { return nil } +func (m *DomainDiscoverAPIHost) validateDeviceSlots(formats strfmt.Registry) error { + if swag.IsZero(m.DeviceSlots) { // not required + return nil + } + + for i := 0; i < len(m.DeviceSlots); i++ { + if swag.IsZero(m.DeviceSlots[i]) { // not required + continue + } + + if m.DeviceSlots[i] != nil { + if err := m.DeviceSlots[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_slots" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("device_slots" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainDiscoverAPIHost) validateDiskSizes(formats strfmt.Registry) error { if swag.IsZero(m.DiskSizes) { // not required return nil @@ -665,6 +758,10 @@ func (m *DomainDiscoverAPIHost) ContextValidate(ctx context.Context, formats str res = append(res, err) } + if err := m.contextValidateDeviceSlots(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDiskSizes(ctx, formats); err != nil { res = append(res, err) } @@ -741,6 +838,31 @@ func (m *DomainDiscoverAPIHost) contextValidateBiosHashesData(ctx context.Contex return nil } +func (m *DomainDiscoverAPIHost) contextValidateDeviceSlots(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DeviceSlots); i++ { + + if m.DeviceSlots[i] != nil { + + if swag.IsZero(m.DeviceSlots[i]) { // not required + return nil + } + + if err := m.DeviceSlots[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_slots" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("device_slots" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainDiscoverAPIHost) contextValidateDiskSizes(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.DiskSizes); i++ { diff --git a/falcon/models/domain_discover_api_io_t_host.go b/falcon/models/domain_discover_api_io_t_host.go index 227f7b84..dd781b7c 100644 --- a/falcon/models/domain_discover_api_io_t_host.go +++ b/falcon/models/domain_discover_api_io_t_host.go @@ -15,7 +15,7 @@ import ( "github.com/go-openapi/validate" ) -// DomainDiscoverAPIIoTHost Represents information about a managed, an unmanaged or an unsupported asset. +// DomainDiscoverAPIIoTHost domain discover API io t host // // swagger:model domain.DiscoverAPIIoTHost type DomainDiscoverAPIIoTHost struct { @@ -26,16 +26,28 @@ type DomainDiscoverAPIIoTHost struct { // The agent ID of the Falcon sensor installed on the asset. Aid string `json:"aid,omitempty"` - // The Amount of available disk space on the asset in GB + // The asset role or roles currently assigned to the asset either automatically or by a user (Jump host, Highly connected, Highly active, Server by behavior, DHCP server, DNS server, FTP server, SSH server, or Web server). + AssetRoles []string `json:"asset_roles"` + + // The available disk space in the last 15 minutes on the host AvailableDiskSpace int32 `json:"available_disk_space,omitempty"` - // The average memory usage in the last 15 minutes on the asset + // The available disk space percent in the last 15 minutes on the host + AvailableDiskSpacePct int32 `json:"available_disk_space_pct,omitempty"` + + // The average memory usage in the last 15 minutes on the host AverageMemoryUsage int32 `json:"average_memory_usage,omitempty"` - // The average processor usage in the last 15 minutes on the asset + // The average memory usage percent in the last 15 minutes on the host + AverageMemoryUsagePct int32 `json:"average_memory_usage_pct,omitempty"` + + // The average processor usage in the last 15 minutes on the host AverageProcessorUsage int32 `json:"average_processor_usage,omitempty"` - // The id of the bios on the asset + // The list of found sha256 and their measurement types + BiosHashesData []*DomainDiscoverAPIBiosHashesData `json:"bios_hashes_data"` + + // The id of the bios on the host BiosID string `json:"bios_id,omitempty"` // The name of the asset's BIOS manufacturer. @@ -57,13 +69,16 @@ type DomainDiscoverAPIIoTHost struct { // The external ID of the IoT Device in 3rd Party System(Claroty). ClarotyID string `json:"claroty_id,omitempty"` - // Whether the asset is exposed to the internet (Yes or Unknown) + // The asset role or roles assigned to the asset automatically (Jump host, Highly connected, Highly active, Server by behavior, DHCP server, DNS server, FTP server, SSH server, or Web server). + ComputedAssetRoles []string `json:"computed_asset_roles"` + + // Whether the asset is exposed to the internet as determined automatically (Yes, No, or Pending). ComputedInternetExposure string `json:"computed_internet_exposure,omitempty"` - // External IP that is exposed to the Internet + // External IP exposed to the internet. ComputedInternetExposureExternalIP string `json:"computed_internet_exposure_external_ip,omitempty"` - // Timestamp when the asset was last seen as exposed to the Internet + // When the asset was last seen as internet exposed. ComputedInternetExposureLastSeen string `json:"computed_internet_exposure_last_seen,omitempty"` // The level of confidence that the asset is a corporate asset (25 = low confidence, 50 = medium confidence, 75 = high confidence). @@ -72,19 +87,34 @@ type DomainDiscoverAPIIoTHost struct { // The name of the country where the asset is located. Country string `json:"country,omitempty"` - // The Detailed processor name + // The name of the processor on the system CPUProcessorName string `json:"cpu_processor_name,omitempty"` - // The credential guard status of the asset - CredentialGuardStatus bool `json:"credential_guard_status,omitempty"` + // The criticality level of the asset (Critical, High, Noncritical, or Unassigned) + Criticality string `json:"criticality,omitempty"` + + // The description the user entered when manually assigning a criticality level + CriticalityDescription string `json:"criticality_description,omitempty"` + + // The ID of the criticality rule that has most recently applied to the asset. + CriticalityRuleID string `json:"criticality_rule_id,omitempty"` + + // The date and time the criticality level was manually assigned + CriticalityTimestamp string `json:"criticality_timestamp,omitempty"` + + // The username of the account that manually assigned the criticality level + CriticalityUsername string `json:"criticality_username,omitempty"` // The last seen local IPv4 address of the asset. CurrentLocalIP string `json:"current_local_ip,omitempty"` - // The asset's data providers. + // The last seen network prefix of the asset. + CurrentNetworkPrefix string `json:"current_network_prefix,omitempty"` + + // Where the data about the asset came from (such as CrowdStrike, ServiceNow, or Active Directory). DataProviders []string `json:"data_providers"` - // The number of data providers for the asset. + // How many services provided data about the asset. DataProvidersCount int32 `json:"data_providers_count,omitempty"` // The Device Class of IoT Asset @@ -93,37 +123,49 @@ type DomainDiscoverAPIIoTHost struct { // The Device Family of IoT Asset DeviceFamily string `json:"device_family,omitempty"` - // The device guard status of the asset - DeviceGuardStatus bool `json:"device_guard_status,omitempty"` - // The slots of IoT Asset DeviceSlots []*DomainDiscoverAPIDeviceSlot `json:"device_slots"` // The Device Type of IoT Asset DeviceType string `json:"device_type,omitempty"` + // The agent IDs of the Falcon sensors installed on the sources that discovered the asset. + DiscovererAids []string `json:"discoverer_aids"` + // The number of sources that discovered the asset. DiscovererCount int32 `json:"discoverer_count,omitempty"` + // The criticalities of the sources that discovered the asset + DiscovererCriticalities []string `json:"discoverer_criticalities"` + + // The hostnames of the sources that discovered the asset. + DiscovererHostnames []string `json:"discoverer_hostnames"` + // A list of agent IDs of the Falcon sensors installed on the source hosts that discovered the asset via ICS Asset discovery mechanism DiscovererIcsCollectorIds []string `json:"discoverer_ics_collector_ids"` + // The platform names of the sources that discovered the asset. + DiscovererPlatformNames []string `json:"discoverer_platform_names"` + // The product type descriptions of the sources that discovered the asset. DiscovererProductTypeDescs []string `json:"discoverer_product_type_descs"` + // The tags of the sources that discovered the asset. + DiscovererTags []string `json:"discoverer_tags"` + // The names and sizes of the disks on the asset DiskSizes []*DomainDiscoverAPIDiskSize `json:"disk_sizes"` // The ID generated by dragos asset discovery mechanism DragosID string `json:"dragos_id,omitempty"` - // The list of encrypted drives on the asset + // The list of encrypted drives on the host EncryptedDrives []string `json:"encrypted_drives"` - // The count of encrypted drives on the asset + // The count of encrypted drives on the host EncryptedDrivesCount int32 `json:"encrypted_drives_count,omitempty"` - // The encryption status of the asset + // The encryption status of the host EncryptionStatus string `json:"encryption_status,omitempty"` // The type of asset (managed, unmanaged, unsupported). @@ -135,13 +177,19 @@ type DomainDiscoverAPIIoTHost struct { // Lists the data providers for each property in the response (Cannot be used for filtering, sorting, or querying). FieldMetadata map[string]DomainDiscoverAPIFieldMetadata `json:"field_metadata,omitempty"` + // The agent ID of the Falcon sensor on the source that first discovered the asset. + FirstDiscovererAid string `json:"first_discoverer_aid,omitempty"` + // The first time the asset was seen in your environment. FirstSeenTimestamp string `json:"first_seen_timestamp,omitempty"` + // The form factor of the host + FormFactor string `json:"form_factor,omitempty"` + // The host management groups the asset is part of. Groups []string `json:"groups"` - // The asset's hostname . + // The asset's hostname. Hostname string `json:"hostname,omitempty"` // The ID generated by ICS collector asset discovery mechanism @@ -151,43 +199,55 @@ type DomainDiscoverAPIIoTHost struct { // Required: true ID *string `json:"id"` - // Whether the asset is exposed to the internet (Yes or Unknown) + // Whether the asset is exposed to the internet (Yes, No or Pending). InternetExposure string `json:"internet_exposure,omitempty"` - // The iommu protection status of the host - IommuProtectionStatus string `json:"iommu_protection_status,omitempty"` + // The description the user entered when manually assigning a internet exposure level + InternetExposureDescription string `json:"internet_exposure_description,omitempty"` - // The kernel dma protection status of the asset - KernelDmaProtectionStatus bool `json:"kernel_dma_protection_status,omitempty"` + // The date and time the internet exposure level was manually assigned + InternetExposureTimestamp string `json:"internet_exposure_timestamp,omitempty"` + + // The username of the account that manually assigned the internet exposure level + InternetExposureUsername string `json:"internet_exposure_username,omitempty"` // For Linux and Mac hosts: the major version, minor version, and patch version of the kernel for the asset. For Windows hosts: the build number of the asset. KernelVersion string `json:"kernel_version,omitempty"` + // The agent ID of the Falcon sensor installed on the source that most recently discovered the asset. + LastDiscovererAid string `json:"last_discoverer_aid,omitempty"` + + // The hostname of the last source that discovered the asset. + LastDiscovererHostname string `json:"last_discoverer_hostname,omitempty"` + // The agent ID of the Falcon sensor installed on the source host that most recently discovered the asset via ICS Asset discovery mechanism LastDiscovererIcsCollectorID string `json:"last_discoverer_ics_collector_id,omitempty"` // The most recent time the asset was seen in your environment. LastSeenTimestamp string `json:"last_seen_timestamp,omitempty"` - // The IoT asset's IP address list + // Historical local IPv4 addresses associated with the asset. LocalIPAddresses []string `json:"local_ip_addresses"` // The number of historical local IPv4 addresses the asset has had. LocalIpsCount int32 `json:"local_ips_count,omitempty"` - // The Number of Logical Cores on the asset + // The number of logical cores available on the system LogicalCoreCount int32 `json:"logical_core_count,omitempty"` - // The IoT asset's MAC address list + // Historical MAC addresses associated with the asset. MacAddresses []string `json:"mac_addresses"` - // The domain name the asset is currently joined to (applies only to Windows hosts). + // The domain name the asset is currently joined to. MachineDomain string `json:"machine_domain,omitempty"` - // The max memory usage in the last 15 minutes on the asset + // The max memory usage in the last 15 minutes on the host MaxMemoryUsage int32 `json:"max_memory_usage,omitempty"` - // The max processor usage in the last 15 minutes on the asset + // The max memory usage percent in the last 15 minutes on the host + MaxMemoryUsagePct int32 `json:"max_memory_usage_pct,omitempty"` + + // The max processor usage in the last 15 minutes on the host MaxProcessorUsage int32 `json:"max_processor_usage,omitempty"` // The Total memory. @@ -199,36 +259,49 @@ type DomainDiscoverAPIIoTHost struct { // The network ID to which device is connected. NetworkID string `json:"network_id,omitempty"` - // The asset's network interfaces. + // The asset's network interfaces (Cannot be used for filtering, sorting, or querying). NetworkInterfaces []*DomainDiscoverAPINetworkInterface `json:"network_interfaces"` - // The number of active physical drives available on the system + // The number of active physical drives available on the system. NumberOfDiskDrives int32 `json:"number_of_disk_drives,omitempty"` - // Whether the asset is at end of support (Yes, No, or Unknown) + // Whether the asset is at end of support (Yes, No, or Unknown). OsIsEol string `json:"os_is_eol,omitempty"` + // The os security features of the asset + OsSecurity *DomainDiscoverAPIOsSecurity `json:"os_security,omitempty"` + // The OS version of the asset. OsVersion string `json:"os_version,omitempty"` // A list of sources through which host is discovered - // Required: true OtInformationSources []string `json:"ot_information_sources"` + // A list of network ids to which host belongs + OtNetworkIds []string `json:"ot_network_ids"` + // A list of ot serial numbers that discovered with host - // Required: true OtSerialNumbers []string `json:"ot_serial_numbers"` - // The organizational unit of the asset (applies only to Windows hosts). + // The organizational unit of the asset. Ou string `json:"ou,omitempty"` - // The number of physical CPU cores available on the system + // Whether a user overrode automatically assigned asset roles to manually assign a role to the asset (true or false). + OverrideAssetRoles bool `json:"override_asset_roles,omitempty"` + + // Whether a user overrode a criticality rule to manually assign a criticality level on the asset (true or false). + OverrideCriticalityRules bool `json:"override_criticality_rules,omitempty"` + + // Whether a user overrode the automatically assigned internet exposure (True or False). + OverrideInternetExposure bool `json:"override_internet_exposure,omitempty"` + + // The number of physical CPU cores available on the system. PhysicalCoreCount int32 `json:"physical_core_count,omitempty"` // The platform name of the asset (Windows, Mac, Linux). PlatformName string `json:"platform_name,omitempty"` - // The number of physical processors available on the system + // The number of physical processors available on the system. ProcessorPackageCount int32 `json:"processor_package_count,omitempty"` // The product type of the asset represented as a number (1 = Workstation, 2 = Domain Controller, 3 = Server). @@ -243,27 +316,15 @@ type DomainDiscoverAPIIoTHost struct { // The purdue level of IoT Asset PurdueLevel string `json:"purdue_level,omitempty"` - // Whether the asset is in reduced functionality mode (Yes or No) + // Whether the asset is in reduced functionality mode (Yes or No). ReducedFunctionalityMode string `json:"reduced_functionality_mode,omitempty"` - // The secure boot enabled status of the asset - SecureBootEnabledStatus bool `json:"secure_boot_enabled_status,omitempty"` - - // The secure boot requested status of the asset - SecureBootRequestedStatus bool `json:"secure_boot_requested_status,omitempty"` - - // The secure memory overwrite requested status of the asset - SecureMemoryOverwriteRequestedStatus string `json:"secure_memory_overwrite_requested_status,omitempty"` - // The site name of the domain the asset is joined to (applies only to Windows hosts). SiteName string `json:"site_name,omitempty"` // The subnet to which device is connected. Subnet string `json:"subnet,omitempty"` - // The system guard status of the asset - SystemGuardStatus string `json:"system_guard_status,omitempty"` - // The asset's system manufacturer. SystemManufacturer string `json:"system_manufacturer,omitempty"` @@ -279,27 +340,36 @@ type DomainDiscoverAPIIoTHost struct { // The count of bios files measured by the firmware image TotalBiosFiles int32 `json:"total_bios_files,omitempty"` - // The Total amount of disk space available on the asset in GB + // Total amount of disk space available on the system TotalDiskSpace int32 `json:"total_disk_space,omitempty"` - // The uefi memory protection status of the asset - UefiMemoryProtectionStatus string `json:"uefi_memory_protection_status,omitempty"` + // The total memory of the asset + TotalMemory int32 `json:"total_memory,omitempty"` - // The list of unencrypted drives on the asset + // Represents triage information about this host. + Triage *DomainDiscoverAPIIoTHostTriage `json:"triage,omitempty"` + + // The list of unencrypted drives on the host UnencryptedDrives []string `json:"unencrypted_drives"` - // The count of unencrypted drives on the asset + // The count of unencrypted drives on the host UnencryptedDrivesCount int32 `json:"unencrypted_drives_count,omitempty"` - // The Current amount of used disk space on the asset in GB + // The used disk space in the last 15 minutes on the host UsedDiskSpace int32 `json:"used_disk_space,omitempty"` + // The used disk space percent in the last 15 minutes on the host + UsedDiskSpacePct int32 `json:"used_disk_space_pct,omitempty"` + + // The asset role or roles manually assigned to the asset. + UserAssetRoles []string `json:"user_asset_roles"` + + // The internet exposure manually assigned to the asset + UserInternetExposure string `json:"user_internet_exposure,omitempty"` + // The Virtual Zone name in which device is installed. VirtualZone string `json:"virtual_zone,omitempty"` - // The virtualization based security status of the asset - VirtualizationBasedSecurityStatus bool `json:"virtualization_based_security_status,omitempty"` - // The VLAN IDs to which device is connected. Vlan []string `json:"vlan"` @@ -311,6 +381,10 @@ type DomainDiscoverAPIIoTHost struct { func (m *DomainDiscoverAPIIoTHost) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBiosHashesData(formats); err != nil { + res = append(res, err) + } + if err := m.validateCid(formats); err != nil { res = append(res, err) } @@ -339,11 +413,11 @@ func (m *DomainDiscoverAPIIoTHost) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateOtInformationSources(formats); err != nil { + if err := m.validateOsSecurity(formats); err != nil { res = append(res, err) } - if err := m.validateOtSerialNumbers(formats); err != nil { + if err := m.validateTriage(formats); err != nil { res = append(res, err) } @@ -353,6 +427,32 @@ func (m *DomainDiscoverAPIIoTHost) Validate(formats strfmt.Registry) error { return nil } +func (m *DomainDiscoverAPIIoTHost) validateBiosHashesData(formats strfmt.Registry) error { + if swag.IsZero(m.BiosHashesData) { // not required + return nil + } + + for i := 0; i < len(m.BiosHashesData); i++ { + if swag.IsZero(m.BiosHashesData[i]) { // not required + continue + } + + if m.BiosHashesData[i] != nil { + if err := m.BiosHashesData[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bios_hashes_data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bios_hashes_data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainDiscoverAPIIoTHost) validateCid(formats strfmt.Registry) error { if err := validate.Required("cid", "body", m.Cid); err != nil { @@ -501,19 +601,39 @@ func (m *DomainDiscoverAPIIoTHost) validateNetworkInterfaces(formats strfmt.Regi return nil } -func (m *DomainDiscoverAPIIoTHost) validateOtInformationSources(formats strfmt.Registry) error { +func (m *DomainDiscoverAPIIoTHost) validateOsSecurity(formats strfmt.Registry) error { + if swag.IsZero(m.OsSecurity) { // not required + return nil + } - if err := validate.Required("ot_information_sources", "body", m.OtInformationSources); err != nil { - return err + if m.OsSecurity != nil { + if err := m.OsSecurity.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("os_security") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("os_security") + } + return err + } } return nil } -func (m *DomainDiscoverAPIIoTHost) validateOtSerialNumbers(formats strfmt.Registry) error { +func (m *DomainDiscoverAPIIoTHost) validateTriage(formats strfmt.Registry) error { + if swag.IsZero(m.Triage) { // not required + return nil + } - if err := validate.Required("ot_serial_numbers", "body", m.OtSerialNumbers); err != nil { - return err + if m.Triage != nil { + if err := m.Triage.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triage") + } + return err + } } return nil @@ -523,6 +643,10 @@ func (m *DomainDiscoverAPIIoTHost) validateOtSerialNumbers(formats strfmt.Regist func (m *DomainDiscoverAPIIoTHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateBiosHashesData(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDeviceSlots(ctx, formats); err != nil { res = append(res, err) } @@ -543,12 +667,45 @@ func (m *DomainDiscoverAPIIoTHost) ContextValidate(ctx context.Context, formats res = append(res, err) } + if err := m.contextValidateOsSecurity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTriage(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +func (m *DomainDiscoverAPIIoTHost) contextValidateBiosHashesData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BiosHashesData); i++ { + + if m.BiosHashesData[i] != nil { + + if swag.IsZero(m.BiosHashesData[i]) { // not required + return nil + } + + if err := m.BiosHashesData[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bios_hashes_data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bios_hashes_data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainDiscoverAPIIoTHost) contextValidateDeviceSlots(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.DeviceSlots); i++ { @@ -664,6 +821,48 @@ func (m *DomainDiscoverAPIIoTHost) contextValidateNetworkInterfaces(ctx context. return nil } +func (m *DomainDiscoverAPIIoTHost) contextValidateOsSecurity(ctx context.Context, formats strfmt.Registry) error { + + if m.OsSecurity != nil { + + if swag.IsZero(m.OsSecurity) { // not required + return nil + } + + if err := m.OsSecurity.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("os_security") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("os_security") + } + return err + } + } + + return nil +} + +func (m *DomainDiscoverAPIIoTHost) contextValidateTriage(ctx context.Context, formats strfmt.Registry) error { + + if m.Triage != nil { + + if swag.IsZero(m.Triage) { // not required + return nil + } + + if err := m.Triage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triage") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *DomainDiscoverAPIIoTHost) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/domain_discover_api_io_t_host_triage.go b/falcon/models/domain_discover_api_io_t_host_triage.go new file mode 100644 index 00000000..7cae255f --- /dev/null +++ b/falcon/models/domain_discover_api_io_t_host_triage.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainDiscoverAPIIoTHostTriage domain discover API io t host triage +// +// swagger:model domain.DiscoverAPIIoTHostTriage +type DomainDiscoverAPIIoTHostTriage struct { + + // The host triage action. + Action string `json:"action,omitempty"` + + // The user assigned to triage the host. + AssignedTo string `json:"assigned_to,omitempty"` + + // The host triage description. + Description string `json:"description,omitempty"` + + // The host triage status. + Status string `json:"status,omitempty"` + + // The user who last triaged the host.' + UpdatedBy string `json:"updated_by,omitempty"` + + // The time at which the host was last triaged. + UpdatedTimestamp string `json:"updated_timestamp,omitempty"` +} + +// Validate validates this domain discover API io t host triage +func (m *DomainDiscoverAPIIoTHostTriage) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain discover API io t host triage based on context it is used +func (m *DomainDiscoverAPIIoTHostTriage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDiscoverAPIIoTHostTriage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDiscoverAPIIoTHostTriage) UnmarshalBinary(b []byte) error { + var res DomainDiscoverAPIIoTHostTriage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_discover_api_meta_info.go b/falcon/models/domain_discover_api_meta_info.go new file mode 100644 index 00000000..88198b38 --- /dev/null +++ b/falcon/models/domain_discover_api_meta_info.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDiscoverAPIMetaInfo domain discover API meta info +// +// swagger:model domain.DiscoverAPIMetaInfo +type DomainDiscoverAPIMetaInfo struct { + + // pagination + Pagination *DomainDiscoverAPIPaging `json:"pagination,omitempty"` + + // powered by + PoweredBy string `json:"powered_by,omitempty"` + + // query time + // Required: true + QueryTime *float64 `json:"query_time"` + + // trace id + // Required: true + TraceID *string `json:"trace_id"` + + // writes + Writes *MsaspecWrites `json:"writes,omitempty"` +} + +// Validate validates this domain discover API meta info +func (m *DomainDiscoverAPIMetaInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePagination(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQueryTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTraceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWrites(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDiscoverAPIMetaInfo) validatePagination(formats strfmt.Registry) error { + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if m.Pagination != nil { + if err := m.Pagination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagination") + } + return err + } + } + + return nil +} + +func (m *DomainDiscoverAPIMetaInfo) validateQueryTime(formats strfmt.Registry) error { + + if err := validate.Required("query_time", "body", m.QueryTime); err != nil { + return err + } + + return nil +} + +func (m *DomainDiscoverAPIMetaInfo) validateTraceID(formats strfmt.Registry) error { + + if err := validate.Required("trace_id", "body", m.TraceID); err != nil { + return err + } + + return nil +} + +func (m *DomainDiscoverAPIMetaInfo) validateWrites(formats strfmt.Registry) error { + if swag.IsZero(m.Writes) { // not required + return nil + } + + if m.Writes != nil { + if err := m.Writes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("writes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("writes") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain discover API meta info based on the context it is used +func (m *DomainDiscoverAPIMetaInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePagination(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWrites(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDiscoverAPIMetaInfo) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { + + if m.Pagination != nil { + + if swag.IsZero(m.Pagination) { // not required + return nil + } + + if err := m.Pagination.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagination") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagination") + } + return err + } + } + + return nil +} + +func (m *DomainDiscoverAPIMetaInfo) contextValidateWrites(ctx context.Context, formats strfmt.Registry) error { + + if m.Writes != nil { + + if swag.IsZero(m.Writes) { // not required + return nil + } + + if err := m.Writes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("writes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("writes") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDiscoverAPIMetaInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDiscoverAPIMetaInfo) UnmarshalBinary(b []byte) error { + var res DomainDiscoverAPIMetaInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_discover_api_paging.go b/falcon/models/domain_discover_api_paging.go new file mode 100644 index 00000000..77b01589 --- /dev/null +++ b/falcon/models/domain_discover_api_paging.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDiscoverAPIPaging domain discover API paging +// +// swagger:model domain.DiscoverAPIPaging +type DomainDiscoverAPIPaging struct { + + // after + // Required: true + After *string `json:"after"` + + // limit + // Required: true + Limit *int32 `json:"limit"` + + // total + // Required: true + Total *int64 `json:"total"` +} + +// Validate validates this domain discover API paging +func (m *DomainDiscoverAPIPaging) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAfter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLimit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDiscoverAPIPaging) validateAfter(formats strfmt.Registry) error { + + if err := validate.Required("after", "body", m.After); err != nil { + return err + } + + return nil +} + +func (m *DomainDiscoverAPIPaging) validateLimit(formats strfmt.Registry) error { + + if err := validate.Required("limit", "body", m.Limit); err != nil { + return err + } + + return nil +} + +func (m *DomainDiscoverAPIPaging) validateTotal(formats strfmt.Registry) error { + + if err := validate.Required("total", "body", m.Total); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain discover API paging based on context it is used +func (m *DomainDiscoverAPIPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDiscoverAPIPaging) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDiscoverAPIPaging) UnmarshalBinary(b []byte) error { + var res DomainDiscoverAPIPaging + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_discover_api_response.go b/falcon/models/domain_discover_api_response.go new file mode 100644 index 00000000..13b62d9f --- /dev/null +++ b/falcon/models/domain_discover_api_response.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainDiscoverAPIResponse domain discover API response +// +// swagger:model domain.DiscoverAPIResponse +type DomainDiscoverAPIResponse struct { + + // errors + // Required: true + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *DomainDiscoverAPIMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []string `json:"resources"` +} + +// Validate validates this domain discover API response +func (m *DomainDiscoverAPIResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainDiscoverAPIResponse) validateErrors(formats strfmt.Registry) error { + + if err := validate.Required("errors", "body", m.Errors); err != nil { + return err + } + + for i := 0; i < len(m.Errors); i++ { + if swag.IsZero(m.Errors[i]) { // not required + continue + } + + if m.Errors[i] != nil { + if err := m.Errors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainDiscoverAPIResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainDiscoverAPIResponse) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain discover API response based on the context it is used +func (m *DomainDiscoverAPIResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateErrors(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 *DomainDiscoverAPIResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Errors); i++ { + + if m.Errors[i] != nil { + + if swag.IsZero(m.Errors[i]) { // not required + return nil + } + + if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainDiscoverAPIResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainDiscoverAPIResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainDiscoverAPIResponse) UnmarshalBinary(b []byte) error { + var res DomainDiscoverAPIResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_discover_params.go b/falcon/models/domain_discover_params.go index ca131b40..e4b9ebd4 100644 --- a/falcon/models/domain_discover_params.go +++ b/falcon/models/domain_discover_params.go @@ -31,6 +31,10 @@ type DomainDiscoverParams struct { // Required: true ApplicationVendors *string `json:"application_vendors"` + // inline app filter + // Required: true + InlineAppFilter *string `json:"inline_app_filter"` + // requirement criteria // Required: true RequirementCriteria *string `json:"requirement_criteria"` @@ -52,6 +56,10 @@ func (m *DomainDiscoverParams) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateInlineAppFilter(formats); err != nil { + res = append(res, err) + } + if err := m.validateRequirementCriteria(formats); err != nil { res = append(res, err) } @@ -89,6 +97,15 @@ func (m *DomainDiscoverParams) validateApplicationVendors(formats strfmt.Registr return nil } +func (m *DomainDiscoverParams) validateInlineAppFilter(formats strfmt.Registry) error { + + if err := validate.Required("inline_app_filter", "body", m.InlineAppFilter); err != nil { + return err + } + + return nil +} + func (m *DomainDiscoverParams) validateRequirementCriteria(formats strfmt.Registry) error { if err := validate.Required("requirement_criteria", "body", m.RequirementCriteria); err != nil { diff --git a/falcon/models/domain_entity.go b/falcon/models/domain_entity.go index 148f7d32..ca7b52e3 100644 --- a/falcon/models/domain_entity.go +++ b/falcon/models/domain_entity.go @@ -5,76 +5,7 @@ package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - // DomainEntity domain entity // // swagger:model domain.Entity -type DomainEntity struct { - - // numerical id ensuring data integrity - // Required: true - ID *int64 `json:"id"` - - // name of the entity - Name string `json:"name,omitempty"` - - // search and url friendly value, usually lowercase representation of value with spaces replaced with dashes, except for countries where 2 letters codes are used - Slug string `json:"slug,omitempty"` - - // string value of the generic entity which is searchable and filterable - Value string `json:"value,omitempty"` -} - -// Validate validates this domain entity -func (m *DomainEntity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainEntity) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this domain entity based on context it is used -func (m *DomainEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainEntity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainEntity) UnmarshalBinary(b []byte) error { - var res DomainEntity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} +type DomainEntity interface{} diff --git a/falcon/models/domain_event.go b/falcon/models/domain_event.go index a1555883..09478d10 100644 --- a/falcon/models/domain_event.go +++ b/falcon/models/domain_event.go @@ -7,7 +7,6 @@ package models import ( "context" - "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -20,105 +19,161 @@ import ( // swagger:model domain.Event type DomainEvent struct { - // The raw body of the event + // attributes // Required: true - Body *string `json:"body"` + Attributes map[string]string `json:"Attributes"` - // By default, event bodies are truncated to 64kb and bodyIsTruncated is set to True. For event bodies larger than 64kb, call the /events-full-body endpoint with the respective eventId + // c ID // Required: true - BodyIsTruncated *bool `json:"body_is_truncated"` + CID *string `json:"CID"` - // Link to the event, can be missing - BodyLink string `json:"body_link,omitempty"` + // data domain + // Required: true + DataDomain *string `json:"DataDomain"` + + // event ID + // Required: true + EventID *int32 `json:"EventID"` + + // event name + // Required: true + EventName *string `json:"EventName"` + + // internal metadata + // Required: true + InternalMetadata interface{} `json:"InternalMetadata"` + + // local ID + // Required: true + LocalID *string `json:"LocalID"` - // botnet config source - BotnetConfigSource *DomainBotnetConfigSource `json:"botnet_config_source,omitempty"` + // metadata + // Required: true + Metadata *DomainEventMetadata `json:"Metadata"` - // The date the event was created (in UTC format) + // parent incident i ds // Required: true - CreatedDate *string `json:"created_date"` + ParentIncidentIDs []string `json:"ParentIncidentIDs"` - // ddos attack source - DdosAttackSource *DomainDDOSAttackSource `json:"ddos_attack_source,omitempty"` + // parent indicator i ds + // Required: true + ParentIndicatorIDs []string `json:"ParentIndicatorIDs"` - // The type of event. One of `TweetEvent`, `CodePasteEvent`, `BotnetConfigEvent`, `DdosAttackEvent` + // product // Required: true - EventType *string `json:"event_type"` + Product *string `json:"Product"` - // The event's fingerprint + // source // Required: true - Fingerprint *string `json:"fingerprint"` + Source *string `json:"Source"` - // The unique event ID + // source vertex ID // Required: true - ID *string `json:"id"` + SourceVertexID *string `json:"SourceVertexID"` - // List of objects with rules that matched the event - MatchedRules []*DomainMatchedRule `json:"matched_rules"` + // timestamp + // Required: true + // Format: date-time + Timestamp *strfmt.DateTime `json:"Timestamp"` - // pastebin text source - PastebinTextSource *DomainPastebinTextSource `json:"pastebin_text_source,omitempty"` + // vendor + // Required: true + Vendor *string `json:"Vendor"` - // A list of tags summarizing event content - Tags []string `json:"tags"` + // x d r detection ID + // Required: true + XDRDetectionID *string `json:"XDRDetectionID"` - // tweet source - TweetSource *DomainTweetSource `json:"tweet_source,omitempty"` + // x d r event ID + // Required: true + XDREventID *string `json:"XDREventID"` + + // x d r indicator ID + // Required: true + XDRIndicatorID *string `json:"XDRIndicatorID"` - // The date the event was last updated (in UTC format) + // source event // Required: true - UpdatedDate *string `json:"updated_date"` + SourceEvent *DomainRawEvent `json:"sourceEvent"` } // Validate validates this domain event func (m *DomainEvent) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateBody(formats); err != nil { + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDataDomain(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEventID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEventName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInternalMetadata(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocalID(formats); err != nil { res = append(res, err) } - if err := m.validateBodyIsTruncated(formats); err != nil { + if err := m.validateMetadata(formats); err != nil { res = append(res, err) } - if err := m.validateBotnetConfigSource(formats); err != nil { + if err := m.validateParentIncidentIDs(formats); err != nil { res = append(res, err) } - if err := m.validateCreatedDate(formats); err != nil { + if err := m.validateParentIndicatorIDs(formats); err != nil { res = append(res, err) } - if err := m.validateDdosAttackSource(formats); err != nil { + if err := m.validateProduct(formats); err != nil { res = append(res, err) } - if err := m.validateEventType(formats); err != nil { + if err := m.validateSource(formats); err != nil { res = append(res, err) } - if err := m.validateFingerprint(formats); err != nil { + if err := m.validateSourceVertexID(formats); err != nil { res = append(res, err) } - if err := m.validateID(formats); err != nil { + if err := m.validateTimestamp(formats); err != nil { res = append(res, err) } - if err := m.validateMatchedRules(formats); err != nil { + if err := m.validateVendor(formats); err != nil { res = append(res, err) } - if err := m.validatePastebinTextSource(formats); err != nil { + if err := m.validateXDRDetectionID(formats); err != nil { res = append(res, err) } - if err := m.validateTweetSource(formats); err != nil { + if err := m.validateXDREventID(formats); err != nil { res = append(res, err) } - if err := m.validateUpdatedDate(formats); err != nil { + if err := m.validateXDRIndicatorID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSourceEvent(formats); err != nil { res = append(res, err) } @@ -128,63 +183,81 @@ func (m *DomainEvent) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainEvent) validateBody(formats strfmt.Registry) error { +func (m *DomainEvent) validateAttributes(formats strfmt.Registry) error { - if err := validate.Required("body", "body", m.Body); err != nil { + if err := validate.Required("Attributes", "body", m.Attributes); err != nil { return err } return nil } -func (m *DomainEvent) validateBodyIsTruncated(formats strfmt.Registry) error { +func (m *DomainEvent) validateCID(formats strfmt.Registry) error { - if err := validate.Required("body_is_truncated", "body", m.BodyIsTruncated); err != nil { + if err := validate.Required("CID", "body", m.CID); err != nil { return err } return nil } -func (m *DomainEvent) validateBotnetConfigSource(formats strfmt.Registry) error { - if swag.IsZero(m.BotnetConfigSource) { // not required - return nil +func (m *DomainEvent) validateDataDomain(formats strfmt.Registry) error { + + if err := validate.Required("DataDomain", "body", m.DataDomain); err != nil { + return err } - if m.BotnetConfigSource != nil { - if err := m.BotnetConfigSource.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("botnet_config_source") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("botnet_config_source") - } - return err - } + return nil +} + +func (m *DomainEvent) validateEventID(formats strfmt.Registry) error { + + if err := validate.Required("EventID", "body", m.EventID); err != nil { + return err + } + + return nil +} + +func (m *DomainEvent) validateEventName(formats strfmt.Registry) error { + + if err := validate.Required("EventName", "body", m.EventName); err != nil { + return err } return nil } -func (m *DomainEvent) validateCreatedDate(formats strfmt.Registry) error { +func (m *DomainEvent) validateInternalMetadata(formats strfmt.Registry) error { - if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { + if m.InternalMetadata == nil { + return errors.Required("InternalMetadata", "body", nil) + } + + return nil +} + +func (m *DomainEvent) validateLocalID(formats strfmt.Registry) error { + + if err := validate.Required("LocalID", "body", m.LocalID); err != nil { return err } return nil } -func (m *DomainEvent) validateDdosAttackSource(formats strfmt.Registry) error { - if swag.IsZero(m.DdosAttackSource) { // not required - return nil +func (m *DomainEvent) validateMetadata(formats strfmt.Registry) error { + + if err := validate.Required("Metadata", "body", m.Metadata); err != nil { + return err } - if m.DdosAttackSource != nil { - if err := m.DdosAttackSource.Validate(formats); err != nil { + if m.Metadata != nil { + if err := m.Metadata.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ddos_attack_source") + return ve.ValidateName("Metadata") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ddos_attack_source") + return ce.ValidateName("Metadata") } return err } @@ -193,170 +266,112 @@ func (m *DomainEvent) validateDdosAttackSource(formats strfmt.Registry) error { return nil } -func (m *DomainEvent) validateEventType(formats strfmt.Registry) error { +func (m *DomainEvent) validateParentIncidentIDs(formats strfmt.Registry) error { - if err := validate.Required("event_type", "body", m.EventType); err != nil { + if err := validate.Required("ParentIncidentIDs", "body", m.ParentIncidentIDs); err != nil { return err } return nil } -func (m *DomainEvent) validateFingerprint(formats strfmt.Registry) error { +func (m *DomainEvent) validateParentIndicatorIDs(formats strfmt.Registry) error { - if err := validate.Required("fingerprint", "body", m.Fingerprint); err != nil { + if err := validate.Required("ParentIndicatorIDs", "body", m.ParentIndicatorIDs); err != nil { return err } return nil } -func (m *DomainEvent) validateID(formats strfmt.Registry) error { +func (m *DomainEvent) validateProduct(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { + if err := validate.Required("Product", "body", m.Product); err != nil { return err } return nil } -func (m *DomainEvent) validateMatchedRules(formats strfmt.Registry) error { - if swag.IsZero(m.MatchedRules) { // not required - return nil - } - - for i := 0; i < len(m.MatchedRules); i++ { - if swag.IsZero(m.MatchedRules[i]) { // not required - continue - } - - if m.MatchedRules[i] != nil { - if err := m.MatchedRules[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("matched_rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("matched_rules" + "." + strconv.Itoa(i)) - } - return err - } - } +func (m *DomainEvent) validateSource(formats strfmt.Registry) error { + if err := validate.Required("Source", "body", m.Source); err != nil { + return err } return nil } -func (m *DomainEvent) validatePastebinTextSource(formats strfmt.Registry) error { - if swag.IsZero(m.PastebinTextSource) { // not required - return nil - } +func (m *DomainEvent) validateSourceVertexID(formats strfmt.Registry) error { - if m.PastebinTextSource != nil { - if err := m.PastebinTextSource.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pastebin_text_source") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pastebin_text_source") - } - return err - } + if err := validate.Required("SourceVertexID", "body", m.SourceVertexID); err != nil { + return err } return nil } -func (m *DomainEvent) validateTweetSource(formats strfmt.Registry) error { - if swag.IsZero(m.TweetSource) { // not required - return nil +func (m *DomainEvent) validateTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("Timestamp", "body", m.Timestamp); err != nil { + return err } - if m.TweetSource != nil { - if err := m.TweetSource.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tweet_source") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tweet_source") - } - return err - } + if err := validate.FormatOf("Timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil { + return err } return nil } -func (m *DomainEvent) validateUpdatedDate(formats strfmt.Registry) error { +func (m *DomainEvent) validateVendor(formats strfmt.Registry) error { - if err := validate.Required("updated_date", "body", m.UpdatedDate); err != nil { + if err := validate.Required("Vendor", "body", m.Vendor); err != nil { return err } return nil } -// ContextValidate validate this domain event based on the context it is used -func (m *DomainEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +func (m *DomainEvent) validateXDRDetectionID(formats strfmt.Registry) error { - if err := m.contextValidateBotnetConfigSource(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDdosAttackSource(ctx, formats); err != nil { - res = append(res, err) + if err := validate.Required("XDRDetectionID", "body", m.XDRDetectionID); err != nil { + return err } - if err := m.contextValidateMatchedRules(ctx, formats); err != nil { - res = append(res, err) - } + return nil +} - if err := m.contextValidatePastebinTextSource(ctx, formats); err != nil { - res = append(res, err) - } +func (m *DomainEvent) validateXDREventID(formats strfmt.Registry) error { - if err := m.contextValidateTweetSource(ctx, formats); err != nil { - res = append(res, err) + if err := validate.Required("XDREventID", "body", m.XDREventID); err != nil { + return err } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } -func (m *DomainEvent) contextValidateBotnetConfigSource(ctx context.Context, formats strfmt.Registry) error { - - if m.BotnetConfigSource != nil { - - if swag.IsZero(m.BotnetConfigSource) { // not required - return nil - } +func (m *DomainEvent) validateXDRIndicatorID(formats strfmt.Registry) error { - if err := m.BotnetConfigSource.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("botnet_config_source") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("botnet_config_source") - } - return err - } + if err := validate.Required("XDRIndicatorID", "body", m.XDRIndicatorID); err != nil { + return err } return nil } -func (m *DomainEvent) contextValidateDdosAttackSource(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainEvent) validateSourceEvent(formats strfmt.Registry) error { - if m.DdosAttackSource != nil { - - if swag.IsZero(m.DdosAttackSource) { // not required - return nil - } + if err := validate.Required("sourceEvent", "body", m.SourceEvent); err != nil { + return err + } - if err := m.DdosAttackSource.ContextValidate(ctx, formats); err != nil { + if m.SourceEvent != nil { + if err := m.SourceEvent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ddos_attack_source") + return ve.ValidateName("sourceEvent") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ddos_attack_source") + return ce.ValidateName("sourceEvent") } return err } @@ -365,44 +380,33 @@ func (m *DomainEvent) contextValidateDdosAttackSource(ctx context.Context, forma return nil } -func (m *DomainEvent) contextValidateMatchedRules(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MatchedRules); i++ { - - if m.MatchedRules[i] != nil { - - if swag.IsZero(m.MatchedRules[i]) { // not required - return nil - } +// ContextValidate validate this domain event based on the context it is used +func (m *DomainEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if err := m.MatchedRules[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("matched_rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("matched_rules" + "." + strconv.Itoa(i)) - } - return err - } - } + if err := m.contextValidateMetadata(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSourceEvent(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -func (m *DomainEvent) contextValidatePastebinTextSource(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainEvent) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { - if m.PastebinTextSource != nil { + if m.Metadata != nil { - if swag.IsZero(m.PastebinTextSource) { // not required - return nil - } - - if err := m.PastebinTextSource.ContextValidate(ctx, formats); err != nil { + if err := m.Metadata.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pastebin_text_source") + return ve.ValidateName("Metadata") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pastebin_text_source") + return ce.ValidateName("Metadata") } return err } @@ -411,19 +415,15 @@ func (m *DomainEvent) contextValidatePastebinTextSource(ctx context.Context, for return nil } -func (m *DomainEvent) contextValidateTweetSource(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainEvent) contextValidateSourceEvent(ctx context.Context, formats strfmt.Registry) error { - if m.TweetSource != nil { - - if swag.IsZero(m.TweetSource) { // not required - return nil - } + if m.SourceEvent != nil { - if err := m.TweetSource.ContextValidate(ctx, formats); err != nil { + if err := m.SourceEvent.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tweet_source") + return ve.ValidateName("sourceEvent") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tweet_source") + return ce.ValidateName("sourceEvent") } return err } diff --git a/falcon/models/domain_event_metadata.go b/falcon/models/domain_event_metadata.go new file mode 100644 index 00000000..3041ed08 --- /dev/null +++ b/falcon/models/domain_event_metadata.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainEventMetadata domain event metadata +// +// swagger:model domain.EventMetadata +type DomainEventMetadata struct { + + // metadata + // Required: true + Metadata interface{} `json:"Metadata"` +} + +// Validate validates this domain event metadata +func (m *DomainEventMetadata) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMetadata(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainEventMetadata) validateMetadata(formats strfmt.Registry) error { + + if m.Metadata == nil { + return errors.Required("Metadata", "body", nil) + } + + return nil +} + +// ContextValidate validates this domain event metadata based on context it is used +func (m *DomainEventMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainEventMetadata) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainEventMetadata) UnmarshalBinary(b []byte) error { + var res DomainEventMetadata + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_api_patch_request_v1.go b/falcon/models/domain_external_asset_api_patch_request_v1.go new file mode 100644 index 00000000..7063491c --- /dev/null +++ b/falcon/models/domain_external_asset_api_patch_request_v1.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetAPIPatchRequestV1 Represents the payload for patching multiple assets. +// +// swagger:model domain.ExternalAssetAPIPatchRequestV1 +type DomainExternalAssetAPIPatchRequestV1 struct { + + // List of asset patches + // Required: true + Assets []*DomainExternalAssetsAPIPatch `json:"assets"` +} + +// Validate validates this domain external asset API patch request v1 +func (m *DomainExternalAssetAPIPatchRequestV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetAPIPatchRequestV1) validateAssets(formats strfmt.Registry) error { + + if err := validate.Required("assets", "body", m.Assets); err != nil { + return err + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain external asset API patch request v1 based on the context it is used +func (m *DomainExternalAssetAPIPatchRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAssets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetAPIPatchRequestV1) contextValidateAssets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Assets); i++ { + + if m.Assets[i] != nil { + + if swag.IsZero(m.Assets[i]) { // not required + return nil + } + + if err := m.Assets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetAPIPatchRequestV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetAPIPatchRequestV1) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetAPIPatchRequestV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_application.go b/falcon/models/domain_external_asset_application.go new file mode 100644 index 00000000..2088f8a6 --- /dev/null +++ b/falcon/models/domain_external_asset_application.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetApplication domain external asset application +// +// swagger:model domain.ExternalAssetApplication +type DomainExternalAssetApplication struct { + + // category + Category string `json:"category,omitempty"` + + // cpe + Cpe string `json:"cpe,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // vendor + Vendor string `json:"vendor,omitempty"` + + // version + Version string `json:"version,omitempty"` +} + +// Validate validates this domain external asset application +func (m *DomainExternalAssetApplication) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain external asset application based on context it is used +func (m *DomainExternalAssetApplication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetApplication) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetApplication) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetApplication + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_certificate.go b/falcon/models/domain_external_asset_certificate.go new file mode 100644 index 00000000..aa5f7f31 --- /dev/null +++ b/falcon/models/domain_external_asset_certificate.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetCertificate domain external asset certificate +// +// swagger:model domain.ExternalAssetCertificate +type DomainExternalAssetCertificate struct { + + // ciphers + Ciphers []String `json:"ciphers"` + + // fingerprint sha256 + FingerprintSha256 string `json:"fingerprint_sha256,omitempty"` + + // issuer + Issuer *DomainExternalAssetCertificateEntityIdentifiers `json:"issuer,omitempty"` + + // pubkey bits + PubkeyBits int64 `json:"pubkey_bits,omitempty"` + + // pubkey type + PubkeyType string `json:"pubkey_type,omitempty"` + + // serial + Serial string `json:"serial,omitempty"` + + // signature algorithm + SignatureAlgorithm string `json:"signature_algorithm,omitempty"` + + // subject + Subject *DomainExternalAssetCertificateEntityIdentifiers `json:"subject,omitempty"` + + // valid from + // Format: date-time + ValidFrom strfmt.DateTime `json:"valid_from,omitempty"` + + // valid to + // Format: date-time + ValidTo strfmt.DateTime `json:"valid_to,omitempty"` +} + +// Validate validates this domain external asset certificate +func (m *DomainExternalAssetCertificate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIssuer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubject(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValidFrom(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValidTo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetCertificate) validateIssuer(formats strfmt.Registry) error { + if swag.IsZero(m.Issuer) { // not required + return nil + } + + if m.Issuer != nil { + if err := m.Issuer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("issuer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("issuer") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetCertificate) validateSubject(formats strfmt.Registry) error { + if swag.IsZero(m.Subject) { // not required + return nil + } + + if m.Subject != nil { + if err := m.Subject.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subject") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetCertificate) validateValidFrom(formats strfmt.Registry) error { + if swag.IsZero(m.ValidFrom) { // not required + return nil + } + + if err := validate.FormatOf("valid_from", "body", "date-time", m.ValidFrom.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetCertificate) validateValidTo(formats strfmt.Registry) error { + if swag.IsZero(m.ValidTo) { // not required + return nil + } + + if err := validate.FormatOf("valid_to", "body", "date-time", m.ValidTo.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain external asset certificate based on the context it is used +func (m *DomainExternalAssetCertificate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIssuer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubject(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetCertificate) contextValidateIssuer(ctx context.Context, formats strfmt.Registry) error { + + if m.Issuer != nil { + + if swag.IsZero(m.Issuer) { // not required + return nil + } + + if err := m.Issuer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("issuer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("issuer") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetCertificate) contextValidateSubject(ctx context.Context, formats strfmt.Registry) error { + + if m.Subject != nil { + + if swag.IsZero(m.Subject) { // not required + return nil + } + + if err := m.Subject.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subject") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetCertificate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetCertificate) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetCertificate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_certificate_entity_identifiers.go b/falcon/models/domain_external_asset_certificate_entity_identifiers.go new file mode 100644 index 00000000..3b8c6acb --- /dev/null +++ b/falcon/models/domain_external_asset_certificate_entity_identifiers.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetCertificateEntityIdentifiers domain external asset certificate entity identifiers +// +// swagger:model domain.ExternalAssetCertificateEntityIdentifiers +type DomainExternalAssetCertificateEntityIdentifiers struct { + + // common name + CommonName string `json:"common_name,omitempty"` + + // country name + CountryName string `json:"country_name,omitempty"` + + // dn qualifier + DnQualifier string `json:"dn_qualifier,omitempty"` + + // domain component + DomainComponent string `json:"domain_component,omitempty"` + + // email address + EmailAddress string `json:"email_address,omitempty"` + + // generation qualifier + GenerationQualifier string `json:"generation_qualifier,omitempty"` + + // given name + GivenName string `json:"given_name,omitempty"` + + // locality name + LocalityName string `json:"locality_name,omitempty"` + + // organization name + OrganizationName string `json:"organization_name,omitempty"` + + // organizational unit + OrganizationalUnit string `json:"organizational_unit,omitempty"` + + // pseudonym + Pseudonym string `json:"pseudonym,omitempty"` + + // serial number + SerialNumber string `json:"serial_number,omitempty"` + + // state or province name + StateOrProvinceName string `json:"state_or_province_name,omitempty"` + + // street address + StreetAddress string `json:"street_address,omitempty"` + + // surname + Surname string `json:"surname,omitempty"` + + // user id + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this domain external asset certificate entity identifiers +func (m *DomainExternalAssetCertificateEntityIdentifiers) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain external asset certificate entity identifiers based on context it is used +func (m *DomainExternalAssetCertificateEntityIdentifiers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetCertificateEntityIdentifiers) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetCertificateEntityIdentifiers) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetCertificateEntityIdentifiers + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_cloud_vm.go b/falcon/models/domain_external_asset_cloud_vm.go new file mode 100644 index 00000000..738493c4 --- /dev/null +++ b/falcon/models/domain_external_asset_cloud_vm.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetCloudVM domain external asset cloud VM +// +// swagger:model domain.ExternalAssetCloudVM +type DomainExternalAssetCloudVM struct { + + // The VM description + Description string `json:"description,omitempty"` + + // The ID of the cloud VM + InstanceID string `json:"instance_id,omitempty"` + + // The lifecycle phase + Lifecycle string `json:"lifecycle,omitempty"` + + // MAC address of the VM + MacAddress string `json:"mac_address,omitempty"` + + // VM owner ID + OwnerID string `json:"owner_id,omitempty"` + + // VM platform information + Platform string `json:"platform,omitempty"` + + // VM private IP address + PrivateIP string `json:"private_ip,omitempty"` + + // VM public IP address + PublicIP string `json:"public_ip,omitempty"` + + // The cloud region + Region string `json:"region,omitempty"` + + // Security groups + SecurityGroups []string `json:"security_groups"` + + // The VM source image + Source string `json:"source,omitempty"` + + // Connectivity status of the cloud VM + Status string `json:"status,omitempty"` +} + +// Validate validates this domain external asset cloud VM +func (m *DomainExternalAssetCloudVM) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain external asset cloud VM based on context it is used +func (m *DomainExternalAssetCloudVM) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetCloudVM) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetCloudVM) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetCloudVM + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_discovery_attributes.go b/falcon/models/domain_external_asset_discovery_attributes.go new file mode 100644 index 00000000..62b7439a --- /dev/null +++ b/falcon/models/domain_external_asset_discovery_attributes.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetDiscoveryAttributes domain external asset discovery attributes +// +// swagger:model domain.ExternalAssetDiscoveryAttributes +type DomainExternalAssetDiscoveryAttributes struct { + + // Alternative discovery paths + AlternativePaths []*DomainExternalAssetDiscoveryPathAttributes `json:"alternative_paths"` + + // The chosen discovery path + // Required: true + Path *DomainExternalAssetDiscoveryPathAttributes `json:"path"` +} + +// Validate validates this domain external asset discovery attributes +func (m *DomainExternalAssetDiscoveryAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAlternativePaths(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePath(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetDiscoveryAttributes) validateAlternativePaths(formats strfmt.Registry) error { + if swag.IsZero(m.AlternativePaths) { // not required + return nil + } + + for i := 0; i < len(m.AlternativePaths); i++ { + if swag.IsZero(m.AlternativePaths[i]) { // not required + continue + } + + if m.AlternativePaths[i] != nil { + if err := m.AlternativePaths[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("alternative_paths" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alternative_paths" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetDiscoveryAttributes) validatePath(formats strfmt.Registry) error { + + if err := validate.Required("path", "body", m.Path); err != nil { + return err + } + + if m.Path != nil { + if err := m.Path.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("path") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("path") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain external asset discovery attributes based on the context it is used +func (m *DomainExternalAssetDiscoveryAttributes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAlternativePaths(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePath(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetDiscoveryAttributes) contextValidateAlternativePaths(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AlternativePaths); i++ { + + if m.AlternativePaths[i] != nil { + + if swag.IsZero(m.AlternativePaths[i]) { // not required + return nil + } + + if err := m.AlternativePaths[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("alternative_paths" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alternative_paths" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetDiscoveryAttributes) contextValidatePath(ctx context.Context, formats strfmt.Registry) error { + + if m.Path != nil { + + if err := m.Path.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("path") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("path") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetDiscoveryAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetDiscoveryAttributes) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetDiscoveryAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_discovery_path_attributes.go b/falcon/models/domain_external_asset_discovery_path_attributes.go new file mode 100644 index 00000000..e836c598 --- /dev/null +++ b/falcon/models/domain_external_asset_discovery_path_attributes.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetDiscoveryPathAttributes domain external asset discovery path attributes +// +// swagger:model domain.ExternalAssetDiscoveryPathAttributes +type DomainExternalAssetDiscoveryPathAttributes struct { + + // The list of steps in the current discovery path + Steps []*DomainExternalAssetDiscoveryStepAttributes `json:"steps"` +} + +// Validate validates this domain external asset discovery path attributes +func (m *DomainExternalAssetDiscoveryPathAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSteps(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetDiscoveryPathAttributes) validateSteps(formats strfmt.Registry) error { + if swag.IsZero(m.Steps) { // not required + return nil + } + + for i := 0; i < len(m.Steps); i++ { + if swag.IsZero(m.Steps[i]) { // not required + continue + } + + if m.Steps[i] != nil { + if err := m.Steps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain external asset discovery path attributes based on the context it is used +func (m *DomainExternalAssetDiscoveryPathAttributes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSteps(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetDiscoveryPathAttributes) contextValidateSteps(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Steps); i++ { + + if m.Steps[i] != nil { + + if swag.IsZero(m.Steps[i]) { // not required + return nil + } + + if err := m.Steps[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetDiscoveryPathAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetDiscoveryPathAttributes) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetDiscoveryPathAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_discovery_step_attributes.go b/falcon/models/domain_external_asset_discovery_step_attributes.go new file mode 100644 index 00000000..f9008f96 --- /dev/null +++ b/falcon/models/domain_external_asset_discovery_step_attributes.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetDiscoveryStepAttributes domain external asset discovery step attributes +// +// swagger:model domain.ExternalAssetDiscoveryStepAttributes +type DomainExternalAssetDiscoveryStepAttributes struct { + + // The reasoning behind this association + // Required: true + Clue *string `json:"clue"` + + // The step entity + // Required: true + Entity *string `json:"entity"` + + // The entity type of the described entity + // Required: true + EntityType *string `json:"entity_type"` + + // The discovery step identifier + ID string `json:"id,omitempty"` + + // The redirect path + RedirectPath []*DomainExternalAssetRedirectStepAttributes `json:"redirect_path"` +} + +// Validate validates this domain external asset discovery step attributes +func (m *DomainExternalAssetDiscoveryStepAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClue(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRedirectPath(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetDiscoveryStepAttributes) validateClue(formats strfmt.Registry) error { + + if err := validate.Required("clue", "body", m.Clue); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetDiscoveryStepAttributes) validateEntity(formats strfmt.Registry) error { + + if err := validate.Required("entity", "body", m.Entity); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetDiscoveryStepAttributes) validateEntityType(formats strfmt.Registry) error { + + if err := validate.Required("entity_type", "body", m.EntityType); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetDiscoveryStepAttributes) validateRedirectPath(formats strfmt.Registry) error { + if swag.IsZero(m.RedirectPath) { // not required + return nil + } + + for i := 0; i < len(m.RedirectPath); i++ { + if swag.IsZero(m.RedirectPath[i]) { // not required + continue + } + + if m.RedirectPath[i] != nil { + if err := m.RedirectPath[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("redirect_path" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("redirect_path" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain external asset discovery step attributes based on the context it is used +func (m *DomainExternalAssetDiscoveryStepAttributes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRedirectPath(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetDiscoveryStepAttributes) contextValidateRedirectPath(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.RedirectPath); i++ { + + if m.RedirectPath[i] != nil { + + if swag.IsZero(m.RedirectPath[i]) { // not required + return nil + } + + if err := m.RedirectPath[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("redirect_path" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("redirect_path" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetDiscoveryStepAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetDiscoveryStepAttributes) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetDiscoveryStepAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_geographical_location.go b/falcon/models/domain_external_asset_geographical_location.go new file mode 100644 index 00000000..ca01d889 --- /dev/null +++ b/falcon/models/domain_external_asset_geographical_location.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetGeographicalLocation domain external asset geographical location +// +// swagger:model domain.ExternalAssetGeographicalLocation +type DomainExternalAssetGeographicalLocation struct { + + // area code + AreaCode string `json:"area_code,omitempty"` + + // city + City string `json:"city,omitempty"` + + // country code + CountryCode string `json:"country_code,omitempty"` + + // country name + CountryName string `json:"country_name,omitempty"` + + // geo point + GeoPoint *DomainGeoPoint `json:"geo_point,omitempty"` + + // postal code + PostalCode string `json:"postal_code,omitempty"` + + // region code + RegionCode string `json:"region_code,omitempty"` + + // region name + RegionName string `json:"region_name,omitempty"` + + // timezone + Timezone string `json:"timezone,omitempty"` +} + +// Validate validates this domain external asset geographical location +func (m *DomainExternalAssetGeographicalLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGeoPoint(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetGeographicalLocation) validateGeoPoint(formats strfmt.Registry) error { + if swag.IsZero(m.GeoPoint) { // not required + return nil + } + + if m.GeoPoint != nil { + if err := m.GeoPoint.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("geo_point") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("geo_point") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain external asset geographical location based on the context it is used +func (m *DomainExternalAssetGeographicalLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGeoPoint(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetGeographicalLocation) contextValidateGeoPoint(ctx context.Context, formats strfmt.Registry) error { + + if m.GeoPoint != nil { + + if swag.IsZero(m.GeoPoint) { // not required + return nil + } + + if err := m.GeoPoint.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("geo_point") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("geo_point") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetGeographicalLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetGeographicalLocation) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetGeographicalLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_http_attributes.go b/falcon/models/domain_external_asset_http_attributes.go new file mode 100644 index 00000000..df4a32a9 --- /dev/null +++ b/falcon/models/domain_external_asset_http_attributes.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetHTTPAttributes domain external asset HTTP attributes +// +// swagger:model domain.ExternalAssetHTTPAttributes +type DomainExternalAssetHTTPAttributes struct { + + // cookies + Cookies []string `json:"cookies"` + + // meta + Meta []string `json:"meta"` + + // response headers + // Required: true + ResponseHeaders *string `json:"response_headers"` + + // technologies + Technologies []string `json:"technologies"` + + // title + Title string `json:"title,omitempty"` +} + +// Validate validates this domain external asset HTTP attributes +func (m *DomainExternalAssetHTTPAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResponseHeaders(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetHTTPAttributes) validateResponseHeaders(formats strfmt.Registry) error { + + if err := validate.Required("response_headers", "body", m.ResponseHeaders); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain external asset HTTP attributes based on context it is used +func (m *DomainExternalAssetHTTPAttributes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetHTTPAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetHTTPAttributes) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetHTTPAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_redirect_step_attributes.go b/falcon/models/domain_external_asset_redirect_step_attributes.go new file mode 100644 index 00000000..a3837891 --- /dev/null +++ b/falcon/models/domain_external_asset_redirect_step_attributes.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetRedirectStepAttributes domain external asset redirect step attributes +// +// swagger:model domain.ExternalAssetRedirectStepAttributes +type DomainExternalAssetRedirectStepAttributes struct { + + // Clue to how the entity was discovered + // Required: true + Clue *string `json:"clue"` + + // The value of the entity being presented + // Required: true + Entity *string `json:"entity"` + + // The entity type of the described entity + // Required: true + EntityType *string `json:"entity_type"` + + // The discovery redirect step identifier, can be omitted + ID string `json:"id,omitempty"` +} + +// Validate validates this domain external asset redirect step attributes +func (m *DomainExternalAssetRedirectStepAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClue(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntityType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetRedirectStepAttributes) validateClue(formats strfmt.Registry) error { + + if err := validate.Required("clue", "body", m.Clue); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetRedirectStepAttributes) validateEntity(formats strfmt.Registry) error { + + if err := validate.Required("entity", "body", m.Entity); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetRedirectStepAttributes) validateEntityType(formats strfmt.Registry) error { + + if err := validate.Required("entity_type", "body", m.EntityType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain external asset redirect step attributes based on context it is used +func (m *DomainExternalAssetRedirectStepAttributes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetRedirectStepAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetRedirectStepAttributes) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetRedirectStepAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_s_s_l_record.go b/falcon/models/domain_external_asset_s_s_l_record.go new file mode 100644 index 00000000..7379480e --- /dev/null +++ b/falcon/models/domain_external_asset_s_s_l_record.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetSSLRecord domain external asset s s l record +// +// swagger:model domain.ExternalAssetSSLRecord +type DomainExternalAssetSSLRecord struct { + + // alpn + Alpn string `json:"alpn,omitempty"` + + // alternative name + AlternativeName string `json:"alternative_name,omitempty"` + + // certificate + Certificate *DomainExternalAssetCertificate `json:"certificate,omitempty"` + + // cipher + Cipher *DomainCipher `json:"cipher,omitempty"` + + // ja3s + Ja3s string `json:"ja3s,omitempty"` + + // jarm + Jarm string `json:"jarm,omitempty"` + + // supported tls versions + SupportedTLSVersions []string `json:"supported_tls_versions"` + + // version + Version string `json:"version,omitempty"` +} + +// Validate validates this domain external asset s s l record +func (m *DomainExternalAssetSSLRecord) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCertificate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCipher(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetSSLRecord) validateCertificate(formats strfmt.Registry) error { + if swag.IsZero(m.Certificate) { // not required + return nil + } + + if m.Certificate != nil { + if err := m.Certificate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificate") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetSSLRecord) validateCipher(formats strfmt.Registry) error { + if swag.IsZero(m.Cipher) { // not required + return nil + } + + if m.Cipher != nil { + if err := m.Cipher.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cipher") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cipher") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain external asset s s l record based on the context it is used +func (m *DomainExternalAssetSSLRecord) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCertificate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCipher(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetSSLRecord) contextValidateCertificate(ctx context.Context, formats strfmt.Registry) error { + + if m.Certificate != nil { + + if swag.IsZero(m.Certificate) { // not required + return nil + } + + if err := m.Certificate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificate") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetSSLRecord) contextValidateCipher(ctx context.Context, formats strfmt.Registry) error { + + if m.Cipher != nil { + + if swag.IsZero(m.Cipher) { // not required + return nil + } + + if err := m.Cipher.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cipher") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cipher") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetSSLRecord) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetSSLRecord) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetSSLRecord + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_service.go b/falcon/models/domain_external_asset_service.go new file mode 100644 index 00000000..1bbdf629 --- /dev/null +++ b/falcon/models/domain_external_asset_service.go @@ -0,0 +1,496 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetService domain external asset service +// +// swagger:model domain.ExternalAssetService +type DomainExternalAssetService struct { + + // Details about the applications associated to the service + Applications []*DomainExternalAssetApplication `json:"applications"` + + // HATEOAS representation of related URLs for downloading/previewing blobs + BlobLinks *DomainExternalAssetServiceBlobsLinks `json:"blob_links,omitempty"` + + // The cloud provider name + CloudProvider string `json:"cloud_provider,omitempty"` + + // A list of Common Platform Enumeration identifiers for this service. The schema format is: cpe:::::::::::: + Cpes []string `json:"cpes"` + + // The first time this service was observed + // Format: date-time + FirstSeen strfmt.DateTime `json:"first_seen,omitempty"` + + // The hosting provider name + HostingProvider string `json:"hosting_provider,omitempty"` + + // A list of common HTTP attributes extracted from the response + HTTPAttributes *DomainExternalAssetHTTPAttributes `json:"http_attributes,omitempty"` + + // The unique external asset identifier + // Required: true + ID *string `json:"id"` + + // The date on which this was last scanned + // Required: true + // Format: date-time + LastSeen *strfmt.DateTime `json:"last_seen"` + + // The operating system the service is running on + Os string `json:"os,omitempty"` + + // The name of the platform on which the service is running (Windows, Mac, Linux). + PlatformName string `json:"platform_name,omitempty"` + + // The port on which the service is accessible + // Required: true + Port *int32 `json:"port"` + + // The protocol used to access this service + // Required: true + Protocol *string `json:"protocol"` + + // The availability status for this service + // Required: true + Status *string `json:"status"` + + // The status code returned by the service + // Required: true + StatusCode *int32 `json:"status_code"` + + // List of subsidiaries that the asset belongs to + Subsidiaries []*DomainExternalAssetSubsidiary `json:"subsidiaries"` + + // SSL/TLS information + TLS *DomainExternalAssetSSLRecord `json:"tls,omitempty"` + + // The network transport used to access this service + // Required: true + Transport *string `json:"transport"` +} + +// Validate validates this domain external asset service +func (m *DomainExternalAssetService) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplications(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBlobLinks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHTTPAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProtocol(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatusCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubsidiaries(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTLS(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransport(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetService) validateApplications(formats strfmt.Registry) error { + if swag.IsZero(m.Applications) { // not required + return nil + } + + for i := 0; i < len(m.Applications); i++ { + if swag.IsZero(m.Applications[i]) { // not required + continue + } + + if m.Applications[i] != nil { + if err := m.Applications[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applications" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetService) validateBlobLinks(formats strfmt.Registry) error { + if swag.IsZero(m.BlobLinks) { // not required + return nil + } + + if m.BlobLinks != nil { + if err := m.BlobLinks.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("blob_links") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("blob_links") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetService) validateFirstSeen(formats strfmt.Registry) error { + if swag.IsZero(m.FirstSeen) { // not required + return nil + } + + if err := validate.FormatOf("first_seen", "body", "date-time", m.FirstSeen.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetService) validateHTTPAttributes(formats strfmt.Registry) error { + if swag.IsZero(m.HTTPAttributes) { // not required + return nil + } + + if m.HTTPAttributes != nil { + if err := m.HTTPAttributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("http_attributes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("http_attributes") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetService) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetService) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + if err := validate.FormatOf("last_seen", "body", "date-time", m.LastSeen.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetService) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", m.Port); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetService) validateProtocol(formats strfmt.Registry) error { + + if err := validate.Required("protocol", "body", m.Protocol); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetService) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetService) validateStatusCode(formats strfmt.Registry) error { + + if err := validate.Required("status_code", "body", m.StatusCode); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetService) validateSubsidiaries(formats strfmt.Registry) error { + if swag.IsZero(m.Subsidiaries) { // not required + return nil + } + + for i := 0; i < len(m.Subsidiaries); i++ { + if swag.IsZero(m.Subsidiaries[i]) { // not required + continue + } + + if m.Subsidiaries[i] != nil { + if err := m.Subsidiaries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetService) validateTLS(formats strfmt.Registry) error { + if swag.IsZero(m.TLS) { // not required + return nil + } + + if m.TLS != nil { + if err := m.TLS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tls") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tls") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetService) validateTransport(formats strfmt.Registry) error { + + if err := validate.Required("transport", "body", m.Transport); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain external asset service based on the context it is used +func (m *DomainExternalAssetService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApplications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBlobLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHTTPAttributes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubsidiaries(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTLS(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetService) contextValidateApplications(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Applications); i++ { + + if m.Applications[i] != nil { + + if swag.IsZero(m.Applications[i]) { // not required + return nil + } + + if err := m.Applications[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applications" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetService) contextValidateBlobLinks(ctx context.Context, formats strfmt.Registry) error { + + if m.BlobLinks != nil { + + if swag.IsZero(m.BlobLinks) { // not required + return nil + } + + if err := m.BlobLinks.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("blob_links") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("blob_links") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetService) contextValidateHTTPAttributes(ctx context.Context, formats strfmt.Registry) error { + + if m.HTTPAttributes != nil { + + if swag.IsZero(m.HTTPAttributes) { // not required + return nil + } + + if err := m.HTTPAttributes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("http_attributes") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("http_attributes") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetService) contextValidateSubsidiaries(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Subsidiaries); i++ { + + if m.Subsidiaries[i] != nil { + + if swag.IsZero(m.Subsidiaries[i]) { // not required + return nil + } + + if err := m.Subsidiaries[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetService) contextValidateTLS(ctx context.Context, formats strfmt.Registry) error { + + if m.TLS != nil { + + if swag.IsZero(m.TLS) { // not required + return nil + } + + if err := m.TLS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tls") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tls") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetService) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_service_blobs_links.go b/falcon/models/domain_external_asset_service_blobs_links.go new file mode 100644 index 00000000..e8b7a506 --- /dev/null +++ b/falcon/models/domain_external_asset_service_blobs_links.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetServiceBlobsLinks domain external asset service blobs links +// +// swagger:model domain.ExternalAssetServiceBlobsLinks +type DomainExternalAssetServiceBlobsLinks struct { + + // download attributes + DownloadAttributes string `json:"download_attributes,omitempty"` + + // download banner + DownloadBanner string `json:"download_banner,omitempty"` + + // preview attributes + PreviewAttributes string `json:"preview_attributes,omitempty"` + + // preview banner + PreviewBanner string `json:"preview_banner,omitempty"` +} + +// Validate validates this domain external asset service blobs links +func (m *DomainExternalAssetServiceBlobsLinks) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain external asset service blobs links based on context it is used +func (m *DomainExternalAssetServiceBlobsLinks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetServiceBlobsLinks) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetServiceBlobsLinks) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetServiceBlobsLinks + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_asset_subsidiary.go b/falcon/models/domain_external_asset_subsidiary.go new file mode 100644 index 00000000..a9e38a07 --- /dev/null +++ b/falcon/models/domain_external_asset_subsidiary.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetSubsidiary domain external asset subsidiary +// +// swagger:model domain.ExternalAssetSubsidiary +type DomainExternalAssetSubsidiary struct { + + // ExternalAssetSubsidiary ID + // Required: true + ID *string `json:"id"` + + // ExternalAssetSubsidiary name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this domain external asset subsidiary +func (m *DomainExternalAssetSubsidiary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetSubsidiary) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetSubsidiary) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain external asset subsidiary based on context it is used +func (m *DomainExternalAssetSubsidiary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetSubsidiary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetSubsidiary) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetSubsidiary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_assets_api_patch.go b/falcon/models/domain_external_assets_api_patch.go new file mode 100644 index 00000000..9ea1c4af --- /dev/null +++ b/falcon/models/domain_external_assets_api_patch.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetsAPIPatch Represents information about a managed, an unmanaged or an unsupported asset. +// +// swagger:model domain.ExternalAssetsAPIPatch +type DomainExternalAssetsAPIPatch struct { + + // The asset's customer ID. + Cid string `json:"cid,omitempty"` + + // The criticality level manually assigned to this asset. + Criticality string `json:"criticality,omitempty"` + + // The criticality description manually assigned to this asset. + CriticalityDescription string `json:"criticality_description,omitempty"` + + // The unique ID of the asset. + // Required: true + ID *string `json:"id"` + + // The patch object definition to be applied to the asset + Triage *DomainExternalAssetsAPITriagePatch `json:"triage,omitempty"` +} + +// Validate validates this domain external assets API patch +func (m *DomainExternalAssetsAPIPatch) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTriage(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetsAPIPatch) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainExternalAssetsAPIPatch) validateTriage(formats strfmt.Registry) error { + if swag.IsZero(m.Triage) { // not required + return nil + } + + if m.Triage != nil { + if err := m.Triage.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triage") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain external assets API patch based on the context it is used +func (m *DomainExternalAssetsAPIPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTriage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetsAPIPatch) contextValidateTriage(ctx context.Context, formats strfmt.Registry) error { + + if m.Triage != nil { + + if swag.IsZero(m.Triage) { // not required + return nil + } + + if err := m.Triage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triage") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetsAPIPatch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetsAPIPatch) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetsAPIPatch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_assets_api_triage.go b/falcon/models/domain_external_assets_api_triage.go new file mode 100644 index 00000000..f31bda48 --- /dev/null +++ b/falcon/models/domain_external_assets_api_triage.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetsAPITriage domain external assets API triage +// +// swagger:model domain.ExternalAssetsAPITriage +type DomainExternalAssetsAPITriage struct { + + // The asset triage action. + Action string `json:"action,omitempty"` + + // The asset assigned to triage the host. + AssignedTo string `json:"assigned_to,omitempty"` + + // The asset triage description. + Description string `json:"description,omitempty"` + + // The asset triage status. + Status string `json:"status,omitempty"` + + // The user who last triaged the asset.' + UpdatedBy string `json:"updated_by,omitempty"` + + // The time at which the asset was last triaged. + UpdatedTimestamp string `json:"updated_timestamp,omitempty"` +} + +// Validate validates this domain external assets API triage +func (m *DomainExternalAssetsAPITriage) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain external assets API triage based on context it is used +func (m *DomainExternalAssetsAPITriage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetsAPITriage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetsAPITriage) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetsAPITriage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_assets_api_triage_patch.go b/falcon/models/domain_external_assets_api_triage_patch.go new file mode 100644 index 00000000..e3e72924 --- /dev/null +++ b/falcon/models/domain_external_assets_api_triage_patch.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainExternalAssetsAPITriagePatch domain external assets API triage patch +// +// swagger:model domain.ExternalAssetsAPITriagePatch +type DomainExternalAssetsAPITriagePatch struct { + + // The asset triage action. + Action string `json:"action,omitempty"` + + // The user assigned to triage the asset. + AssignedTo string `json:"assigned_to,omitempty"` + + // The asset triage description. + Description string `json:"description,omitempty"` + + // The asset triage status. + Status string `json:"status,omitempty"` +} + +// Validate validates this domain external assets API triage patch +func (m *DomainExternalAssetsAPITriagePatch) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain external assets API triage patch based on context it is used +func (m *DomainExternalAssetsAPITriagePatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetsAPITriagePatch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetsAPITriagePatch) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetsAPITriagePatch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_assets_api_type_v1.go b/falcon/models/domain_external_assets_api_type_v1.go new file mode 100644 index 00000000..bbb72cb1 --- /dev/null +++ b/falcon/models/domain_external_assets_api_type_v1.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetsAPITypeV1 domain external assets API type v1 +// +// swagger:model domain.ExternalAssetsAPITypeV1 +type DomainExternalAssetsAPITypeV1 struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*DomainFemExternalAsset `json:"resources"` +} + +// Validate validates this domain external assets API type v1 +func (m *DomainExternalAssetsAPITypeV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetsAPITypeV1) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil + } + + for i := 0; i < len(m.Errors); i++ { + if swag.IsZero(m.Errors[i]) { // not required + continue + } + + if m.Errors[i] != nil { + if err := m.Errors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetsAPITypeV1) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetsAPITypeV1) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain external assets API type v1 based on the context it is used +func (m *DomainExternalAssetsAPITypeV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateErrors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetsAPITypeV1) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Errors); i++ { + + if m.Errors[i] != nil { + + if swag.IsZero(m.Errors[i]) { // not required + return nil + } + + if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetsAPITypeV1) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetsAPITypeV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetsAPITypeV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetsAPITypeV1) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetsAPITypeV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_external_assets_blob_api_type_v1.go b/falcon/models/domain_external_assets_blob_api_type_v1.go new file mode 100644 index 00000000..ba66c477 --- /dev/null +++ b/falcon/models/domain_external_assets_blob_api_type_v1.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainExternalAssetsBlobAPITypeV1 domain external assets blob API type v1 +// +// swagger:model domain.ExternalAssetsBlobAPITypeV1 +type DomainExternalAssetsBlobAPITypeV1 struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []string `json:"resources"` +} + +// Validate validates this domain external assets blob API type v1 +func (m *DomainExternalAssetsBlobAPITypeV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainExternalAssetsBlobAPITypeV1) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil + } + + for i := 0; i < len(m.Errors); i++ { + if swag.IsZero(m.Errors[i]) { // not required + continue + } + + if m.Errors[i] != nil { + if err := m.Errors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetsBlobAPITypeV1) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainExternalAssetsBlobAPITypeV1) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain external assets blob API type v1 based on the context it is used +func (m *DomainExternalAssetsBlobAPITypeV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateErrors(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 *DomainExternalAssetsBlobAPITypeV1) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Errors); i++ { + + if m.Errors[i] != nil { + + if swag.IsZero(m.Errors[i]) { // not required + return nil + } + + if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainExternalAssetsBlobAPITypeV1) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainExternalAssetsBlobAPITypeV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainExternalAssetsBlobAPITypeV1) UnmarshalBinary(b []byte) error { + var res DomainExternalAssetsBlobAPITypeV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_fem_dns_domain.go b/falcon/models/domain_fem_dns_domain.go new file mode 100644 index 00000000..91ce253e --- /dev/null +++ b/falcon/models/domain_fem_dns_domain.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainFemDNSDomain domain fem DNS domain +// +// swagger:model domain.FemDNSDomain +type DomainFemDNSDomain struct { + + // The FQDN + // Required: true + Fqdn *string `json:"fqdn"` + + // The ISPs hosting this domain + Isps []string `json:"isps"` + + // The ID of the parent domain (only populated if domain type is subdomain) + ParentDomain string `json:"parent_domain,omitempty"` + + // IPs the domain resolved to + ResolvedIps []string `json:"resolved_ips"` + + // A list of exposed services on the domain + Services []*DomainExternalAssetService `json:"services"` + + // The type of domain (root, subdomain) + // Required: true + Type *string `json:"type"` +} + +// Validate validates this domain fem DNS domain +func (m *DomainFemDNSDomain) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFqdn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServices(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainFemDNSDomain) validateFqdn(formats strfmt.Registry) error { + + if err := validate.Required("fqdn", "body", m.Fqdn); err != nil { + return err + } + + return nil +} + +func (m *DomainFemDNSDomain) validateServices(formats strfmt.Registry) error { + if swag.IsZero(m.Services) { // not required + return nil + } + + for i := 0; i < len(m.Services); i++ { + if swag.IsZero(m.Services[i]) { // not required + continue + } + + if m.Services[i] != nil { + if err := m.Services[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainFemDNSDomain) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain fem DNS domain based on the context it is used +func (m *DomainFemDNSDomain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainFemDNSDomain) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + + if swag.IsZero(m.Services[i]) { // not required + return nil + } + + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainFemDNSDomain) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainFemDNSDomain) UnmarshalBinary(b []byte) error { + var res DomainFemDNSDomain + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_fem_external_asset.go b/falcon/models/domain_fem_external_asset.go new file mode 100644 index 00000000..e904c11d --- /dev/null +++ b/falcon/models/domain_fem_external_asset.go @@ -0,0 +1,475 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainFemExternalAsset domain fem external asset +// +// swagger:model domain.FemExternalAsset +type DomainFemExternalAsset struct { + + // Lists the user actions can be taken on this asset (triage, delete, etc) + // Required: true + ApplicableActions []string `json:"applicable_actions"` + + // The type of external asset (ip, dns_domain) + // Required: true + AssetType *string `json:"asset_type"` + + // The customer ID + // Required: true + Cid *string `json:"cid"` + + // Confidence level for the asset association to the organization + // Required: true + Confidence *int32 `json:"confidence"` + + // The criticality level of the asset (Critical, High, Noncritical, or Unassigned) + Criticality string `json:"criticality,omitempty"` + + // The description the user entered when manually assigning a criticality level + CriticalityDescription string `json:"criticality_description,omitempty"` + + // The date and time the criticality level was manually assigned + CriticalityTimestamp string `json:"criticality_timestamp,omitempty"` + + // The username of the account that manually assigned the criticality level + CriticalityUsername string `json:"criticality_username,omitempty"` + + // A list of the source providers for the asset information + // Required: true + DataProviders []string `json:"data_providers"` + + // The identifier of the asset + DiscoveredBy string `json:"discovered_by,omitempty"` + + // An object that shows how this asset has been linked to the customer inventory + Discovery *DomainExternalAssetDiscoveryAttributes `json:"discovery,omitempty"` + + // DNS Domain details + DNSDomain *DomainFemDNSDomain `json:"dns_domain,omitempty"` + + // The first time this asset has been observed as externally exposed + FirstSeen string `json:"first_seen,omitempty"` + + // The unique external asset identifier + // Required: true + ID *string `json:"id"` + + // The internet exposure status of the asset + InternetExposure string `json:"internet_exposure,omitempty"` + + // IP details + IP *DomainFemExternalIP `json:"ip,omitempty"` + + // The last time this asset has been observed as externally exposed + LastSeen string `json:"last_seen,omitempty"` + + // Flag indicating if the asset has been manually added + Manual bool `json:"manual,omitempty"` + + // Perimeter of this asset (Official/Unofficial) + Perimeter string `json:"perimeter,omitempty"` + + // The availability status for the asset + // Required: true + Status *string `json:"status"` + + // List of subsidiaries that the asset belongs to + Subsidiaries []*DomainExternalAssetSubsidiary `json:"subsidiaries"` + + // The triage information about this asset. + Triage *DomainExternalAssetsAPITriage `json:"triage,omitempty"` +} + +// Validate validates this domain fem external asset +func (m *DomainFemExternalAsset) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplicableActions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssetType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConfidence(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDataProviders(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDiscovery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDNSDomain(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIP(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubsidiaries(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTriage(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainFemExternalAsset) validateApplicableActions(formats strfmt.Registry) error { + + if err := validate.Required("applicable_actions", "body", m.ApplicableActions); err != nil { + return err + } + + return nil +} + +func (m *DomainFemExternalAsset) validateAssetType(formats strfmt.Registry) error { + + if err := validate.Required("asset_type", "body", m.AssetType); err != nil { + return err + } + + return nil +} + +func (m *DomainFemExternalAsset) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *DomainFemExternalAsset) validateConfidence(formats strfmt.Registry) error { + + if err := validate.Required("confidence", "body", m.Confidence); err != nil { + return err + } + + return nil +} + +func (m *DomainFemExternalAsset) validateDataProviders(formats strfmt.Registry) error { + + if err := validate.Required("data_providers", "body", m.DataProviders); err != nil { + return err + } + + return nil +} + +func (m *DomainFemExternalAsset) validateDiscovery(formats strfmt.Registry) error { + if swag.IsZero(m.Discovery) { // not required + return nil + } + + if m.Discovery != nil { + if err := m.Discovery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("discovery") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("discovery") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalAsset) validateDNSDomain(formats strfmt.Registry) error { + if swag.IsZero(m.DNSDomain) { // not required + return nil + } + + if m.DNSDomain != nil { + if err := m.DNSDomain.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dns_domain") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dns_domain") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalAsset) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainFemExternalAsset) validateIP(formats strfmt.Registry) error { + if swag.IsZero(m.IP) { // not required + return nil + } + + if m.IP != nil { + if err := m.IP.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ip") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ip") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalAsset) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *DomainFemExternalAsset) validateSubsidiaries(formats strfmt.Registry) error { + if swag.IsZero(m.Subsidiaries) { // not required + return nil + } + + for i := 0; i < len(m.Subsidiaries); i++ { + if swag.IsZero(m.Subsidiaries[i]) { // not required + continue + } + + if m.Subsidiaries[i] != nil { + if err := m.Subsidiaries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainFemExternalAsset) validateTriage(formats strfmt.Registry) error { + if swag.IsZero(m.Triage) { // not required + return nil + } + + if m.Triage != nil { + if err := m.Triage.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triage") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain fem external asset based on the context it is used +func (m *DomainFemExternalAsset) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDiscovery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDNSDomain(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIP(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubsidiaries(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTriage(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainFemExternalAsset) contextValidateDiscovery(ctx context.Context, formats strfmt.Registry) error { + + if m.Discovery != nil { + + if swag.IsZero(m.Discovery) { // not required + return nil + } + + if err := m.Discovery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("discovery") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("discovery") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalAsset) contextValidateDNSDomain(ctx context.Context, formats strfmt.Registry) error { + + if m.DNSDomain != nil { + + if swag.IsZero(m.DNSDomain) { // not required + return nil + } + + if err := m.DNSDomain.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dns_domain") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dns_domain") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalAsset) contextValidateIP(ctx context.Context, formats strfmt.Registry) error { + + if m.IP != nil { + + if swag.IsZero(m.IP) { // not required + return nil + } + + if err := m.IP.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ip") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ip") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalAsset) contextValidateSubsidiaries(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Subsidiaries); i++ { + + if m.Subsidiaries[i] != nil { + + if swag.IsZero(m.Subsidiaries[i]) { // not required + return nil + } + + if err := m.Subsidiaries[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subsidiaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainFemExternalAsset) contextValidateTriage(ctx context.Context, formats strfmt.Registry) error { + + if m.Triage != nil { + + if swag.IsZero(m.Triage) { // not required + return nil + } + + if err := m.Triage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triage") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainFemExternalAsset) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainFemExternalAsset) UnmarshalBinary(b []byte) error { + var res DomainFemExternalAsset + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_fem_external_ip.go b/falcon/models/domain_fem_external_ip.go new file mode 100644 index 00000000..2aff14c6 --- /dev/null +++ b/falcon/models/domain_fem_external_ip.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainFemExternalIP domain fem external IP +// +// swagger:model domain.FemExternalIP +type DomainFemExternalIP struct { + + // AID if available + Aid string `json:"aid,omitempty"` + + // ASN + Asn int32 `json:"asn,omitempty"` + + // Cloud VM attributes + CloudVM *DomainExternalAssetCloudVM `json:"cloud_vm,omitempty"` + + // The FQDN List of the related domains + Fqdns []string `json:"fqdns"` + + // The IP address + IPAddress string `json:"ip_address,omitempty"` + + // The ISP + Isp string `json:"isp,omitempty"` + + // Information about the asset localisation + Location *DomainExternalAssetGeographicalLocation `json:"location,omitempty"` + + // The PTR record + Ptr string `json:"ptr,omitempty"` + + // A list of exposed services on the IP + Services []*DomainExternalAssetService `json:"services"` +} + +// Validate validates this domain fem external IP +func (m *DomainFemExternalIP) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCloudVM(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServices(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainFemExternalIP) validateCloudVM(formats strfmt.Registry) error { + if swag.IsZero(m.CloudVM) { // not required + return nil + } + + if m.CloudVM != nil { + if err := m.CloudVM.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cloud_vm") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloud_vm") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalIP) validateLocation(formats strfmt.Registry) error { + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalIP) validateServices(formats strfmt.Registry) error { + if swag.IsZero(m.Services) { // not required + return nil + } + + for i := 0; i < len(m.Services); i++ { + if swag.IsZero(m.Services[i]) { // not required + continue + } + + if m.Services[i] != nil { + if err := m.Services[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain fem external IP based on the context it is used +func (m *DomainFemExternalIP) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCloudVM(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainFemExternalIP) contextValidateCloudVM(ctx context.Context, formats strfmt.Registry) error { + + if m.CloudVM != nil { + + if swag.IsZero(m.CloudVM) { // not required + return nil + } + + if err := m.CloudVM.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cloud_vm") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloud_vm") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalIP) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.Location != nil { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if err := m.Location.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *DomainFemExternalIP) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + + if swag.IsZero(m.Services[i]) { // not required + return nil + } + + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainFemExternalIP) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainFemExternalIP) UnmarshalBinary(b []byte) error { + var res DomainFemExternalIP + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_g_c_p_account_v1.go b/falcon/models/domain_g_c_p_account_v1.go index 3d5f2323..228ffec6 100644 --- a/falcon/models/domain_g_c_p_account_v1.go +++ b/falcon/models/domain_g_c_p_account_v1.go @@ -46,6 +46,9 @@ type DomainGCPAccountV1 struct { // cloud scopes CloudScopes []*DomainCloudScope `json:"cloud_scopes"` + // conditions + Conditions []*DomainCondition `json:"conditions"` + // cspm enabled // Required: true CspmEnabled *bool `json:"cspm_enabled"` @@ -88,6 +91,9 @@ type DomainGCPAccountV1 struct { // service account client id ServiceAccountClientID string `json:"service_account_client_id,omitempty"` + // service account conditions + ServiceAccountConditions []*DomainCondition `json:"service_account_conditions"` + // GCP service account ID ServiceAccountID int64 `json:"service_account_id,omitempty"` @@ -130,6 +136,10 @@ func (m *DomainGCPAccountV1) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateConditions(formats); err != nil { + res = append(res, err) + } + if err := m.validateCspmEnabled(formats); err != nil { res = append(res, err) } @@ -142,6 +152,10 @@ func (m *DomainGCPAccountV1) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateServiceAccountConditions(formats); err != nil { + res = append(res, err) + } + if err := m.validateServiceAccountProjectID(formats); err != nil { res = append(res, err) } @@ -235,6 +249,32 @@ func (m *DomainGCPAccountV1) validateCloudScopes(formats strfmt.Registry) error return nil } +func (m *DomainGCPAccountV1) validateConditions(formats strfmt.Registry) error { + if swag.IsZero(m.Conditions) { // not required + return nil + } + + for i := 0; i < len(m.Conditions); i++ { + if swag.IsZero(m.Conditions[i]) { // not required + continue + } + + if m.Conditions[i] != nil { + if err := m.Conditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainGCPAccountV1) validateCspmEnabled(formats strfmt.Registry) error { if err := validate.Required("cspm_enabled", "body", m.CspmEnabled); err != nil { @@ -280,6 +320,32 @@ func (m *DomainGCPAccountV1) validateParentID(formats strfmt.Registry) error { return nil } +func (m *DomainGCPAccountV1) validateServiceAccountConditions(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceAccountConditions) { // not required + return nil + } + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + continue + } + + if m.ServiceAccountConditions[i] != nil { + if err := m.ServiceAccountConditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainGCPAccountV1) validateServiceAccountProjectID(formats strfmt.Registry) error { if err := validate.Required("service_account_project_id", "body", m.ServiceAccountProjectID); err != nil { @@ -297,10 +363,18 @@ func (m *DomainGCPAccountV1) ContextValidate(ctx context.Context, formats strfmt res = append(res, err) } + if err := m.contextValidateConditions(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateGcpPermissionsStatus(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateServiceAccountConditions(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -332,6 +406,31 @@ func (m *DomainGCPAccountV1) contextValidateCloudScopes(ctx context.Context, for return nil } +func (m *DomainGCPAccountV1) contextValidateConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Conditions); i++ { + + if m.Conditions[i] != nil { + + if swag.IsZero(m.Conditions[i]) { // not required + return nil + } + + if err := m.Conditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DomainGCPAccountV1) contextValidateGcpPermissionsStatus(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.GcpPermissionsStatus); i++ { @@ -357,6 +456,31 @@ func (m *DomainGCPAccountV1) contextValidateGcpPermissionsStatus(ctx context.Con return nil } +func (m *DomainGCPAccountV1) contextValidateServiceAccountConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + + if m.ServiceAccountConditions[i] != nil { + + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + return nil + } + + if err := m.ServiceAccountConditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *DomainGCPAccountV1) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/domain_generic_entity.go b/falcon/models/domain_generic_entity.go new file mode 100644 index 00000000..e43bec82 --- /dev/null +++ b/falcon/models/domain_generic_entity.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// DomainGenericEntity domain generic entity +// +// swagger:model domain.GenericEntity +type DomainGenericEntity map[string]string + +// Validate validates this domain generic entity +func (m DomainGenericEntity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain generic entity based on context it is used +func (m DomainGenericEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/domain_geo_point.go b/falcon/models/domain_geo_point.go new file mode 100644 index 00000000..cde0089b --- /dev/null +++ b/falcon/models/domain_geo_point.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainGeoPoint domain geo point +// +// swagger:model domain.GeoPoint +type DomainGeoPoint struct { + + // lat + Lat float64 `json:"lat,omitempty"` + + // lon + Lon float64 `json:"lon,omitempty"` +} + +// Validate validates this domain geo point +func (m *DomainGeoPoint) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain geo point based on context it is used +func (m *DomainGeoPoint) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainGeoPoint) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainGeoPoint) UnmarshalBinary(b []byte) error { + var res DomainGeoPoint + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_incident.go b/falcon/models/domain_incident.go index abe2aa8b..1c1784d2 100644 --- a/falcon/models/domain_incident.go +++ b/falcon/models/domain_incident.go @@ -53,6 +53,9 @@ type DomainIncident struct { // Required: true FineScore *int32 `json:"fine_score"` + // grouping ids + GroupingIds []string `json:"grouping_ids"` + // host ids // Required: true HostIds []string `json:"host_ids"` diff --git a/falcon/models/domain_k_b_list.go b/falcon/models/domain_k_b_list.go new file mode 100644 index 00000000..b5c35fe7 --- /dev/null +++ b/falcon/models/domain_k_b_list.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainKBList domain k b list +// +// swagger:model domain.KBList +type DomainKBList struct { + + // hash + // Required: true + Hash *string `json:"Hash"` + + // items + // Required: true + Items []string `json:"Items"` +} + +// Validate validates this domain k b list +func (m *DomainKBList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainKBList) validateHash(formats strfmt.Registry) error { + + if err := validate.Required("Hash", "body", m.Hash); err != nil { + return err + } + + return nil +} + +func (m *DomainKBList) validateItems(formats strfmt.Registry) error { + + if err := validate.Required("Items", "body", m.Items); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain k b list based on context it is used +func (m *DomainKBList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainKBList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainKBList) UnmarshalBinary(b []byte) error { + var res DomainKBList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_malware_document.go b/falcon/models/domain_malware_document.go new file mode 100644 index 00000000..a574ea89 --- /dev/null +++ b/falcon/models/domain_malware_document.go @@ -0,0 +1,1528 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainMalwareDocument JSON definition of a Malware, also known as a Threat +// +// swagger:model domain.MalwareDocument +type DomainMalwareDocument struct { + + // actors count + ActorsCount int64 `json:"actors_count,omitempty"` + + // All the Systems affected (i.e AWS, Lambda) + AllSystems []string `json:"all_systems"` + + // All the actors related to this Malware + AssociatedActors []*DomainDenormalizedAdversaryReference `json:"associated_actors"` + + // capabilities + Capabilities []string `json:"capabilities"` + + // Malware's community identifiers + CommunityIdentifiers []string `json:"community_identifiers"` + + // Malware's creation date when it was added to CKB in unix timestamp format + CreatedTimestamp string `json:"created_timestamp,omitempty"` + + // Malware's text description + Description string `json:"description,omitempty"` + + // description text length + DescriptionTextLength int64 `json:"description_text_length,omitempty"` + + // Actors that developed this Malware + DevelopedBy []*DomainDenormalizedAdversaryReference `json:"developed_by"` + + // developed by count + DevelopedByCount int64 `json:"developed_by_count,omitempty"` + + // files containing threat count + FilesContainingThreatCount int64 `json:"files_containing_threat_count,omitempty"` + + // Alphanumeric ID for the Malware + // Required: true + ID *string `json:"id"` + + // indicator count + IndicatorCount int64 `json:"indicator_count,omitempty"` + + // kill chain + KillChain []string `json:"kill_chain"` + + // Malware's last updated date in unix timestamp format + LastUpdated string `json:"last_updated,omitempty"` + + // MITRE used by this Malware + Mitre []*DomainDenormalizedThreatUsedMitre `json:"mitre"` + + // mitre attack count + MitreAttackCount int64 `json:"mitre_attack_count,omitempty"` + + // mitre tactic count + MitreTacticCount int64 `json:"mitre_tactic_count,omitempty"` + + // mitre technique count + MitreTechniqueCount int64 `json:"mitre_technique_count,omitempty"` + + // Malware's activity motivation, one of: State-Sponsored, Criminal, Hacktivism + Motivation []string `json:"motivation"` + + // Malware's family name + // Required: true + Name *string `json:"name"` + + // The previous stage of this Malware + NextStageOf []*DomainDenormalizedThreatReference `json:"next_stage_of"` + + // The next stages of this Malware + NextStages []*DomainDenormalizedThreatReference `json:"next_stages"` + + // The parent of this Malware + PluginOf []*DomainDenormalizedThreatReference `json:"plugin_of"` + + // The plugins of this Malware + Plugins []*DomainDenormalizedThreatReference `json:"plugins"` + + // Actors that purchase this Malware + PurchasedBy []*DomainDenormalizedAdversaryReference `json:"purchased_by"` + + // purchased by count + PurchasedByCount int64 `json:"purchased_by_count,omitempty"` + + // report count + ReportCount int64 `json:"report_count,omitempty"` + + // Reports that contain this Malware + Reports []*DomainDenormalizedReportReference `json:"reports"` + + // Counts of detections, sandbox and vulnerabilities in costumer environment + SeenInEnvironment *DomainMalwareEnvironmentAggregates `json:"seen_in_environment,omitempty"` + + // Name in url friendly format, lowercased and spaces replaced with dash + Slug string `json:"slug,omitempty"` + + // Actors that sell this Malware + SoldBy []*DomainDenormalizedAdversaryReference `json:"sold_by"` + + // sold by count + SoldByCount int64 `json:"sold_by_count,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // The parent botnet of this Malware + SubBotnetOf []*DomainDenormalizedThreatReference `json:"sub_botnet_of"` + + // The sub-botnets of this Malware + SubBotnets []*DomainDenormalizedThreatReference `json:"sub_botnets"` + + // The predecessor of this Malware + SuccessorOf []*DomainDenormalizedThreatReference `json:"successor_of"` + + // The successors of this Malware + Successors []*DomainDenormalizedThreatReference `json:"successors"` + + // systems targeted count + SystemsTargetedCount int64 `json:"systems_targeted_count,omitempty"` + + // Target countries of malware's activity and attacks, slug value is a 2 characters code for the country value, some examples: United States,United Kingdom,Germany,India,Japan,France,Australia,Canada,China + TargetCountries []*DomainDenormalizedCountry `json:"target_countries"` + + // Target economical industries of malware's activity and attacks. List of available values: Government, Financial Services, Technology, Telecommunications, Healthcare, Energy, Academic, Media, Aerospace, NGO, Manufacturing, Industrials and Engineering, Retail, Hospitality, Consulting and Professional Services, Opportunistic, Aviation, Defense, Transportation, Oil and Gas, Legal, Pharmaceutical, Logistics, Military, Automotive, Food and Beverage, Consumer Goods, Real Estate, Insurance, Agriculture, Chemicals, Utilities, Maritime, Extractive, Travel, Dissident, Cryptocurrency, Entertainment, National Government, Law Enforcement, Think Tanks, Local Government, Sports Organizations, Computer Gaming, Biomedical, Nonprofit, Financial Management & Hedge Funds, Political Parties, Architectural and Engineering, Emergency Services, Social Media, International Government, Nuclear, Research Entities, Vocational and Higher-Level Education, eCommerce + TargetIndustries []*DomainDenormalizedSector `json:"target_industries"` + + // Malware's targeting profile + TargetingProfile []string `json:"targeting_profile"` + + // The System directly targeted by this Malware (i.e Lambda) + TargetsSystems []*DomainDenormalizedCustomerTarget `json:"targets_systems"` + + // threat file count + ThreatFileCount int64 `json:"threat_file_count,omitempty"` + + // Malware's properties one of: Commodity, OpenSource, SourceCodeLeaked, Modular, RepurposedLegitimateSoftware + ThreatProperties []string `json:"threat_properties"` + + // threat relations count + ThreatRelationsCount int64 `json:"threat_relations_count,omitempty"` + + // Actors that use this Malware + UsedBy []*DomainDenormalizedAdversaryReference `json:"used_by"` + + // used by count + UsedByCount int64 `json:"used_by_count,omitempty"` + + // The parent variant of this Malware + VariantOf []*DomainDenormalizedThreatReference `json:"variant_of"` + + // The variants of this Malware + Variants []*DomainDenormalizedThreatReference `json:"variants"` + + // Vulnerabilities this Malware exploits + Vulnerabilities []*DomainVuln `json:"vulnerabilities"` +} + +// Validate validates this domain malware document +func (m *DomainMalwareDocument) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssociatedActors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevelopedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMitre(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNextStageOf(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNextStages(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePluginOf(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlugins(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePurchasedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReports(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeenInEnvironment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSoldBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubBotnetOf(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubBotnets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSuccessorOf(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSuccessors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetCountries(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetIndustries(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetsSystems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVariantOf(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVariants(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainMalwareDocument) validateAssociatedActors(formats strfmt.Registry) error { + if swag.IsZero(m.AssociatedActors) { // not required + return nil + } + + for i := 0; i < len(m.AssociatedActors); i++ { + if swag.IsZero(m.AssociatedActors[i]) { // not required + continue + } + + if m.AssociatedActors[i] != nil { + if err := m.AssociatedActors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("associated_actors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("associated_actors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateDevelopedBy(formats strfmt.Registry) error { + if swag.IsZero(m.DevelopedBy) { // not required + return nil + } + + for i := 0; i < len(m.DevelopedBy); i++ { + if swag.IsZero(m.DevelopedBy[i]) { // not required + continue + } + + if m.DevelopedBy[i] != nil { + if err := m.DevelopedBy[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("developed_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("developed_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainMalwareDocument) validateMitre(formats strfmt.Registry) error { + if swag.IsZero(m.Mitre) { // not required + return nil + } + + for i := 0; i < len(m.Mitre); i++ { + if swag.IsZero(m.Mitre[i]) { // not required + continue + } + + if m.Mitre[i] != nil { + if err := m.Mitre[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mitre" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mitre" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *DomainMalwareDocument) validateNextStageOf(formats strfmt.Registry) error { + if swag.IsZero(m.NextStageOf) { // not required + return nil + } + + for i := 0; i < len(m.NextStageOf); i++ { + if swag.IsZero(m.NextStageOf[i]) { // not required + continue + } + + if m.NextStageOf[i] != nil { + if err := m.NextStageOf[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("next_stage_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("next_stage_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateNextStages(formats strfmt.Registry) error { + if swag.IsZero(m.NextStages) { // not required + return nil + } + + for i := 0; i < len(m.NextStages); i++ { + if swag.IsZero(m.NextStages[i]) { // not required + continue + } + + if m.NextStages[i] != nil { + if err := m.NextStages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("next_stages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("next_stages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validatePluginOf(formats strfmt.Registry) error { + if swag.IsZero(m.PluginOf) { // not required + return nil + } + + for i := 0; i < len(m.PluginOf); i++ { + if swag.IsZero(m.PluginOf[i]) { // not required + continue + } + + if m.PluginOf[i] != nil { + if err := m.PluginOf[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("plugin_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("plugin_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validatePlugins(formats strfmt.Registry) error { + if swag.IsZero(m.Plugins) { // not required + return nil + } + + for i := 0; i < len(m.Plugins); i++ { + if swag.IsZero(m.Plugins[i]) { // not required + continue + } + + if m.Plugins[i] != nil { + if err := m.Plugins[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("plugins" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("plugins" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validatePurchasedBy(formats strfmt.Registry) error { + if swag.IsZero(m.PurchasedBy) { // not required + return nil + } + + for i := 0; i < len(m.PurchasedBy); i++ { + if swag.IsZero(m.PurchasedBy[i]) { // not required + continue + } + + if m.PurchasedBy[i] != nil { + if err := m.PurchasedBy[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("purchased_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("purchased_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateReports(formats strfmt.Registry) error { + if swag.IsZero(m.Reports) { // not required + return nil + } + + for i := 0; i < len(m.Reports); i++ { + if swag.IsZero(m.Reports[i]) { // not required + continue + } + + if m.Reports[i] != nil { + if err := m.Reports[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateSeenInEnvironment(formats strfmt.Registry) error { + if swag.IsZero(m.SeenInEnvironment) { // not required + return nil + } + + if m.SeenInEnvironment != nil { + if err := m.SeenInEnvironment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("seen_in_environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("seen_in_environment") + } + return err + } + } + + return nil +} + +func (m *DomainMalwareDocument) validateSoldBy(formats strfmt.Registry) error { + if swag.IsZero(m.SoldBy) { // not required + return nil + } + + for i := 0; i < len(m.SoldBy); i++ { + if swag.IsZero(m.SoldBy[i]) { // not required + continue + } + + if m.SoldBy[i] != nil { + if err := m.SoldBy[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sold_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sold_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateSubBotnetOf(formats strfmt.Registry) error { + if swag.IsZero(m.SubBotnetOf) { // not required + return nil + } + + for i := 0; i < len(m.SubBotnetOf); i++ { + if swag.IsZero(m.SubBotnetOf[i]) { // not required + continue + } + + if m.SubBotnetOf[i] != nil { + if err := m.SubBotnetOf[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sub_botnet_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sub_botnet_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateSubBotnets(formats strfmt.Registry) error { + if swag.IsZero(m.SubBotnets) { // not required + return nil + } + + for i := 0; i < len(m.SubBotnets); i++ { + if swag.IsZero(m.SubBotnets[i]) { // not required + continue + } + + if m.SubBotnets[i] != nil { + if err := m.SubBotnets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sub_botnets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sub_botnets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateSuccessorOf(formats strfmt.Registry) error { + if swag.IsZero(m.SuccessorOf) { // not required + return nil + } + + for i := 0; i < len(m.SuccessorOf); i++ { + if swag.IsZero(m.SuccessorOf[i]) { // not required + continue + } + + if m.SuccessorOf[i] != nil { + if err := m.SuccessorOf[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("successor_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("successor_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateSuccessors(formats strfmt.Registry) error { + if swag.IsZero(m.Successors) { // not required + return nil + } + + for i := 0; i < len(m.Successors); i++ { + if swag.IsZero(m.Successors[i]) { // not required + continue + } + + if m.Successors[i] != nil { + if err := m.Successors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("successors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("successors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateTargetCountries(formats strfmt.Registry) error { + if swag.IsZero(m.TargetCountries) { // not required + return nil + } + + for i := 0; i < len(m.TargetCountries); i++ { + if swag.IsZero(m.TargetCountries[i]) { // not required + continue + } + + if m.TargetCountries[i] != nil { + if err := m.TargetCountries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateTargetIndustries(formats strfmt.Registry) error { + if swag.IsZero(m.TargetIndustries) { // not required + return nil + } + + for i := 0; i < len(m.TargetIndustries); i++ { + if swag.IsZero(m.TargetIndustries[i]) { // not required + continue + } + + if m.TargetIndustries[i] != nil { + if err := m.TargetIndustries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target_industries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateTargetsSystems(formats strfmt.Registry) error { + if swag.IsZero(m.TargetsSystems) { // not required + return nil + } + + for i := 0; i < len(m.TargetsSystems); i++ { + if swag.IsZero(m.TargetsSystems[i]) { // not required + continue + } + + if m.TargetsSystems[i] != nil { + if err := m.TargetsSystems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("targets_systems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("targets_systems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateUsedBy(formats strfmt.Registry) error { + if swag.IsZero(m.UsedBy) { // not required + return nil + } + + for i := 0; i < len(m.UsedBy); i++ { + if swag.IsZero(m.UsedBy[i]) { // not required + continue + } + + if m.UsedBy[i] != nil { + if err := m.UsedBy[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("used_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("used_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateVariantOf(formats strfmt.Registry) error { + if swag.IsZero(m.VariantOf) { // not required + return nil + } + + for i := 0; i < len(m.VariantOf); i++ { + if swag.IsZero(m.VariantOf[i]) { // not required + continue + } + + if m.VariantOf[i] != nil { + if err := m.VariantOf[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("variant_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("variant_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateVariants(formats strfmt.Registry) error { + if swag.IsZero(m.Variants) { // not required + return nil + } + + for i := 0; i < len(m.Variants); i++ { + if swag.IsZero(m.Variants[i]) { // not required + continue + } + + if m.Variants[i] != nil { + if err := m.Variants[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("variants" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("variants" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) validateVulnerabilities(formats strfmt.Registry) error { + if swag.IsZero(m.Vulnerabilities) { // not required + return nil + } + + for i := 0; i < len(m.Vulnerabilities); i++ { + if swag.IsZero(m.Vulnerabilities[i]) { // not required + continue + } + + if m.Vulnerabilities[i] != nil { + if err := m.Vulnerabilities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vulnerabilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vulnerabilities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain malware document based on the context it is used +func (m *DomainMalwareDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAssociatedActors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDevelopedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMitre(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNextStageOf(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNextStages(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePluginOf(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePlugins(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePurchasedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReports(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSeenInEnvironment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSoldBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubBotnetOf(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubBotnets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSuccessorOf(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSuccessors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTargetCountries(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTargetIndustries(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTargetsSystems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUsedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVariantOf(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVariants(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVulnerabilities(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainMalwareDocument) contextValidateAssociatedActors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AssociatedActors); i++ { + + if m.AssociatedActors[i] != nil { + + if swag.IsZero(m.AssociatedActors[i]) { // not required + return nil + } + + if err := m.AssociatedActors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("associated_actors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("associated_actors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateDevelopedBy(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DevelopedBy); i++ { + + if m.DevelopedBy[i] != nil { + + if swag.IsZero(m.DevelopedBy[i]) { // not required + return nil + } + + if err := m.DevelopedBy[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("developed_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("developed_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateMitre(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Mitre); i++ { + + if m.Mitre[i] != nil { + + if swag.IsZero(m.Mitre[i]) { // not required + return nil + } + + if err := m.Mitre[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mitre" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mitre" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateNextStageOf(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NextStageOf); i++ { + + if m.NextStageOf[i] != nil { + + if swag.IsZero(m.NextStageOf[i]) { // not required + return nil + } + + if err := m.NextStageOf[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("next_stage_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("next_stage_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateNextStages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.NextStages); i++ { + + if m.NextStages[i] != nil { + + if swag.IsZero(m.NextStages[i]) { // not required + return nil + } + + if err := m.NextStages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("next_stages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("next_stages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidatePluginOf(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PluginOf); i++ { + + if m.PluginOf[i] != nil { + + if swag.IsZero(m.PluginOf[i]) { // not required + return nil + } + + if err := m.PluginOf[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("plugin_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("plugin_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidatePlugins(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Plugins); i++ { + + if m.Plugins[i] != nil { + + if swag.IsZero(m.Plugins[i]) { // not required + return nil + } + + if err := m.Plugins[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("plugins" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("plugins" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidatePurchasedBy(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PurchasedBy); i++ { + + if m.PurchasedBy[i] != nil { + + if swag.IsZero(m.PurchasedBy[i]) { // not required + return nil + } + + if err := m.PurchasedBy[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("purchased_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("purchased_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateReports(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Reports); i++ { + + if m.Reports[i] != nil { + + if swag.IsZero(m.Reports[i]) { // not required + return nil + } + + if err := m.Reports[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateSeenInEnvironment(ctx context.Context, formats strfmt.Registry) error { + + if m.SeenInEnvironment != nil { + + if swag.IsZero(m.SeenInEnvironment) { // not required + return nil + } + + if err := m.SeenInEnvironment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("seen_in_environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("seen_in_environment") + } + return err + } + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateSoldBy(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SoldBy); i++ { + + if m.SoldBy[i] != nil { + + if swag.IsZero(m.SoldBy[i]) { // not required + return nil + } + + if err := m.SoldBy[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sold_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sold_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateSubBotnetOf(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SubBotnetOf); i++ { + + if m.SubBotnetOf[i] != nil { + + if swag.IsZero(m.SubBotnetOf[i]) { // not required + return nil + } + + if err := m.SubBotnetOf[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sub_botnet_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sub_botnet_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateSubBotnets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SubBotnets); i++ { + + if m.SubBotnets[i] != nil { + + if swag.IsZero(m.SubBotnets[i]) { // not required + return nil + } + + if err := m.SubBotnets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sub_botnets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sub_botnets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateSuccessorOf(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SuccessorOf); i++ { + + if m.SuccessorOf[i] != nil { + + if swag.IsZero(m.SuccessorOf[i]) { // not required + return nil + } + + if err := m.SuccessorOf[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("successor_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("successor_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateSuccessors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Successors); i++ { + + if m.Successors[i] != nil { + + if swag.IsZero(m.Successors[i]) { // not required + return nil + } + + if err := m.Successors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("successors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("successors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateTargetCountries(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TargetCountries); i++ { + + if m.TargetCountries[i] != nil { + + if swag.IsZero(m.TargetCountries[i]) { // not required + return nil + } + + if err := m.TargetCountries[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateTargetIndustries(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TargetIndustries); i++ { + + if m.TargetIndustries[i] != nil { + + if swag.IsZero(m.TargetIndustries[i]) { // not required + return nil + } + + if err := m.TargetIndustries[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target_industries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateTargetsSystems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TargetsSystems); i++ { + + if m.TargetsSystems[i] != nil { + + if swag.IsZero(m.TargetsSystems[i]) { // not required + return nil + } + + if err := m.TargetsSystems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("targets_systems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("targets_systems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateUsedBy(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.UsedBy); i++ { + + if m.UsedBy[i] != nil { + + if swag.IsZero(m.UsedBy[i]) { // not required + return nil + } + + if err := m.UsedBy[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("used_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("used_by" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateVariantOf(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VariantOf); i++ { + + if m.VariantOf[i] != nil { + + if swag.IsZero(m.VariantOf[i]) { // not required + return nil + } + + if err := m.VariantOf[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("variant_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("variant_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateVariants(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Variants); i++ { + + if m.Variants[i] != nil { + + if swag.IsZero(m.Variants[i]) { // not required + return nil + } + + if err := m.Variants[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("variants" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("variants" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareDocument) contextValidateVulnerabilities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Vulnerabilities); i++ { + + if m.Vulnerabilities[i] != nil { + + if swag.IsZero(m.Vulnerabilities[i]) { // not required + return nil + } + + if err := m.Vulnerabilities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vulnerabilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vulnerabilities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainMalwareDocument) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainMalwareDocument) UnmarshalBinary(b []byte) error { + var res DomainMalwareDocument + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_malware_environment_aggregates.go b/falcon/models/domain_malware_environment_aggregates.go new file mode 100644 index 00000000..a63106a4 --- /dev/null +++ b/falcon/models/domain_malware_environment_aggregates.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainMalwareEnvironmentAggregates domain malware environment aggregates +// +// swagger:model domain.MalwareEnvironmentAggregates +type DomainMalwareEnvironmentAggregates struct { + + // detections + // Required: true + Detections *int64 `json:"detections"` + + // sandbox + // Required: true + Sandbox *int64 `json:"sandbox"` + + // vulnerabilities + // Required: true + Vulnerabilities *int64 `json:"vulnerabilities"` +} + +// Validate validates this domain malware environment aggregates +func (m *DomainMalwareEnvironmentAggregates) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDetections(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSandbox(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainMalwareEnvironmentAggregates) validateDetections(formats strfmt.Registry) error { + + if err := validate.Required("detections", "body", m.Detections); err != nil { + return err + } + + return nil +} + +func (m *DomainMalwareEnvironmentAggregates) validateSandbox(formats strfmt.Registry) error { + + if err := validate.Required("sandbox", "body", m.Sandbox); err != nil { + return err + } + + return nil +} + +func (m *DomainMalwareEnvironmentAggregates) validateVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("vulnerabilities", "body", m.Vulnerabilities); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain malware environment aggregates based on context it is used +func (m *DomainMalwareEnvironmentAggregates) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainMalwareEnvironmentAggregates) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainMalwareEnvironmentAggregates) UnmarshalBinary(b []byte) error { + var res DomainMalwareEnvironmentAggregates + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_malware_response.go b/falcon/models/domain_malware_response.go new file mode 100644 index 00000000..6f29c2e8 --- /dev/null +++ b/falcon/models/domain_malware_response.go @@ -0,0 +1,237 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainMalwareResponse domain malware response +// +// swagger:model domain.MalwareResponse +type DomainMalwareResponse struct { + + // Array of API Errors + // Required: true + Errors []*MsaAPIError `json:"errors"` + + // Meta information of a request, including traceID of the request and pagination information + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*DomainMalwareDocument `json:"resources"` +} + +// Validate validates this domain malware response +func (m *DomainMalwareResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainMalwareResponse) validateErrors(formats strfmt.Registry) error { + + if err := validate.Required("errors", "body", m.Errors); err != nil { + return err + } + + for i := 0; i < len(m.Errors); i++ { + if swag.IsZero(m.Errors[i]) { // not required + continue + } + + if m.Errors[i] != nil { + if err := m.Errors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainMalwareResponse) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain malware response based on the context it is used +func (m *DomainMalwareResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateErrors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainMalwareResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Errors); i++ { + + if m.Errors[i] != nil { + + if swag.IsZero(m.Errors[i]) { // not required + return nil + } + + if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainMalwareResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainMalwareResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainMalwareResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainMalwareResponse) UnmarshalBinary(b []byte) error { + var res DomainMalwareResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_matched_rule.go b/falcon/models/domain_matched_rule.go deleted file mode 100644 index 4a1dbb84..00000000 --- a/falcon/models/domain_matched_rule.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DomainMatchedRule domain matched rule -// -// swagger:model domain.MatchedRule -type DomainMatchedRule struct { - - // The customer ID - CustomerID string `json:"customer_id,omitempty"` - - // The matched rule hit ID - HitID string `json:"hit_id,omitempty"` - - // The matched rule ID - RuleID string `json:"rule_id,omitempty"` -} - -// Validate validates this domain matched rule -func (m *DomainMatchedRule) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this domain matched rule based on context it is used -func (m *DomainMatchedRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainMatchedRule) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainMatchedRule) UnmarshalBinary(b []byte) error { - var res DomainMatchedRule - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_meta_info.go b/falcon/models/domain_meta_info.go index c9f07b21..024ca819 100644 --- a/falcon/models/domain_meta_info.go +++ b/falcon/models/domain_meta_info.go @@ -20,7 +20,7 @@ import ( type DomainMetaInfo struct { // pagination - Pagination *MsaPaging `json:"pagination,omitempty"` + Pagination *DomainAssessmentPaging `json:"pagination,omitempty"` // powered by PoweredBy string `json:"powered_by,omitempty"` @@ -29,15 +29,9 @@ type DomainMetaInfo struct { // Required: true QueryTime *float64 `json:"query_time"` - // quota - Quota *DomainQuota `json:"quota,omitempty"` - // trace id // Required: true TraceID *string `json:"trace_id"` - - // writes - Writes *MsaspecWrites `json:"writes,omitempty"` } // Validate validates this domain meta info @@ -52,18 +46,10 @@ func (m *DomainMetaInfo) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateQuota(formats); err != nil { - res = append(res, err) - } - if err := m.validateTraceID(formats); err != nil { res = append(res, err) } - if err := m.validateWrites(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -98,25 +84,6 @@ func (m *DomainMetaInfo) validateQueryTime(formats strfmt.Registry) error { return nil } -func (m *DomainMetaInfo) validateQuota(formats strfmt.Registry) error { - if swag.IsZero(m.Quota) { // not required - return nil - } - - if m.Quota != nil { - if err := m.Quota.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("quota") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("quota") - } - return err - } - } - - return nil -} - func (m *DomainMetaInfo) validateTraceID(formats strfmt.Registry) error { if err := validate.Required("trace_id", "body", m.TraceID); err != nil { @@ -126,25 +93,6 @@ func (m *DomainMetaInfo) validateTraceID(formats strfmt.Registry) error { return nil } -func (m *DomainMetaInfo) validateWrites(formats strfmt.Registry) error { - if swag.IsZero(m.Writes) { // not required - return nil - } - - if m.Writes != nil { - if err := m.Writes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("writes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("writes") - } - return err - } - } - - return nil -} - // ContextValidate validate this domain meta info based on the context it is used func (m *DomainMetaInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -153,14 +101,6 @@ func (m *DomainMetaInfo) ContextValidate(ctx context.Context, formats strfmt.Reg res = append(res, err) } - if err := m.contextValidateQuota(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWrites(ctx, formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -188,48 +128,6 @@ func (m *DomainMetaInfo) contextValidatePagination(ctx context.Context, formats return nil } -func (m *DomainMetaInfo) contextValidateQuota(ctx context.Context, formats strfmt.Registry) error { - - if m.Quota != nil { - - if swag.IsZero(m.Quota) { // not required - return nil - } - - if err := m.Quota.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("quota") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("quota") - } - return err - } - } - - return nil -} - -func (m *DomainMetaInfo) contextValidateWrites(ctx context.Context, formats strfmt.Registry) error { - - if m.Writes != nil { - - if swag.IsZero(m.Writes) { // not required - return nil - } - - if err := m.Writes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("writes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("writes") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *DomainMetaInfo) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/domain_news_document.go b/falcon/models/domain_news_document.go index 7cc2e34e..137c1e83 100644 --- a/falcon/models/domain_news_document.go +++ b/falcon/models/domain_news_document.go @@ -38,7 +38,7 @@ type DomainNewsDocument struct { Description string `json:"description,omitempty"` // internal property used for permissions check of access, not returned or explicitly filterable - Entitlements []*DomainEntity `json:"entitlements"` + Entitlements []DomainEntity `json:"entitlements"` // Integer ID of the News document // Required: true @@ -56,7 +56,7 @@ type DomainNewsDocument struct { // News mentioned motivation or motivation of related actors and malware families // Required: true - Motivations []*DomainEntity `json:"motivations"` + Motivations []DomainEntity `json:"motivations"` // News title // Required: true @@ -76,29 +76,29 @@ type DomainNewsDocument struct { Slug *string `json:"slug"` // News document sub-type. For Feeds type it can be: Snort/Suricata, Yara, NetWitness, Common Event Format. For Periodic Report type it can be: Daily, Weekly, Monthly, Quarterly, Annual. For non feeds or periodic reports type it is empty. - SubType *DomainEntity `json:"sub_type,omitempty"` + SubType DomainEntity `json:"sub_type,omitempty"` // News tags, which contains MITRE, Vulnerability community identifiers, capabilities, malware family name, customer target, activity cluster, notable event, geopolitical issue // Required: true - Tags []*DomainEntity `json:"tags"` + Tags []DomainEntity `json:"tags"` // News mentioned target countries or related actor's target countries // Required: true - TargetCountries []*DomainEntity `json:"target_countries"` + TargetCountries []DomainEntity `json:"target_countries"` // News mentioned target industries or related actor's target industries // Required: true - TargetIndustries []*DomainEntity `json:"target_industries"` + TargetIndustries []DomainEntity `json:"target_industries"` // News document thumbnail version of image // Required: true Thumbnail *DomainImage `json:"thumbnail"` // legacy, unused field - Topic *DomainEntity `json:"topic,omitempty"` + Topic DomainEntity `json:"topic,omitempty"` // News document type, one of: Notice, Feeds, Tipper, Periodic Report, Intelligence Report - Type *DomainEntity `json:"type,omitempty"` + Type DomainEntity `json:"type,omitempty"` // URL of the news document where it can be accessed in the Falcon Portal URL string `json:"url,omitempty"` @@ -120,10 +120,6 @@ func (m *DomainNewsDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateEntitlements(formats); err != nil { - res = append(res, err) - } - if err := m.validateID(formats); err != nil { res = append(res, err) } @@ -152,10 +148,6 @@ func (m *DomainNewsDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateSubType(formats); err != nil { - res = append(res, err) - } - if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -172,14 +164,6 @@ func (m *DomainNewsDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateTopic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -248,32 +232,6 @@ func (m *DomainNewsDocument) validateCreatedDate(formats strfmt.Registry) error return nil } -func (m *DomainNewsDocument) validateEntitlements(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlements) { // not required - return nil - } - - for i := 0; i < len(m.Entitlements); i++ { - if swag.IsZero(m.Entitlements[i]) { // not required - continue - } - - if m.Entitlements[i] != nil { - if err := m.Entitlements[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - func (m *DomainNewsDocument) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { @@ -343,24 +301,6 @@ func (m *DomainNewsDocument) validateMotivations(formats strfmt.Registry) error return err } - for i := 0; i < len(m.Motivations); i++ { - if swag.IsZero(m.Motivations[i]) { // not required - continue - } - - if m.Motivations[i] != nil { - if err := m.Motivations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("motivations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("motivations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -382,49 +322,12 @@ func (m *DomainNewsDocument) validateSlug(formats strfmt.Registry) error { return nil } -func (m *DomainNewsDocument) validateSubType(formats strfmt.Registry) error { - if swag.IsZero(m.SubType) { // not required - return nil - } - - if m.SubType != nil { - if err := m.SubType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sub_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sub_type") - } - return err - } - } - - return nil -} - func (m *DomainNewsDocument) validateTags(formats strfmt.Registry) error { if err := validate.Required("tags", "body", m.Tags); err != nil { return err } - for i := 0; i < len(m.Tags); i++ { - if swag.IsZero(m.Tags[i]) { // not required - continue - } - - if m.Tags[i] != nil { - if err := m.Tags[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -434,24 +337,6 @@ func (m *DomainNewsDocument) validateTargetCountries(formats strfmt.Registry) er return err } - for i := 0; i < len(m.TargetCountries); i++ { - if swag.IsZero(m.TargetCountries[i]) { // not required - continue - } - - if m.TargetCountries[i] != nil { - if err := m.TargetCountries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -461,24 +346,6 @@ func (m *DomainNewsDocument) validateTargetIndustries(formats strfmt.Registry) e return err } - for i := 0; i < len(m.TargetIndustries); i++ { - if swag.IsZero(m.TargetIndustries[i]) { // not required - continue - } - - if m.TargetIndustries[i] != nil { - if err := m.TargetIndustries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } @@ -502,44 +369,6 @@ func (m *DomainNewsDocument) validateThumbnail(formats strfmt.Registry) error { return nil } -func (m *DomainNewsDocument) validateTopic(formats strfmt.Registry) error { - if swag.IsZero(m.Topic) { // not required - return nil - } - - if m.Topic != nil { - if err := m.Topic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("topic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("topic") - } - return err - } - } - - return nil -} - -func (m *DomainNewsDocument) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - // ContextValidate validate this domain news document based on the context it is used func (m *DomainNewsDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -552,10 +381,6 @@ func (m *DomainNewsDocument) ContextValidate(ctx context.Context, formats strfmt res = append(res, err) } - if err := m.contextValidateEntitlements(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateImage(ctx, formats); err != nil { res = append(res, err) } @@ -564,38 +389,10 @@ func (m *DomainNewsDocument) ContextValidate(ctx context.Context, formats strfmt res = append(res, err) } - if err := m.contextValidateMotivations(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSubType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTargetCountries(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTargetIndustries(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateThumbnail(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateTopic(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...) } @@ -652,31 +449,6 @@ func (m *DomainNewsDocument) contextValidateAttachments(ctx context.Context, for return nil } -func (m *DomainNewsDocument) contextValidateEntitlements(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Entitlements); i++ { - - if m.Entitlements[i] != nil { - - if swag.IsZero(m.Entitlements[i]) { // not required - return nil - } - - if err := m.Entitlements[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - func (m *DomainNewsDocument) contextValidateImage(ctx context.Context, formats strfmt.Registry) error { if m.Image != nil { @@ -723,127 +495,6 @@ func (m *DomainNewsDocument) contextValidateMalware(ctx context.Context, formats return nil } -func (m *DomainNewsDocument) contextValidateMotivations(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Motivations); i++ { - - if m.Motivations[i] != nil { - - if swag.IsZero(m.Motivations[i]) { // not required - return nil - } - - if err := m.Motivations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("motivations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("motivations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainNewsDocument) contextValidateSubType(ctx context.Context, formats strfmt.Registry) error { - - if m.SubType != nil { - - if swag.IsZero(m.SubType) { // not required - return nil - } - - if err := m.SubType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sub_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sub_type") - } - return err - } - } - - return nil -} - -func (m *DomainNewsDocument) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Tags); i++ { - - if m.Tags[i] != nil { - - if swag.IsZero(m.Tags[i]) { // not required - return nil - } - - if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainNewsDocument) contextValidateTargetCountries(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TargetCountries); i++ { - - if m.TargetCountries[i] != nil { - - if swag.IsZero(m.TargetCountries[i]) { // not required - return nil - } - - if err := m.TargetCountries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainNewsDocument) contextValidateTargetIndustries(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TargetIndustries); i++ { - - if m.TargetIndustries[i] != nil { - - if swag.IsZero(m.TargetIndustries[i]) { // not required - return nil - } - - if err := m.TargetIndustries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_industries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - func (m *DomainNewsDocument) contextValidateThumbnail(ctx context.Context, formats strfmt.Registry) error { if m.Thumbnail != nil { @@ -861,48 +512,6 @@ func (m *DomainNewsDocument) contextValidateThumbnail(ctx context.Context, forma return nil } -func (m *DomainNewsDocument) contextValidateTopic(ctx context.Context, formats strfmt.Registry) error { - - if m.Topic != nil { - - if swag.IsZero(m.Topic) { // not required - return nil - } - - if err := m.Topic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("topic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("topic") - } - return err - } - } - - return nil -} - -func (m *DomainNewsDocument) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *DomainNewsDocument) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/domain_notification_v1.go b/falcon/models/domain_notification_v1.go index 287a4e8a..99f250f9 100644 --- a/falcon/models/domain_notification_v1.go +++ b/falcon/models/domain_notification_v1.go @@ -84,6 +84,15 @@ type DomainNotificationV1 struct { // Required: true RawIntelID *string `json:"raw_intel_id"` + // The name of the user who created the rule + RuleCreatorName string `json:"rule_creator_name,omitempty"` + + // The user ID of the user who created the rule + RuleCreatorUID string `json:"rule_creator_uid,omitempty"` + + // The unique UUID of the user who created the rule + RuleCreatorUUID string `json:"rule_creator_uuid,omitempty"` + // The ID of the rule that generated this notification // Required: true RuleID *string `json:"rule_id"` diff --git a/falcon/models/domain_pastebin_text_source.go b/falcon/models/domain_pastebin_text_source.go deleted file mode 100644 index 440c4664..00000000 --- a/falcon/models/domain_pastebin_text_source.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DomainPastebinTextSource domain pastebin text source -// -// swagger:model domain.PastebinTextSource -type DomainPastebinTextSource struct { - - // The name of the author - // Required: true - AuthorName *string `json:"author_name"` - - // legacy source - LegacySource DomainPastebinTextSourceLegacySource `json:"legacy_source,omitempty"` - - // Unique ID of the Pastebin content - // Required: true - PastebinID *string `json:"pastebin_id"` - - // The Pastebin URL - // Required: true - SourceLink *string `json:"source_link"` - - // The title of the Pastebin content - // Required: true - Title *string `json:"title"` -} - -// Validate validates this domain pastebin text source -func (m *DomainPastebinTextSource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthorName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePastebinID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourceLink(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTitle(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainPastebinTextSource) validateAuthorName(formats strfmt.Registry) error { - - if err := validate.Required("author_name", "body", m.AuthorName); err != nil { - return err - } - - return nil -} - -func (m *DomainPastebinTextSource) validatePastebinID(formats strfmt.Registry) error { - - if err := validate.Required("pastebin_id", "body", m.PastebinID); err != nil { - return err - } - - return nil -} - -func (m *DomainPastebinTextSource) validateSourceLink(formats strfmt.Registry) error { - - if err := validate.Required("source_link", "body", m.SourceLink); err != nil { - return err - } - - return nil -} - -func (m *DomainPastebinTextSource) validateTitle(formats strfmt.Registry) error { - - if err := validate.Required("title", "body", m.Title); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this domain pastebin text source based on context it is used -func (m *DomainPastebinTextSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainPastebinTextSource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainPastebinTextSource) UnmarshalBinary(b []byte) error { - var res DomainPastebinTextSource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_pastebin_text_source_legacy_source.go b/falcon/models/domain_pastebin_text_source_legacy_source.go deleted file mode 100644 index 88976074..00000000 --- a/falcon/models/domain_pastebin_text_source_legacy_source.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// DomainPastebinTextSourceLegacySource domain pastebin text source legacy source -// -// swagger:model domain.PastebinTextSource.legacy_source -type DomainPastebinTextSourceLegacySource interface{} diff --git a/falcon/models/domain_policy_info.go b/falcon/models/domain_policy_info.go index f756dfcb..e8b845ba 100644 --- a/falcon/models/domain_policy_info.go +++ b/falcon/models/domain_policy_info.go @@ -87,12 +87,18 @@ type DomainPolicyInfo struct { // cloud service friendly CloudServiceFriendly string `json:"cloud_service_friendly,omitempty"` + // cloud service id + CloudServiceID int32 `json:"cloud_service_id,omitempty"` + // cloud service subtype CloudServiceSubtype string `json:"cloud_service_subtype,omitempty"` // cloud service type CloudServiceType string `json:"cloud_service_type,omitempty"` + // compliance + Compliance *DomainCompliance `json:"compliance,omitempty"` + // confidence Confidence string `json:"confidence,omitempty"` @@ -167,6 +173,12 @@ type DomainPolicyInfo struct { // remediation summary RemediationSummary string `json:"remediation_summary,omitempty"` + // resource type friendly name + ResourceTypeFriendlyName string `json:"resource_type_friendly_name,omitempty"` + + // resource type id + ResourceTypeID string `json:"resource_type_id,omitempty"` + // soc2 benchmark ids Soc2BenchmarkIds []int64 `json:"soc2_benchmark_ids"` @@ -213,6 +225,10 @@ func (m *DomainPolicyInfo) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCompliance(formats); err != nil { + res = append(res, err) + } + if err := m.validateIsEnabled(formats); err != nil { res = append(res, err) } @@ -284,6 +300,25 @@ func (m *DomainPolicyInfo) validateAccountScope(formats strfmt.Registry) error { return nil } +func (m *DomainPolicyInfo) validateCompliance(formats strfmt.Registry) error { + if swag.IsZero(m.Compliance) { // not required + return nil + } + + if m.Compliance != nil { + if err := m.Compliance.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("compliance") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("compliance") + } + return err + } + } + + return nil +} + func (m *DomainPolicyInfo) validateIsEnabled(formats strfmt.Registry) error { if err := validate.Required("is_enabled", "body", m.IsEnabled); err != nil { @@ -302,8 +337,38 @@ func (m *DomainPolicyInfo) validateIsRemediable(formats strfmt.Registry) error { return nil } -// ContextValidate validates this domain policy info based on context it is used +// ContextValidate validate this domain policy info based on the context it is used func (m *DomainPolicyInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCompliance(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainPolicyInfo) contextValidateCompliance(ctx context.Context, formats strfmt.Registry) error { + + if m.Compliance != nil { + + if swag.IsZero(m.Compliance) { // not required + return nil + } + + if err := m.Compliance.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("compliance") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("compliance") + } + return err + } + } + return nil } diff --git a/falcon/models/domain_product.go b/falcon/models/domain_product.go new file mode 100644 index 00000000..67e7f173 --- /dev/null +++ b/falcon/models/domain_product.go @@ -0,0 +1,439 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainProduct domain product +// +// swagger:model domain.Product +type DomainProduct struct { + + // c p e + // Required: true + CPE *string `json:"CPE"` + + // closed timestamp + // Required: true + // Format: date-time + ClosedTimestamp *strfmt.DateTime `json:"ClosedTimestamp"` + + // created timestamp + // Required: true + // Format: date-time + CreatedTimestamp *strfmt.DateTime `json:"CreatedTimestamp"` + + // evaluation logic ID + // Required: true + EvaluationLogicID *string `json:"EvaluationLogicID"` + + // hardware architecture + // Required: true + HardwareArchitecture *string `json:"HardwareArchitecture"` + + // major version + // Required: true + MajorVersion *string `json:"MajorVersion"` + + // package hash + // Required: true + PackageHash *string `json:"PackageHash"` + + // package provider + // Required: true + PackageProvider *string `json:"PackageProvider"` + + // package source + // Required: true + PackageSource *string `json:"PackageSource"` + + // platform type + // Required: true + PlatformType *string `json:"PlatformType"` + + // product + // Required: true + Product *string `json:"Product"` + + // product normalized + // Required: true + ProductNormalized *string `json:"ProductNormalized"` + + // remediation i ds + // Required: true + RemediationIDs *DomainRemediationIDs `json:"RemediationIDs"` + + // software architecture + // Required: true + SoftwareArchitecture *string `json:"SoftwareArchitecture"` + + // sub status + // Required: true + SubStatus *string `json:"SubStatus"` + + // update k bs + // Required: true + UpdateKBs *DomainKBList `json:"UpdateKBs"` + + // vendor + // Required: true + Vendor *string `json:"Vendor"` + + // vendor normalized + // Required: true + VendorNormalized *string `json:"VendorNormalized"` +} + +// Validate validates this domain product +func (m *DomainProduct) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCPE(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClosedTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEvaluationLogicID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHardwareArchitecture(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMajorVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageProvider(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageSource(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlatformType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProduct(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProductNormalized(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediationIDs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSoftwareArchitecture(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdateKBs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVendor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVendorNormalized(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainProduct) validateCPE(formats strfmt.Registry) error { + + if err := validate.Required("CPE", "body", m.CPE); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateClosedTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("ClosedTimestamp", "body", m.ClosedTimestamp); err != nil { + return err + } + + if err := validate.FormatOf("ClosedTimestamp", "body", "date-time", m.ClosedTimestamp.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateCreatedTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("CreatedTimestamp", "body", m.CreatedTimestamp); err != nil { + return err + } + + if err := validate.FormatOf("CreatedTimestamp", "body", "date-time", m.CreatedTimestamp.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateEvaluationLogicID(formats strfmt.Registry) error { + + if err := validate.Required("EvaluationLogicID", "body", m.EvaluationLogicID); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateHardwareArchitecture(formats strfmt.Registry) error { + + if err := validate.Required("HardwareArchitecture", "body", m.HardwareArchitecture); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateMajorVersion(formats strfmt.Registry) error { + + if err := validate.Required("MajorVersion", "body", m.MajorVersion); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validatePackageHash(formats strfmt.Registry) error { + + if err := validate.Required("PackageHash", "body", m.PackageHash); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validatePackageProvider(formats strfmt.Registry) error { + + if err := validate.Required("PackageProvider", "body", m.PackageProvider); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validatePackageSource(formats strfmt.Registry) error { + + if err := validate.Required("PackageSource", "body", m.PackageSource); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validatePlatformType(formats strfmt.Registry) error { + + if err := validate.Required("PlatformType", "body", m.PlatformType); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateProduct(formats strfmt.Registry) error { + + if err := validate.Required("Product", "body", m.Product); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateProductNormalized(formats strfmt.Registry) error { + + if err := validate.Required("ProductNormalized", "body", m.ProductNormalized); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateRemediationIDs(formats strfmt.Registry) error { + + if err := validate.Required("RemediationIDs", "body", m.RemediationIDs); err != nil { + return err + } + + if m.RemediationIDs != nil { + if err := m.RemediationIDs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemediationIDs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemediationIDs") + } + return err + } + } + + return nil +} + +func (m *DomainProduct) validateSoftwareArchitecture(formats strfmt.Registry) error { + + if err := validate.Required("SoftwareArchitecture", "body", m.SoftwareArchitecture); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateSubStatus(formats strfmt.Registry) error { + + if err := validate.Required("SubStatus", "body", m.SubStatus); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateUpdateKBs(formats strfmt.Registry) error { + + if err := validate.Required("UpdateKBs", "body", m.UpdateKBs); err != nil { + return err + } + + if m.UpdateKBs != nil { + if err := m.UpdateKBs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UpdateKBs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdateKBs") + } + return err + } + } + + return nil +} + +func (m *DomainProduct) validateVendor(formats strfmt.Registry) error { + + if err := validate.Required("Vendor", "body", m.Vendor); err != nil { + return err + } + + return nil +} + +func (m *DomainProduct) validateVendorNormalized(formats strfmt.Registry) error { + + if err := validate.Required("VendorNormalized", "body", m.VendorNormalized); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain product based on the context it is used +func (m *DomainProduct) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRemediationIDs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdateKBs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainProduct) contextValidateRemediationIDs(ctx context.Context, formats strfmt.Registry) error { + + if m.RemediationIDs != nil { + + if err := m.RemediationIDs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemediationIDs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemediationIDs") + } + return err + } + } + + return nil +} + +func (m *DomainProduct) contextValidateUpdateKBs(ctx context.Context, formats strfmt.Registry) error { + + if m.UpdateKBs != nil { + + if err := m.UpdateKBs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UpdateKBs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdateKBs") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainProduct) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainProduct) UnmarshalBinary(b []byte) error { + var res DomainProduct + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_raw_event.go b/falcon/models/domain_raw_event.go new file mode 100644 index 00000000..690f2670 --- /dev/null +++ b/falcon/models/domain_raw_event.go @@ -0,0 +1,457 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainRawEvent domain raw event +// +// swagger:model domain.RawEvent +type DomainRawEvent struct { + + // c ID + // Required: true + CID *string `json:"CID"` + + // event name + // Required: true + EventName *string `json:"EventName"` + + // fields + // Required: true + Fields map[string]string `json:"Fields"` + + // ID + // Required: true + ID *string `json:"ID"` + + // internal metadata + // Required: true + InternalMetadata interface{} `json:"InternalMetadata"` + + // local ID + // Required: true + LocalID *string `json:"LocalID"` + + // metadata + // Required: true + Metadata *DomainEventMetadata `json:"Metadata"` + + // model + // Required: true + Model *int64 `json:"Model"` + + // properties + // Required: true + Properties []DomainGenericEntity `json:"Properties"` + + // raw string + // Required: true + RawString *string `json:"RawString"` + + // timestamp + // Required: true + // Format: date-time + Timestamp *strfmt.DateTime `json:"Timestamp"` + + // trace ID + // Required: true + TraceID *string `json:"TraceID"` + + // type + // Required: true + Type *string `json:"Type"` + + // ecs categorization + // Required: true + EcsCategorization *EcsCategorization `json:"ecsCategorization"` + + // source event + // Required: true + SourceEvent *DomainRawEvent `json:"sourceEvent"` +} + +// Validate validates this domain raw event +func (m *DomainRawEvent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEventName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFields(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInternalMetadata(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocalID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMetadata(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProperties(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRawString(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTraceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEcsCategorization(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSourceEvent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainRawEvent) validateCID(formats strfmt.Registry) error { + + if err := validate.Required("CID", "body", m.CID); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateEventName(formats strfmt.Registry) error { + + if err := validate.Required("EventName", "body", m.EventName); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateFields(formats strfmt.Registry) error { + + if err := validate.Required("Fields", "body", m.Fields); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateID(formats strfmt.Registry) error { + + if err := validate.Required("ID", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateInternalMetadata(formats strfmt.Registry) error { + + if m.InternalMetadata == nil { + return errors.Required("InternalMetadata", "body", nil) + } + + return nil +} + +func (m *DomainRawEvent) validateLocalID(formats strfmt.Registry) error { + + if err := validate.Required("LocalID", "body", m.LocalID); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateMetadata(formats strfmt.Registry) error { + + if err := validate.Required("Metadata", "body", m.Metadata); err != nil { + return err + } + + if m.Metadata != nil { + if err := m.Metadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Metadata") + } + return err + } + } + + return nil +} + +func (m *DomainRawEvent) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("Model", "body", m.Model); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateProperties(formats strfmt.Registry) error { + + if err := validate.Required("Properties", "body", m.Properties); err != nil { + return err + } + + for i := 0; i < len(m.Properties); i++ { + + if m.Properties[i] != nil { + if err := m.Properties[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Properties" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Properties" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainRawEvent) validateRawString(formats strfmt.Registry) error { + + if err := validate.Required("RawString", "body", m.RawString); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("Timestamp", "body", m.Timestamp); err != nil { + return err + } + + if err := validate.FormatOf("Timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateTraceID(formats strfmt.Registry) error { + + if err := validate.Required("TraceID", "body", m.TraceID); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateType(formats strfmt.Registry) error { + + if err := validate.Required("Type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *DomainRawEvent) validateEcsCategorization(formats strfmt.Registry) error { + + if err := validate.Required("ecsCategorization", "body", m.EcsCategorization); err != nil { + return err + } + + if m.EcsCategorization != nil { + if err := m.EcsCategorization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ecsCategorization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ecsCategorization") + } + return err + } + } + + return nil +} + +func (m *DomainRawEvent) validateSourceEvent(formats strfmt.Registry) error { + + if err := validate.Required("sourceEvent", "body", m.SourceEvent); err != nil { + return err + } + + if m.SourceEvent != nil { + if err := m.SourceEvent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sourceEvent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sourceEvent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain raw event based on the context it is used +func (m *DomainRawEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMetadata(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProperties(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEcsCategorization(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSourceEvent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainRawEvent) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { + + if m.Metadata != nil { + + if err := m.Metadata.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Metadata") + } + return err + } + } + + return nil +} + +func (m *DomainRawEvent) contextValidateProperties(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Properties); i++ { + + if swag.IsZero(m.Properties[i]) { // not required + return nil + } + + if err := m.Properties[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Properties" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Properties" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *DomainRawEvent) contextValidateEcsCategorization(ctx context.Context, formats strfmt.Registry) error { + + if m.EcsCategorization != nil { + + if err := m.EcsCategorization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ecsCategorization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ecsCategorization") + } + return err + } + } + + return nil +} + +func (m *DomainRawEvent) contextValidateSourceEvent(ctx context.Context, formats strfmt.Registry) error { + + if m.SourceEvent != nil { + + if err := m.SourceEvent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sourceEvent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sourceEvent") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainRawEvent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainRawEvent) UnmarshalBinary(b []byte) error { + var res DomainRawEvent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_reference.go b/falcon/models/domain_reference.go new file mode 100644 index 00000000..23b80e0a --- /dev/null +++ b/falcon/models/domain_reference.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainReference domain reference +// +// swagger:model domain.Reference +type DomainReference struct { + + // tags + // Required: true + Tags []string `json:"Tags"` + + // URL + // Required: true + URL *string `json:"URL"` +} + +// Validate validates this domain reference +func (m *DomainReference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainReference) validateTags(formats strfmt.Registry) error { + + if err := validate.Required("Tags", "body", m.Tags); err != nil { + return err + } + + return nil +} + +func (m *DomainReference) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("URL", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain reference based on context it is used +func (m *DomainReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainReference) UnmarshalBinary(b []byte) error { + var res DomainReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_remediation_i_ds.go b/falcon/models/domain_remediation_i_ds.go new file mode 100644 index 00000000..c516504b --- /dev/null +++ b/falcon/models/domain_remediation_i_ds.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainRemediationIDs domain remediation i ds +// +// swagger:model domain.RemediationIDs +type DomainRemediationIDs struct { + + // items + // Required: true + Items []string `json:"Items"` + + // hash + // Required: true + Hash *string `json:"hash"` +} + +// Validate validates this domain remediation i ds +func (m *DomainRemediationIDs) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHash(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainRemediationIDs) validateItems(formats strfmt.Registry) error { + + if err := validate.Required("Items", "body", m.Items); err != nil { + return err + } + + return nil +} + +func (m *DomainRemediationIDs) validateHash(formats strfmt.Registry) error { + + if err := validate.Required("hash", "body", m.Hash); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain remediation i ds based on context it is used +func (m *DomainRemediationIDs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainRemediationIDs) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainRemediationIDs) UnmarshalBinary(b []byte) error { + var res DomainRemediationIDs + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_report_params.go b/falcon/models/domain_report_params.go index be71969b..5c315df2 100644 --- a/falcon/models/domain_report_params.go +++ b/falcon/models/domain_report_params.go @@ -19,6 +19,10 @@ import ( // swagger:model domain.ReportParams type DomainReportParams struct { + // columns + // Required: true + Columns []string `json:"columns"` + // dashboard id // Required: true DashboardID *string `json:"dashboard_id"` @@ -55,6 +59,10 @@ type DomainReportParams struct { func (m *DomainReportParams) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateColumns(formats); err != nil { + res = append(res, err) + } + if err := m.validateDashboardID(formats); err != nil { res = append(res, err) } @@ -89,6 +97,15 @@ func (m *DomainReportParams) Validate(formats strfmt.Registry) error { return nil } +func (m *DomainReportParams) validateColumns(formats strfmt.Registry) error { + + if err := validate.Required("columns", "body", m.Columns); err != nil { + return err + } + + return nil +} + func (m *DomainReportParams) validateDashboardID(formats strfmt.Registry) error { if err := validate.Required("dashboard_id", "body", m.DashboardID); err != nil { diff --git a/falcon/models/domain_rule.go b/falcon/models/domain_rule.go index c543aec7..cfd1914b 100644 --- a/falcon/models/domain_rule.go +++ b/falcon/models/domain_rule.go @@ -19,56 +19,60 @@ import ( // swagger:model domain.Rule type DomainRule struct { - // The categories associated with the rule + // created date // Required: true - Categories []string `json:"categories"` + CreatedDate *int64 `json:"created_date"` - // UTC timestamp when rule was created + // description // Required: true - CreatedDate *string `json:"created_date"` + Description *string `json:"description"` - // The ID of the customer + // id // Required: true - CustomerID *string `json:"customer_id"` + ID *int32 `json:"id"` - // The ID of the rule + // last modified date // Required: true - ID *string `json:"id"` + LastModifiedDate *int64 `json:"last_modified_date"` - // The name of the rule + // name // Required: true Name *string `json:"name"` - // The type of the rule + // rich text description // Required: true - RuleType *string `json:"rule_type"` + RichTextDescription *string `json:"rich_text_description"` - // UTC timestamp when rule was last updated + // short description // Required: true - UpdatedDate *string `json:"updated_date"` + ShortDescription *string `json:"short_description"` - // The value of the rule + // tags // Required: true - Value *string `json:"value"` + Tags []string `json:"tags"` + + // type + // Required: true + Type *string `json:"type"` } // Validate validates this domain rule func (m *DomainRule) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateCategories(formats); err != nil { + if err := m.validateCreatedDate(formats); err != nil { res = append(res, err) } - if err := m.validateCreatedDate(formats); err != nil { + if err := m.validateDescription(formats); err != nil { res = append(res, err) } - if err := m.validateCustomerID(formats); err != nil { + if err := m.validateID(formats); err != nil { res = append(res, err) } - if err := m.validateID(formats); err != nil { + if err := m.validateLastModifiedDate(formats); err != nil { res = append(res, err) } @@ -76,15 +80,19 @@ func (m *DomainRule) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateRuleType(formats); err != nil { + if err := m.validateRichTextDescription(formats); err != nil { res = append(res, err) } - if err := m.validateUpdatedDate(formats); err != nil { + if err := m.validateShortDescription(formats); err != nil { res = append(res, err) } - if err := m.validateValue(formats); err != nil { + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -94,36 +102,36 @@ func (m *DomainRule) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainRule) validateCategories(formats strfmt.Registry) error { +func (m *DomainRule) validateCreatedDate(formats strfmt.Registry) error { - if err := validate.Required("categories", "body", m.Categories); err != nil { + if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { return err } return nil } -func (m *DomainRule) validateCreatedDate(formats strfmt.Registry) error { +func (m *DomainRule) validateDescription(formats strfmt.Registry) error { - if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { + if err := validate.Required("description", "body", m.Description); err != nil { return err } return nil } -func (m *DomainRule) validateCustomerID(formats strfmt.Registry) error { +func (m *DomainRule) validateID(formats strfmt.Registry) error { - if err := validate.Required("customer_id", "body", m.CustomerID); err != nil { + if err := validate.Required("id", "body", m.ID); err != nil { return err } return nil } -func (m *DomainRule) validateID(formats strfmt.Registry) error { +func (m *DomainRule) validateLastModifiedDate(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { + if err := validate.Required("last_modified_date", "body", m.LastModifiedDate); err != nil { return err } @@ -139,27 +147,36 @@ func (m *DomainRule) validateName(formats strfmt.Registry) error { return nil } -func (m *DomainRule) validateRuleType(formats strfmt.Registry) error { +func (m *DomainRule) validateRichTextDescription(formats strfmt.Registry) error { + + if err := validate.Required("rich_text_description", "body", m.RichTextDescription); err != nil { + return err + } + + return nil +} + +func (m *DomainRule) validateShortDescription(formats strfmt.Registry) error { - if err := validate.Required("rule_type", "body", m.RuleType); err != nil { + if err := validate.Required("short_description", "body", m.ShortDescription); err != nil { return err } return nil } -func (m *DomainRule) validateUpdatedDate(formats strfmt.Registry) error { +func (m *DomainRule) validateTags(formats strfmt.Registry) error { - if err := validate.Required("updated_date", "body", m.UpdatedDate); err != nil { + if err := validate.Required("tags", "body", m.Tags); err != nil { return err } return nil } -func (m *DomainRule) validateValue(formats strfmt.Registry) error { +func (m *DomainRule) validateType(formats strfmt.Registry) error { - if err := validate.Required("value", "body", m.Value); err != nil { + if err := validate.Required("type", "body", m.Type); err != nil { return err } diff --git a/falcon/models/domain_scan_metadata.go b/falcon/models/domain_scan_metadata.go index 417e605b..07ae395d 100644 --- a/falcon/models/domain_scan_metadata.go +++ b/falcon/models/domain_scan_metadata.go @@ -30,6 +30,9 @@ type DomainScanMetadata struct { // Required: true HostID *string `json:"host_id"` + // host name + HostName string `json:"host_name,omitempty"` + // host scan id HostScanID string `json:"host_scan_id,omitempty"` diff --git a/falcon/models/domain_schedule.go b/falcon/models/domain_schedule.go index fc2fbcbd..344ed702 100644 --- a/falcon/models/domain_schedule.go +++ b/falcon/models/domain_schedule.go @@ -8,8 +8,10 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // DomainSchedule domain schedule @@ -17,18 +19,65 @@ import ( // swagger:model domain.Schedule type DomainSchedule struct { - // ignored by channelfile - IgnoredByChannelfile bool `json:"ignored_by_channelfile,omitempty"` + // can stagger + // Required: true + CanStagger *bool `json:"can_stagger"` - // interval - Interval int32 `json:"interval,omitempty"` + // definition + // Required: true + Definition *string `json:"definition"` - // start timestamp - StartTimestamp string `json:"start_timestamp,omitempty"` + // display + // Required: true + Display *string `json:"display"` } // Validate validates this domain schedule func (m *DomainSchedule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCanStagger(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefinition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDisplay(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainSchedule) validateCanStagger(formats strfmt.Registry) error { + + if err := validate.Required("can_stagger", "body", m.CanStagger); err != nil { + return err + } + + return nil +} + +func (m *DomainSchedule) validateDefinition(formats strfmt.Registry) error { + + if err := validate.Required("definition", "body", m.Definition); err != nil { + return err + } + + return nil +} + +func (m *DomainSchedule) validateDisplay(formats strfmt.Registry) error { + + if err := validate.Required("display", "body", m.Display); err != nil { + return err + } + return nil } diff --git a/falcon/models/domain_sensor_installer_v2.go b/falcon/models/domain_sensor_installer_v2.go new file mode 100644 index 00000000..5371bf15 --- /dev/null +++ b/falcon/models/domain_sensor_installer_v2.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainSensorInstallerV2 domain sensor installer v2 +// +// swagger:model domain.SensorInstallerV2 +type DomainSensorInstallerV2 struct { + + // architectures supported + Architectures []string `json:"architectures"` + + // installer description + // Required: true + Description *string `json:"description"` + + // file size + // Required: true + FileSize *int32 `json:"file_size"` + + // file type + // Required: true + FileType *string `json:"file_type"` + + // ltv expiry date + LtvExpiryDate string `json:"ltv_expiry_date,omitempty"` + + // ltv promoted date + LtvPromotedDate string `json:"ltv_promoted_date,omitempty"` + + // installer file name + // Required: true + Name *string `json:"name"` + + // os + // Required: true + Os *string `json:"os"` + + // os version + // Required: true + OsVersion *string `json:"os_version"` + + // supported platform + // Required: true + Platform *string `json:"platform"` + + // release date + // Required: true + // Format: date-time + ReleaseDate *strfmt.DateTime `json:"release_date"` + + // sha256 + // Required: true + Sha256 *string `json:"sha256"` + + // version of the installer + // Required: true + Version *string `json:"version"` +} + +// Validate validates this domain sensor installer v2 +func (m *DomainSensorInstallerV2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFileSize(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFileType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOsVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlatform(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReleaseDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSha256(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainSensorInstallerV2) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateFileSize(formats strfmt.Registry) error { + + if err := validate.Required("file_size", "body", m.FileSize); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateFileType(formats strfmt.Registry) error { + + if err := validate.Required("file_type", "body", m.FileType); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateOs(formats strfmt.Registry) error { + + if err := validate.Required("os", "body", m.Os); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateOsVersion(formats strfmt.Registry) error { + + if err := validate.Required("os_version", "body", m.OsVersion); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validatePlatform(formats strfmt.Registry) error { + + if err := validate.Required("platform", "body", m.Platform); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateReleaseDate(formats strfmt.Registry) error { + + if err := validate.Required("release_date", "body", m.ReleaseDate); err != nil { + return err + } + + if err := validate.FormatOf("release_date", "body", "date-time", m.ReleaseDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateSha256(formats strfmt.Registry) error { + + if err := validate.Required("sha256", "body", m.Sha256); err != nil { + return err + } + + return nil +} + +func (m *DomainSensorInstallerV2) validateVersion(formats strfmt.Registry) error { + + if err := validate.Required("version", "body", m.Version); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain sensor installer v2 based on context it is used +func (m *DomainSensorInstallerV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainSensorInstallerV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainSensorInstallerV2) UnmarshalBinary(b []byte) error { + var res DomainSensorInstallerV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_sensor_installers_v2.go b/falcon/models/domain_sensor_installers_v2.go new file mode 100644 index 00000000..189cb593 --- /dev/null +++ b/falcon/models/domain_sensor_installers_v2.go @@ -0,0 +1,237 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainSensorInstallersV2 domain sensor installers v2 +// +// swagger:model domain.SensorInstallersV2 +type DomainSensorInstallersV2 struct { + + // errors + // Required: true + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*DomainSensorInstallerV2 `json:"resources"` +} + +// Validate validates this domain sensor installers v2 +func (m *DomainSensorInstallersV2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainSensorInstallersV2) validateErrors(formats strfmt.Registry) error { + + if err := validate.Required("errors", "body", m.Errors); err != nil { + return err + } + + for i := 0; i < len(m.Errors); i++ { + if swag.IsZero(m.Errors[i]) { // not required + continue + } + + if m.Errors[i] != nil { + if err := m.Errors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainSensorInstallersV2) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainSensorInstallersV2) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this domain sensor installers v2 based on the context it is used +func (m *DomainSensorInstallersV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateErrors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainSensorInstallersV2) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Errors); i++ { + + if m.Errors[i] != nil { + + if swag.IsZero(m.Errors[i]) { // not required + return nil + } + + if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainSensorInstallersV2) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *DomainSensorInstallersV2) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainSensorInstallersV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainSensorInstallersV2) UnmarshalBinary(b []byte) error { + var res DomainSensorInstallersV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_simple_actor.go b/falcon/models/domain_simple_actor.go index 9995baab..447d0914 100644 --- a/falcon/models/domain_simple_actor.go +++ b/falcon/models/domain_simple_actor.go @@ -7,7 +7,6 @@ package models import ( "context" - "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -21,7 +20,7 @@ import ( type DomainSimpleActor struct { // entitlements - Entitlements []*DomainEntity `json:"entitlements"` + Entitlements []DomainEntity `json:"entitlements"` // id // Required: true @@ -44,10 +43,6 @@ type DomainSimpleActor struct { func (m *DomainSimpleActor) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateEntitlements(formats); err != nil { - res = append(res, err) - } - if err := m.validateID(formats); err != nil { res = append(res, err) } @@ -62,32 +57,6 @@ func (m *DomainSimpleActor) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainSimpleActor) validateEntitlements(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlements) { // not required - return nil - } - - for i := 0; i < len(m.Entitlements); i++ { - if swag.IsZero(m.Entitlements[i]) { // not required - continue - } - - if m.Entitlements[i] != nil { - if err := m.Entitlements[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - func (m *DomainSimpleActor) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { @@ -120,10 +89,6 @@ func (m *DomainSimpleActor) validateThumbnail(formats strfmt.Registry) error { func (m *DomainSimpleActor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateEntitlements(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateThumbnail(ctx, formats); err != nil { res = append(res, err) } @@ -134,31 +99,6 @@ func (m *DomainSimpleActor) ContextValidate(ctx context.Context, formats strfmt. return nil } -func (m *DomainSimpleActor) contextValidateEntitlements(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Entitlements); i++ { - - if m.Entitlements[i] != nil { - - if swag.IsZero(m.Entitlements[i]) { // not required - return nil - } - - if err := m.Entitlements[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - func (m *DomainSimpleActor) contextValidateThumbnail(ctx context.Context, formats strfmt.Registry) error { if m.Thumbnail != nil { diff --git a/falcon/models/domain_tweet_source.go b/falcon/models/domain_tweet_source.go deleted file mode 100644 index 9a89cab9..00000000 --- a/falcon/models/domain_tweet_source.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DomainTweetSource domain tweet source -// -// swagger:model domain.TweetSource -type DomainTweetSource struct { - - // The username of the tweet's author - // Required: true - AuthorName *string `json:"author_name"` - - // The language of the tweet - // Required: true - Language *string `json:"language"` - - // Populated for legacy source events - LegacySource DomainTweetSourceLegacySource `json:"legacy_source,omitempty"` - - // The link to the tweet - // Required: true - SourceLink *string `json:"source_link"` - - // The tweet ID - // Required: true - TweetID *int64 `json:"tweet_id"` -} - -// Validate validates this domain tweet source -func (m *DomainTweetSource) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthorName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLanguage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSourceLink(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTweetID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainTweetSource) validateAuthorName(formats strfmt.Registry) error { - - if err := validate.Required("author_name", "body", m.AuthorName); err != nil { - return err - } - - return nil -} - -func (m *DomainTweetSource) validateLanguage(formats strfmt.Registry) error { - - if err := validate.Required("language", "body", m.Language); err != nil { - return err - } - - return nil -} - -func (m *DomainTweetSource) validateSourceLink(formats strfmt.Registry) error { - - if err := validate.Required("source_link", "body", m.SourceLink); err != nil { - return err - } - - return nil -} - -func (m *DomainTweetSource) validateTweetID(formats strfmt.Registry) error { - - if err := validate.Required("tweet_id", "body", m.TweetID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this domain tweet source based on context it is used -func (m *DomainTweetSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainTweetSource) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainTweetSource) UnmarshalBinary(b []byte) error { - var res DomainTweetSource - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_update_rule_request_v1.go b/falcon/models/domain_update_rule_request_v1.go index 9bd6f6c8..dcd1cb93 100644 --- a/falcon/models/domain_update_rule_request_v1.go +++ b/falcon/models/domain_update_rule_request_v1.go @@ -19,6 +19,10 @@ import ( // swagger:model domain.UpdateRuleRequestV1 type DomainUpdateRuleRequestV1 struct { + // Monitor only for breach data. Must be accompanied by breach_monitoring_enabled:true. + // Required: true + BreachMonitorOnly *bool `json:"breach_monitor_only"` + // Whether to monitor for breach data. Available only for `Company Domains` and `Email addresses` rule topics. When enabled, ownership of the monitored domains or emails is required // Required: true BreachMonitoringEnabled *bool `json:"breach_monitoring_enabled"` @@ -52,6 +56,10 @@ type DomainUpdateRuleRequestV1 struct { func (m *DomainUpdateRuleRequestV1) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBreachMonitorOnly(formats); err != nil { + res = append(res, err) + } + if err := m.validateBreachMonitoringEnabled(formats); err != nil { res = append(res, err) } @@ -86,6 +94,15 @@ func (m *DomainUpdateRuleRequestV1) Validate(formats strfmt.Registry) error { return nil } +func (m *DomainUpdateRuleRequestV1) validateBreachMonitorOnly(formats strfmt.Registry) error { + + if err := validate.Required("breach_monitor_only", "body", m.BreachMonitorOnly); err != nil { + return err + } + + return nil +} + func (m *DomainUpdateRuleRequestV1) validateBreachMonitoringEnabled(formats strfmt.Registry) error { if err := validate.Required("breach_monitoring_enabled", "body", m.BreachMonitoringEnabled); err != nil { diff --git a/falcon/models/domain_user.go b/falcon/models/domain_user.go index 0b7f8363..db6fd2dd 100644 --- a/falcon/models/domain_user.go +++ b/falcon/models/domain_user.go @@ -8,8 +8,10 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // DomainUser domain user @@ -20,14 +22,25 @@ type DomainUser struct { // cid Cid string `json:"cid,omitempty"` - // email - Email string `json:"email,omitempty"` + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` // first name - FirstName string `json:"firstName,omitempty"` + FirstName string `json:"first_name,omitempty"` + + // last login at + // Format: date-time + LastLoginAt strfmt.DateTime `json:"last_login_at,omitempty"` // last name - LastName string `json:"lastName,omitempty"` + LastName string `json:"last_name,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // uid + UID string `json:"uid,omitempty"` // uuid UUID string `json:"uuid,omitempty"` @@ -35,6 +48,43 @@ type DomainUser struct { // Validate validates this domain user func (m *DomainUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastLoginAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainUser) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainUser) validateLastLoginAt(formats strfmt.Registry) error { + if swag.IsZero(m.LastLoginAt) { // not required + return nil + } + + if err := validate.FormatOf("last_login_at", "body", "date-time", m.LastLoginAt.String(), formats); err != nil { + return err + } + return nil } diff --git a/falcon/models/domain_user_action.go b/falcon/models/domain_user_action.go index c2663a0f..9fb3b5a0 100644 --- a/falcon/models/domain_user_action.go +++ b/falcon/models/domain_user_action.go @@ -21,9 +21,8 @@ import ( type DomainUserAction struct { // Action name - // Required: true // Enum: [reset_password reset_2fa] - ActionName *string `json:"action_name"` + ActionName string `json:"action_name,omitempty"` // Value for action, if any ActionValue string `json:"action_value,omitempty"` @@ -73,13 +72,12 @@ func (m *DomainUserAction) validateActionNameEnum(path, location string, value s } func (m *DomainUserAction) validateActionName(formats strfmt.Registry) error { - - if err := validate.Required("action_name", "body", m.ActionName); err != nil { - return err + if swag.IsZero(m.ActionName) { // not required + return nil } // value enum - if err := m.validateActionNameEnum("action_name", "body", *m.ActionName); err != nil { + if err := m.validateActionNameEnum("action_name", "body", m.ActionName); err != nil { return err } diff --git a/falcon/models/domain_user_action_request.go b/falcon/models/domain_user_action_request.go index 7c229e08..6ebc8eb7 100644 --- a/falcon/models/domain_user_action_request.go +++ b/falcon/models/domain_user_action_request.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// DomainUserActionRequest ID(s) of users the action(s) are to applied to +// DomainUserActionRequest ID(s) of users the action are to applied to // // swagger:model domain.UserActionRequest type DomainUserActionRequest struct { diff --git a/falcon/models/domain_vuln.go b/falcon/models/domain_vuln.go new file mode 100644 index 00000000..45ceeffa --- /dev/null +++ b/falcon/models/domain_vuln.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainVuln domain vuln +// +// swagger:model domain.Vuln +type DomainVuln struct { + + // CVE ID number with four or more digits in the sequence number portion of the ID, examples: CVE-1999-0067, CVE-2014-12345, CVE-2016-7654321 + // Required: true + Cve *string `json:"cve"` +} + +// Validate validates this domain vuln +func (m *DomainVuln) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCve(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainVuln) validateCve(formats strfmt.Registry) error { + + if err := validate.Required("cve", "body", m.Cve); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain vuln based on context it is used +func (m *DomainVuln) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainVuln) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainVuln) UnmarshalBinary(b []byte) error { + var res DomainVuln + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_vulnerability.go b/falcon/models/domain_vulnerability.go index 66f640a4..9d2cd545 100644 --- a/falcon/models/domain_vulnerability.go +++ b/falcon/models/domain_vulnerability.go @@ -7,7 +7,6 @@ package models import ( "context" - "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -20,71 +19,40 @@ import ( // swagger:model domain.Vulnerability type DomainVulnerability struct { - // List of products affected by vulnerability, specifying product and vendor - AffectedProducts []*DomainVulnerabilityAffectedProduct `json:"affected_products"` - - // Vulnerability community identifiers, which is usually populated for the most popular vulnerabilities - CommunityIdentifiers []string `json:"community_identifiers"` - - // CVE ID number with four or more digits in the sequence number portion of the ID, examples: CVE-1999-0067, CVE-2014-12345, CVE-2016-7654321 + // evaluated affected assets count // Required: true - Cve *string `json:"cve"` - - // Vulnerability severity score, according to Common Vulnerability Scoring System V2 - CvssV2Base string `json:"cvss_v2_base,omitempty"` - - // Vulnerability severity score, according to Common Vulnerability Scoring System V3 - CvssV3Base string `json:"cvss_v3_base,omitempty"` - - // Text description of the vulnerability - Description string `json:"description,omitempty"` - - // Exploit status of vulnerability, one of: unproven, available, easilyaccessible, activelyused - ExploitStatus string `json:"exploit_status,omitempty"` + EvaluatedAffectedAssetsCount *float64 `json:"evaluatedAffectedAssetsCount"` - // legacy field, not populated - Name string `json:"name,omitempty"` - - // Date when the vulnerability was published - PublishDate string `json:"publish_date,omitempty"` - - // Threat actors that exploits vulnerability - RelatedActors []*DomainVulnerabilityActor `json:"related_actors"` - - // Related finished Intelligence Reports to vulnerability, which usually describes the exploitation or attacks using those - RelatedReports []*DomainVulnerabilityReport `json:"related_reports"` - - // Malware Families (threats) that are known to be related to the vulnerability - RelatedThreats []*DomainVulnerabilityRelatedThreat `json:"related_threats"` + // exploit status + // Required: true + ExploitStatus *float64 `json:"exploitStatus"` - // Severity of the vulnerability, can be empty or one of: LOW, MEDIUM, HIGH, CRITICAL - Severity string `json:"severity,omitempty"` + // exprt rating + // Required: true + ExprtRating *string `json:"exprt_rating"` - // Date when the vulnerability was last time updated in the CrowdStrike's database - UpdatedTimestamp string `json:"updated_timestamp,omitempty"` + // total affected assets + // Required: true + TotalAffectedAssets *float64 `json:"totalAffectedAssets"` } // Validate validates this domain vulnerability func (m *DomainVulnerability) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateAffectedProducts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCve(formats); err != nil { + if err := m.validateEvaluatedAffectedAssetsCount(formats); err != nil { res = append(res, err) } - if err := m.validateRelatedActors(formats); err != nil { + if err := m.validateExploitStatus(formats); err != nil { res = append(res, err) } - if err := m.validateRelatedReports(formats); err != nil { + if err := m.validateExprtRating(formats); err != nil { res = append(res, err) } - if err := m.validateRelatedThreats(formats); err != nil { + if err := m.validateTotalAffectedAssets(formats); err != nil { res = append(res, err) } @@ -94,242 +62,44 @@ func (m *DomainVulnerability) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainVulnerability) validateAffectedProducts(formats strfmt.Registry) error { - if swag.IsZero(m.AffectedProducts) { // not required - return nil - } - - for i := 0; i < len(m.AffectedProducts); i++ { - if swag.IsZero(m.AffectedProducts[i]) { // not required - continue - } - - if m.AffectedProducts[i] != nil { - if err := m.AffectedProducts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affected_products" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affected_products" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} +func (m *DomainVulnerability) validateEvaluatedAffectedAssetsCount(formats strfmt.Registry) error { -func (m *DomainVulnerability) validateCve(formats strfmt.Registry) error { - - if err := validate.Required("cve", "body", m.Cve); err != nil { + if err := validate.Required("evaluatedAffectedAssetsCount", "body", m.EvaluatedAffectedAssetsCount); err != nil { return err } return nil } -func (m *DomainVulnerability) validateRelatedActors(formats strfmt.Registry) error { - if swag.IsZero(m.RelatedActors) { // not required - return nil - } - - for i := 0; i < len(m.RelatedActors); i++ { - if swag.IsZero(m.RelatedActors[i]) { // not required - continue - } - - if m.RelatedActors[i] != nil { - if err := m.RelatedActors[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("related_actors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("related_actors" + "." + strconv.Itoa(i)) - } - return err - } - } +func (m *DomainVulnerability) validateExploitStatus(formats strfmt.Registry) error { + if err := validate.Required("exploitStatus", "body", m.ExploitStatus); err != nil { + return err } return nil } -func (m *DomainVulnerability) validateRelatedReports(formats strfmt.Registry) error { - if swag.IsZero(m.RelatedReports) { // not required - return nil - } - - for i := 0; i < len(m.RelatedReports); i++ { - if swag.IsZero(m.RelatedReports[i]) { // not required - continue - } - - if m.RelatedReports[i] != nil { - if err := m.RelatedReports[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("related_reports" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("related_reports" + "." + strconv.Itoa(i)) - } - return err - } - } +func (m *DomainVulnerability) validateExprtRating(formats strfmt.Registry) error { + if err := validate.Required("exprt_rating", "body", m.ExprtRating); err != nil { + return err } return nil } -func (m *DomainVulnerability) validateRelatedThreats(formats strfmt.Registry) error { - if swag.IsZero(m.RelatedThreats) { // not required - return nil - } - - for i := 0; i < len(m.RelatedThreats); i++ { - if swag.IsZero(m.RelatedThreats[i]) { // not required - continue - } - - if m.RelatedThreats[i] != nil { - if err := m.RelatedThreats[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("related_threats" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("related_threats" + "." + strconv.Itoa(i)) - } - return err - } - } +func (m *DomainVulnerability) validateTotalAffectedAssets(formats strfmt.Registry) error { + if err := validate.Required("totalAffectedAssets", "body", m.TotalAffectedAssets); err != nil { + return err } return nil } -// ContextValidate validate this domain vulnerability based on the context it is used +// ContextValidate validates this domain vulnerability based on context it is used func (m *DomainVulnerability) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAffectedProducts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRelatedActors(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRelatedReports(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRelatedThreats(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainVulnerability) contextValidateAffectedProducts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.AffectedProducts); i++ { - - if m.AffectedProducts[i] != nil { - - if swag.IsZero(m.AffectedProducts[i]) { // not required - return nil - } - - if err := m.AffectedProducts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affected_products" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affected_products" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainVulnerability) contextValidateRelatedActors(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.RelatedActors); i++ { - - if m.RelatedActors[i] != nil { - - if swag.IsZero(m.RelatedActors[i]) { // not required - return nil - } - - if err := m.RelatedActors[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("related_actors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("related_actors" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainVulnerability) contextValidateRelatedReports(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.RelatedReports); i++ { - - if m.RelatedReports[i] != nil { - - if swag.IsZero(m.RelatedReports[i]) { // not required - return nil - } - - if err := m.RelatedReports[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("related_reports" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("related_reports" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DomainVulnerability) contextValidateRelatedThreats(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.RelatedThreats); i++ { - - if m.RelatedThreats[i] != nil { - - if swag.IsZero(m.RelatedThreats[i]) { // not required - return nil - } - - if err := m.RelatedThreats[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("related_threats" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("related_threats" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - return nil } diff --git a/falcon/models/domain_vulnerability_actor.go b/falcon/models/domain_vulnerability_actor.go deleted file mode 100644 index d342ba65..00000000 --- a/falcon/models/domain_vulnerability_actor.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DomainVulnerabilityActor domain vulnerability actor -// -// swagger:model domain.VulnerabilityActor -type DomainVulnerabilityActor struct { - - // Actor internal ID, consisting of it's name with spaces removed - ID string `json:"id,omitempty"` - - // Actor name, composed of 2 uppercase words - Name string `json:"name,omitempty"` -} - -// Validate validates this domain vulnerability actor -func (m *DomainVulnerabilityActor) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this domain vulnerability actor based on context it is used -func (m *DomainVulnerabilityActor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainVulnerabilityActor) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainVulnerabilityActor) UnmarshalBinary(b []byte) error { - var res DomainVulnerabilityActor - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_vulnerability_affected_product.go b/falcon/models/domain_vulnerability_affected_product.go deleted file mode 100644 index 59770de8..00000000 --- a/falcon/models/domain_vulnerability_affected_product.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DomainVulnerabilityAffectedProduct domain vulnerability affected product -// -// swagger:model domain.VulnerabilityAffectedProduct -type DomainVulnerabilityAffectedProduct struct { - - // Lowercase product name that vulnerability affects - Product string `json:"product,omitempty"` - - // Lowercase vendor name that develops or provides the affected product - Vendor string `json:"vendor,omitempty"` -} - -// Validate validates this domain vulnerability affected product -func (m *DomainVulnerabilityAffectedProduct) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this domain vulnerability affected product based on context it is used -func (m *DomainVulnerabilityAffectedProduct) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainVulnerabilityAffectedProduct) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainVulnerabilityAffectedProduct) UnmarshalBinary(b []byte) error { - var res DomainVulnerabilityAffectedProduct - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_vulnerability_related_threat.go b/falcon/models/domain_vulnerability_related_threat.go deleted file mode 100644 index 596461d0..00000000 --- a/falcon/models/domain_vulnerability_related_threat.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DomainVulnerabilityRelatedThreat domain vulnerability related threat -// -// swagger:model domain.VulnerabilityRelatedThreat -type DomainVulnerabilityRelatedThreat struct { - - // List of malware family or threat capabilities - Capabilities []string `json:"capabilities"` - - // Malware Family or Threat Name - Name string `json:"name,omitempty"` -} - -// Validate validates this domain vulnerability related threat -func (m *DomainVulnerabilityRelatedThreat) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this domain vulnerability related threat based on context it is used -func (m *DomainVulnerabilityRelatedThreat) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainVulnerabilityRelatedThreat) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainVulnerabilityRelatedThreat) UnmarshalBinary(b []byte) error { - var res DomainVulnerabilityRelatedThreat - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_vulnerability_report.go b/falcon/models/domain_vulnerability_report.go deleted file mode 100644 index adfbe4f4..00000000 --- a/falcon/models/domain_vulnerability_report.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DomainVulnerabilityReport domain vulnerability report -// -// swagger:model domain.VulnerabilityReport -type DomainVulnerabilityReport struct { - - // Report serial ID, composed of 2 parts separated with dash, example: CSA-20000, CSIT-220000 - SerialID string `json:"serial_id,omitempty"` - - // legacy, not populated field - Title string `json:"title,omitempty"` -} - -// Validate validates this domain vulnerability report -func (m *DomainVulnerabilityReport) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this domain vulnerability report based on context it is used -func (m *DomainVulnerabilityReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainVulnerabilityReport) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainVulnerabilityReport) UnmarshalBinary(b []byte) error { - var res DomainVulnerabilityReport - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/ecs_categorization.go b/falcon/models/ecs_categorization.go new file mode 100644 index 00000000..b71889d3 --- /dev/null +++ b/falcon/models/ecs_categorization.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EcsCategorization ecs categorization +// +// swagger:model ecs.Categorization +type EcsCategorization struct { + + // categories + // Required: true + Categories []string `json:"Categories"` + + // kind + // Required: true + Kind *string `json:"Kind"` + + // outcome + // Required: true + Outcome *string `json:"Outcome"` + + // types + // Required: true + Types []string `json:"Types"` +} + +// Validate validates this ecs categorization +func (m *EcsCategorization) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCategories(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKind(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOutcome(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTypes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EcsCategorization) validateCategories(formats strfmt.Registry) error { + + if err := validate.Required("Categories", "body", m.Categories); err != nil { + return err + } + + return nil +} + +func (m *EcsCategorization) validateKind(formats strfmt.Registry) error { + + if err := validate.Required("Kind", "body", m.Kind); err != nil { + return err + } + + return nil +} + +func (m *EcsCategorization) validateOutcome(formats strfmt.Registry) error { + + if err := validate.Required("Outcome", "body", m.Outcome); err != nil { + return err + } + + return nil +} + +func (m *EcsCategorization) validateTypes(formats strfmt.Registry) error { + + if err := validate.Required("Types", "body", m.Types); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this ecs categorization based on context it is used +func (m *EcsCategorization) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EcsCategorization) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EcsCategorization) UnmarshalBinary(b []byte) error { + var res EcsCategorization + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/executions_trigger_result.go b/falcon/models/executions_trigger_result.go index 592c766e..98ccf3a8 100644 --- a/falcon/models/executions_trigger_result.go +++ b/falcon/models/executions_trigger_result.go @@ -30,7 +30,7 @@ type ExecutionsTriggerResult struct { Name *string `json:"name"` // Opaque blob for result of trigger. Structured according to the trigger's JSON schema'. - Result string `json:"result,omitempty"` + Result interface{} `json:"result,omitempty"` } // Validate validates this executions trigger result diff --git a/falcon/models/falconx_report_v1.go b/falcon/models/falconx_report_v1.go index ffc663d8..b98c6f79 100644 --- a/falcon/models/falconx_report_v1.go +++ b/falcon/models/falconx_report_v1.go @@ -25,6 +25,9 @@ type FalconxReportV1 struct { // created timestamp CreatedTimestamp string `json:"created_timestamp,omitempty"` + // has recording + HasRecording bool `json:"has_recording,omitempty"` + // id ID string `json:"id,omitempty"` diff --git a/falcon/models/falconx_sandbox_parameters_v1.go b/falcon/models/falconx_sandbox_parameters_v1.go index 7a997b0f..f0078c36 100644 --- a/falcon/models/falconx_sandbox_parameters_v1.go +++ b/falcon/models/falconx_sandbox_parameters_v1.go @@ -20,6 +20,9 @@ type FalconxSandboxParametersV1 struct { // action script ActionScript string `json:"action_script,omitempty"` + // browser + Browser string `json:"browser,omitempty"` + // command line CommandLine string `json:"command_line,omitempty"` diff --git a/falcon/models/falconx_summary_report_v1.go b/falcon/models/falconx_summary_report_v1.go index 549f8291..99eb4ff2 100644 --- a/falcon/models/falconx_summary_report_v1.go +++ b/falcon/models/falconx_summary_report_v1.go @@ -25,6 +25,9 @@ type FalconxSummaryReportV1 struct { // created timestamp CreatedTimestamp string `json:"created_timestamp,omitempty"` + // has recording + HasRecording bool `json:"has_recording,omitempty"` + // id ID string `json:"id,omitempty"` diff --git a/falcon/models/graph_multi.go b/falcon/models/graph_multi.go index 082b1d28..6b91e494 100644 --- a/falcon/models/graph_multi.go +++ b/falcon/models/graph_multi.go @@ -34,6 +34,9 @@ type GraphMulti struct { // Maximum number of iterations allowed in sub model // Required: true MaxIterationCount *int32 `json:"max_iteration_count"` + + // Indicates the loop will run sequentially + Sequential bool `json:"sequential,omitempty"` } // Validate validates this graph multi diff --git a/falcon/models/graph_validation_error.go b/falcon/models/graph_validation_error.go index 3e3f9565..26ea3b09 100644 --- a/falcon/models/graph_validation_error.go +++ b/falcon/models/graph_validation_error.go @@ -40,6 +40,9 @@ type GraphValidationError struct { // Used to specify an exact property that is invalid for fql evaluation Property string `json:"property,omitempty"` + + // Resouce ID for property if it exists, e.g. trigger ID or activity ID + ResourceID string `json:"resource_id,omitempty"` } // Validate validates this graph validation error diff --git a/falcon/models/host_groups_update_group_req_v1.go b/falcon/models/host_groups_update_group_req_v1.go index 049a240d..547df369 100644 --- a/falcon/models/host_groups_update_group_req_v1.go +++ b/falcon/models/host_groups_update_group_req_v1.go @@ -20,7 +20,7 @@ import ( type HostGroupsUpdateGroupReqV1 struct { // The new assignment rule of the group. Note: If the group type is static, this field cannot be updated manually - AssignmentRule string `json:"assignment_rule,omitempty"` + AssignmentRule *string `json:"assignment_rule,omitempty"` // The new description of the group Description string `json:"description,omitempty"` diff --git a/falcon/models/images_ext_combined_images_response.go b/falcon/models/images_ext_combined_images_response.go index f92fda38..2d317817 100644 --- a/falcon/models/images_ext_combined_images_response.go +++ b/falcon/models/images_ext_combined_images_response.go @@ -17,7 +17,7 @@ import ( // ImagesExtCombinedImagesResponse images ext combined images response // -// swagger:model images.extCombinedImagesResponse +// swagger:model images.ExtCombinedImagesResponse type ImagesExtCombinedImagesResponse struct { // errors diff --git a/falcon/models/jsonschema_condition_group_fields.go b/falcon/models/jsonschema_condition_group_fields.go index ca015402..5f99e565 100644 --- a/falcon/models/jsonschema_condition_group_fields.go +++ b/falcon/models/jsonschema_condition_group_fields.go @@ -30,6 +30,9 @@ type JsonschemaConditionGroupFields struct { // dependent control DependentControl string `json:"dependent_control,omitempty"` + // requires meta + RequiresMeta string `json:"requires_meta,omitempty"` + // reset fields ResetFields *JsonschemaResetFields `json:"reset_fields,omitempty"` } diff --git a/falcon/models/jsonschema_sub_schema.go b/falcon/models/jsonschema_sub_schema.go index 861fb178..3e6de678 100644 --- a/falcon/models/jsonschema_sub_schema.go +++ b/falcon/models/jsonschema_sub_schema.go @@ -158,6 +158,9 @@ type JsonschemaSubSchema struct { // x cs do not hide XCsDoNotHide bool `json:"x-cs-do-not-hide,omitempty"` + // x cs immutable + XCsImmutable bool `json:"x-cs-immutable,omitempty"` + // x cs indexable XCsIndexable bool `json:"x-cs-indexable,omitempty"` @@ -194,6 +197,9 @@ type JsonschemaSubSchema struct { // x cs tags XCsTags []string `json:"x-cs-tags"` + // x cs ui + XCsUI *JsonschemaUIExtensions `json:"x-cs-ui,omitempty"` + // x cs workflow XCsWorkflow *JsonschemaWorkflowExtensions `json:"x-cs-workflow,omitempty"` } @@ -270,6 +276,10 @@ func (m *JsonschemaSubSchema) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateXCsUI(formats); err != nil { + res = append(res, err) + } + if err := m.validateXCsWorkflow(formats); err != nil { res = append(res, err) } @@ -652,6 +662,25 @@ func (m *JsonschemaSubSchema) validateXCsSignals(formats strfmt.Registry) error return nil } +func (m *JsonschemaSubSchema) validateXCsUI(formats strfmt.Registry) error { + if swag.IsZero(m.XCsUI) { // not required + return nil + } + + if m.XCsUI != nil { + if err := m.XCsUI.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("x-cs-ui") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("x-cs-ui") + } + return err + } + } + + return nil +} + func (m *JsonschemaSubSchema) validateXCsWorkflow(formats strfmt.Registry) error { if swag.IsZero(m.XCsWorkflow) { // not required return nil @@ -743,6 +772,10 @@ func (m *JsonschemaSubSchema) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateXCsUI(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateXCsWorkflow(ctx, formats); err != nil { res = append(res, err) } @@ -1108,6 +1141,27 @@ func (m *JsonschemaSubSchema) contextValidateXCsSignals(ctx context.Context, for return nil } +func (m *JsonschemaSubSchema) contextValidateXCsUI(ctx context.Context, formats strfmt.Registry) error { + + if m.XCsUI != nil { + + if swag.IsZero(m.XCsUI) { // not required + return nil + } + + if err := m.XCsUI.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("x-cs-ui") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("x-cs-ui") + } + return err + } + } + + return nil +} + func (m *JsonschemaSubSchema) contextValidateXCsWorkflow(ctx context.Context, formats strfmt.Registry) error { if m.XCsWorkflow != nil { diff --git a/falcon/models/jsonschema_ui_extensions.go b/falcon/models/jsonschema_ui_extensions.go new file mode 100644 index 00000000..5cad0d40 --- /dev/null +++ b/falcon/models/jsonschema_ui_extensions.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JsonschemaUIExtensions jsonschema UI extensions +// +// swagger:model jsonschema.UIExtensions +type JsonschemaUIExtensions struct { + + // helper text + HelperText string `json:"helperText,omitempty"` +} + +// Validate validates this jsonschema UI extensions +func (m *JsonschemaUIExtensions) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this jsonschema UI extensions based on context it is used +func (m *JsonschemaUIExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JsonschemaUIExtensions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JsonschemaUIExtensions) UnmarshalBinary(b []byte) error { + var res JsonschemaUIExtensions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_cluster_enrichment_data.go b/falcon/models/k8sassets_cluster_enrichment_data.go index b6fd0403..89703f80 100644 --- a/falcon/models/k8sassets_cluster_enrichment_data.go +++ b/falcon/models/k8sassets_cluster_enrichment_data.go @@ -23,6 +23,10 @@ type K8sassetsClusterEnrichmentData struct { // Required: true ContainerCount *int64 `json:"container_count"` + // image count + // Required: true + ImageCount *int64 `json:"image_count"` + // node count // Required: true NodeCount *int64 `json:"node_count"` @@ -40,6 +44,10 @@ func (m *K8sassetsClusterEnrichmentData) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateImageCount(formats); err != nil { + res = append(res, err) + } + if err := m.validateNodeCount(formats); err != nil { res = append(res, err) } @@ -63,6 +71,15 @@ func (m *K8sassetsClusterEnrichmentData) validateContainerCount(formats strfmt.R return nil } +func (m *K8sassetsClusterEnrichmentData) validateImageCount(formats strfmt.Registry) error { + + if err := validate.Required("image_count", "body", m.ImageCount); err != nil { + return err + } + + return nil +} + func (m *K8sassetsClusterEnrichmentData) validateNodeCount(formats strfmt.Registry) error { if err := validate.Required("node_count", "body", m.NodeCount); err != nil { diff --git a/falcon/models/k8sassets_container_enrichment_data.go b/falcon/models/k8sassets_container_enrichment_data.go deleted file mode 100644 index c83e5e80..00000000 --- a/falcon/models/k8sassets_container_enrichment_data.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// K8sassetsContainerEnrichmentData k8sassets container enrichment data -// -// swagger:model k8sassets.ContainerEnrichmentData -type K8sassetsContainerEnrichmentData struct { - - // agents - // Required: true - Agents []K8sassetsContainerEnrichmentDataAgents `json:"agents"` -} - -// Validate validates this k8sassets container enrichment data -func (m *K8sassetsContainerEnrichmentData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsContainerEnrichmentData) validateAgents(formats strfmt.Registry) error { - - if err := validate.Required("agents", "body", m.Agents); err != nil { - return err - } - - for i := 0; i < len(m.Agents); i++ { - - if m.Agents[i] != nil { - if err := m.Agents[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this k8sassets container enrichment data based on the context it is used -func (m *K8sassetsContainerEnrichmentData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsContainerEnrichmentData) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Agents); i++ { - - if swag.IsZero(m.Agents[i]) { // not required - return nil - } - - if err := m.Agents[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *K8sassetsContainerEnrichmentData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *K8sassetsContainerEnrichmentData) UnmarshalBinary(b []byte) error { - var res K8sassetsContainerEnrichmentData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/k8sassets_container_enrichment_data_agents.go b/falcon/models/k8sassets_container_enrichment_data_agents.go deleted file mode 100644 index 151471aa..00000000 --- a/falcon/models/k8sassets_container_enrichment_data_agents.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// K8sassetsContainerEnrichmentDataAgents k8sassets container enrichment data agents -// -// swagger:model k8sassets.ContainerEnrichmentData.agents -type K8sassetsContainerEnrichmentDataAgents map[string]string - -// Validate validates this k8sassets container enrichment data agents -func (m K8sassetsContainerEnrichmentDataAgents) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this k8sassets container enrichment data agents based on context it is used -func (m K8sassetsContainerEnrichmentDataAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/falcon/models/k8sassets_container_enrichment_entry.go b/falcon/models/k8sassets_container_enrichment_entry.go deleted file mode 100644 index decd703b..00000000 --- a/falcon/models/k8sassets_container_enrichment_entry.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// K8sassetsContainerEnrichmentEntry k8sassets container enrichment entry -// -// swagger:model k8sassets.ContainerEnrichmentEntry -type K8sassetsContainerEnrichmentEntry struct { - - // container id - // Required: true - ContainerID *string `json:"container_id"` - - // enrichment data - // Required: true - EnrichmentData *K8sassetsContainerEnrichmentData `json:"enrichment_data"` -} - -// Validate validates this k8sassets container enrichment entry -func (m *K8sassetsContainerEnrichmentEntry) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContainerID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrichmentData(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsContainerEnrichmentEntry) validateContainerID(formats strfmt.Registry) error { - - if err := validate.Required("container_id", "body", m.ContainerID); err != nil { - return err - } - - return nil -} - -func (m *K8sassetsContainerEnrichmentEntry) validateEnrichmentData(formats strfmt.Registry) error { - - if err := validate.Required("enrichment_data", "body", m.EnrichmentData); err != nil { - return err - } - - if m.EnrichmentData != nil { - if err := m.EnrichmentData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrichment_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrichment_data") - } - return err - } - } - - return nil -} - -// ContextValidate validate this k8sassets container enrichment entry based on the context it is used -func (m *K8sassetsContainerEnrichmentEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsContainerEnrichmentEntry) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { - - if m.EnrichmentData != nil { - - if err := m.EnrichmentData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrichment_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrichment_data") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *K8sassetsContainerEnrichmentEntry) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *K8sassetsContainerEnrichmentEntry) UnmarshalBinary(b []byte) error { - var res K8sassetsContainerEnrichmentEntry - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/k8sassets_deployment_enrichment_data.go b/falcon/models/k8sassets_deployment_enrichment_data.go deleted file mode 100644 index c8183322..00000000 --- a/falcon/models/k8sassets_deployment_enrichment_data.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// K8sassetsDeploymentEnrichmentData k8sassets deployment enrichment data -// -// swagger:model k8sassets.DeploymentEnrichmentData -type K8sassetsDeploymentEnrichmentData struct { - - // pod count - // Required: true - PodCount *int64 `json:"pod_count"` -} - -// Validate validates this k8sassets deployment enrichment data -func (m *K8sassetsDeploymentEnrichmentData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePodCount(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsDeploymentEnrichmentData) validatePodCount(formats strfmt.Registry) error { - - if err := validate.Required("pod_count", "body", m.PodCount); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this k8sassets deployment enrichment data based on context it is used -func (m *K8sassetsDeploymentEnrichmentData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *K8sassetsDeploymentEnrichmentData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *K8sassetsDeploymentEnrichmentData) UnmarshalBinary(b []byte) error { - var res K8sassetsDeploymentEnrichmentData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/k8sassets_deployment_enrichment_entry.go b/falcon/models/k8sassets_deployment_enrichment_entry.go deleted file mode 100644 index a84b9feb..00000000 --- a/falcon/models/k8sassets_deployment_enrichment_entry.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// K8sassetsDeploymentEnrichmentEntry k8sassets deployment enrichment entry -// -// swagger:model k8sassets.DeploymentEnrichmentEntry -type K8sassetsDeploymentEnrichmentEntry struct { - - // deployment id - // Required: true - DeploymentID *string `json:"deployment_id"` - - // enrichment data - // Required: true - EnrichmentData *K8sassetsDeploymentEnrichmentData `json:"enrichment_data"` -} - -// Validate validates this k8sassets deployment enrichment entry -func (m *K8sassetsDeploymentEnrichmentEntry) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeploymentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrichmentData(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsDeploymentEnrichmentEntry) validateDeploymentID(formats strfmt.Registry) error { - - if err := validate.Required("deployment_id", "body", m.DeploymentID); err != nil { - return err - } - - return nil -} - -func (m *K8sassetsDeploymentEnrichmentEntry) validateEnrichmentData(formats strfmt.Registry) error { - - if err := validate.Required("enrichment_data", "body", m.EnrichmentData); err != nil { - return err - } - - if m.EnrichmentData != nil { - if err := m.EnrichmentData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrichment_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrichment_data") - } - return err - } - } - - return nil -} - -// ContextValidate validate this k8sassets deployment enrichment entry based on the context it is used -func (m *K8sassetsDeploymentEnrichmentEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsDeploymentEnrichmentEntry) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { - - if m.EnrichmentData != nil { - - if err := m.EnrichmentData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrichment_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrichment_data") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *K8sassetsDeploymentEnrichmentEntry) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *K8sassetsDeploymentEnrichmentEntry) UnmarshalBinary(b []byte) error { - var res K8sassetsDeploymentEnrichmentEntry - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/k8sassets_pod_enrichment_data.go b/falcon/models/k8sassets_pod_enrichment_data.go deleted file mode 100644 index fa177891..00000000 --- a/falcon/models/k8sassets_pod_enrichment_data.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// K8sassetsPodEnrichmentData k8sassets pod enrichment data -// -// swagger:model k8sassets.PodEnrichmentData -type K8sassetsPodEnrichmentData struct { - - // container count - // Required: true - ContainerCount *int64 `json:"container_count"` - - // container info - // Required: true - ContainerInfo []*K8sassetsContainerInfo `json:"container_info"` - - // deployment id - // Required: true - DeploymentID *string `json:"deployment_id"` -} - -// Validate validates this k8sassets pod enrichment data -func (m *K8sassetsPodEnrichmentData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContainerCount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContainerInfo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeploymentID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsPodEnrichmentData) validateContainerCount(formats strfmt.Registry) error { - - if err := validate.Required("container_count", "body", m.ContainerCount); err != nil { - return err - } - - return nil -} - -func (m *K8sassetsPodEnrichmentData) validateContainerInfo(formats strfmt.Registry) error { - - if err := validate.Required("container_info", "body", m.ContainerInfo); err != nil { - return err - } - - for i := 0; i < len(m.ContainerInfo); i++ { - if swag.IsZero(m.ContainerInfo[i]) { // not required - continue - } - - if m.ContainerInfo[i] != nil { - if err := m.ContainerInfo[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("container_info" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("container_info" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *K8sassetsPodEnrichmentData) validateDeploymentID(formats strfmt.Registry) error { - - if err := validate.Required("deployment_id", "body", m.DeploymentID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this k8sassets pod enrichment data based on the context it is used -func (m *K8sassetsPodEnrichmentData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateContainerInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsPodEnrichmentData) contextValidateContainerInfo(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ContainerInfo); i++ { - - if m.ContainerInfo[i] != nil { - - if swag.IsZero(m.ContainerInfo[i]) { // not required - return nil - } - - if err := m.ContainerInfo[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("container_info" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("container_info" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *K8sassetsPodEnrichmentData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *K8sassetsPodEnrichmentData) UnmarshalBinary(b []byte) error { - var res K8sassetsPodEnrichmentData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/k8sassets_pod_enrichment_entry.go b/falcon/models/k8sassets_pod_enrichment_entry.go deleted file mode 100644 index 96875a3e..00000000 --- a/falcon/models/k8sassets_pod_enrichment_entry.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// K8sassetsPodEnrichmentEntry k8sassets pod enrichment entry -// -// swagger:model k8sassets.PodEnrichmentEntry -type K8sassetsPodEnrichmentEntry struct { - - // enrichment data - // Required: true - EnrichmentData *K8sassetsPodEnrichmentData `json:"enrichment_data"` - - // pod id - // Required: true - PodID *string `json:"pod_id"` -} - -// Validate validates this k8sassets pod enrichment entry -func (m *K8sassetsPodEnrichmentEntry) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEnrichmentData(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePodID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsPodEnrichmentEntry) validateEnrichmentData(formats strfmt.Registry) error { - - if err := validate.Required("enrichment_data", "body", m.EnrichmentData); err != nil { - return err - } - - if m.EnrichmentData != nil { - if err := m.EnrichmentData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrichment_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrichment_data") - } - return err - } - } - - return nil -} - -func (m *K8sassetsPodEnrichmentEntry) validatePodID(formats strfmt.Registry) error { - - if err := validate.Required("pod_id", "body", m.PodID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this k8sassets pod enrichment entry based on the context it is used -func (m *K8sassetsPodEnrichmentEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *K8sassetsPodEnrichmentEntry) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { - - if m.EnrichmentData != nil { - - if err := m.EnrichmentData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrichment_data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrichment_data") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *K8sassetsPodEnrichmentEntry) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *K8sassetsPodEnrichmentEntry) UnmarshalBinary(b []byte) error { - var res K8sassetsPodEnrichmentEntry - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/models_api_customer_and_image.go b/falcon/models/models_api_customer_and_image.go index ce7bdd01..e431159c 100644 --- a/falcon/models/models_api_customer_and_image.go +++ b/falcon/models/models_api_customer_and_image.go @@ -85,6 +85,10 @@ type ModelsAPICustomerAndImage struct { // uuid // Required: true UUID *string `json:"uuid"` + + // warning + // Required: true + Warning *int32 `json:"warning"` } // Validate validates this models API customer and image @@ -159,6 +163,10 @@ func (m *ModelsAPICustomerAndImage) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateWarning(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -328,6 +336,15 @@ func (m *ModelsAPICustomerAndImage) validateUUID(formats strfmt.Registry) error return nil } +func (m *ModelsAPICustomerAndImage) validateWarning(formats strfmt.Registry) error { + + if err := validate.Required("warning", "body", m.Warning); err != nil { + return err + } + + return nil +} + // ContextValidate validate this models API customer and image based on the context it is used func (m *ModelsAPICustomerAndImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error diff --git a/falcon/models/models_application_library.go b/falcon/models/models_application_library.go index 27d94964..cf37071c 100644 --- a/falcon/models/models_application_library.go +++ b/falcon/models/models_application_library.go @@ -20,12 +20,6 @@ type ModelsApplicationLibrary struct { // hash Hash string `json:"Hash,omitempty"` - // layer hash - LayerHash string `json:"LayerHash,omitempty"` - - // layer index - LayerIndex int32 `json:"LayerIndex,omitempty"` - // license License string `json:"License,omitempty"` diff --git a/falcon/models/models_cluster.go b/falcon/models/models_cluster.go index d71be6cc..d2c7ab18 100644 --- a/falcon/models/models_cluster.go +++ b/falcon/models/models_cluster.go @@ -72,6 +72,10 @@ type ModelsCluster struct { // Required: true FirstSeen *string `json:"first_seen"` + // iar coverage + // Required: true + IarCoverage *bool `json:"iar_coverage"` + // kubernetes version // Required: true KubernetesVersion *string `json:"kubernetes_version"` @@ -165,6 +169,10 @@ func (m *ModelsCluster) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateIarCoverage(formats); err != nil { + res = append(res, err) + } + if err := m.validateKubernetesVersion(formats); err != nil { res = append(res, err) } @@ -339,6 +347,15 @@ func (m *ModelsCluster) validateFirstSeen(formats strfmt.Registry) error { return nil } +func (m *ModelsCluster) validateIarCoverage(formats strfmt.Registry) error { + + if err := validate.Required("iar_coverage", "body", m.IarCoverage); err != nil { + return err + } + + return nil +} + func (m *ModelsCluster) validateKubernetesVersion(formats strfmt.Registry) error { if err := validate.Required("kubernetes_version", "body", m.KubernetesVersion); err != nil { diff --git a/falcon/models/models_container_image.go b/falcon/models/models_container_image.go index a5d7f4d0..432faa68 100644 --- a/falcon/models/models_container_image.go +++ b/falcon/models/models_container_image.go @@ -23,6 +23,10 @@ type ModelsContainerImage struct { // Required: true Cid *string `json:"cid"` + // cluster ids + // Required: true + ClusterIds []string `json:"cluster_ids"` + // container count // Required: true ContainerCount *int32 `json:"container_count"` @@ -92,6 +96,10 @@ func (m *ModelsContainerImage) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateClusterIds(formats); err != nil { + res = append(res, err) + } + if err := m.validateContainerCount(formats); err != nil { res = append(res, err) } @@ -167,6 +175,15 @@ func (m *ModelsContainerImage) validateCid(formats strfmt.Registry) error { return nil } +func (m *ModelsContainerImage) validateClusterIds(formats strfmt.Registry) error { + + if err := validate.Required("cluster_ids", "body", m.ClusterIds); err != nil { + return err + } + + return nil +} + func (m *ModelsContainerImage) validateContainerCount(formats strfmt.Registry) error { if err := validate.Required("container_count", "body", m.ContainerCount); err != nil { diff --git a/falcon/models/models_create_deployment_input.go b/falcon/models/models_create_deployment_input.go new file mode 100644 index 00000000..f6b26af1 --- /dev/null +++ b/falcon/models/models_create_deployment_input.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsCreateDeploymentInput models create deployment input +// +// swagger:model models.CreateDeploymentInput +type ModelsCreateDeploymentInput struct { + + // resources + // Required: true + Resources []*ModelsDeploymentResource `json:"resources"` +} + +// Validate validates this models create deployment input +func (m *ModelsCreateDeploymentInput) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsCreateDeploymentInput) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this models create deployment input based on the context it is used +func (m *ModelsCreateDeploymentInput) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsCreateDeploymentInput) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsCreateDeploymentInput) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsCreateDeploymentInput) UnmarshalBinary(b []byte) error { + var res ModelsCreateDeploymentInput + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_deployment_resource.go b/falcon/models/models_deployment_resource.go new file mode 100644 index 00000000..83f56826 --- /dev/null +++ b/falcon/models/models_deployment_resource.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsDeploymentResource models deployment resource +// +// swagger:model models.DeploymentResource +type ModelsDeploymentResource struct { + + // account id + // Required: true + AccountID *string `json:"account_id"` + + // asset identifier + // Required: true + AssetIdentifier *string `json:"asset_identifier"` + + // cloud provider + // Required: true + CloudProvider *string `json:"cloud_provider"` + + // region + // Required: true + Region *string `json:"region"` +} + +// Validate validates this models deployment resource +func (m *ModelsDeploymentResource) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccountID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssetIdentifier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudProvider(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsDeploymentResource) validateAccountID(formats strfmt.Registry) error { + + if err := validate.Required("account_id", "body", m.AccountID); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeploymentResource) validateAssetIdentifier(formats strfmt.Registry) error { + + if err := validate.Required("asset_identifier", "body", m.AssetIdentifier); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeploymentResource) validateCloudProvider(formats strfmt.Registry) error { + + if err := validate.Required("cloud_provider", "body", m.CloudProvider); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeploymentResource) validateRegion(formats strfmt.Registry) error { + + if err := validate.Required("region", "body", m.Region); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models deployment resource based on context it is used +func (m *ModelsDeploymentResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsDeploymentResource) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsDeploymentResource) UnmarshalBinary(b []byte) error { + var res ModelsDeploymentResource + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_detection.go b/falcon/models/models_detection.go new file mode 100644 index 00000000..b71dd5b2 --- /dev/null +++ b/falcon/models/models_detection.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsDetection models detection +// +// swagger:model models.Detection +type ModelsDetection struct { + + // description + // Required: true + Description *string `json:"description"` + + // details + // Required: true + Details interface{} `json:"details"` + + // hash + // Required: true + Hash *string `json:"hash"` + + // id + // Required: true + ID *string `json:"id"` + + // name + // Required: true + Name *string `json:"name"` + + // path + // Required: true + Path *string `json:"path"` + + // remediation + // Required: true + Remediation *string `json:"remediation"` + + // severity + // Required: true + Severity *string `json:"severity"` + + // title + // Required: true + Title *string `json:"title"` + + // type + // Required: true + Type *int32 `json:"type"` +} + +// Validate validates this models detection +func (m *ModelsDetection) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetails(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePath(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsDetection) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validateDetails(formats strfmt.Registry) error { + + if m.Details == nil { + return errors.Required("details", "body", nil) + } + + return nil +} + +func (m *ModelsDetection) validateHash(formats strfmt.Registry) error { + + if err := validate.Required("hash", "body", m.Hash); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validatePath(formats strfmt.Registry) error { + + if err := validate.Required("path", "body", m.Path); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validateRemediation(formats strfmt.Registry) error { + + if err := validate.Required("remediation", "body", m.Remediation); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetection) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models detection based on context it is used +func (m *ModelsDetection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsDetection) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsDetection) UnmarshalBinary(b []byte) error { + var res ModelsDetection + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_detection_engine_info_type.go b/falcon/models/models_detection_engine_info_type.go new file mode 100644 index 00000000..f7a3fe18 --- /dev/null +++ b/falcon/models/models_detection_engine_info_type.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsDetectionEngineInfoType models detection engine info type +// +// swagger:model models.DetectionEngineInfoType +type ModelsDetectionEngineInfoType struct { + + // apk static version + // Required: true + ApkStaticVersion *string `json:"ApkStaticVersion"` + + // engine version + // Required: true + EngineVersion *string `json:"EngineVersion"` + + // performed at + // Required: true + // Format: date-time + PerformedAt *strfmt.DateTime `json:"PerformedAt"` +} + +// Validate validates this models detection engine info type +func (m *ModelsDetectionEngineInfoType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApkStaticVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEngineVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePerformedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsDetectionEngineInfoType) validateApkStaticVersion(formats strfmt.Registry) error { + + if err := validate.Required("ApkStaticVersion", "body", m.ApkStaticVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetectionEngineInfoType) validateEngineVersion(formats strfmt.Registry) error { + + if err := validate.Required("EngineVersion", "body", m.EngineVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsDetectionEngineInfoType) validatePerformedAt(formats strfmt.Registry) error { + + if err := validate.Required("PerformedAt", "body", m.PerformedAt); err != nil { + return err + } + + if err := validate.FormatOf("PerformedAt", "body", "date-time", m.PerformedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models detection engine info type based on context it is used +func (m *ModelsDetectionEngineInfoType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsDetectionEngineInfoType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsDetectionEngineInfoType) UnmarshalBinary(b []byte) error { + var res ModelsDetectionEngineInfoType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_detection_info_type.go b/falcon/models/models_detection_info_type.go new file mode 100644 index 00000000..db85495e --- /dev/null +++ b/falcon/models/models_detection_info_type.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsDetectionInfoType models detection info type +// +// swagger:model models.DetectionInfoType +type ModelsDetectionInfoType struct { + + // detection + // Required: true + Detection *ModelsDetection `json:"Detection"` +} + +// Validate validates this models detection info type +func (m *ModelsDetectionInfoType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDetection(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsDetectionInfoType) validateDetection(formats strfmt.Registry) error { + + if err := validate.Required("Detection", "body", m.Detection); err != nil { + return err + } + + if m.Detection != nil { + if err := m.Detection.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Detection") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Detection") + } + return err + } + } + + return nil +} + +// ContextValidate validate this models detection info type based on the context it is used +func (m *ModelsDetectionInfoType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDetection(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsDetectionInfoType) contextValidateDetection(ctx context.Context, formats strfmt.Registry) error { + + if m.Detection != nil { + + if err := m.Detection.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Detection") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Detection") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsDetectionInfoType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsDetectionInfoType) UnmarshalBinary(b []byte) error { + var res ModelsDetectionInfoType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_e_l_f_binary.go b/falcon/models/models_e_l_f_binary.go new file mode 100644 index 00000000..abfa549c --- /dev/null +++ b/falcon/models/models_e_l_f_binary.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsELFBinary models e l f binary +// +// swagger:model models.ELFBinary +type ModelsELFBinary struct { + + // hash + // Required: true + Hash *string `json:"hash"` + + // path + // Required: true + Path *string `json:"path"` + + // permissions + // Required: true + Permissions *string `json:"permissions"` + + // size + // Required: true + Size *int64 `json:"size"` +} + +// Validate validates this models e l f binary +func (m *ModelsELFBinary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePath(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePermissions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSize(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsELFBinary) validateHash(formats strfmt.Registry) error { + + if err := validate.Required("hash", "body", m.Hash); err != nil { + return err + } + + return nil +} + +func (m *ModelsELFBinary) validatePath(formats strfmt.Registry) error { + + if err := validate.Required("path", "body", m.Path); err != nil { + return err + } + + return nil +} + +func (m *ModelsELFBinary) validatePermissions(formats strfmt.Registry) error { + + if err := validate.Required("permissions", "body", m.Permissions); err != nil { + return err + } + + return nil +} + +func (m *ModelsELFBinary) validateSize(formats strfmt.Registry) error { + + if err := validate.Required("size", "body", m.Size); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models e l f binary based on context it is used +func (m *ModelsELFBinary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsELFBinary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsELFBinary) UnmarshalBinary(b []byte) error { + var res ModelsELFBinary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_job_meta_data.go b/falcon/models/models_job_meta_data.go new file mode 100644 index 00000000..0249dbce --- /dev/null +++ b/falcon/models/models_job_meta_data.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsJobMetaData models job meta data +// +// swagger:model models.JobMetaData +type ModelsJobMetaData struct { + + // cloud provider + // Required: true + CloudProvider *string `json:"cloud_provider"` + + // instance id + // Required: true + InstanceID *string `json:"instance_id"` + + // job end time + // Required: true + // Format: date-time + JobEndTime *strfmt.DateTime `json:"job_end_time"` + + // job id + // Required: true + JobID *string `json:"job_id"` + + // job start time + // Required: true + // Format: date-time + JobStartTime *strfmt.DateTime `json:"job_start_time"` + + // message + // Required: true + Message *string `json:"message"` + + // scanner version + // Required: true + ScannerVersion *string `json:"scanner_version"` + + // status + // Required: true + Status *string `json:"status"` +} + +// Validate validates this models job meta data +func (m *ModelsJobMetaData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCloudProvider(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJobEndTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJobID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJobStartTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMessage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScannerVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsJobMetaData) validateCloudProvider(formats strfmt.Registry) error { + + if err := validate.Required("cloud_provider", "body", m.CloudProvider); err != nil { + return err + } + + return nil +} + +func (m *ModelsJobMetaData) validateInstanceID(formats strfmt.Registry) error { + + if err := validate.Required("instance_id", "body", m.InstanceID); err != nil { + return err + } + + return nil +} + +func (m *ModelsJobMetaData) validateJobEndTime(formats strfmt.Registry) error { + + if err := validate.Required("job_end_time", "body", m.JobEndTime); err != nil { + return err + } + + if err := validate.FormatOf("job_end_time", "body", "date-time", m.JobEndTime.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ModelsJobMetaData) validateJobID(formats strfmt.Registry) error { + + if err := validate.Required("job_id", "body", m.JobID); err != nil { + return err + } + + return nil +} + +func (m *ModelsJobMetaData) validateJobStartTime(formats strfmt.Registry) error { + + if err := validate.Required("job_start_time", "body", m.JobStartTime); err != nil { + return err + } + + if err := validate.FormatOf("job_start_time", "body", "date-time", m.JobStartTime.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ModelsJobMetaData) validateMessage(formats strfmt.Registry) error { + + if err := validate.Required("message", "body", m.Message); err != nil { + return err + } + + return nil +} + +func (m *ModelsJobMetaData) validateScannerVersion(formats strfmt.Registry) error { + + if err := validate.Required("scanner_version", "body", m.ScannerVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsJobMetaData) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models job meta data based on context it is used +func (m *ModelsJobMetaData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsJobMetaData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsJobMetaData) UnmarshalBinary(b []byte) error { + var res ModelsJobMetaData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_mock_execution_create_request_v1.go b/falcon/models/models_mock_execution_create_request_v1.go new file mode 100644 index 00000000..4f87e5e8 --- /dev/null +++ b/falcon/models/models_mock_execution_create_request_v1.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsMockExecutionCreateRequestV1 models mock execution create request v1 +// +// swagger:model models.MockExecutionCreateRequestV1 +type ModelsMockExecutionCreateRequestV1 struct { + + // definition to be executed with provided mock results and on-demand trigger data + Definition *ModelsDefinitionCreateRequestV2 `json:"definition,omitempty"` + + // Mock activity data and trigger data for non-on-demand executions, keyed by node ID, may include trigger and/or activity nodes + // Required: true + Mocks *string `json:"mocks"` + + // Trigger data for on-demand executions + OnDemandTrigger string `json:"on_demand_trigger,omitempty"` +} + +// Validate validates this models mock execution create request v1 +func (m *ModelsMockExecutionCreateRequestV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDefinition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMocks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsMockExecutionCreateRequestV1) validateDefinition(formats strfmt.Registry) error { + if swag.IsZero(m.Definition) { // not required + return nil + } + + if m.Definition != nil { + if err := m.Definition.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("definition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("definition") + } + return err + } + } + + return nil +} + +func (m *ModelsMockExecutionCreateRequestV1) validateMocks(formats strfmt.Registry) error { + + if err := validate.Required("mocks", "body", m.Mocks); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models mock execution create request v1 based on the context it is used +func (m *ModelsMockExecutionCreateRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDefinition(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsMockExecutionCreateRequestV1) contextValidateDefinition(ctx context.Context, formats strfmt.Registry) error { + + if m.Definition != nil { + + if swag.IsZero(m.Definition) { // not required + return nil + } + + if err := m.Definition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("definition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("definition") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsMockExecutionCreateRequestV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsMockExecutionCreateRequestV1) UnmarshalBinary(b []byte) error { + var res ModelsMockExecutionCreateRequestV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_node.go b/falcon/models/models_node.go index 5e69a834..acacae3a 100644 --- a/falcon/models/models_node.go +++ b/falcon/models/models_node.go @@ -84,6 +84,9 @@ type ModelsNode struct { // Required: true CreatedAt *string `json:"created_at"` + // deleted at + DeletedAt string `json:"deleted_at,omitempty"` + // external ip // Required: true ExternalIP *string `json:"external_ip"` diff --git a/falcon/models/models_o_s_info_type.go b/falcon/models/models_o_s_info_type.go new file mode 100644 index 00000000..2d1ecd48 --- /dev/null +++ b/falcon/models/models_o_s_info_type.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsOSInfoType models o s info type +// +// swagger:model models.OSInfoType +type ModelsOSInfoType struct { + + // name + // Required: true + Name *string `json:"Name"` + + // version + // Required: true + Version *string `json:"Version"` +} + +// Validate validates this models o s info type +func (m *ModelsOSInfoType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsOSInfoType) validateName(formats strfmt.Registry) error { + + if err := validate.Required("Name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ModelsOSInfoType) validateVersion(formats strfmt.Registry) error { + + if err := validate.Required("Version", "body", m.Version); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models o s info type based on context it is used +func (m *ModelsOSInfoType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsOSInfoType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsOSInfoType) UnmarshalBinary(b []byte) error { + var res ModelsOSInfoType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_package_vulnerability_type.go b/falcon/models/models_package_vulnerability_type.go new file mode 100644 index 00000000..528c2f75 --- /dev/null +++ b/falcon/models/models_package_vulnerability_type.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsPackageVulnerabilityType models package vulnerability type +// +// swagger:model models.PackageVulnerabilityType +type ModelsPackageVulnerabilityType struct { + + // vulnerability + // Required: true + Vulnerability *ModelsVulnerabilityType `json:"Vulnerability"` +} + +// Validate validates this models package vulnerability type +func (m *ModelsPackageVulnerabilityType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVulnerability(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsPackageVulnerabilityType) validateVulnerability(formats strfmt.Registry) error { + + if err := validate.Required("Vulnerability", "body", m.Vulnerability); err != nil { + return err + } + + if m.Vulnerability != nil { + if err := m.Vulnerability.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Vulnerability") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Vulnerability") + } + return err + } + } + + return nil +} + +// ContextValidate validate this models package vulnerability type based on the context it is used +func (m *ModelsPackageVulnerabilityType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVulnerability(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsPackageVulnerabilityType) contextValidateVulnerability(ctx context.Context, formats strfmt.Registry) error { + + if m.Vulnerability != nil { + + if err := m.Vulnerability.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Vulnerability") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Vulnerability") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsPackageVulnerabilityType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsPackageVulnerabilityType) UnmarshalBinary(b []byte) error { + var res ModelsPackageVulnerabilityType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_pod.go b/falcon/models/models_pod.go index 5f9eb28b..23454da9 100644 --- a/falcon/models/models_pod.go +++ b/falcon/models/models_pod.go @@ -72,6 +72,9 @@ type ModelsPod struct { // Required: true CreatedAt *string `json:"created_at"` + // deleted at + DeletedAt string `json:"deleted_at,omitempty"` + // first seen // Required: true FirstSeen *string `json:"first_seen"` diff --git a/falcon/models/models_scan_report_type.go b/falcon/models/models_scan_report_type.go new file mode 100644 index 00000000..1ff4905e --- /dev/null +++ b/falcon/models/models_scan_report_type.go @@ -0,0 +1,497 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsScanReportType models scan report type +// +// swagger:model models.ScanReportType +type ModelsScanReportType struct { + + // application packages + ApplicationPackages []*ModelsApplicationPackageInfoType `json:"ApplicationPackages"` + + // detection engine info + // Required: true + DetectionEngineInfo *ModelsDetectionEngineInfoType `json:"DetectionEngineInfo"` + + // detections + // Required: true + Detections []*ModelsDetectionInfoType `json:"Detections"` + + // vulnerabilities + // Required: true + Vulnerabilities []*ModelsPackageVulnerabilityType `json:"Vulnerabilities"` + + // vulnerabilities truncated + VulnerabilitiesTruncated *ModelsVulnerabilitiesType `json:"VulnerabilitiesTruncated,omitempty"` + + // job metadata + // Required: true + JobMetadata *ModelsJobMetaData `json:"job_metadata"` + + // os info + // Required: true + OsInfo *ModelsOSInfoType `json:"os_info"` + + // results + // Required: true + Results *ModelsScanResults `json:"results"` +} + +// Validate validates this models scan report type +func (m *ModelsScanReportType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplicationPackages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionEngineInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetections(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilitiesTruncated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateJobMetadata(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOsInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsScanReportType) validateApplicationPackages(formats strfmt.Registry) error { + if swag.IsZero(m.ApplicationPackages) { // not required + return nil + } + + for i := 0; i < len(m.ApplicationPackages); i++ { + if swag.IsZero(m.ApplicationPackages[i]) { // not required + continue + } + + if m.ApplicationPackages[i] != nil { + if err := m.ApplicationPackages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ApplicationPackages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ApplicationPackages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanReportType) validateDetectionEngineInfo(formats strfmt.Registry) error { + + if err := validate.Required("DetectionEngineInfo", "body", m.DetectionEngineInfo); err != nil { + return err + } + + if m.DetectionEngineInfo != nil { + if err := m.DetectionEngineInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DetectionEngineInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DetectionEngineInfo") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) validateDetections(formats strfmt.Registry) error { + + if err := validate.Required("Detections", "body", m.Detections); err != nil { + return err + } + + for i := 0; i < len(m.Detections); i++ { + if swag.IsZero(m.Detections[i]) { // not required + continue + } + + if m.Detections[i] != nil { + if err := m.Detections[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Detections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Detections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanReportType) validateVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("Vulnerabilities", "body", m.Vulnerabilities); err != nil { + return err + } + + for i := 0; i < len(m.Vulnerabilities); i++ { + if swag.IsZero(m.Vulnerabilities[i]) { // not required + continue + } + + if m.Vulnerabilities[i] != nil { + if err := m.Vulnerabilities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Vulnerabilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Vulnerabilities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanReportType) validateVulnerabilitiesTruncated(formats strfmt.Registry) error { + if swag.IsZero(m.VulnerabilitiesTruncated) { // not required + return nil + } + + if m.VulnerabilitiesTruncated != nil { + if err := m.VulnerabilitiesTruncated.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("VulnerabilitiesTruncated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("VulnerabilitiesTruncated") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) validateJobMetadata(formats strfmt.Registry) error { + + if err := validate.Required("job_metadata", "body", m.JobMetadata); err != nil { + return err + } + + if m.JobMetadata != nil { + if err := m.JobMetadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("job_metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("job_metadata") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) validateOsInfo(formats strfmt.Registry) error { + + if err := validate.Required("os_info", "body", m.OsInfo); err != nil { + return err + } + + if m.OsInfo != nil { + if err := m.OsInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("os_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("os_info") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if m.Results != nil { + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("results") + } + return err + } + } + + return nil +} + +// ContextValidate validate this models scan report type based on the context it is used +func (m *ModelsScanReportType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApplicationPackages(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDetectionEngineInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDetections(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVulnerabilities(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVulnerabilitiesTruncated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateJobMetadata(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOsInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsScanReportType) contextValidateApplicationPackages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ApplicationPackages); i++ { + + if m.ApplicationPackages[i] != nil { + + if swag.IsZero(m.ApplicationPackages[i]) { // not required + return nil + } + + if err := m.ApplicationPackages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ApplicationPackages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ApplicationPackages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanReportType) contextValidateDetectionEngineInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.DetectionEngineInfo != nil { + + if err := m.DetectionEngineInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DetectionEngineInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DetectionEngineInfo") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) contextValidateDetections(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Detections); i++ { + + if m.Detections[i] != nil { + + if swag.IsZero(m.Detections[i]) { // not required + return nil + } + + if err := m.Detections[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Detections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Detections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanReportType) contextValidateVulnerabilities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Vulnerabilities); i++ { + + if m.Vulnerabilities[i] != nil { + + if swag.IsZero(m.Vulnerabilities[i]) { // not required + return nil + } + + if err := m.Vulnerabilities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Vulnerabilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Vulnerabilities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanReportType) contextValidateVulnerabilitiesTruncated(ctx context.Context, formats strfmt.Registry) error { + + if m.VulnerabilitiesTruncated != nil { + + if swag.IsZero(m.VulnerabilitiesTruncated) { // not required + return nil + } + + if err := m.VulnerabilitiesTruncated.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("VulnerabilitiesTruncated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("VulnerabilitiesTruncated") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) contextValidateJobMetadata(ctx context.Context, formats strfmt.Registry) error { + + if m.JobMetadata != nil { + + if err := m.JobMetadata.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("job_metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("job_metadata") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) contextValidateOsInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.OsInfo != nil { + + if err := m.OsInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("os_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("os_info") + } + return err + } + } + + return nil +} + +func (m *ModelsScanReportType) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + if m.Results != nil { + + if err := m.Results.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("results") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsScanReportType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsScanReportType) UnmarshalBinary(b []byte) error { + var res ModelsScanReportType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_scan_results.go b/falcon/models/models_scan_results.go new file mode 100644 index 00000000..76707035 --- /dev/null +++ b/falcon/models/models_scan_results.go @@ -0,0 +1,269 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsScanResults models scan results +// +// swagger:model models.ScanResults +type ModelsScanResults struct { + + // applications + // Required: true + Applications []*ModelsSnapshotInventoryApplication `json:"applications"` + + // containers + // Required: true + Containers []*ModelsContainer `json:"containers"` + + // elf binaries + // Required: true + ElfBinaries []*ModelsELFBinary `json:"elf_binaries"` + + // os version + // Required: true + OsVersion *string `json:"os_version"` +} + +// Validate validates this models scan results +func (m *ModelsScanResults) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplications(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateElfBinaries(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOsVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsScanResults) validateApplications(formats strfmt.Registry) error { + + if err := validate.Required("applications", "body", m.Applications); err != nil { + return err + } + + for i := 0; i < len(m.Applications); i++ { + if swag.IsZero(m.Applications[i]) { // not required + continue + } + + if m.Applications[i] != nil { + if err := m.Applications[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applications" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanResults) validateContainers(formats strfmt.Registry) error { + + if err := validate.Required("containers", "body", m.Containers); err != nil { + return err + } + + for i := 0; i < len(m.Containers); i++ { + if swag.IsZero(m.Containers[i]) { // not required + continue + } + + if m.Containers[i] != nil { + if err := m.Containers[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("containers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("containers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanResults) validateElfBinaries(formats strfmt.Registry) error { + + if err := validate.Required("elf_binaries", "body", m.ElfBinaries); err != nil { + return err + } + + for i := 0; i < len(m.ElfBinaries); i++ { + if swag.IsZero(m.ElfBinaries[i]) { // not required + continue + } + + if m.ElfBinaries[i] != nil { + if err := m.ElfBinaries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("elf_binaries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("elf_binaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanResults) validateOsVersion(formats strfmt.Registry) error { + + if err := validate.Required("os_version", "body", m.OsVersion); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models scan results based on the context it is used +func (m *ModelsScanResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApplications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContainers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateElfBinaries(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsScanResults) contextValidateApplications(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Applications); i++ { + + if m.Applications[i] != nil { + + if swag.IsZero(m.Applications[i]) { // not required + return nil + } + + if err := m.Applications[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("applications" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("applications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanResults) contextValidateContainers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Containers); i++ { + + if m.Containers[i] != nil { + + if swag.IsZero(m.Containers[i]) { // not required + return nil + } + + if err := m.Containers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("containers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("containers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsScanResults) contextValidateElfBinaries(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ElfBinaries); i++ { + + if m.ElfBinaries[i] != nil { + + if swag.IsZero(m.ElfBinaries[i]) { // not required + return nil + } + + if err := m.ElfBinaries[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("elf_binaries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("elf_binaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsScanResults) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsScanResults) UnmarshalBinary(b []byte) error { + var res ModelsScanResults + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_snapshot_inventory_application.go b/falcon/models/models_snapshot_inventory_application.go new file mode 100644 index 00000000..6073b9d6 --- /dev/null +++ b/falcon/models/models_snapshot_inventory_application.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsSnapshotInventoryApplication models snapshot inventory application +// +// swagger:model models.SnapshotInventoryApplication +type ModelsSnapshotInventoryApplication struct { + + // major version + // Required: true + MajorVersion *string `json:"major_version"` + + // package hash + // Required: true + PackageHash *string `json:"package_hash"` + + // package provider + // Required: true + PackageProvider *string `json:"package_provider"` + + // package source + // Required: true + PackageSource *string `json:"package_source"` + + // path + // Required: true + Path *string `json:"path"` + + // product + // Required: true + Product *string `json:"product"` + + // software architecture + // Required: true + SoftwareArchitecture *string `json:"software_architecture"` + + // type + // Required: true + Type *string `json:"type"` + + // vendor + // Required: true + Vendor *string `json:"vendor"` +} + +// Validate validates this models snapshot inventory application +func (m *ModelsSnapshotInventoryApplication) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMajorVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageProvider(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageSource(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePath(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProduct(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSoftwareArchitecture(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVendor(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validateMajorVersion(formats strfmt.Registry) error { + + if err := validate.Required("major_version", "body", m.MajorVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validatePackageHash(formats strfmt.Registry) error { + + if err := validate.Required("package_hash", "body", m.PackageHash); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validatePackageProvider(formats strfmt.Registry) error { + + if err := validate.Required("package_provider", "body", m.PackageProvider); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validatePackageSource(formats strfmt.Registry) error { + + if err := validate.Required("package_source", "body", m.PackageSource); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validatePath(formats strfmt.Registry) error { + + if err := validate.Required("path", "body", m.Path); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validateProduct(formats strfmt.Registry) error { + + if err := validate.Required("product", "body", m.Product); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validateSoftwareArchitecture(formats strfmt.Registry) error { + + if err := validate.Required("software_architecture", "body", m.SoftwareArchitecture); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *ModelsSnapshotInventoryApplication) validateVendor(formats strfmt.Registry) error { + + if err := validate.Required("vendor", "body", m.Vendor); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models snapshot inventory application based on context it is used +func (m *ModelsSnapshotInventoryApplication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsSnapshotInventoryApplication) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsSnapshotInventoryApplication) UnmarshalBinary(b []byte) error { + var res ModelsSnapshotInventoryApplication + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_vulnerabilities_type.go b/falcon/models/models_vulnerabilities_type.go new file mode 100644 index 00000000..f17dde2d --- /dev/null +++ b/falcon/models/models_vulnerabilities_type.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsVulnerabilitiesType models vulnerabilities type +// +// swagger:model models.VulnerabilitiesType +type ModelsVulnerabilitiesType struct { + + // c v e mapping + // Required: true + CVEMapping []string `json:"CVEMapping"` +} + +// Validate validates this models vulnerabilities type +func (m *ModelsVulnerabilitiesType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCVEMapping(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsVulnerabilitiesType) validateCVEMapping(formats strfmt.Registry) error { + + if err := validate.Required("CVEMapping", "body", m.CVEMapping); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models vulnerabilities type based on context it is used +func (m *ModelsVulnerabilitiesType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsVulnerabilitiesType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsVulnerabilitiesType) UnmarshalBinary(b []byte) error { + var res ModelsVulnerabilitiesType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_vulnerability_type.go b/falcon/models/models_vulnerability_type.go new file mode 100644 index 00000000..7aeafdb9 --- /dev/null +++ b/falcon/models/models_vulnerability_type.go @@ -0,0 +1,262 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsVulnerabilityType models vulnerability type +// +// swagger:model models.VulnerabilityType +type ModelsVulnerabilityType struct { + + // c v e ID + // Required: true + CVEID *string `json:"CVEID"` + + // content data hash + // Required: true + ContentDataHash *int64 `json:"ContentDataHash"` + + // details + // Required: true + Details *DomainCVE `json:"Details"` + + // exploit details + ExploitDetails *VulncheckExploitDetails `json:"ExploitDetails,omitempty"` + + // fixed versions + FixedVersions []string `json:"FixedVersions"` + + // product + // Required: true + Product *DomainProduct `json:"Product"` + + // remediation + // Required: true + Remediation []string `json:"Remediation"` +} + +// Validate validates this models vulnerability type +func (m *ModelsVulnerabilityType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCVEID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentDataHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetails(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploitDetails(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProduct(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsVulnerabilityType) validateCVEID(formats strfmt.Registry) error { + + if err := validate.Required("CVEID", "body", m.CVEID); err != nil { + return err + } + + return nil +} + +func (m *ModelsVulnerabilityType) validateContentDataHash(formats strfmt.Registry) error { + + if err := validate.Required("ContentDataHash", "body", m.ContentDataHash); err != nil { + return err + } + + return nil +} + +func (m *ModelsVulnerabilityType) validateDetails(formats strfmt.Registry) error { + + if err := validate.Required("Details", "body", m.Details); err != nil { + return err + } + + if m.Details != nil { + if err := m.Details.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Details") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Details") + } + return err + } + } + + return nil +} + +func (m *ModelsVulnerabilityType) validateExploitDetails(formats strfmt.Registry) error { + if swag.IsZero(m.ExploitDetails) { // not required + return nil + } + + if m.ExploitDetails != nil { + if err := m.ExploitDetails.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ExploitDetails") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ExploitDetails") + } + return err + } + } + + return nil +} + +func (m *ModelsVulnerabilityType) validateProduct(formats strfmt.Registry) error { + + if err := validate.Required("Product", "body", m.Product); err != nil { + return err + } + + if m.Product != nil { + if err := m.Product.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Product") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Product") + } + return err + } + } + + return nil +} + +func (m *ModelsVulnerabilityType) validateRemediation(formats strfmt.Registry) error { + + if err := validate.Required("Remediation", "body", m.Remediation); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models vulnerability type based on the context it is used +func (m *ModelsVulnerabilityType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExploitDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProduct(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsVulnerabilityType) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + if m.Details != nil { + + if err := m.Details.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Details") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Details") + } + return err + } + } + + return nil +} + +func (m *ModelsVulnerabilityType) contextValidateExploitDetails(ctx context.Context, formats strfmt.Registry) error { + + if m.ExploitDetails != nil { + + if swag.IsZero(m.ExploitDetails) { // not required + return nil + } + + if err := m.ExploitDetails.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ExploitDetails") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ExploitDetails") + } + return err + } + } + + return nil +} + +func (m *ModelsVulnerabilityType) contextValidateProduct(ctx context.Context, formats strfmt.Registry) error { + + if m.Product != nil { + + if err := m.Product.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Product") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Product") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsVulnerabilityType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsVulnerabilityType) UnmarshalBinary(b []byte) error { + var res ModelsVulnerabilityType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/policies_policy.go b/falcon/models/policies_policy.go index 48497551..5db04063 100644 --- a/falcon/models/policies_policy.go +++ b/falcon/models/policies_policy.go @@ -20,6 +20,10 @@ import ( // swagger:model policies.Policy type PoliciesPolicy struct { + // cid + // Required: true + Cid *string `json:"cid"` + // created by CreatedBy string `json:"created_by,omitempty"` @@ -66,6 +70,10 @@ type PoliciesPolicy struct { func (m *PoliciesPolicy) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + if err := m.validateCreatedTimestamp(formats); err != nil { res = append(res, err) } @@ -100,6 +108,15 @@ func (m *PoliciesPolicy) Validate(formats strfmt.Registry) error { return nil } +func (m *PoliciesPolicy) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + func (m *PoliciesPolicy) validateCreatedTimestamp(formats strfmt.Registry) error { if err := validate.Required("created_timestamp", "body", m.CreatedTimestamp); err != nil { diff --git a/falcon/models/registration_a_w_s_account_ext_v2.go b/falcon/models/registration_a_w_s_account_ext_v2.go index 29ccbaf5..e1cfd4fc 100644 --- a/falcon/models/registration_a_w_s_account_ext_v2.go +++ b/falcon/models/registration_a_w_s_account_ext_v2.go @@ -47,6 +47,9 @@ type RegistrationAWSAccountExtV2 struct { // sensor management enabled SensorManagementEnabled bool `json:"sensor_management_enabled,omitempty"` + // target ous + TargetOus []string `json:"target_ous"` + // use existing cloudtrail UseExistingCloudtrail bool `json:"use_existing_cloudtrail,omitempty"` } diff --git a/falcon/models/registration_a_w_s_account_patch.go b/falcon/models/registration_a_w_s_account_patch.go index 017d913c..e6208af5 100644 --- a/falcon/models/registration_a_w_s_account_patch.go +++ b/falcon/models/registration_a_w_s_account_patch.go @@ -45,6 +45,9 @@ type RegistrationAWSAccountPatch struct { // sensor management enabled SensorManagementEnabled bool `json:"sensor_management_enabled,omitempty"` + + // target ous + TargetOus []string `json:"target_ous"` } // Validate validates this registration a w s account patch diff --git a/falcon/models/registration_g_c_p_account_patch_request.go b/falcon/models/registration_g_c_p_account_patch_request_v1.go similarity index 70% rename from falcon/models/registration_g_c_p_account_patch_request.go rename to falcon/models/registration_g_c_p_account_patch_request_v1.go index f17190ed..bd6f3215 100644 --- a/falcon/models/registration_g_c_p_account_patch_request.go +++ b/falcon/models/registration_g_c_p_account_patch_request_v1.go @@ -15,18 +15,18 @@ import ( "github.com/go-openapi/validate" ) -// RegistrationGCPAccountPatchRequest registration g c p account patch request +// RegistrationGCPAccountPatchRequestV1 registration g c p account patch request v1 // -// swagger:model registration.GCPAccountPatchRequest -type RegistrationGCPAccountPatchRequest struct { +// swagger:model registration.GCPAccountPatchRequestV1 +type RegistrationGCPAccountPatchRequestV1 struct { // resources // Required: true - Resources []*RegistrationGCPAccountPatch `json:"resources"` + Resources []*RegistrationGCPAccountPatchV1 `json:"resources"` } -// Validate validates this registration g c p account patch request -func (m *RegistrationGCPAccountPatchRequest) Validate(formats strfmt.Registry) error { +// Validate validates this registration g c p account patch request v1 +func (m *RegistrationGCPAccountPatchRequestV1) Validate(formats strfmt.Registry) error { var res []error if err := m.validateResources(formats); err != nil { @@ -39,7 +39,7 @@ func (m *RegistrationGCPAccountPatchRequest) Validate(formats strfmt.Registry) e return nil } -func (m *RegistrationGCPAccountPatchRequest) validateResources(formats strfmt.Registry) error { +func (m *RegistrationGCPAccountPatchRequestV1) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err @@ -66,8 +66,8 @@ func (m *RegistrationGCPAccountPatchRequest) validateResources(formats strfmt.Re return nil } -// ContextValidate validate this registration g c p account patch request based on the context it is used -func (m *RegistrationGCPAccountPatchRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this registration g c p account patch request v1 based on the context it is used +func (m *RegistrationGCPAccountPatchRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateResources(ctx, formats); err != nil { @@ -80,7 +80,7 @@ func (m *RegistrationGCPAccountPatchRequest) ContextValidate(ctx context.Context return nil } -func (m *RegistrationGCPAccountPatchRequest) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *RegistrationGCPAccountPatchRequestV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Resources); i++ { @@ -106,7 +106,7 @@ func (m *RegistrationGCPAccountPatchRequest) contextValidateResources(ctx contex } // MarshalBinary interface implementation -func (m *RegistrationGCPAccountPatchRequest) MarshalBinary() ([]byte, error) { +func (m *RegistrationGCPAccountPatchRequestV1) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -114,8 +114,8 @@ func (m *RegistrationGCPAccountPatchRequest) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *RegistrationGCPAccountPatchRequest) UnmarshalBinary(b []byte) error { - var res RegistrationGCPAccountPatchRequest +func (m *RegistrationGCPAccountPatchRequestV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPAccountPatchRequestV1 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/registration_g_c_p_account_patch_v1.go b/falcon/models/registration_g_c_p_account_patch_v1.go new file mode 100644 index 00000000..7042b951 --- /dev/null +++ b/falcon/models/registration_g_c_p_account_patch_v1.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RegistrationGCPAccountPatchV1 registration g c p account patch v1 +// +// swagger:model registration.GCPAccountPatchV1 +type RegistrationGCPAccountPatchV1 struct { + + // environment + Environment string `json:"environment,omitempty"` + + // parent id + // Required: true + ParentID *string `json:"parent_id"` + + // service account + // Required: true + ServiceAccount *RegistrationGCPServiceAccountPatchV1 `json:"service_account"` +} + +// Validate validates this registration g c p account patch v1 +func (m *RegistrationGCPAccountPatchV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateParentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountPatchV1) validateParentID(formats strfmt.Registry) error { + + if err := validate.Required("parent_id", "body", m.ParentID); err != nil { + return err + } + + return nil +} + +func (m *RegistrationGCPAccountPatchV1) validateServiceAccount(formats strfmt.Registry) error { + + if err := validate.Required("service_account", "body", m.ServiceAccount); err != nil { + return err + } + + if m.ServiceAccount != nil { + if err := m.ServiceAccount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account") + } + return err + } + } + + return nil +} + +// ContextValidate validate this registration g c p account patch v1 based on the context it is used +func (m *RegistrationGCPAccountPatchV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceAccount(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountPatchV1) contextValidateServiceAccount(ctx context.Context, formats strfmt.Registry) error { + + if m.ServiceAccount != nil { + + if err := m.ServiceAccount.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPAccountPatchV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPAccountPatchV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPAccountPatchV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/registration_g_c_p_account_req_obj_v2.go b/falcon/models/registration_g_c_p_account_req_obj_v2.go index 602aeb44..acde8b35 100644 --- a/falcon/models/registration_g_c_p_account_req_obj_v2.go +++ b/falcon/models/registration_g_c_p_account_req_obj_v2.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -41,6 +42,9 @@ type RegistrationGCPAccountReqObjV2 struct { // project id ProjectID string `json:"project_id,omitempty"` + // service account conditions + ServiceAccountConditions []*DomainCondition `json:"service_account_conditions"` + // service account id ServiceAccountID int64 `json:"service_account_id,omitempty"` } @@ -53,6 +57,10 @@ func (m *RegistrationGCPAccountReqObjV2) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateServiceAccountConditions(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -68,8 +76,68 @@ func (m *RegistrationGCPAccountReqObjV2) validateParentID(formats strfmt.Registr return nil } -// ContextValidate validates this registration g c p account req obj v2 based on context it is used +func (m *RegistrationGCPAccountReqObjV2) validateServiceAccountConditions(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceAccountConditions) { // not required + return nil + } + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + continue + } + + if m.ServiceAccountConditions[i] != nil { + if err := m.ServiceAccountConditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p account req obj v2 based on the context it is used func (m *RegistrationGCPAccountReqObjV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceAccountConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountReqObjV2) contextValidateServiceAccountConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + + if m.ServiceAccountConditions[i] != nil { + + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + return nil + } + + if err := m.ServiceAccountConditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } diff --git a/falcon/models/registration_g_c_p_account_rsp_obj_v2.go b/falcon/models/registration_g_c_p_account_rsp_obj_v2.go index a78e891f..ed79b29b 100644 --- a/falcon/models/registration_g_c_p_account_rsp_obj_v2.go +++ b/falcon/models/registration_g_c_p_account_rsp_obj_v2.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -35,6 +36,9 @@ type RegistrationGCPAccountRspObjV2 struct { // project id ProjectID string `json:"project_id,omitempty"` + // service account conditions + ServiceAccountConditions []*DomainCondition `json:"service_account_conditions"` + // service account id ServiceAccountID int64 `json:"service_account_id,omitempty"` } @@ -47,6 +51,10 @@ func (m *RegistrationGCPAccountRspObjV2) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateServiceAccountConditions(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -62,8 +70,68 @@ func (m *RegistrationGCPAccountRspObjV2) validateParentID(formats strfmt.Registr return nil } -// ContextValidate validates this registration g c p account rsp obj v2 based on context it is used +func (m *RegistrationGCPAccountRspObjV2) validateServiceAccountConditions(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceAccountConditions) { // not required + return nil + } + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + continue + } + + if m.ServiceAccountConditions[i] != nil { + if err := m.ServiceAccountConditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p account rsp obj v2 based on the context it is used func (m *RegistrationGCPAccountRspObjV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceAccountConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountRspObjV2) contextValidateServiceAccountConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + + if m.ServiceAccountConditions[i] != nil { + + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + return nil + } + + if err := m.ServiceAccountConditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } diff --git a/falcon/models/registration_g_c_p_account_validated_v1.go b/falcon/models/registration_g_c_p_account_validated_v1.go new file mode 100644 index 00000000..0e9c2be8 --- /dev/null +++ b/falcon/models/registration_g_c_p_account_validated_v1.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RegistrationGCPAccountValidatedV1 registration g c p account validated v1 +// +// swagger:model registration.GCPAccountValidatedV1 +type RegistrationGCPAccountValidatedV1 struct { + + // Account conditions + Conditions []*DomainCondition `json:"conditions"` + + // Permissions status + // Required: true + GcpPermissionsStatus []*DomainPermission `json:"gcp_permissions_status"` + + // parent id + // Required: true + ParentID *string `json:"parent_id"` + + // service account conditions + ServiceAccountConditions []*DomainCondition `json:"service_account_conditions"` + + // Service account ID + ServiceAccountID int64 `json:"service_account_id,omitempty"` + + // Account registration status + Status string `json:"status,omitempty"` +} + +// Validate validates this registration g c p account validated v1 +func (m *RegistrationGCPAccountValidatedV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGcpPermissionsStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceAccountConditions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountValidatedV1) validateConditions(formats strfmt.Registry) error { + if swag.IsZero(m.Conditions) { // not required + return nil + } + + for i := 0; i < len(m.Conditions); i++ { + if swag.IsZero(m.Conditions[i]) { // not required + continue + } + + if m.Conditions[i] != nil { + if err := m.Conditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RegistrationGCPAccountValidatedV1) validateGcpPermissionsStatus(formats strfmt.Registry) error { + + if err := validate.Required("gcp_permissions_status", "body", m.GcpPermissionsStatus); err != nil { + return err + } + + for i := 0; i < len(m.GcpPermissionsStatus); i++ { + if swag.IsZero(m.GcpPermissionsStatus[i]) { // not required + continue + } + + if m.GcpPermissionsStatus[i] != nil { + if err := m.GcpPermissionsStatus[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gcp_permissions_status" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gcp_permissions_status" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RegistrationGCPAccountValidatedV1) validateParentID(formats strfmt.Registry) error { + + if err := validate.Required("parent_id", "body", m.ParentID); err != nil { + return err + } + + return nil +} + +func (m *RegistrationGCPAccountValidatedV1) validateServiceAccountConditions(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceAccountConditions) { // not required + return nil + } + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + continue + } + + if m.ServiceAccountConditions[i] != nil { + if err := m.ServiceAccountConditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p account validated v1 based on the context it is used +func (m *RegistrationGCPAccountValidatedV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGcpPermissionsStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceAccountConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountValidatedV1) contextValidateConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Conditions); i++ { + + if m.Conditions[i] != nil { + + if swag.IsZero(m.Conditions[i]) { // not required + return nil + } + + if err := m.Conditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RegistrationGCPAccountValidatedV1) contextValidateGcpPermissionsStatus(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.GcpPermissionsStatus); i++ { + + if m.GcpPermissionsStatus[i] != nil { + + if swag.IsZero(m.GcpPermissionsStatus[i]) { // not required + return nil + } + + if err := m.GcpPermissionsStatus[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gcp_permissions_status" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gcp_permissions_status" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RegistrationGCPAccountValidatedV1) contextValidateServiceAccountConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + + if m.ServiceAccountConditions[i] != nil { + + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + return nil + } + + if err := m.ServiceAccountConditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPAccountValidatedV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPAccountValidatedV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPAccountValidatedV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/registration_g_c_p_account_patch.go b/falcon/models/registration_g_c_p_account_validation_req_obj_v1.go similarity index 51% rename from falcon/models/registration_g_c_p_account_patch.go rename to falcon/models/registration_g_c_p_account_validation_req_obj_v1.go index a765444a..b9262b5e 100644 --- a/falcon/models/registration_g_c_p_account_patch.go +++ b/falcon/models/registration_g_c_p_account_validation_req_obj_v1.go @@ -14,21 +14,18 @@ import ( "github.com/go-openapi/validate" ) -// RegistrationGCPAccountPatch registration g c p account patch +// RegistrationGCPAccountValidationReqObjV1 registration g c p account validation req obj v1 // -// swagger:model registration.GCPAccountPatch -type RegistrationGCPAccountPatch struct { - - // environment - Environment string `json:"environment,omitempty"` +// swagger:model registration.GCPAccountValidationReqObjV1 +type RegistrationGCPAccountValidationReqObjV1 struct { // parent id // Required: true ParentID *string `json:"parent_id"` } -// Validate validates this registration g c p account patch -func (m *RegistrationGCPAccountPatch) Validate(formats strfmt.Registry) error { +// Validate validates this registration g c p account validation req obj v1 +func (m *RegistrationGCPAccountValidationReqObjV1) Validate(formats strfmt.Registry) error { var res []error if err := m.validateParentID(formats); err != nil { @@ -41,7 +38,7 @@ func (m *RegistrationGCPAccountPatch) Validate(formats strfmt.Registry) error { return nil } -func (m *RegistrationGCPAccountPatch) validateParentID(formats strfmt.Registry) error { +func (m *RegistrationGCPAccountValidationReqObjV1) validateParentID(formats strfmt.Registry) error { if err := validate.Required("parent_id", "body", m.ParentID); err != nil { return err @@ -50,13 +47,13 @@ func (m *RegistrationGCPAccountPatch) validateParentID(formats strfmt.Registry) return nil } -// ContextValidate validates this registration g c p account patch based on context it is used -func (m *RegistrationGCPAccountPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this registration g c p account validation req obj v1 based on context it is used +func (m *RegistrationGCPAccountValidationReqObjV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *RegistrationGCPAccountPatch) MarshalBinary() ([]byte, error) { +func (m *RegistrationGCPAccountValidationReqObjV1) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -64,8 +61,8 @@ func (m *RegistrationGCPAccountPatch) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *RegistrationGCPAccountPatch) UnmarshalBinary(b []byte) error { - var res RegistrationGCPAccountPatch +func (m *RegistrationGCPAccountValidationReqObjV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPAccountValidationReqObjV1 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/registration_g_c_p_account_validation_request_v1.go b/falcon/models/registration_g_c_p_account_validation_request_v1.go new file mode 100644 index 00000000..29558275 --- /dev/null +++ b/falcon/models/registration_g_c_p_account_validation_request_v1.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RegistrationGCPAccountValidationRequestV1 registration g c p account validation request v1 +// +// swagger:model registration.GCPAccountValidationRequestV1 +type RegistrationGCPAccountValidationRequestV1 struct { + + // resources + // Required: true + Resources []*RegistrationGCPAccountValidationReqObjV1 `json:"resources"` +} + +// Validate validates this registration g c p account validation request v1 +func (m *RegistrationGCPAccountValidationRequestV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountValidationRequestV1) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p account validation request v1 based on the context it is used +func (m *RegistrationGCPAccountValidationRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPAccountValidationRequestV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPAccountValidationRequestV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPAccountValidationRequestV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPAccountValidationRequestV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_container_enrichment_response.go b/falcon/models/registration_g_c_p_account_validation_response_v1.go similarity index 58% rename from falcon/models/k8sassets_container_enrichment_response.go rename to falcon/models/registration_g_c_p_account_validation_response_v1.go index 60a63e69..d187b7ba 100644 --- a/falcon/models/k8sassets_container_enrichment_response.go +++ b/falcon/models/registration_g_c_p_account_validation_response_v1.go @@ -15,14 +15,10 @@ import ( "github.com/go-openapi/validate" ) -// K8sassetsContainerEnrichmentResponse k8sassets container enrichment response +// RegistrationGCPAccountValidationResponseV1 registration g c p account validation response v1 // -// swagger:model k8sassets.ContainerEnrichmentResponse -type K8sassetsContainerEnrichmentResponse struct { - - // enrichment data - // Required: true - EnrichmentData []*K8sassetsContainerEnrichmentEntry `json:"EnrichmentData"` +// swagger:model registration.GCPAccountValidationResponseV1 +type RegistrationGCPAccountValidationResponseV1 struct { // errors Errors []*MsaAPIError `json:"errors"` @@ -30,21 +26,25 @@ type K8sassetsContainerEnrichmentResponse struct { // meta // Required: true Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*RegistrationGCPAccountValidatedV1 `json:"resources"` } -// Validate validates this k8sassets container enrichment response -func (m *K8sassetsContainerEnrichmentResponse) Validate(formats strfmt.Registry) error { +// Validate validates this registration g c p account validation response v1 +func (m *RegistrationGCPAccountValidationResponseV1) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateEnrichmentData(formats); err != nil { + if err := m.validateErrors(formats); err != nil { res = append(res, err) } - if err := m.validateErrors(formats); err != nil { + if err := m.validateMeta(formats); err != nil { res = append(res, err) } - if err := m.validateMeta(formats); err != nil { + if err := m.validateResources(formats); err != nil { res = append(res, err) } @@ -54,34 +54,7 @@ func (m *K8sassetsContainerEnrichmentResponse) Validate(formats strfmt.Registry) return nil } -func (m *K8sassetsContainerEnrichmentResponse) validateEnrichmentData(formats strfmt.Registry) error { - - if err := validate.Required("EnrichmentData", "body", m.EnrichmentData); err != nil { - return err - } - - for i := 0; i < len(m.EnrichmentData); i++ { - if swag.IsZero(m.EnrichmentData[i]) { // not required - continue - } - - if m.EnrichmentData[i] != nil { - if err := m.EnrichmentData[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *K8sassetsContainerEnrichmentResponse) validateErrors(formats strfmt.Registry) error { +func (m *RegistrationGCPAccountValidationResponseV1) validateErrors(formats strfmt.Registry) error { if swag.IsZero(m.Errors) { // not required return nil } @@ -107,7 +80,7 @@ func (m *K8sassetsContainerEnrichmentResponse) validateErrors(formats strfmt.Reg return nil } -func (m *K8sassetsContainerEnrichmentResponse) validateMeta(formats strfmt.Registry) error { +func (m *RegistrationGCPAccountValidationResponseV1) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -127,54 +100,56 @@ func (m *K8sassetsContainerEnrichmentResponse) validateMeta(formats strfmt.Regis return nil } -// ContextValidate validate this k8sassets container enrichment response based on the context it is used -func (m *K8sassetsContainerEnrichmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +func (m *RegistrationGCPAccountValidationResponseV1) validateResources(formats strfmt.Registry) error { - if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { - res = append(res, err) + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err } - if err := m.contextValidateErrors(ctx, formats); err != nil { - res = append(res, err) - } + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } - if len(res) > 0 { - return errors.CompositeValidationError(res...) } + return nil } -func (m *K8sassetsContainerEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.EnrichmentData); i++ { - - if m.EnrichmentData[i] != nil { +// ContextValidate validate this registration g c p account validation response v1 based on the context it is used +func (m *RegistrationGCPAccountValidationResponseV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(m.EnrichmentData[i]) { // not required - return nil - } + if err := m.contextValidateErrors(ctx, formats); err != nil { + res = append(res, err) + } - if err := m.EnrichmentData[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } - return err - } - } + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -func (m *K8sassetsContainerEnrichmentResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *RegistrationGCPAccountValidationResponseV1) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -199,7 +174,7 @@ func (m *K8sassetsContainerEnrichmentResponse) contextValidateErrors(ctx context return nil } -func (m *K8sassetsContainerEnrichmentResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *RegistrationGCPAccountValidationResponseV1) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -216,8 +191,33 @@ func (m *K8sassetsContainerEnrichmentResponse) contextValidateMeta(ctx context.C return nil } +func (m *RegistrationGCPAccountValidationResponseV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation -func (m *K8sassetsContainerEnrichmentResponse) MarshalBinary() ([]byte, error) { +func (m *RegistrationGCPAccountValidationResponseV1) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -225,8 +225,8 @@ func (m *K8sassetsContainerEnrichmentResponse) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *K8sassetsContainerEnrichmentResponse) UnmarshalBinary(b []byte) error { - var res K8sassetsContainerEnrichmentResponse +func (m *RegistrationGCPAccountValidationResponseV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPAccountValidationResponseV1 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/registration_g_c_p_service_account_ext_v1.go b/falcon/models/registration_g_c_p_service_account_ext_v1.go index 18ac3d5f..439050bf 100644 --- a/falcon/models/registration_g_c_p_service_account_ext_v1.go +++ b/falcon/models/registration_g_c_p_service_account_ext_v1.go @@ -7,7 +7,9 @@ package models import ( "context" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,17 +28,89 @@ type RegistrationGCPServiceAccountExtV1 struct { // project id ProjectID string `json:"project_id,omitempty"` + // service account conditions + ServiceAccountConditions []*DomainCondition `json:"service_account_conditions"` + // service account id ServiceAccountID int64 `json:"service_account_id,omitempty"` } // Validate validates this registration g c p service account ext v1 func (m *RegistrationGCPServiceAccountExtV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceAccountConditions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountExtV1) validateServiceAccountConditions(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceAccountConditions) { // not required + return nil + } + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + continue + } + + if m.ServiceAccountConditions[i] != nil { + if err := m.ServiceAccountConditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } -// ContextValidate validates this registration g c p service account ext v1 based on context it is used +// ContextValidate validate this registration g c p service account ext v1 based on the context it is used func (m *RegistrationGCPServiceAccountExtV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceAccountConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountExtV1) contextValidateServiceAccountConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + + if m.ServiceAccountConditions[i] != nil { + + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + return nil + } + + if err := m.ServiceAccountConditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } diff --git a/falcon/models/registration_g_c_p_service_account_patch_request_v1.go b/falcon/models/registration_g_c_p_service_account_patch_request_v1.go new file mode 100644 index 00000000..efdb5d57 --- /dev/null +++ b/falcon/models/registration_g_c_p_service_account_patch_request_v1.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RegistrationGCPServiceAccountPatchRequestV1 registration g c p service account patch request v1 +// +// swagger:model registration.GCPServiceAccountPatchRequestV1 +type RegistrationGCPServiceAccountPatchRequestV1 struct { + + // resources + // Required: true + Resources []*RegistrationGCPServiceAccountPatchV1 `json:"resources"` +} + +// Validate validates this registration g c p service account patch request v1 +func (m *RegistrationGCPServiceAccountPatchRequestV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountPatchRequestV1) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p service account patch request v1 based on the context it is used +func (m *RegistrationGCPServiceAccountPatchRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountPatchRequestV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountPatchRequestV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountPatchRequestV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPServiceAccountPatchRequestV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/registration_g_c_p_service_account_patch_v1.go b/falcon/models/registration_g_c_p_service_account_patch_v1.go new file mode 100644 index 00000000..5606a3d2 --- /dev/null +++ b/falcon/models/registration_g_c_p_service_account_patch_v1.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RegistrationGCPServiceAccountPatchV1 registration g c p service account patch v1 +// +// swagger:model registration.GCPServiceAccountPatchV1 +type RegistrationGCPServiceAccountPatchV1 struct { + + // client email + ClientEmail string `json:"client_email,omitempty"` + + // client id + ClientID string `json:"client_id,omitempty"` + + // private key + PrivateKey string `json:"private_key,omitempty"` + + // private key id + PrivateKeyID string `json:"private_key_id,omitempty"` + + // project id + ProjectID string `json:"project_id,omitempty"` + + // service account conditions + ServiceAccountConditions []*DomainCondition `json:"service_account_conditions"` + + // service account id + ServiceAccountID int64 `json:"service_account_id,omitempty"` +} + +// Validate validates this registration g c p service account patch v1 +func (m *RegistrationGCPServiceAccountPatchV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceAccountConditions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountPatchV1) validateServiceAccountConditions(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceAccountConditions) { // not required + return nil + } + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + continue + } + + if m.ServiceAccountConditions[i] != nil { + if err := m.ServiceAccountConditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p service account patch v1 based on the context it is used +func (m *RegistrationGCPServiceAccountPatchV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceAccountConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountPatchV1) contextValidateServiceAccountConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + + if m.ServiceAccountConditions[i] != nil { + + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + return nil + } + + if err := m.ServiceAccountConditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountPatchV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountPatchV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPServiceAccountPatchV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/registration_g_c_p_service_account_validation_request_obj_v1.go b/falcon/models/registration_g_c_p_service_account_validation_request_obj_v1.go new file mode 100644 index 00000000..fe9b0f12 --- /dev/null +++ b/falcon/models/registration_g_c_p_service_account_validation_request_obj_v1.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RegistrationGCPServiceAccountValidationRequestObjV1 registration g c p service account validation request obj v1 +// +// swagger:model registration.GCPServiceAccountValidationRequestObjV1 +type RegistrationGCPServiceAccountValidationRequestObjV1 struct { + + // client email + ClientEmail string `json:"client_email,omitempty"` + + // client id + ClientID string `json:"client_id,omitempty"` + + // private key + PrivateKey string `json:"private_key,omitempty"` + + // private key id + PrivateKeyID string `json:"private_key_id,omitempty"` + + // project id + ProjectID string `json:"project_id,omitempty"` + + // service account conditions + ServiceAccountConditions []*DomainCondition `json:"service_account_conditions"` + + // service account id + ServiceAccountID int64 `json:"service_account_id,omitempty"` +} + +// Validate validates this registration g c p service account validation request obj v1 +func (m *RegistrationGCPServiceAccountValidationRequestObjV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceAccountConditions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountValidationRequestObjV1) validateServiceAccountConditions(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceAccountConditions) { // not required + return nil + } + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + continue + } + + if m.ServiceAccountConditions[i] != nil { + if err := m.ServiceAccountConditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p service account validation request obj v1 based on the context it is used +func (m *RegistrationGCPServiceAccountValidationRequestObjV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceAccountConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountValidationRequestObjV1) contextValidateServiceAccountConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ServiceAccountConditions); i++ { + + if m.ServiceAccountConditions[i] != nil { + + if swag.IsZero(m.ServiceAccountConditions[i]) { // not required + return nil + } + + if err := m.ServiceAccountConditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_account_conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountValidationRequestObjV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountValidationRequestObjV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPServiceAccountValidationRequestObjV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/registration_g_c_p_service_account_validation_request_v1.go b/falcon/models/registration_g_c_p_service_account_validation_request_v1.go new file mode 100644 index 00000000..fe548a81 --- /dev/null +++ b/falcon/models/registration_g_c_p_service_account_validation_request_v1.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RegistrationGCPServiceAccountValidationRequestV1 registration g c p service account validation request v1 +// +// swagger:model registration.GCPServiceAccountValidationRequestV1 +type RegistrationGCPServiceAccountValidationRequestV1 struct { + + // resources + // Required: true + Resources []*RegistrationGCPServiceAccountValidationRequestObjV1 `json:"resources"` +} + +// Validate validates this registration g c p service account validation request v1 +func (m *RegistrationGCPServiceAccountValidationRequestV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountValidationRequestV1) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p service account validation request v1 based on the context it is used +func (m *RegistrationGCPServiceAccountValidationRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountValidationRequestV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountValidationRequestV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountValidationRequestV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPServiceAccountValidationRequestV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/registration_g_c_p_service_account_validation_response_v1.go b/falcon/models/registration_g_c_p_service_account_validation_response_v1.go new file mode 100644 index 00000000..2c845575 --- /dev/null +++ b/falcon/models/registration_g_c_p_service_account_validation_response_v1.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RegistrationGCPServiceAccountValidationResponseV1 registration g c p service account validation response v1 +// +// swagger:model registration.GCPServiceAccountValidationResponseV1 +type RegistrationGCPServiceAccountValidationResponseV1 struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*RegistrationGCPServiceAccountExtV1 `json:"resources"` +} + +// Validate validates this registration g c p service account validation response v1 +func (m *RegistrationGCPServiceAccountValidationResponseV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountValidationResponseV1) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil + } + + for i := 0; i < len(m.Errors); i++ { + if swag.IsZero(m.Errors[i]) { // not required + continue + } + + if m.Errors[i] != nil { + if err := m.Errors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RegistrationGCPServiceAccountValidationResponseV1) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *RegistrationGCPServiceAccountValidationResponseV1) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this registration g c p service account validation response v1 based on the context it is used +func (m *RegistrationGCPServiceAccountValidationResponseV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateErrors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RegistrationGCPServiceAccountValidationResponseV1) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Errors); i++ { + + if m.Errors[i] != nil { + + if swag.IsZero(m.Errors[i]) { // not required + return nil + } + + if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("errors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("errors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RegistrationGCPServiceAccountValidationResponseV1) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +func (m *RegistrationGCPServiceAccountValidationResponseV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountValidationResponseV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RegistrationGCPServiceAccountValidationResponseV1) UnmarshalBinary(b []byte) error { + var res RegistrationGCPServiceAccountValidationResponseV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/rulegroups_rule.go b/falcon/models/rulegroups_rule.go index db20c65d..ea61c339 100644 --- a/falcon/models/rulegroups_rule.go +++ b/falcon/models/rulegroups_rule.go @@ -38,6 +38,9 @@ type RulegroupsRule struct { // enable content capture EnableContentCapture bool `json:"enable_content_capture,omitempty"` + // enable hash capture + EnableHashCapture bool `json:"enable_hash_capture,omitempty"` + // exclude Exclude string `json:"exclude,omitempty"` @@ -116,6 +119,9 @@ type RulegroupsRule struct { // watch permissions file changes WatchPermissionsFileChanges bool `json:"watch_permissions_file_changes,omitempty"` + // watch permissions key changes + WatchPermissionsKeyChanges bool `json:"watch_permissions_key_changes,omitempty"` + // watch rename directory changes WatchRenameDirectoryChanges bool `json:"watch_rename_directory_changes,omitempty"` diff --git a/falcon/models/sadomain_create_rule_request_v1.go b/falcon/models/sadomain_create_rule_request_v1.go index 7b283ed5..4d1fe46e 100644 --- a/falcon/models/sadomain_create_rule_request_v1.go +++ b/falcon/models/sadomain_create_rule_request_v1.go @@ -19,6 +19,10 @@ import ( // swagger:model sadomain.CreateRuleRequestV1 type SadomainCreateRuleRequestV1 struct { + // Monitor only for breach data. Must be accompanied by breach_monitoring_enabled:true. + // Required: true + BreachMonitorOnly *bool `json:"breach_monitor_only"` + // Whether to monitor for breach data. Available only for `Company Domains` and `Email addresses` rule topics. When enabled, ownership of the monitored domains or emails is required // Required: true BreachMonitoringEnabled *bool `json:"breach_monitoring_enabled"` @@ -31,6 +35,10 @@ type SadomainCreateRuleRequestV1 struct { // Required: true Name *string `json:"name"` + // If the rule was generated based on a template, the id of the template + // Required: true + OriginatingTemplateID *string `json:"originating_template_id"` + // The permissions for a given rule which specifies the rule's access by other users. Possible values: [`public`, `private`] // Required: true Permissions *string `json:"permissions"` @@ -52,6 +60,10 @@ type SadomainCreateRuleRequestV1 struct { func (m *SadomainCreateRuleRequestV1) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBreachMonitorOnly(formats); err != nil { + res = append(res, err) + } + if err := m.validateBreachMonitoringEnabled(formats); err != nil { res = append(res, err) } @@ -64,6 +76,10 @@ func (m *SadomainCreateRuleRequestV1) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateOriginatingTemplateID(formats); err != nil { + res = append(res, err) + } + if err := m.validatePermissions(formats); err != nil { res = append(res, err) } @@ -86,6 +102,15 @@ func (m *SadomainCreateRuleRequestV1) Validate(formats strfmt.Registry) error { return nil } +func (m *SadomainCreateRuleRequestV1) validateBreachMonitorOnly(formats strfmt.Registry) error { + + if err := validate.Required("breach_monitor_only", "body", m.BreachMonitorOnly); err != nil { + return err + } + + return nil +} + func (m *SadomainCreateRuleRequestV1) validateBreachMonitoringEnabled(formats strfmt.Registry) error { if err := validate.Required("breach_monitoring_enabled", "body", m.BreachMonitoringEnabled); err != nil { @@ -113,6 +138,15 @@ func (m *SadomainCreateRuleRequestV1) validateName(formats strfmt.Registry) erro return nil } +func (m *SadomainCreateRuleRequestV1) validateOriginatingTemplateID(formats strfmt.Registry) error { + + if err := validate.Required("originating_template_id", "body", m.OriginatingTemplateID); err != nil { + return err + } + + return nil +} + func (m *SadomainCreateRuleRequestV1) validatePermissions(formats strfmt.Registry) error { if err := validate.Required("permissions", "body", m.Permissions); err != nil { diff --git a/falcon/models/sadomain_rule.go b/falcon/models/sadomain_rule.go index 4711b54c..8838c260 100644 --- a/falcon/models/sadomain_rule.go +++ b/falcon/models/sadomain_rule.go @@ -19,6 +19,10 @@ import ( // swagger:model sadomain.Rule type SadomainRule struct { + // Weather to monitor exclusively for breach data. breach_monitoring_enabled also needs to be sent as true for this to be enabled. + // Required: true + BreachMonitorOnly *bool `json:"breach_monitor_only"` + // Whether to monitor for breach data. Available only for `Company Domains` and `Email addresses` rule topics. When enabled, ownership of the monitored domains or emails is required // Required: true BreachMonitoringEnabled *bool `json:"breach_monitoring_enabled"` @@ -44,6 +48,9 @@ type SadomainRule struct { // Required: true Name *string `json:"name"` + // If the rule was generated based on a template, the id of the template + OriginatingTemplateID string `json:"originating_template_id,omitempty"` + // The customer assets for which ownership must be verified, in order to monitor for breach data OwnershipAssets *SadomainCustomerAssets `json:"ownership_assets,omitempty"` @@ -90,6 +97,10 @@ type SadomainRule struct { func (m *SadomainRule) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBreachMonitorOnly(formats); err != nil { + res = append(res, err) + } + if err := m.validateBreachMonitoringEnabled(formats); err != nil { res = append(res, err) } @@ -152,6 +163,15 @@ func (m *SadomainRule) Validate(formats strfmt.Registry) error { return nil } +func (m *SadomainRule) validateBreachMonitorOnly(formats strfmt.Registry) error { + + if err := validate.Required("breach_monitor_only", "body", m.BreachMonitorOnly); err != nil { + return err + } + + return nil +} + func (m *SadomainRule) validateBreachMonitoringEnabled(formats strfmt.Registry) error { if err := validate.Required("breach_monitoring_enabled", "body", m.BreachMonitoringEnabled); err != nil { diff --git a/falcon/models/k8sassets_pod_enrichment_response.go b/falcon/models/scanreports_entities_response.go similarity index 60% rename from falcon/models/k8sassets_pod_enrichment_response.go rename to falcon/models/scanreports_entities_response.go index da3fd04a..d5fdefc0 100644 --- a/falcon/models/k8sassets_pod_enrichment_response.go +++ b/falcon/models/scanreports_entities_response.go @@ -15,14 +15,10 @@ import ( "github.com/go-openapi/validate" ) -// K8sassetsPodEnrichmentResponse k8sassets pod enrichment response +// ScanreportsEntitiesResponse scanreports entities response // -// swagger:model k8sassets.PodEnrichmentResponse -type K8sassetsPodEnrichmentResponse struct { - - // enrichment data - // Required: true - EnrichmentData []*K8sassetsPodEnrichmentEntry `json:"EnrichmentData"` +// swagger:model scanreports.EntitiesResponse +type ScanreportsEntitiesResponse struct { // errors Errors []*MsaAPIError `json:"errors"` @@ -30,21 +26,25 @@ type K8sassetsPodEnrichmentResponse struct { // meta // Required: true Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsScanReportType `json:"resources"` } -// Validate validates this k8sassets pod enrichment response -func (m *K8sassetsPodEnrichmentResponse) Validate(formats strfmt.Registry) error { +// Validate validates this scanreports entities response +func (m *ScanreportsEntitiesResponse) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateEnrichmentData(formats); err != nil { + if err := m.validateErrors(formats); err != nil { res = append(res, err) } - if err := m.validateErrors(formats); err != nil { + if err := m.validateMeta(formats); err != nil { res = append(res, err) } - if err := m.validateMeta(formats); err != nil { + if err := m.validateResources(formats); err != nil { res = append(res, err) } @@ -54,34 +54,7 @@ func (m *K8sassetsPodEnrichmentResponse) Validate(formats strfmt.Registry) error return nil } -func (m *K8sassetsPodEnrichmentResponse) validateEnrichmentData(formats strfmt.Registry) error { - - if err := validate.Required("EnrichmentData", "body", m.EnrichmentData); err != nil { - return err - } - - for i := 0; i < len(m.EnrichmentData); i++ { - if swag.IsZero(m.EnrichmentData[i]) { // not required - continue - } - - if m.EnrichmentData[i] != nil { - if err := m.EnrichmentData[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *K8sassetsPodEnrichmentResponse) validateErrors(formats strfmt.Registry) error { +func (m *ScanreportsEntitiesResponse) validateErrors(formats strfmt.Registry) error { if swag.IsZero(m.Errors) { // not required return nil } @@ -107,7 +80,7 @@ func (m *K8sassetsPodEnrichmentResponse) validateErrors(formats strfmt.Registry) return nil } -func (m *K8sassetsPodEnrichmentResponse) validateMeta(formats strfmt.Registry) error { +func (m *ScanreportsEntitiesResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -127,54 +100,56 @@ func (m *K8sassetsPodEnrichmentResponse) validateMeta(formats strfmt.Registry) e return nil } -// ContextValidate validate this k8sassets pod enrichment response based on the context it is used -func (m *K8sassetsPodEnrichmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +func (m *ScanreportsEntitiesResponse) validateResources(formats strfmt.Registry) error { - if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { - res = append(res, err) + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err } - if err := m.contextValidateErrors(ctx, formats); err != nil { - res = append(res, err) - } + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } - if len(res) > 0 { - return errors.CompositeValidationError(res...) } + return nil } -func (m *K8sassetsPodEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.EnrichmentData); i++ { - - if m.EnrichmentData[i] != nil { +// ContextValidate validate this scanreports entities response based on the context it is used +func (m *ScanreportsEntitiesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(m.EnrichmentData[i]) { // not required - return nil - } + if err := m.contextValidateErrors(ctx, formats); err != nil { + res = append(res, err) + } - if err := m.EnrichmentData[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("EnrichmentData" + "." + strconv.Itoa(i)) - } - return err - } - } + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -func (m *K8sassetsPodEnrichmentResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *ScanreportsEntitiesResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -199,7 +174,7 @@ func (m *K8sassetsPodEnrichmentResponse) contextValidateErrors(ctx context.Conte return nil } -func (m *K8sassetsPodEnrichmentResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *ScanreportsEntitiesResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -216,8 +191,33 @@ func (m *K8sassetsPodEnrichmentResponse) contextValidateMeta(ctx context.Context return nil } +func (m *ScanreportsEntitiesResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + + if swag.IsZero(m.Resources[i]) { // not required + return nil + } + + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation -func (m *K8sassetsPodEnrichmentResponse) MarshalBinary() ([]byte, error) { +func (m *ScanreportsEntitiesResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -225,8 +225,8 @@ func (m *K8sassetsPodEnrichmentResponse) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *K8sassetsPodEnrichmentResponse) UnmarshalBinary(b []byte) error { - var res K8sassetsPodEnrichmentResponse +func (m *ScanreportsEntitiesResponse) UnmarshalBinary(b []byte) error { + var res ScanreportsEntitiesResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/domain_tweet_source_legacy_source.go b/falcon/models/string.go similarity index 54% rename from falcon/models/domain_tweet_source_legacy_source.go rename to falcon/models/string.go index e02a9a46..6ac3f64a 100644 --- a/falcon/models/domain_tweet_source_legacy_source.go +++ b/falcon/models/string.go @@ -5,7 +5,7 @@ package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command -// DomainTweetSourceLegacySource domain tweet source legacy source +// String string // -// swagger:model domain.TweetSource.legacy_source -type DomainTweetSourceLegacySource interface{} +// swagger:model string +type String interface{} diff --git a/falcon/models/v2_definition.go b/falcon/models/v2_definition.go index bad49fb9..bf8ace19 100644 --- a/falcon/models/v2_definition.go +++ b/falcon/models/v2_definition.go @@ -48,6 +48,10 @@ type V2Definition struct { // parameters Parameters *V2Parameters `json:"parameters,omitempty"` + // parent + // Required: true + Parent *V2Model `json:"parent"` + // provision on install ProvisionOnInstall bool `json:"provision_on_install,omitempty"` @@ -91,6 +95,10 @@ func (m *V2Definition) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + if err := m.validateTrigger(formats); err != nil { res = append(res, err) } @@ -220,6 +228,26 @@ func (m *V2Definition) validateParameters(formats strfmt.Registry) error { return nil } +func (m *V2Definition) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + func (m *V2Definition) validateTrigger(formats strfmt.Registry) error { if err := validate.Required("trigger", "body", m.Trigger); err != nil { @@ -269,6 +297,10 @@ func (m *V2Definition) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTrigger(ctx, formats); err != nil { res = append(res, err) } @@ -345,6 +377,23 @@ func (m *V2Definition) contextValidateParameters(ctx context.Context, formats st return nil } +func (m *V2Definition) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + func (m *V2Definition) contextValidateTrigger(ctx context.Context, formats strfmt.Registry) error { if m.Trigger != nil { diff --git a/falcon/models/v2_for_loop.go b/falcon/models/v2_for_loop.go index 4d1e07e2..6f49cb1a 100644 --- a/falcon/models/v2_for_loop.go +++ b/falcon/models/v2_for_loop.go @@ -26,6 +26,9 @@ type V2ForLoop struct { // input // Required: true Input *string `json:"input"` + + // sequential + Sequential bool `json:"sequential,omitempty"` } // Validate validates this v2 for loop diff --git a/falcon/models/v2_model.go b/falcon/models/v2_model.go new file mode 100644 index 00000000..cb85b25a --- /dev/null +++ b/falcon/models/v2_model.go @@ -0,0 +1,347 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// V2Model v2 model +// +// swagger:model v2.Model +type V2Model struct { + + // actions + Actions map[string]V2Activity `json:"actions,omitempty"` + + // conditions + Conditions map[string]V2Condition `json:"conditions,omitempty"` + + // loops + Loops map[string]V2Loop `json:"loops,omitempty"` + + // node registry + // Required: true + NodeRegistry map[string]string `json:"nodeRegistry"` + + // parent + // Required: true + Parent *V2Model `json:"parent"` + + // trigger + // Required: true + Trigger *V2Trigger `json:"trigger"` + + // uniq node seen + // Required: true + UniqNodeSeen map[string]bool `json:"uniqNodeSeen"` +} + +// Validate validates this v2 model +func (m *V2Model) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConditions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoops(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeRegistry(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTrigger(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUniqNodeSeen(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *V2Model) validateActions(formats strfmt.Registry) error { + if swag.IsZero(m.Actions) { // not required + return nil + } + + for k := range m.Actions { + + if err := validate.Required("actions"+"."+k, "body", m.Actions[k]); err != nil { + return err + } + if val, ok := m.Actions[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("actions" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("actions" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *V2Model) validateConditions(formats strfmt.Registry) error { + if swag.IsZero(m.Conditions) { // not required + return nil + } + + for k := range m.Conditions { + + if err := validate.Required("conditions"+"."+k, "body", m.Conditions[k]); err != nil { + return err + } + if val, ok := m.Conditions[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conditions" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conditions" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *V2Model) validateLoops(formats strfmt.Registry) error { + if swag.IsZero(m.Loops) { // not required + return nil + } + + for k := range m.Loops { + + if err := validate.Required("loops"+"."+k, "body", m.Loops[k]); err != nil { + return err + } + if val, ok := m.Loops[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("loops" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("loops" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *V2Model) validateNodeRegistry(formats strfmt.Registry) error { + + if err := validate.Required("nodeRegistry", "body", m.NodeRegistry); err != nil { + return err + } + + return nil +} + +func (m *V2Model) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *V2Model) validateTrigger(formats strfmt.Registry) error { + + if err := validate.Required("trigger", "body", m.Trigger); err != nil { + return err + } + + if m.Trigger != nil { + if err := m.Trigger.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("trigger") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("trigger") + } + return err + } + } + + return nil +} + +func (m *V2Model) validateUniqNodeSeen(formats strfmt.Registry) error { + + if err := validate.Required("uniqNodeSeen", "body", m.UniqNodeSeen); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this v2 model based on the context it is used +func (m *V2Model) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateActions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLoops(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTrigger(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *V2Model) contextValidateActions(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Actions { + + if val, ok := m.Actions[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *V2Model) contextValidateConditions(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Conditions { + + if val, ok := m.Conditions[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *V2Model) contextValidateLoops(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Loops { + + if val, ok := m.Loops[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *V2Model) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *V2Model) contextValidateTrigger(ctx context.Context, formats strfmt.Registry) error { + + if m.Trigger != nil { + + if err := m.Trigger.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("trigger") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("trigger") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *V2Model) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *V2Model) UnmarshalBinary(b []byte) error { + var res V2Model + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_e_p_s_s.go b/falcon/models/vulncheck_e_p_s_s.go new file mode 100644 index 00000000..54528f18 --- /dev/null +++ b/falcon/models/vulncheck_e_p_s_s.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckEPSS vulncheck e p s s +// +// swagger:model vulncheck.EPSS +type VulncheckEPSS struct { + + // epss percentile + // Required: true + EpssPercentile *float64 `json:"epss_percentile"` + + // epss score + // Required: true + EpssScore *float64 `json:"epss_score"` +} + +// Validate validates this vulncheck e p s s +func (m *VulncheckEPSS) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEpssPercentile(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEpssScore(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckEPSS) validateEpssPercentile(formats strfmt.Registry) error { + + if err := validate.Required("epss_percentile", "body", m.EpssPercentile); err != nil { + return err + } + + return nil +} + +func (m *VulncheckEPSS) validateEpssScore(formats strfmt.Registry) error { + + if err := validate.Required("epss_score", "body", m.EpssScore); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this vulncheck e p s s based on context it is used +func (m *VulncheckEPSS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckEPSS) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckEPSS) UnmarshalBinary(b []byte) error { + var res VulncheckEPSS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_botnets.go b/falcon/models/vulncheck_exploit_botnets.go new file mode 100644 index 00000000..c79431e5 --- /dev/null +++ b/falcon/models/vulncheck_exploit_botnets.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckExploitBotnets vulncheck exploit botnets +// +// swagger:model vulncheck.ExploitBotnets +type VulncheckExploitBotnets struct { + + // botnet name + // Required: true + BotnetName *string `json:"botnet_name"` + + // cve references + // Required: true + CveReferences []*VulncheckExploitCVEReference `json:"cve_references"` + + // malpedia url + // Required: true + MalpediaURL *string `json:"malpedia_url"` +} + +// Validate validates this vulncheck exploit botnets +func (m *VulncheckExploitBotnets) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBotnetName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCveReferences(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMalpediaURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitBotnets) validateBotnetName(formats strfmt.Registry) error { + + if err := validate.Required("botnet_name", "body", m.BotnetName); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitBotnets) validateCveReferences(formats strfmt.Registry) error { + + if err := validate.Required("cve_references", "body", m.CveReferences); err != nil { + return err + } + + for i := 0; i < len(m.CveReferences); i++ { + if swag.IsZero(m.CveReferences[i]) { // not required + continue + } + + if m.CveReferences[i] != nil { + if err := m.CveReferences[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitBotnets) validateMalpediaURL(formats strfmt.Registry) error { + + if err := validate.Required("malpedia_url", "body", m.MalpediaURL); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this vulncheck exploit botnets based on the context it is used +func (m *VulncheckExploitBotnets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCveReferences(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitBotnets) contextValidateCveReferences(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CveReferences); i++ { + + if m.CveReferences[i] != nil { + + if swag.IsZero(m.CveReferences[i]) { // not required + return nil + } + + if err := m.CveReferences[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitBotnets) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitBotnets) UnmarshalBinary(b []byte) error { + var res VulncheckExploitBotnets + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_c_v_e_reference.go b/falcon/models/vulncheck_exploit_c_v_e_reference.go new file mode 100644 index 00000000..17541cfe --- /dev/null +++ b/falcon/models/vulncheck_exploit_c_v_e_reference.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckExploitCVEReference vulncheck exploit c v e reference +// +// swagger:model vulncheck.ExploitCVEReference +type VulncheckExploitCVEReference struct { + + // cve + // Required: true + Cve []string `json:"cve"` + + // date added + // Required: true + DateAdded *string `json:"date_added"` + + // url + // Required: true + URL *string `json:"url"` +} + +// Validate validates this vulncheck exploit c v e reference +func (m *VulncheckExploitCVEReference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCve(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateAdded(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitCVEReference) validateCve(formats strfmt.Registry) error { + + if err := validate.Required("cve", "body", m.Cve); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitCVEReference) validateDateAdded(formats strfmt.Registry) error { + + if err := validate.Required("date_added", "body", m.DateAdded); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitCVEReference) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this vulncheck exploit c v e reference based on context it is used +func (m *VulncheckExploitCVEReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitCVEReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitCVEReference) UnmarshalBinary(b []byte) error { + var res VulncheckExploitCVEReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_counts.go b/falcon/models/vulncheck_exploit_counts.go new file mode 100644 index 00000000..8318523d --- /dev/null +++ b/falcon/models/vulncheck_exploit_counts.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckExploitCounts vulncheck exploit counts +// +// swagger:model vulncheck.ExploitCounts +type VulncheckExploitCounts struct { + + // botnets + // Required: true + Botnets *int32 `json:"botnets"` + + // exploits + // Required: true + Exploits *int32 `json:"exploits"` + + // threat actors + // Required: true + ThreatActors *int32 `json:"threat_actors"` +} + +// Validate validates this vulncheck exploit counts +func (m *VulncheckExploitCounts) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBotnets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploits(formats); err != nil { + res = append(res, err) + } + + if err := m.validateThreatActors(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitCounts) validateBotnets(formats strfmt.Registry) error { + + if err := validate.Required("botnets", "body", m.Botnets); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitCounts) validateExploits(formats strfmt.Registry) error { + + if err := validate.Required("exploits", "body", m.Exploits); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitCounts) validateThreatActors(formats strfmt.Registry) error { + + if err := validate.Required("threat_actors", "body", m.ThreatActors); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this vulncheck exploit counts based on context it is used +func (m *VulncheckExploitCounts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitCounts) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitCounts) UnmarshalBinary(b []byte) error { + var res VulncheckExploitCounts + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_details.go b/falcon/models/vulncheck_exploit_details.go new file mode 100644 index 00000000..95831616 --- /dev/null +++ b/falcon/models/vulncheck_exploit_details.go @@ -0,0 +1,608 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckExploitDetails vulncheck exploit details +// +// swagger:model vulncheck.ExploitDetails +type VulncheckExploitDetails struct { + + // botnets + Botnets []*VulncheckExploitBotnets `json:"botnets"` + + // counts + // Required: true + Counts *VulncheckExploitCounts `json:"counts"` + + // epss + Epss *VulncheckEPSS `json:"epss,omitempty"` + + // exploit found + // Required: true + ExploitFound *bool `json:"exploit_found"` + + // exploits + Exploits []*VulncheckExploitRecord `json:"exploits"` + + // max exploit maturity + // Required: true + MaxExploitMaturity *string `json:"max_exploit_maturity"` + + // ransomware + Ransomware []*VulncheckExploitRansomware `json:"ransomware"` + + // reported exploited by botnets + // Required: true + ReportedExploitedByBotnets *bool `json:"reported_exploited_by_botnets"` + + // reported exploited by named threat actors + // Required: true + ReportedExploitedByNamedThreatActors *bool `json:"reported_exploited_by_named_threat_actors"` + + // reported exploited by ransomware + // Required: true + ReportedExploitedByRansomware *bool `json:"reported_exploited_by_ransomware"` + + // reported exploited in the wild + // Required: true + ReportedExploitedInTheWild *bool `json:"reported_exploited_in_the_wild"` + + // threat actors + ThreatActors []*VulncheckExploitThreatActor `json:"threat_actors"` + + // timeline + // Required: true + Timeline *VulncheckExploitTimeline `json:"timeline"` + + // trending + // Required: true + Trending *VulncheckExploitTrending `json:"trending"` +} + +// Validate validates this vulncheck exploit details +func (m *VulncheckExploitDetails) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBotnets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCounts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEpss(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploitFound(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploits(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxExploitMaturity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRansomware(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportedExploitedByBotnets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportedExploitedByNamedThreatActors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportedExploitedByRansomware(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportedExploitedInTheWild(formats); err != nil { + res = append(res, err) + } + + if err := m.validateThreatActors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeline(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTrending(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitDetails) validateBotnets(formats strfmt.Registry) error { + if swag.IsZero(m.Botnets) { // not required + return nil + } + + for i := 0; i < len(m.Botnets); i++ { + if swag.IsZero(m.Botnets[i]) { // not required + continue + } + + if m.Botnets[i] != nil { + if err := m.Botnets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("botnets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("botnets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) validateCounts(formats strfmt.Registry) error { + + if err := validate.Required("counts", "body", m.Counts); err != nil { + return err + } + + if m.Counts != nil { + if err := m.Counts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counts") + } + return err + } + } + + return nil +} + +func (m *VulncheckExploitDetails) validateEpss(formats strfmt.Registry) error { + if swag.IsZero(m.Epss) { // not required + return nil + } + + if m.Epss != nil { + if err := m.Epss.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("epss") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("epss") + } + return err + } + } + + return nil +} + +func (m *VulncheckExploitDetails) validateExploitFound(formats strfmt.Registry) error { + + if err := validate.Required("exploit_found", "body", m.ExploitFound); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitDetails) validateExploits(formats strfmt.Registry) error { + if swag.IsZero(m.Exploits) { // not required + return nil + } + + for i := 0; i < len(m.Exploits); i++ { + if swag.IsZero(m.Exploits[i]) { // not required + continue + } + + if m.Exploits[i] != nil { + if err := m.Exploits[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("exploits" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("exploits" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) validateMaxExploitMaturity(formats strfmt.Registry) error { + + if err := validate.Required("max_exploit_maturity", "body", m.MaxExploitMaturity); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitDetails) validateRansomware(formats strfmt.Registry) error { + if swag.IsZero(m.Ransomware) { // not required + return nil + } + + for i := 0; i < len(m.Ransomware); i++ { + if swag.IsZero(m.Ransomware[i]) { // not required + continue + } + + if m.Ransomware[i] != nil { + if err := m.Ransomware[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ransomware" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ransomware" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) validateReportedExploitedByBotnets(formats strfmt.Registry) error { + + if err := validate.Required("reported_exploited_by_botnets", "body", m.ReportedExploitedByBotnets); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitDetails) validateReportedExploitedByNamedThreatActors(formats strfmt.Registry) error { + + if err := validate.Required("reported_exploited_by_named_threat_actors", "body", m.ReportedExploitedByNamedThreatActors); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitDetails) validateReportedExploitedByRansomware(formats strfmt.Registry) error { + + if err := validate.Required("reported_exploited_by_ransomware", "body", m.ReportedExploitedByRansomware); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitDetails) validateReportedExploitedInTheWild(formats strfmt.Registry) error { + + if err := validate.Required("reported_exploited_in_the_wild", "body", m.ReportedExploitedInTheWild); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitDetails) validateThreatActors(formats strfmt.Registry) error { + if swag.IsZero(m.ThreatActors) { // not required + return nil + } + + for i := 0; i < len(m.ThreatActors); i++ { + if swag.IsZero(m.ThreatActors[i]) { // not required + continue + } + + if m.ThreatActors[i] != nil { + if err := m.ThreatActors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("threat_actors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("threat_actors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) validateTimeline(formats strfmt.Registry) error { + + if err := validate.Required("timeline", "body", m.Timeline); err != nil { + return err + } + + if m.Timeline != nil { + if err := m.Timeline.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timeline") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timeline") + } + return err + } + } + + return nil +} + +func (m *VulncheckExploitDetails) validateTrending(formats strfmt.Registry) error { + + if err := validate.Required("trending", "body", m.Trending); err != nil { + return err + } + + if m.Trending != nil { + if err := m.Trending.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("trending") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("trending") + } + return err + } + } + + return nil +} + +// ContextValidate validate this vulncheck exploit details based on the context it is used +func (m *VulncheckExploitDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBotnets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCounts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEpss(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExploits(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRansomware(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateThreatActors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimeline(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTrending(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitDetails) contextValidateBotnets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Botnets); i++ { + + if m.Botnets[i] != nil { + + if swag.IsZero(m.Botnets[i]) { // not required + return nil + } + + if err := m.Botnets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("botnets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("botnets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) contextValidateCounts(ctx context.Context, formats strfmt.Registry) error { + + if m.Counts != nil { + + if err := m.Counts.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counts") + } + return err + } + } + + return nil +} + +func (m *VulncheckExploitDetails) contextValidateEpss(ctx context.Context, formats strfmt.Registry) error { + + if m.Epss != nil { + + if swag.IsZero(m.Epss) { // not required + return nil + } + + if err := m.Epss.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("epss") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("epss") + } + return err + } + } + + return nil +} + +func (m *VulncheckExploitDetails) contextValidateExploits(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Exploits); i++ { + + if m.Exploits[i] != nil { + + if swag.IsZero(m.Exploits[i]) { // not required + return nil + } + + if err := m.Exploits[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("exploits" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("exploits" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) contextValidateRansomware(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Ransomware); i++ { + + if m.Ransomware[i] != nil { + + if swag.IsZero(m.Ransomware[i]) { // not required + return nil + } + + if err := m.Ransomware[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ransomware" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ransomware" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) contextValidateThreatActors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ThreatActors); i++ { + + if m.ThreatActors[i] != nil { + + if swag.IsZero(m.ThreatActors[i]) { // not required + return nil + } + + if err := m.ThreatActors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("threat_actors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("threat_actors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitDetails) contextValidateTimeline(ctx context.Context, formats strfmt.Registry) error { + + if m.Timeline != nil { + + if err := m.Timeline.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timeline") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timeline") + } + return err + } + } + + return nil +} + +func (m *VulncheckExploitDetails) contextValidateTrending(ctx context.Context, formats strfmt.Registry) error { + + if m.Trending != nil { + + if err := m.Trending.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("trending") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("trending") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitDetails) UnmarshalBinary(b []byte) error { + var res VulncheckExploitDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_ransomware.go b/falcon/models/vulncheck_exploit_ransomware.go new file mode 100644 index 00000000..d17e70a5 --- /dev/null +++ b/falcon/models/vulncheck_exploit_ransomware.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckExploitRansomware vulncheck exploit ransomware +// +// swagger:model vulncheck.ExploitRansomware +type VulncheckExploitRansomware struct { + + // ransomware families + // Required: true + RansomwareFamilies []string `json:"ransomware_families"` + + // reference data + // Required: true + ReferenceData []*VulncheckExploitRansomwareData `json:"reference_data"` +} + +// Validate validates this vulncheck exploit ransomware +func (m *VulncheckExploitRansomware) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRansomwareFamilies(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReferenceData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitRansomware) validateRansomwareFamilies(formats strfmt.Registry) error { + + if err := validate.Required("ransomware_families", "body", m.RansomwareFamilies); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitRansomware) validateReferenceData(formats strfmt.Registry) error { + + if err := validate.Required("reference_data", "body", m.ReferenceData); err != nil { + return err + } + + for i := 0; i < len(m.ReferenceData); i++ { + if swag.IsZero(m.ReferenceData[i]) { // not required + continue + } + + if m.ReferenceData[i] != nil { + if err := m.ReferenceData[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reference_data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reference_data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this vulncheck exploit ransomware based on the context it is used +func (m *VulncheckExploitRansomware) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateReferenceData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitRansomware) contextValidateReferenceData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ReferenceData); i++ { + + if m.ReferenceData[i] != nil { + + if swag.IsZero(m.ReferenceData[i]) { // not required + return nil + } + + if err := m.ReferenceData[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reference_data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reference_data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitRansomware) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitRansomware) UnmarshalBinary(b []byte) error { + var res VulncheckExploitRansomware + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_ransomware_data.go b/falcon/models/vulncheck_exploit_ransomware_data.go new file mode 100644 index 00000000..a9b31ad9 --- /dev/null +++ b/falcon/models/vulncheck_exploit_ransomware_data.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckExploitRansomwareData vulncheck exploit ransomware data +// +// swagger:model vulncheck.ExploitRansomwareData +type VulncheckExploitRansomwareData struct { + + // date added + // Required: true + DateAdded *string `json:"date_added"` + + // url + // Required: true + URL *string `json:"url"` +} + +// Validate validates this vulncheck exploit ransomware data +func (m *VulncheckExploitRansomwareData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDateAdded(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitRansomwareData) validateDateAdded(formats strfmt.Registry) error { + + if err := validate.Required("date_added", "body", m.DateAdded); err != nil { + return err + } + + return nil +} + +func (m *VulncheckExploitRansomwareData) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this vulncheck exploit ransomware data based on context it is used +func (m *VulncheckExploitRansomwareData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitRansomwareData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitRansomwareData) UnmarshalBinary(b []byte) error { + var res VulncheckExploitRansomwareData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_record.go b/falcon/models/vulncheck_exploit_record.go new file mode 100644 index 00000000..7dece42a --- /dev/null +++ b/falcon/models/vulncheck_exploit_record.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VulncheckExploitRecord vulncheck exploit record +// +// swagger:model vulncheck.ExploitRecord +type VulncheckExploitRecord struct { + + // cve + Cve string `json:"cve,omitempty"` + + // date added + DateAdded string `json:"date_added,omitempty"` + + // exploit availability + ExploitAvailability string `json:"exploit_availability,omitempty"` + + // exploit maturity + ExploitMaturity string `json:"exploit_maturity,omitempty"` + + // exploit type + ExploitType string `json:"exploit_type,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // refsource + Refsource string `json:"refsource,omitempty"` + + // url + URL string `json:"url,omitempty"` +} + +// Validate validates this vulncheck exploit record +func (m *VulncheckExploitRecord) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this vulncheck exploit record based on context it is used +func (m *VulncheckExploitRecord) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitRecord) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitRecord) UnmarshalBinary(b []byte) error { + var res VulncheckExploitRecord + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_threat_actor.go b/falcon/models/vulncheck_exploit_threat_actor.go new file mode 100644 index 00000000..b6e791d5 --- /dev/null +++ b/falcon/models/vulncheck_exploit_threat_actor.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VulncheckExploitThreatActor vulncheck exploit threat actor +// +// swagger:model vulncheck.ExploitThreatActor +type VulncheckExploitThreatActor struct { + + // cve references + CveReferences []*VulncheckExploitCVEReference `json:"cve_references"` + + // malpedia url + MalpediaURL string `json:"malpedia_url,omitempty"` + + // misp id + MispID string `json:"misp_id,omitempty"` + + // misp threat actor names + MispThreatActorNames []string `json:"misp_threat_actor_names"` + + // mitre id + MitreID string `json:"mitre_id,omitempty"` + + // mitre threat actor names + MitreThreatActorNames []string `json:"mitre_threat_actor_names"` + + // threat actor name + ThreatActorName string `json:"threat_actor_name,omitempty"` + + // vendor names for threat actors + VendorNamesForThreatActors []*VulncheckThreatActorVendorName `json:"vendor_names_for_threat_actors"` +} + +// Validate validates this vulncheck exploit threat actor +func (m *VulncheckExploitThreatActor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCveReferences(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVendorNamesForThreatActors(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitThreatActor) validateCveReferences(formats strfmt.Registry) error { + if swag.IsZero(m.CveReferences) { // not required + return nil + } + + for i := 0; i < len(m.CveReferences); i++ { + if swag.IsZero(m.CveReferences[i]) { // not required + continue + } + + if m.CveReferences[i] != nil { + if err := m.CveReferences[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitThreatActor) validateVendorNamesForThreatActors(formats strfmt.Registry) error { + if swag.IsZero(m.VendorNamesForThreatActors) { // not required + return nil + } + + for i := 0; i < len(m.VendorNamesForThreatActors); i++ { + if swag.IsZero(m.VendorNamesForThreatActors[i]) { // not required + continue + } + + if m.VendorNamesForThreatActors[i] != nil { + if err := m.VendorNamesForThreatActors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vendor_names_for_threat_actors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vendor_names_for_threat_actors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this vulncheck exploit threat actor based on the context it is used +func (m *VulncheckExploitThreatActor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCveReferences(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVendorNamesForThreatActors(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitThreatActor) contextValidateCveReferences(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CveReferences); i++ { + + if m.CveReferences[i] != nil { + + if swag.IsZero(m.CveReferences[i]) { // not required + return nil + } + + if err := m.CveReferences[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cve_references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VulncheckExploitThreatActor) contextValidateVendorNamesForThreatActors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VendorNamesForThreatActors); i++ { + + if m.VendorNamesForThreatActors[i] != nil { + + if swag.IsZero(m.VendorNamesForThreatActors[i]) { // not required + return nil + } + + if err := m.VendorNamesForThreatActors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vendor_names_for_threat_actors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vendor_names_for_threat_actors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitThreatActor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitThreatActor) UnmarshalBinary(b []byte) error { + var res VulncheckExploitThreatActor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_timeline.go b/falcon/models/vulncheck_exploit_timeline.go new file mode 100644 index 00000000..84db7e6e --- /dev/null +++ b/falcon/models/vulncheck_exploit_timeline.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VulncheckExploitTimeline vulncheck exploit timeline +// +// swagger:model vulncheck.ExploitTimeline +type VulncheckExploitTimeline struct { + + // cisa kev date added + CisaKevDateAdded string `json:"cisa_kev_date_added,omitempty"` + + // cisa kev date due + CisaKevDateDue string `json:"cisa_kev_date_due,omitempty"` + + // first exploit poc or higher + FirstExploitPocOrHigher string `json:"first_exploit_poc_or_higher,omitempty"` + + // first exploit published + FirstExploitPublished string `json:"first_exploit_published,omitempty"` + + // first exploit weaponized or higher + FirstExploitWeaponizedOrHigher string `json:"first_exploit_weaponized_or_higher,omitempty"` + + // first reported botnet + FirstReportedBotnet string `json:"first_reported_botnet,omitempty"` + + // first reported ransomware + FirstReportedRansomware string `json:"first_reported_ransomware,omitempty"` + + // first reported threat actor + FirstReportedThreatActor string `json:"first_reported_threat_actor,omitempty"` + + // most recent exploit published + MostRecentExploitPublished string `json:"most_recent_exploit_published,omitempty"` + + // most recent reported botnet + MostRecentReportedBotnet string `json:"most_recent_reported_botnet,omitempty"` + + // most recent reported ransomware + MostRecentReportedRansomware string `json:"most_recent_reported_ransomware,omitempty"` + + // most recent reported threat actor + MostRecentReportedThreatActor string `json:"most_recent_reported_threat_actor,omitempty"` + + // nvd published + NvdPublished string `json:"nvd_published,omitempty"` +} + +// Validate validates this vulncheck exploit timeline +func (m *VulncheckExploitTimeline) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this vulncheck exploit timeline based on context it is used +func (m *VulncheckExploitTimeline) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitTimeline) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitTimeline) UnmarshalBinary(b []byte) error { + var res VulncheckExploitTimeline + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_exploit_trending.go b/falcon/models/vulncheck_exploit_trending.go new file mode 100644 index 00000000..7b4fa775 --- /dev/null +++ b/falcon/models/vulncheck_exploit_trending.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VulncheckExploitTrending vulncheck exploit trending +// +// swagger:model vulncheck.ExploitTrending +type VulncheckExploitTrending struct { + + // github + // Required: true + Github *bool `json:"github"` +} + +// Validate validates this vulncheck exploit trending +func (m *VulncheckExploitTrending) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGithub(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VulncheckExploitTrending) validateGithub(formats strfmt.Registry) error { + + if err := validate.Required("github", "body", m.Github); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this vulncheck exploit trending based on context it is used +func (m *VulncheckExploitTrending) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckExploitTrending) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckExploitTrending) UnmarshalBinary(b []byte) error { + var res VulncheckExploitTrending + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulncheck_threat_actor_vendor_name.go b/falcon/models/vulncheck_threat_actor_vendor_name.go new file mode 100644 index 00000000..f333f3a7 --- /dev/null +++ b/falcon/models/vulncheck_threat_actor_vendor_name.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VulncheckThreatActorVendorName vulncheck threat actor vendor name +// +// swagger:model vulncheck.ThreatActorVendorName +type VulncheckThreatActorVendorName struct { + + // threat actor name + ThreatActorName string `json:"threat_actor_name,omitempty"` + + // url + URL string `json:"url,omitempty"` + + // vendor name + VendorName string `json:"vendor_name,omitempty"` +} + +// Validate validates this vulncheck threat actor vendor name +func (m *VulncheckThreatActorVendorName) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this vulncheck threat actor vendor name based on context it is used +func (m *VulncheckThreatActorVendorName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulncheckThreatActorVendorName) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulncheckThreatActorVendorName) UnmarshalBinary(b []byte) error { + var res VulncheckThreatActorVendorName + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/specs/transformation.jq b/specs/transformation.jq index ccb0399b..06f2f17d 100644 --- a/specs/transformation.jq +++ b/specs/transformation.jq @@ -33,6 +33,8 @@ # IOA Rule Groups Combined API has incorrect swagger response object: list of ids instead of list of objects | .paths."/ioarules/queries/rule-groups-full/v1".get.responses."200" = .paths."/ioarules/entities/rule-groups/v1".get.responses."200" + | .paths."/policy/entities/ioa-exclusions/v1".post.responses."201" = .paths."/policy/entities/ioa-exclusions/v1".post.responses."200" + | del(.paths."/policy/entities/ioa-exclusions/v1".post.responses."200") # Add response code "202" to "/devices/entities/devices/tags/v1" endpoint | .paths."/devices/entities/devices/tags/v1".patch.responses."202" = .paths."/devices/entities/devices/tags/v1".patch.responses."200" @@ -180,43 +182,15 @@ | .paths."/container-security/combined/kubernetes-ioms/v1".get.operationId = "KubernetesIomEntitiesCombined" | .paths."/container-security/queries/kubernetes-ioms/v1".get.operationId = "QueryKubernetesIoms" +# Allow an empty string be passed to assignment_rule + | .definitions."host_groups.UpdateGroupReqV1".properties.assignment_rule += {"x-nullable": true} + # Allow expiration to be nullable + | .definitions."api.IndicatorCreateReqV1".properties.expiration += {"x-nullable": true} + # 202 is a valid response for /real-time-response/entities/scripts/v1 patch +| .paths."/real-time-response/entities/scripts/v1".patch.responses."202" = .paths."/real-time-response/entities/scripts/v1".patch.responses."200" +| del(.paths."/real-time-response/entities/scripts/v1".patch.responses."200") - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# 200 is a valid response from /real-time-response/entities/queued-sessions/command/v1 +| .paths."/real-time-response/entities/queued-sessions/command/v1".delete.responses."200" = .paths."/real-time-response/entities/put-files/v1".delete.responses."200" \ No newline at end of file