From 7b6a7d4846e13099a8d96e7a9b66d31fbac3dcdc Mon Sep 17 00:00:00 2001 From: Frank Falor <35144141+ffalor@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:50:29 -0600 Subject: [PATCH] regen spec 12/8/2023 --- examples/falcon_vulnerabilities/main.go | 6 +- falcon/client/alerts/alerts_client.go | 160 ++ .../alerts/get_aggregate_v2_parameters.go | 153 ++ .../get_aggregate_v2_responses.go} | 266 +-- falcon/client/alerts/get_v2_parameters.go | 150 ++ falcon/client/alerts/get_v2_responses.go | 626 ++++++ falcon/client/alerts/query_v2_parameters.go | 312 +++ falcon/client/alerts/query_v2_responses.go | 626 ++++++ falcon/client/alerts/update_v3_parameters.go | 153 ++ falcon/client/alerts/update_v3_responses.go | 626 ++++++ .../configuration_assessment_client.go | 40 + .../get_rule_details_parameters.go | 175 ++ .../get_rule_details_responses.go} | 158 +- .../crowd_strike_api_specification_client.go | 55 +- .../query_rule_groups_full_parameters.go | 2 +- .../query_rule_groups_mixin0_parameters.go | 2 +- .../query_rules_mixin0_parameters.go | 2 +- .../custom_storage/custom_storage_client.go | 108 +- .../delete_object_parameters.go | 246 --- .../custom_storage/delete_object_responses.go | 394 ---- .../custom_storage/delete_parameters.go | 199 ++ .../delete_responses.go} | 158 +- .../get_object_metadata_parameters.go | 220 --- .../get_object_metadata_responses.go | 394 ---- .../custom_storage/get_object_parameters.go | 220 --- .../client/custom_storage/get_parameters.go | 173 ++ ...t_object_responses.go => get_responses.go} | 152 +- .../custom_storage/list_objects_parameters.go | 274 --- .../client/custom_storage/list_parameters.go | 227 +++ ...objects_responses.go => list_responses.go} | 156 +- .../custom_storage/metadata_parameters.go | 173 ++ .../custom_storage/metadata_responses.go | 394 ++++ .../custom_storage/put_object_parameters.go | 295 --- .../search_objects_parameters.go | 310 --- .../search_objects_responses.go | 394 ---- .../custom_storage/search_parameters.go | 263 +++ .../search_responses.go} | 158 +- .../custom_storage/upload_parameters.go | 255 +++ .../upload_responses.go} | 158 +- .../aggregate_prevention_policy_parameters.go | 150 ++ .../aggregate_prevention_policy_responses.go | 626 ++++++ ...gregate_sensor_update_policy_parameters.go | 150 ++ ...gregate_sensor_update_policy_responses.go} | 254 +-- ...ggregate_total_device_counts_parameters.go | 150 ++ ...aggregate_total_device_counts_responses.go | 626 ++++++ .../falcon_complete_dashboard_client.go | 120 ++ .../filevantage/create_rules_parameters.go | 8 +- .../create_scheduled_exclusions_parameters.go | 22 + .../filevantage/update_rules_parameters.go | 6 + .../update_scheduled_exclusions_parameters.go | 26 +- .../download_results_parameters.go | 190 ++ .../download_results_responses.go | 860 +++++++++ .../execute_dynamic_parameters.go | 36 +- .../execute_dynamic_responses.go | 16 +- .../execute_parameters.go | 104 +- .../execute_responses.go | 16 +- .../foundry_logscale_client.go | 360 ++++ .../get_search_results_parameters.go | 304 +++ .../get_search_results_responses.go} | 158 +- .../ingest_data_parameters.go | 271 +++ .../ingest_data_responses.go} | 158 +- .../list_repos_parameters.go | 51 +- .../list_repos_responses.go | 2 +- .../list_views_parameters.go | 51 +- .../list_views_responses.go | 2 +- .../foundry_logscale/populate_parameters.go | 163 ++ .../populate_responses.go} | 158 +- falcon/client/hosts/hosts_client.go | 40 + ...uery_device_login_history_v2_parameters.go | 150 ++ ...query_device_login_history_v2_responses.go | 394 ++++ .../query_intel_report_entities_parameters.go | 2 +- .../query_intel_report_ids_parameters.go | 2 +- .../create_inventory_parameters.go | 150 -- ...ndicator_get_device_count_v1_parameters.go | 195 ++ ...indicator_get_device_count_v1_responses.go | 394 ++++ falcon/client/ioc/ioc_client.go | 42 +- ...y_container_run_time_version_parameters.go | 266 +++ ...by_container_run_time_version_responses.go | 510 +++++ ..._by_zero_day_vulnerabilities_parameters.go | 128 ++ ...d_by_zero_day_vulnerabilities_responses.go | 510 +++++ .../group_containers_by_managed_parameters.go | 163 ++ .../group_containers_by_managed_responses.go | 510 +++++ .../kubernetes_protection_client.go | 1670 ++++++++++++++++- .../read_cluster_combined_parameters.go | 266 +++ .../read_cluster_combined_responses.go | 510 +++++ .../read_cluster_count_parameters.go | 163 ++ .../read_cluster_count_responses.go | 510 +++++ .../read_cluster_enrichment_parameters.go | 209 +++ .../read_cluster_enrichment_responses.go | 510 +++++ ...clusters_by_date_range_count_parameters.go | 128 ++ ..._clusters_by_date_range_count_responses.go | 510 +++++ ..._by_kubernetes_version_count_parameters.go | 163 ++ ...s_by_kubernetes_version_count_responses.go | 510 +++++ ...ead_clusters_by_status_count_parameters.go | 163 ++ ...read_clusters_by_status_count_responses.go | 510 +++++ .../read_container_combined_parameters.go | 266 +++ .../read_container_combined_responses.go | 510 +++++ ..._container_count_by_registry_parameters.go | 198 ++ ...d_container_count_by_registry_responses.go | 510 +++++ .../read_container_count_parameters.go | 163 ++ .../read_container_count_responses.go | 510 +++++ .../read_container_enrichment_parameters.go | 209 +++ .../read_container_enrichment_responses.go | 510 +++++ ...age_detections_count_by_date_parameters.go | 163 ++ ...mage_detections_count_by_date_responses.go | 510 +++++ ...ontainer_images_by_most_used_parameters.go | 163 ++ ...container_images_by_most_used_responses.go | 510 +++++ ...ad_container_images_by_state_parameters.go | 163 ++ ...ead_container_images_by_state_responses.go | 510 +++++ ...rabilities_by_severity_count_parameters.go | 163 ++ ...erabilities_by_severity_count_responses.go | 510 +++++ ...ntainers_by_date_range_count_parameters.go | 163 ++ ...ontainers_by_date_range_count_responses.go | 510 +++++ ...d_containers_sensor_coverage_parameters.go | 163 ++ ...ad_containers_sensor_coverage_responses.go | 510 +++++ .../read_deployment_combined_parameters.go | 266 +++ .../read_deployment_combined_responses.go | 510 +++++ .../read_deployment_count_parameters.go | 163 ++ .../read_deployment_count_responses.go | 510 +++++ .../read_deployment_enrichment_parameters.go | 209 +++ .../read_deployment_enrichment_responses.go | 510 +++++ ...loyments_by_date_range_count_parameters.go | 128 ++ ...ployments_by_date_range_count_responses.go | 510 +++++ ...stinct_container_image_count_parameters.go | 163 ++ ...istinct_container_image_count_responses.go | 510 +++++ ...kubernetes_iom_by_date_range_parameters.go | 163 ++ ..._kubernetes_iom_by_date_range_responses.go | 510 +++++ .../read_kubernetes_iom_count_parameters.go | 163 ++ .../read_kubernetes_iom_count_responses.go | 510 +++++ ...read_kubernetes_iom_entities_parameters.go | 175 ++ .../read_kubernetes_iom_entities_responses.go | 510 +++++ .../read_node_combined_parameters.go | 266 +++ .../read_node_combined_responses.go | 510 +++++ .../read_node_count_parameters.go | 163 ++ .../read_node_count_responses.go | 510 +++++ .../read_node_enrichment_parameters.go | 209 +++ .../read_node_enrichment_responses.go | 510 +++++ .../read_nodes_by_cloud_count_parameters.go | 163 ++ .../read_nodes_by_cloud_count_responses.go | 510 +++++ ...ntainer_engine_version_count_parameters.go | 163 ++ ...ontainer_engine_version_count_responses.go | 510 +++++ ...ad_nodes_by_date_range_count_parameters.go | 163 ++ ...ead_nodes_by_date_range_count_responses.go | 510 +++++ .../read_pod_combined_parameters.go | 266 +++ .../read_pod_combined_responses.go | 510 +++++ .../read_pod_count_parameters.go | 163 ++ .../read_pod_count_responses.go | 510 +++++ .../read_pod_enrichment_parameters.go | 209 +++ .../read_pod_enrichment_responses.go | 510 +++++ ...ead_pods_by_date_range_count_parameters.go | 128 ++ ...read_pods_by_date_range_count_responses.go | 510 +++++ ...ead_running_container_images_parameters.go | 266 +++ ...read_running_container_images_responses.go | 510 +++++ ...erable_container_image_count_parameters.go | 163 ++ ...nerable_container_image_count_responses.go | 510 +++++ ...read_kubernetes_iom_entities_parameters.go | 266 +++ ..._read_kubernetes_iom_entities_responses.go | 510 +++++ .../search_kubernetes_ioms_parameters.go | 266 +++ .../search_kubernetes_ioms_responses.go | 510 +++++ .../create_view_parameters.go | 150 -- .../initialize_parameters.go | 128 -- .../initialize_responses.go | 394 ---- .../logscale_management_client.go | 199 -- ...ate_query_scan_host_metadata_parameters.go | 22 + .../client/ods/aggregate_scans_parameters.go | 22 + .../aggregate_scheduled_scans_parameters.go | 22 + falcon/client/ods/cancel_scans_parameters.go | 22 + falcon/client/ods/create_scan_parameters.go | 22 + .../ods/delete_scheduled_scans_parameters.go | 22 + .../get_malicious_files_by_ids_parameters.go | 22 + ...et_scan_host_metadata_by_ids_parameters.go | 22 + .../ods/get_scans_by_scan_ids_parameters.go | 22 + .../get_scans_by_scan_ids_v2_parameters.go | 22 + ..._scheduled_scans_by_scan_ids_parameters.go | 22 + .../ods/query_malicious_files_parameters.go | 22 + .../query_scan_host_metadata_parameters.go | 22 + falcon/client/ods/query_scans_parameters.go | 24 +- .../ods/query_scheduled_scans_parameters.go | 22 + falcon/client/ods/schedule_scan_parameters.go | 22 + ...gister_cspm_snapshot_account_parameters.go | 150 -- .../registration/registration_client.go | 79 - .../create_saved_search_parameters.go | 280 --- .../create_saved_search_responses.go | 394 ---- .../delete_saved_search_parameters.go | 175 -- .../delete_saved_search_responses.go | 394 ---- .../saved_searches/deploy_parameters.go | 150 -- .../saved_searches/ingest_parameters.go | 296 --- .../saved_searches/query_by_id_parameters.go | 175 -- .../query_combined_parameters.go | 257 --- .../query_combined_responses.go | 394 ---- .../client/saved_searches/query_parameters.go | 257 --- .../client/saved_searches/query_responses.go | 394 ---- .../saved_searches/result_parameters.go | 304 --- .../saved_searches/saved_searches_client.go | 519 ----- .../update_saved_search_parameters.go | 234 --- .../update_saved_search_responses.go | 394 ---- .../saved_searches/validate_parameters.go | 150 -- .../register_parameters.go | 150 ++ .../register_responses.go | 626 ++++++ .../snapshots_registration_client.go} | 24 +- ...bined_query_evaluation_logic_parameters.go | 2 +- ...mbined_query_evaluation_logic_responses.go | 2 +- .../get_evaluation_logic_parameters.go | 2 +- .../get_evaluation_logic_responses.go | 2 +- .../query_evaluation_logic_parameters.go | 2 +- .../query_evaluation_logic_responses.go | 2 +- .../spotlight_evaluation_logic_client.go} | 6 +- ...mbined_query_vulnerabilities_parameters.go | 4 +- ...ombined_query_vulnerabilities_responses.go | 2 +- .../get_remediations_v2_parameters.go | 2 +- .../get_remediations_v2_responses.go | 2 +- .../get_vulnerabilities_parameters.go | 2 +- .../get_vulnerabilities_responses.go | 2 +- .../query_vulnerabilities_parameters.go | 4 +- .../query_vulnerabilities_responses.go | 2 +- .../spotlight_vulnerabilities_client.go} | 6 +- .../count_by_date_range_parameters.go | 163 ++ .../count_by_date_range_responses.go | 510 +++++ .../count_parameters.go | 163 ++ .../count_responses.go | 510 +++++ .../search_parameters.go | 266 +++ .../search_responses.go | 510 +++++ .../unidentified_containers_client.go | 159 ++ .../workflows/deprovision_parameters.go | 150 ++ .../client/workflows/deprovision_responses.go | 742 ++++++++ ...eprovision_system_definition_parameters.go | 150 -- ...deprovision_system_definition_responses.go | 742 -------- falcon/client/workflows/execute_parameters.go | 34 + falcon/client/workflows/execute_responses.go | 2 +- .../workflows/execution_action_parameters.go | 179 ++ ...onses.go => execution_action_responses.go} | 296 +-- .../workflows/execution_results_parameters.go | 175 ++ ...nses.go => execution_results_responses.go} | 296 +-- .../workflows/executions_action_parameters.go | 179 -- .../workflows/executions_result_parameters.go | 175 -- falcon/client/workflows/promote_parameters.go | 150 ++ ...tion_responses.go => promote_responses.go} | 296 +-- .../promote_system_definition_parameters.go | 150 -- .../client/workflows/provision_parameters.go | 150 ++ .../client/workflows/provision_responses.go | 742 ++++++++ .../provision_system_definition_parameters.go | 150 -- .../provision_system_definition_responses.go | 742 -------- falcon/client/workflows/workflows_client.go | 84 +- .../alerts_container_alerts_count_value.go | 235 +++ ...alerts_container_alerts_entity_response.go | 235 +++ falcon/models/api_detects_query_meta.go | 147 ++ falcon/models/api_detects_query_paging.go | 77 + falcon/models/api_device_count_resp_v1.go | 237 +++ falcon/models/api_device_count_v1.go | 59 + falcon/models/api_devices_ran_on_resp_v1.go | 2 +- ...s_response.go => api_entities_response.go} | 32 +- ....go => api_entities_response_resources.go} | 6 +- .../models/api_exposed_data_record_bot_v1.go | 20 +- .../api_exposed_data_record_financial_v1.go | 6 +- .../api_exposed_data_record_location_v1.go | 12 +- .../api_exposed_data_record_social_v1.go | 18 +- falcon/models/api_meta_info.go | 147 ++ falcon/models/api_processes_ran_on_resp_v1.go | 2 +- falcon/models/api_response_pagination.go | 74 + ...s.go => api_response_pagination_offset.go} | 6 +- falcon/models/api_role.go | 173 -- .../apidomain_initialize_response_v1.go | 127 -- falcon/models/apidomain_query_args.go | 27 - falcon/models/apidomain_query_response_v1.go | 14 + .../apidomain_query_validate_request_v1.go | 88 - .../apidomain_repo_view_list_item_v1.go | 17 + ...pidomain_saved_search_create_request_v1.go | 267 --- ...pidomain_saved_search_update_request_v1.go | 225 --- .../apidomain_validation_response_v1.go | 105 -- .../models/apidomain_workflow_metadata_v1.go | 59 - ...request_v1.go => client_action_request.go} | 24 +- ...1.go => client_data_ingest_response_v1.go} | 26 +- .../client_data_ingest_response_wrapper_v1.go | 237 +++ falcon/models/client_job_status.go | 12 + falcon/models/common_count_as_resource.go | 88 + falcon/models/common_count_response.go | 235 +++ falcon/models/common_entities_response.go | 190 -- ... common_generic_entity_response_string.go} | 30 +- ...58178.go => custom_storage_object_keys.go} | 32 +- ..._wrapper.go => custom_storage_response.go} | 79 +- .../detections_api_assessment_detections.go | 235 +++ .../detections_api_combined_detections.go | 235 +++ .../detections_api_detections_by_severity.go | 235 +++ .../detections_api_detections_by_type.go | 235 +++ .../models/detections_api_detections_count.go | 235 +++ falcon/models/detects_alert.go | 16 +- ...ctsapi_patch_entities_alerts_v3_request.go | 139 ++ ...ectsapi_post_entities_alerts_v2_request.go | 71 + ...ctsapi_post_entities_alerts_v2_response.go | 235 +++ .../models/device_mapped_device_policies.go | 51 + falcon/models/deviceapi_device_swagger.go | 3 + falcon/models/domain_actor_document.go | 763 +++++--- falcon/models/domain_actor_entity.go | 56 + falcon/models/domain_actor_news_document.go | 122 ++ 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 +- .../domain_api_rule_details_response_v1.go | 235 +++ falcon/models/domain_api_rule_details_v1.go | 295 +++ ...pi_vulnerability_c_v_e_details_facet_v2.go | 3 + falcon/models/domain_attachment.go | 120 ++ falcon/models/domain_breached_item_v1.go | 30 +- falcon/models/domain_c_id_group.go | 15 +- falcon/models/domain_card.go | 92 + falcon/models/domain_credentials.go | 31 +- .../models/domain_detailed_notification_v1.go | 2 +- falcon/models/domain_discover_api_host.go | 9 + .../models/domain_discover_api_io_t_host.go | 34 + falcon/models/domain_entity.go | 71 +- falcon/models/domain_event.go | 109 +- .../domain_exposed_data_record_bot_v1.go | 7 +- .../domain_exposed_data_record_social_v1.go | 17 + falcon/models/domain_file_count_v2.go | 139 ++ falcon/models/domain_fragment_info.go | 68 + falcon/models/domain_host.go | 86 + falcon/models/domain_i_o_c.go | 155 ++ falcon/models/domain_item_details_v1.go | 503 +++++ .../domain_launch_export_job_request_v1.go | 2 +- falcon/models/domain_malicious_file.go | 6 + falcon/models/domain_marketplace_product.go | 223 +++ falcon/models/domain_msa_meta_info.go | 18 - falcon/models/domain_news_document.go | 407 +--- .../models/domain_notification_details_v1.go | 150 -- falcon/models/domain_policy_info.go | 6 + falcon/models/domain_query_response.go | 10 +- falcon/models/domain_raw_event.go | 75 - falcon/models/domain_report_malware.go | 91 + falcon/models/domain_saved_search.go | 338 ---- falcon/models/domain_scan_v2.go | 114 +- falcon/models/domain_simple_actor.go | 62 +- falcon/models/domain_telegram_channel_info.go | 53 + falcon/models/domain_telegram_info.go | 211 +++ .../models/domain_telegram_recipient_info.go | 65 + falcon/models/domain_telegram_sender_info.go | 65 + falcon/models/domain_threat_entity.go | 50 + falcon/models/domain_user.go | 55 +- falcon/models/domain_user_action.go | 10 +- falcon/models/domain_user_action_request.go | 2 +- falcon/models/domain_user_grants.go | 64 +- 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/domain_workflow_metadata.go | 59 - .../driftindicators_drift_entity_response.go | 235 +++ ...indicators_drift_indicators_count_value.go | 235 +++ ...indicators_drift_indicators_field_value.go | 235 +++ falcon/models/executions_execution_result.go | 49 + falcon/models/executions_trigger_result.go | 80 + falcon/models/falconx_submission_v1.go | 9 + falcon/models/fwmgr_msa_aggregation_result.go | 3 + falcon/models/humio_group.go | 156 -- falcon/models/humio_search_domain_role.go | 157 -- falcon/models/humio_view.go | 175 -- falcon/models/humio_view_connection.go | 88 - ...go => images_api_combined_image_export.go} | 40 +- .../models/images_api_customer_and_image.go | 235 +++ .../images_api_image_assessment_history.go | 235 +++ ...images_api_image_by_vulnerability_count.go | 235 +++ falcon/models/images_api_image_count.go | 235 +++ .../images_api_image_count_by_base_o_s.go | 235 +++ .../models/images_api_image_count_by_state.go | 235 +++ .../models/images_api_image_issues_summary.go | 235 +++ ...ages_api_image_vulnerabilities_summary.go} | 83 +- falcon/models/internal_sensor_status.go | 18 + .../k8sassets_cluster_enrichment_data.go | 105 ++ .../k8sassets_cluster_enrichment_entry.go | 125 ++ .../k8sassets_cluster_enrichment_response.go | 235 +++ .../k8sassets_container_enrichment_data.go | 118 ++ ...assets_container_enrichment_data_agents.go | 27 + .../k8sassets_container_enrichment_entry.go | 125 ++ ...k8sassets_container_enrichment_response.go | 235 +++ ..._domain.go => k8sassets_container_info.go} | 24 +- .../k8sassets_deployment_enrichment_data.go | 71 + .../k8sassets_deployment_enrichment_entry.go | 125 ++ ...8sassets_deployment_enrichment_response.go | 235 +++ .../models/k8sassets_node_enrichment_data.go | 88 + .../models/k8sassets_node_enrichment_entry.go | 125 ++ .../k8sassets_node_enrichment_response.go | 235 +++ .../models/k8sassets_pod_enrichment_data.go | 141 ++ .../models/k8sassets_pod_enrichment_entry.go | 125 ++ .../k8sassets_pod_enrichment_response.go | 235 +++ .../k8sioms_kubernetes_i_o_m_count_value.go | 235 +++ ...8sioms_kubernetes_i_o_m_entity_response.go | 235 +++ .../k8sioms_kubernetes_i_o_m_field_value.go | 235 +++ ...els_aggregate_values_by_field_response.go} | 83 +- .../models_api_assessment_detections.go | 360 ++++ .../models/models_api_combined_detections.go | 258 +++ falcon/models/models_api_container_alert.go | 190 ++ .../models/models_api_customer_and_image.go | 382 ++++ falcon/models/models_api_detection_count.go | 71 + .../models_api_detection_count_by_type.go | 88 + falcon/models/models_api_drift_indicators.go | 479 +++++ falcon/models/models_api_filter_label.go | 88 + falcon/models/models_api_filter_response.go | 141 ++ falcon/models/models_api_image_assessment.go | 156 ++ .../models_api_image_assessment_history.go | 141 ++ ...models_api_image_by_vulnerability_count.go | 139 ++ .../models_api_image_combined_export.go | 394 ++++ falcon/models/models_api_image_count.go | 71 + .../models/models_api_image_issues_summary.go | 465 +++++ ...odels_api_image_vulnerabilities_summary.go | 354 ++++ falcon/models/models_api_kubernetes_i_o_m.go | 507 +++++ falcon/models/models_api_package_combined.go | 243 +++ .../models_api_package_vulnerability.go | 122 ++ .../models_api_packages_by_vuln_count.go | 156 ++ .../models_api_policy_count_by_action.go | 88 + .../models_api_unidentified_container.go | 558 ++++++ .../models/models_api_vuln_by_image_count.go | 122 ++ .../models_api_vuln_by_publication_date.go | 156 ++ falcon/models/models_api_vuln_count.go | 71 + .../models_api_vuln_count_by_severity.go | 88 + .../models_api_vulnerability_combined.go | 258 +++ .../models_api_vulnerability_details.go | 224 +++ .../models/models_api_vulnerability_info.go | 294 +++ falcon/models/models_cluster.go | 475 +++++ falcon/models/models_cluster_agents.go | 27 + ...1.go => models_cluster_entity_response.go} | 83 +- falcon/models/models_container.go | 386 ++++ falcon/models/models_container_agents.go | 27 + falcon/models/models_container_coverage.go | 88 + ...dels_container_coverage_response_entity.go | 235 +++ .../models_container_entity_response.go | 235 +++ falcon/models/models_container_image.go | 326 ++++ falcon/models/models_container_information.go | 88 + falcon/models/models_container_port_list.go | 27 + .../models/models_container_runtime_pivot.go | 207 ++ ...models_container_runtime_pivot_response.go | 235 +++ falcon/models/models_deployment.go | 207 ++ .../models_deployment_entity_response.go | 235 +++ falcon/models/models_image_information.go | 105 ++ .../models_image_summary_packages_info.go | 88 + .../models_issues_summary_container_info.go | 105 ++ falcon/models/models_job_meta_data.go | 200 -- falcon/models/models_light_weight_config.go | 198 ++ ...odels_light_weight_config_exposed_ports.go | 11 + falcon/models/models_node.go | 679 +++++++ falcon/models/models_node_agents.go | 27 + ...pper.go => models_node_entity_response.go} | 40 +- .../models_package_name_version_type.go | 139 ++ falcon/models/models_pod.go | 880 +++++++++ falcon/models/models_pod_agents.go | 27 + falcon/models/models_pod_containers.go | 27 + ...42126.go => models_pod_entity_response.go} | 83 +- falcon/models/models_pod_ports.go | 27 + falcon/models/models_scan_results.go | 141 -- .../models_snapshot_inventory_application.go | 207 -- .../models_snapshot_inventory_payload.go | 157 -- falcon/models/msa_aggregation_result.go | 3 + .../models/packages_api_combined_package.go | 235 +++ .../packages_api_combined_package_export.go | 235 +++ .../packages_api_packages_by_vuln_count.go | 235 +++ falcon/models/rulegroups_rule.go | 9 + ....go => sadomain_submission_information.go} | 26 +- .../sadomain_typosquatting_component.go | 53 +- .../scheduledexclusions_create_request.go | 75 +- falcon/models/scheduledexclusions_repeated.go | 68 + ...scheduledexclusions_scheduled_exclusion.go | 75 +- .../scheduledexclusions_update_request.go | 75 +- ...ers_unidentified_container_api_response.go | 235 +++ ...ers_unidentified_containers_count_value.go | 235 +++ ...nerabilities_api_combined_vulnerability.go | 235 +++ ...ties_api_combined_vulnerability_details.go | 235 +++ ...ilities_api_combined_vulnerability_info.go | 235 +++ ...vulnerabilities_api_vuln_by_image_count.go | 235 +++ ...vulnerabilities_api_vuln_by_publication.go | 235 +++ .../models/vulnerabilities_api_vuln_count.go | 235 +++ ...es_api_vuln_count_by_actively_exploited.go | 235 +++ ...bilities_api_vuln_count_by_c_s_p_rating.go | 235 +++ ...ilities_api_vuln_count_by_c_v_s_s_score.go | 235 +++ ...nerabilities_api_vuln_count_by_severity.go | 235 +++ specs/transformation.jq | 104 +- 474 files changed, 76834 insertions(+), 17658 deletions(-) create mode 100644 falcon/client/alerts/get_aggregate_v2_parameters.go rename falcon/client/{inventories/create_inventory_responses.go => alerts/get_aggregate_v2_responses.go} (52%) create mode 100644 falcon/client/alerts/get_v2_parameters.go create mode 100644 falcon/client/alerts/get_v2_responses.go create mode 100644 falcon/client/alerts/query_v2_parameters.go create mode 100644 falcon/client/alerts/query_v2_responses.go create mode 100644 falcon/client/alerts/update_v3_parameters.go create mode 100644 falcon/client/alerts/update_v3_responses.go create mode 100644 falcon/client/configuration_assessment/get_rule_details_parameters.go rename falcon/client/{custom_storage/put_object_responses.go => configuration_assessment/get_rule_details_responses.go} (51%) delete mode 100644 falcon/client/custom_storage/delete_object_parameters.go delete mode 100644 falcon/client/custom_storage/delete_object_responses.go create mode 100644 falcon/client/custom_storage/delete_parameters.go rename falcon/client/{saved_searches/result_responses.go => custom_storage/delete_responses.go} (59%) delete mode 100644 falcon/client/custom_storage/get_object_metadata_parameters.go delete mode 100644 falcon/client/custom_storage/get_object_metadata_responses.go delete mode 100644 falcon/client/custom_storage/get_object_parameters.go create mode 100644 falcon/client/custom_storage/get_parameters.go rename falcon/client/custom_storage/{get_object_responses.go => get_responses.go} (57%) delete mode 100644 falcon/client/custom_storage/list_objects_parameters.go create mode 100644 falcon/client/custom_storage/list_parameters.go rename falcon/client/custom_storage/{list_objects_responses.go => list_responses.go} (57%) create mode 100644 falcon/client/custom_storage/metadata_parameters.go create mode 100644 falcon/client/custom_storage/metadata_responses.go delete mode 100644 falcon/client/custom_storage/put_object_parameters.go delete mode 100644 falcon/client/custom_storage/search_objects_parameters.go delete mode 100644 falcon/client/custom_storage/search_objects_responses.go create mode 100644 falcon/client/custom_storage/search_parameters.go rename falcon/client/{saved_searches/deploy_responses.go => custom_storage/search_responses.go} (59%) create mode 100644 falcon/client/custom_storage/upload_parameters.go rename falcon/client/{saved_searches/ingest_responses.go => custom_storage/upload_responses.go} (59%) create mode 100644 falcon/client/falcon_complete_dashboard/aggregate_prevention_policy_parameters.go create mode 100644 falcon/client/falcon_complete_dashboard/aggregate_prevention_policy_responses.go create mode 100644 falcon/client/falcon_complete_dashboard/aggregate_sensor_update_policy_parameters.go rename falcon/client/{registration/register_cspm_snapshot_account_responses.go => falcon_complete_dashboard/aggregate_sensor_update_policy_responses.go} (50%) create mode 100644 falcon/client/falcon_complete_dashboard/aggregate_total_device_counts_parameters.go create mode 100644 falcon/client/falcon_complete_dashboard/aggregate_total_device_counts_responses.go create mode 100644 falcon/client/foundry_logscale/download_results_parameters.go create mode 100644 falcon/client/foundry_logscale/download_results_responses.go rename falcon/client/{saved_searches => foundry_logscale}/execute_dynamic_parameters.go (92%) rename falcon/client/{saved_searches => foundry_logscale}/execute_dynamic_responses.go (92%) rename falcon/client/{saved_searches => foundry_logscale}/execute_parameters.go (84%) rename falcon/client/{saved_searches => foundry_logscale}/execute_responses.go (95%) create mode 100644 falcon/client/foundry_logscale/foundry_logscale_client.go create mode 100644 falcon/client/foundry_logscale/get_search_results_parameters.go rename falcon/client/{saved_searches/query_by_id_responses.go => foundry_logscale/get_search_results_responses.go} (50%) create mode 100644 falcon/client/foundry_logscale/ingest_data_parameters.go rename falcon/client/{logscale_management/create_view_responses.go => foundry_logscale/ingest_data_responses.go} (59%) rename falcon/client/{logscale_management => foundry_logscale}/list_repos_parameters.go (76%) rename falcon/client/{logscale_management => foundry_logscale}/list_repos_responses.go (99%) rename falcon/client/{logscale_management => foundry_logscale}/list_views_parameters.go (76%) rename falcon/client/{logscale_management => foundry_logscale}/list_views_responses.go (99%) create mode 100644 falcon/client/foundry_logscale/populate_parameters.go rename falcon/client/{saved_searches/validate_responses.go => foundry_logscale/populate_responses.go} (59%) create mode 100644 falcon/client/hosts/query_device_login_history_v2_parameters.go create mode 100644 falcon/client/hosts/query_device_login_history_v2_responses.go delete mode 100644 falcon/client/inventories/create_inventory_parameters.go create mode 100644 falcon/client/ioc/indicator_get_device_count_v1_parameters.go create mode 100644 falcon/client/ioc/indicator_get_device_count_v1_responses.go create mode 100644 falcon/client/kubernetes_protection/find_containers_by_container_run_time_version_parameters.go create mode 100644 falcon/client/kubernetes_protection/find_containers_by_container_run_time_version_responses.go create mode 100644 falcon/client/kubernetes_protection/find_containers_count_affected_by_zero_day_vulnerabilities_parameters.go create mode 100644 falcon/client/kubernetes_protection/find_containers_count_affected_by_zero_day_vulnerabilities_responses.go create mode 100644 falcon/client/kubernetes_protection/group_containers_by_managed_parameters.go create mode 100644 falcon/client/kubernetes_protection/group_containers_by_managed_responses.go create mode 100644 falcon/client/kubernetes_protection/read_cluster_combined_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_cluster_combined_responses.go create mode 100644 falcon/client/kubernetes_protection/read_cluster_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_cluster_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_cluster_enrichment_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_cluster_enrichment_responses.go create mode 100644 falcon/client/kubernetes_protection/read_clusters_by_date_range_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_clusters_by_date_range_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_clusters_by_kubernetes_version_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_clusters_by_kubernetes_version_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_clusters_by_status_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_clusters_by_status_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_combined_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_combined_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_count_by_registry_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_count_by_registry_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_enrichment_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_enrichment_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_image_detections_count_by_date_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_image_detections_count_by_date_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_images_by_most_used_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_images_by_most_used_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_images_by_state_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_images_by_state_responses.go create mode 100644 falcon/client/kubernetes_protection/read_container_vulnerabilities_by_severity_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_container_vulnerabilities_by_severity_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_containers_by_date_range_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_containers_by_date_range_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_containers_sensor_coverage_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_containers_sensor_coverage_responses.go create mode 100644 falcon/client/kubernetes_protection/read_deployment_combined_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_deployment_combined_responses.go create mode 100644 falcon/client/kubernetes_protection/read_deployment_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_deployment_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_deployment_enrichment_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_deployment_enrichment_responses.go create mode 100644 falcon/client/kubernetes_protection/read_deployments_by_date_range_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_deployments_by_date_range_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_distinct_container_image_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_distinct_container_image_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_kubernetes_iom_by_date_range_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_kubernetes_iom_by_date_range_responses.go create mode 100644 falcon/client/kubernetes_protection/read_kubernetes_iom_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_kubernetes_iom_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_kubernetes_iom_entities_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_kubernetes_iom_entities_responses.go create mode 100644 falcon/client/kubernetes_protection/read_node_combined_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_node_combined_responses.go create mode 100644 falcon/client/kubernetes_protection/read_node_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_node_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_node_enrichment_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_node_enrichment_responses.go create mode 100644 falcon/client/kubernetes_protection/read_nodes_by_cloud_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_nodes_by_cloud_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_nodes_by_container_engine_version_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_nodes_by_container_engine_version_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_nodes_by_date_range_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_nodes_by_date_range_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_pod_combined_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_pod_combined_responses.go create mode 100644 falcon/client/kubernetes_protection/read_pod_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_pod_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_pod_enrichment_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_pod_enrichment_responses.go create mode 100644 falcon/client/kubernetes_protection/read_pods_by_date_range_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_pods_by_date_range_count_responses.go create mode 100644 falcon/client/kubernetes_protection/read_running_container_images_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_running_container_images_responses.go create mode 100644 falcon/client/kubernetes_protection/read_vulnerable_container_image_count_parameters.go create mode 100644 falcon/client/kubernetes_protection/read_vulnerable_container_image_count_responses.go create mode 100644 falcon/client/kubernetes_protection/search_and_read_kubernetes_iom_entities_parameters.go create mode 100644 falcon/client/kubernetes_protection/search_and_read_kubernetes_iom_entities_responses.go create mode 100644 falcon/client/kubernetes_protection/search_kubernetes_ioms_parameters.go create mode 100644 falcon/client/kubernetes_protection/search_kubernetes_ioms_responses.go delete mode 100644 falcon/client/logscale_management/create_view_parameters.go delete mode 100644 falcon/client/logscale_management/initialize_parameters.go delete mode 100644 falcon/client/logscale_management/initialize_responses.go delete mode 100644 falcon/client/logscale_management/logscale_management_client.go delete mode 100644 falcon/client/registration/register_cspm_snapshot_account_parameters.go delete mode 100644 falcon/client/registration/registration_client.go delete mode 100644 falcon/client/saved_searches/create_saved_search_parameters.go delete mode 100644 falcon/client/saved_searches/create_saved_search_responses.go delete mode 100644 falcon/client/saved_searches/delete_saved_search_parameters.go delete mode 100644 falcon/client/saved_searches/delete_saved_search_responses.go delete mode 100644 falcon/client/saved_searches/deploy_parameters.go delete mode 100644 falcon/client/saved_searches/ingest_parameters.go delete mode 100644 falcon/client/saved_searches/query_by_id_parameters.go delete mode 100644 falcon/client/saved_searches/query_combined_parameters.go delete mode 100644 falcon/client/saved_searches/query_combined_responses.go delete mode 100644 falcon/client/saved_searches/query_parameters.go delete mode 100644 falcon/client/saved_searches/query_responses.go delete mode 100644 falcon/client/saved_searches/result_parameters.go delete mode 100644 falcon/client/saved_searches/saved_searches_client.go delete mode 100644 falcon/client/saved_searches/update_saved_search_parameters.go delete mode 100644 falcon/client/saved_searches/update_saved_search_responses.go delete mode 100644 falcon/client/saved_searches/validate_parameters.go create mode 100644 falcon/client/snapshots_registration/register_parameters.go create mode 100644 falcon/client/snapshots_registration/register_responses.go rename falcon/client/{inventories/inventories_client.go => snapshots_registration/snapshots_registration_client.go} (67%) rename falcon/client/{vulnerabilities_evaluation_logic => spotlight_evaluation_logic}/combined_query_evaluation_logic_parameters.go (99%) rename falcon/client/{vulnerabilities_evaluation_logic => spotlight_evaluation_logic}/combined_query_evaluation_logic_responses.go (99%) rename falcon/client/{vulnerabilities_evaluation_logic => spotlight_evaluation_logic}/get_evaluation_logic_parameters.go (99%) rename falcon/client/{vulnerabilities_evaluation_logic => spotlight_evaluation_logic}/get_evaluation_logic_responses.go (99%) rename falcon/client/{vulnerabilities_evaluation_logic => spotlight_evaluation_logic}/query_evaluation_logic_parameters.go (99%) rename falcon/client/{vulnerabilities_evaluation_logic => spotlight_evaluation_logic}/query_evaluation_logic_responses.go (99%) rename falcon/client/{vulnerabilities_evaluation_logic/vulnerabilities_evaluation_logic_client.go => spotlight_evaluation_logic/spotlight_evaluation_logic_client.go} (97%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/combined_query_vulnerabilities_parameters.go (96%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/combined_query_vulnerabilities_responses.go (99%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/get_remediations_v2_parameters.go (99%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/get_remediations_v2_responses.go (99%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/get_vulnerabilities_parameters.go (99%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/get_vulnerabilities_responses.go (99%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/query_vulnerabilities_parameters.go (96%) rename falcon/client/{vulnerabilities => spotlight_vulnerabilities}/query_vulnerabilities_responses.go (99%) rename falcon/client/{vulnerabilities/vulnerabilities_client.go => spotlight_vulnerabilities/spotlight_vulnerabilities_client.go} (98%) create mode 100644 falcon/client/unidentified_containers/count_by_date_range_parameters.go create mode 100644 falcon/client/unidentified_containers/count_by_date_range_responses.go create mode 100644 falcon/client/unidentified_containers/count_parameters.go create mode 100644 falcon/client/unidentified_containers/count_responses.go create mode 100644 falcon/client/unidentified_containers/search_parameters.go create mode 100644 falcon/client/unidentified_containers/search_responses.go create mode 100644 falcon/client/unidentified_containers/unidentified_containers_client.go create mode 100644 falcon/client/workflows/deprovision_parameters.go create mode 100644 falcon/client/workflows/deprovision_responses.go delete mode 100644 falcon/client/workflows/deprovision_system_definition_parameters.go delete mode 100644 falcon/client/workflows/deprovision_system_definition_responses.go create mode 100644 falcon/client/workflows/execution_action_parameters.go rename falcon/client/workflows/{executions_action_responses.go => execution_action_responses.go} (53%) create mode 100644 falcon/client/workflows/execution_results_parameters.go rename falcon/client/workflows/{executions_result_responses.go => execution_results_responses.go} (62%) delete mode 100644 falcon/client/workflows/executions_action_parameters.go delete mode 100644 falcon/client/workflows/executions_result_parameters.go create mode 100644 falcon/client/workflows/promote_parameters.go rename falcon/client/workflows/{promote_system_definition_responses.go => promote_responses.go} (50%) delete mode 100644 falcon/client/workflows/promote_system_definition_parameters.go create mode 100644 falcon/client/workflows/provision_parameters.go create mode 100644 falcon/client/workflows/provision_responses.go delete mode 100644 falcon/client/workflows/provision_system_definition_parameters.go delete mode 100644 falcon/client/workflows/provision_system_definition_responses.go create mode 100644 falcon/models/alerts_container_alerts_count_value.go create mode 100644 falcon/models/alerts_container_alerts_entity_response.go create mode 100644 falcon/models/api_detects_query_meta.go create mode 100644 falcon/models/api_detects_query_paging.go create mode 100644 falcon/models/api_device_count_resp_v1.go create mode 100644 falcon/models/api_device_count_v1.go rename falcon/models/{csrestful_entities_response.go => api_entities_response.go} (74%) rename falcon/models/{common_entities_response_resources.go => api_entities_response_resources.go} (54%) create mode 100644 falcon/models/api_meta_info.go create mode 100644 falcon/models/api_response_pagination.go rename falcon/models/{csrestful_entities_response_resources.go => api_response_pagination_offset.go} (52%) delete mode 100644 falcon/models/api_role.go delete mode 100644 falcon/models/apidomain_initialize_response_v1.go delete mode 100644 falcon/models/apidomain_query_args.go delete mode 100644 falcon/models/apidomain_query_validate_request_v1.go delete mode 100644 falcon/models/apidomain_saved_search_create_request_v1.go delete mode 100644 falcon/models/apidomain_saved_search_update_request_v1.go delete mode 100644 falcon/models/apidomain_validation_response_v1.go delete mode 100644 falcon/models/apidomain_workflow_metadata_v1.go rename falcon/models/{apidomain_saved_search_deploy_request_v1.go => client_action_request.go} (52%) rename falcon/models/{apidomain_data_ingest_response_v1.go => client_data_ingest_response_v1.go} (66%) create mode 100644 falcon/models/client_data_ingest_response_wrapper_v1.go create mode 100644 falcon/models/common_count_as_resource.go create mode 100644 falcon/models/common_count_response.go delete mode 100644 falcon/models/common_entities_response.go rename falcon/models/{string_wrapper.go => common_generic_entity_response_string.go} (71%) rename falcon/models/{custom_type3747358178.go => custom_storage_object_keys.go} (74%) rename falcon/models/{humio_view_wrapper.go => custom_storage_response.go} (61%) create mode 100644 falcon/models/detections_api_assessment_detections.go create mode 100644 falcon/models/detections_api_combined_detections.go create mode 100644 falcon/models/detections_api_detections_by_severity.go create mode 100644 falcon/models/detections_api_detections_by_type.go create mode 100644 falcon/models/detections_api_detections_count.go create mode 100644 falcon/models/detectsapi_patch_entities_alerts_v3_request.go create mode 100644 falcon/models/detectsapi_post_entities_alerts_v2_request.go create mode 100644 falcon/models/detectsapi_post_entities_alerts_v2_response.go create mode 100644 falcon/models/domain_actor_entity.go create mode 100644 falcon/models/domain_actor_news_document.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_rule_details_response_v1.go create mode 100644 falcon/models/domain_api_rule_details_v1.go create mode 100644 falcon/models/domain_attachment.go create mode 100644 falcon/models/domain_card.go create mode 100644 falcon/models/domain_file_count_v2.go create mode 100644 falcon/models/domain_fragment_info.go create mode 100644 falcon/models/domain_host.go create mode 100644 falcon/models/domain_i_o_c.go create mode 100644 falcon/models/domain_item_details_v1.go create mode 100644 falcon/models/domain_marketplace_product.go delete mode 100644 falcon/models/domain_notification_details_v1.go create mode 100644 falcon/models/domain_report_malware.go delete mode 100644 falcon/models/domain_saved_search.go create mode 100644 falcon/models/domain_telegram_channel_info.go create mode 100644 falcon/models/domain_telegram_info.go create mode 100644 falcon/models/domain_telegram_recipient_info.go create mode 100644 falcon/models/domain_telegram_sender_info.go create mode 100644 falcon/models/domain_threat_entity.go create mode 100644 falcon/models/domain_vulnerability_actor.go create mode 100644 falcon/models/domain_vulnerability_affected_product.go create mode 100644 falcon/models/domain_vulnerability_related_threat.go create mode 100644 falcon/models/domain_vulnerability_report.go delete mode 100644 falcon/models/domain_workflow_metadata.go create mode 100644 falcon/models/driftindicators_drift_entity_response.go create mode 100644 falcon/models/driftindicators_drift_indicators_count_value.go create mode 100644 falcon/models/driftindicators_drift_indicators_field_value.go create mode 100644 falcon/models/executions_trigger_result.go delete mode 100644 falcon/models/humio_group.go delete mode 100644 falcon/models/humio_search_domain_role.go delete mode 100644 falcon/models/humio_view.go delete mode 100644 falcon/models/humio_view_connection.go rename falcon/models/{custom_storage_response_payload.go => images_api_combined_image_export.go} (80%) create mode 100644 falcon/models/images_api_customer_and_image.go create mode 100644 falcon/models/images_api_image_assessment_history.go create mode 100644 falcon/models/images_api_image_by_vulnerability_count.go create mode 100644 falcon/models/images_api_image_count.go create mode 100644 falcon/models/images_api_image_count_by_base_o_s.go create mode 100644 falcon/models/images_api_image_count_by_state.go create mode 100644 falcon/models/images_api_image_issues_summary.go rename falcon/models/{apidomain_initialize_response_wrapper_v1.go => images_api_image_vulnerabilities_summary.go} (63%) create mode 100644 falcon/models/k8sassets_cluster_enrichment_data.go create mode 100644 falcon/models/k8sassets_cluster_enrichment_entry.go create mode 100644 falcon/models/k8sassets_cluster_enrichment_response.go create mode 100644 falcon/models/k8sassets_container_enrichment_data.go create mode 100644 falcon/models/k8sassets_container_enrichment_data_agents.go create mode 100644 falcon/models/k8sassets_container_enrichment_entry.go create mode 100644 falcon/models/k8sassets_container_enrichment_response.go rename falcon/models/{humio_search_domain.go => k8sassets_container_info.go} (60%) create mode 100644 falcon/models/k8sassets_deployment_enrichment_data.go create mode 100644 falcon/models/k8sassets_deployment_enrichment_entry.go create mode 100644 falcon/models/k8sassets_deployment_enrichment_response.go create mode 100644 falcon/models/k8sassets_node_enrichment_data.go create mode 100644 falcon/models/k8sassets_node_enrichment_entry.go create mode 100644 falcon/models/k8sassets_node_enrichment_response.go create mode 100644 falcon/models/k8sassets_pod_enrichment_data.go create mode 100644 falcon/models/k8sassets_pod_enrichment_entry.go create mode 100644 falcon/models/k8sassets_pod_enrichment_response.go create mode 100644 falcon/models/k8sioms_kubernetes_i_o_m_count_value.go create mode 100644 falcon/models/k8sioms_kubernetes_i_o_m_entity_response.go create mode 100644 falcon/models/k8sioms_kubernetes_i_o_m_field_value.go rename falcon/models/{apidomain_validation_response_wrapper_v1.go => models_aggregate_values_by_field_response.go} (63%) create mode 100644 falcon/models/models_api_assessment_detections.go create mode 100644 falcon/models/models_api_combined_detections.go create mode 100644 falcon/models/models_api_container_alert.go create mode 100644 falcon/models/models_api_customer_and_image.go create mode 100644 falcon/models/models_api_detection_count.go create mode 100644 falcon/models/models_api_detection_count_by_type.go create mode 100644 falcon/models/models_api_drift_indicators.go create mode 100644 falcon/models/models_api_filter_label.go create mode 100644 falcon/models/models_api_filter_response.go create mode 100644 falcon/models/models_api_image_assessment.go create mode 100644 falcon/models/models_api_image_assessment_history.go create mode 100644 falcon/models/models_api_image_by_vulnerability_count.go create mode 100644 falcon/models/models_api_image_combined_export.go create mode 100644 falcon/models/models_api_image_count.go create mode 100644 falcon/models/models_api_image_issues_summary.go create mode 100644 falcon/models/models_api_image_vulnerabilities_summary.go create mode 100644 falcon/models/models_api_kubernetes_i_o_m.go create mode 100644 falcon/models/models_api_package_combined.go create mode 100644 falcon/models/models_api_package_vulnerability.go create mode 100644 falcon/models/models_api_packages_by_vuln_count.go create mode 100644 falcon/models/models_api_policy_count_by_action.go create mode 100644 falcon/models/models_api_unidentified_container.go create mode 100644 falcon/models/models_api_vuln_by_image_count.go create mode 100644 falcon/models/models_api_vuln_by_publication_date.go create mode 100644 falcon/models/models_api_vuln_count.go create mode 100644 falcon/models/models_api_vuln_count_by_severity.go create mode 100644 falcon/models/models_api_vulnerability_combined.go create mode 100644 falcon/models/models_api_vulnerability_details.go create mode 100644 falcon/models/models_api_vulnerability_info.go create mode 100644 falcon/models/models_cluster.go create mode 100644 falcon/models/models_cluster_agents.go rename falcon/models/{apidomain_data_ingest_response_wrapper_v1.go => models_cluster_entity_response.go} (59%) create mode 100644 falcon/models/models_container.go create mode 100644 falcon/models/models_container_agents.go create mode 100644 falcon/models/models_container_coverage.go create mode 100644 falcon/models/models_container_coverage_response_entity.go create mode 100644 falcon/models/models_container_entity_response.go create mode 100644 falcon/models/models_container_image.go create mode 100644 falcon/models/models_container_information.go create mode 100644 falcon/models/models_container_port_list.go create mode 100644 falcon/models/models_container_runtime_pivot.go create mode 100644 falcon/models/models_container_runtime_pivot_response.go create mode 100644 falcon/models/models_deployment.go create mode 100644 falcon/models/models_deployment_entity_response.go create mode 100644 falcon/models/models_image_information.go create mode 100644 falcon/models/models_image_summary_packages_info.go create mode 100644 falcon/models/models_issues_summary_container_info.go delete mode 100644 falcon/models/models_job_meta_data.go create mode 100644 falcon/models/models_light_weight_config.go create mode 100644 falcon/models/models_light_weight_config_exposed_ports.go create mode 100644 falcon/models/models_node.go create mode 100644 falcon/models/models_node_agents.go rename falcon/models/{domain_saved_search_wrapper.go => models_node_entity_response.go} (80%) create mode 100644 falcon/models/models_package_name_version_type.go create mode 100644 falcon/models/models_pod.go create mode 100644 falcon/models/models_pod_agents.go create mode 100644 falcon/models/models_pod_containers.go rename falcon/models/{custom_type2096042126.go => models_pod_entity_response.go} (60%) create mode 100644 falcon/models/models_pod_ports.go delete mode 100644 falcon/models/models_scan_results.go delete mode 100644 falcon/models/models_snapshot_inventory_application.go delete mode 100644 falcon/models/models_snapshot_inventory_payload.go create mode 100644 falcon/models/packages_api_combined_package.go create mode 100644 falcon/models/packages_api_combined_package_export.go create mode 100644 falcon/models/packages_api_packages_by_vuln_count.go rename falcon/models/{sadomain_submit_for_blocking_info.go => sadomain_submission_information.go} (68%) create mode 100644 falcon/models/scheduledexclusions_repeated.go create mode 100644 falcon/models/unidentifiedcontainers_unidentified_container_api_response.go create mode 100644 falcon/models/unidentifiedcontainers_unidentified_containers_count_value.go create mode 100644 falcon/models/vulnerabilities_api_combined_vulnerability.go create mode 100644 falcon/models/vulnerabilities_api_combined_vulnerability_details.go create mode 100644 falcon/models/vulnerabilities_api_combined_vulnerability_info.go create mode 100644 falcon/models/vulnerabilities_api_vuln_by_image_count.go create mode 100644 falcon/models/vulnerabilities_api_vuln_by_publication.go create mode 100644 falcon/models/vulnerabilities_api_vuln_count.go create mode 100644 falcon/models/vulnerabilities_api_vuln_count_by_actively_exploited.go create mode 100644 falcon/models/vulnerabilities_api_vuln_count_by_c_s_p_rating.go create mode 100644 falcon/models/vulnerabilities_api_vuln_count_by_c_v_s_s_score.go create mode 100644 falcon/models/vulnerabilities_api_vuln_count_by_severity.go diff --git a/examples/falcon_vulnerabilities/main.go b/examples/falcon_vulnerabilities/main.go index b15da1e1..0a425600 100644 --- a/examples/falcon_vulnerabilities/main.go +++ b/examples/falcon_vulnerabilities/main.go @@ -9,7 +9,7 @@ import ( "github.com/crowdstrike/gofalcon/falcon" "github.com/crowdstrike/gofalcon/falcon/client" - "github.com/crowdstrike/gofalcon/falcon/client/vulnerabilities" + "github.com/crowdstrike/gofalcon/falcon/client/spotlight_vulnerabilities" "github.com/crowdstrike/gofalcon/falcon/models" "github.com/crowdstrike/gofalcon/pkg/falcon_util" ) @@ -88,8 +88,8 @@ func queryVulnerabilities(client *client.CrowdStrikeAPISpecification, filter str go func() { lastSeen := (*string)(nil) for { - response, err := client.Vulnerabilities.CombinedQueryVulnerabilities( - &vulnerabilities.CombinedQueryVulnerabilitiesParams{ + response, err := client.SpotlightVulnerabilities.CombinedQueryVulnerabilities( + &spotlight_vulnerabilities.CombinedQueryVulnerabilitiesParams{ Context: context.Background(), Facet: []string{"cve", "host_info", "remediation", "evaluation_logic"}, Filter: filter, diff --git a/falcon/client/alerts/alerts_client.go b/falcon/client/alerts/alerts_client.go index b00e39b4..4d95b68c 100644 --- a/falcon/client/alerts/alerts_client.go +++ b/falcon/client/alerts/alerts_client.go @@ -30,17 +30,63 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + GetAggregateV2(params *GetAggregateV2Params, opts ...ClientOption) (*GetAggregateV2OK, error) + GetQueriesAlertsV1(params *GetQueriesAlertsV1Params, opts ...ClientOption) (*GetQueriesAlertsV1OK, error) + GetV2(params *GetV2Params, opts ...ClientOption) (*GetV2OK, error) + PatchEntitiesAlertsV2(params *PatchEntitiesAlertsV2Params, opts ...ClientOption) (*PatchEntitiesAlertsV2OK, error) PostAggregatesAlertsV1(params *PostAggregatesAlertsV1Params, opts ...ClientOption) (*PostAggregatesAlertsV1OK, error) PostEntitiesAlertsV1(params *PostEntitiesAlertsV1Params, opts ...ClientOption) (*PostEntitiesAlertsV1OK, error) + QueryV2(params *QueryV2Params, opts ...ClientOption) (*QueryV2OK, error) + + UpdateV3(params *UpdateV3Params, opts ...ClientOption) (*UpdateV3OK, error) + SetTransport(transport runtime.ClientTransport) } +/* +GetAggregateV2 retrieves aggregate values for alerts across all c i ds +*/ +func (a *Client) GetAggregateV2(params *GetAggregateV2Params, opts ...ClientOption) (*GetAggregateV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAggregateV2Params() + } + op := &runtime.ClientOperation{ + ID: "GetAggregateV2", + Method: "POST", + PathPattern: "/alerts/aggregates/alerts/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAggregateV2Reader{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.(*GetAggregateV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetAggregateV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetQueriesAlertsV1 retrieves all alerts ids that match a given query */ @@ -79,6 +125,44 @@ func (a *Client) GetQueriesAlertsV1(params *GetQueriesAlertsV1Params, opts ...Cl panic(msg) } +/* +GetV2 retrieves all alerts given their composite ids +*/ +func (a *Client) GetV2(params *GetV2Params, opts ...ClientOption) (*GetV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetV2Params() + } + op := &runtime.ClientOperation{ + ID: "GetV2", + Method: "POST", + PathPattern: "/alerts/entities/alerts/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetV2Reader{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.(*GetV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PatchEntitiesAlertsV2 performs actions on detections identified by detection ID s in request each action has a name and a description which describes what the action does if a request adds and removes tag in a single request the order of processing would be to remove tags before adding new ones in */ @@ -193,6 +277,82 @@ func (a *Client) PostEntitiesAlertsV1(params *PostEntitiesAlertsV1Params, opts . panic(msg) } +/* +QueryV2 retrieves all alerts ids that match a given query +*/ +func (a *Client) QueryV2(params *QueryV2Params, opts ...ClientOption) (*QueryV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewQueryV2Params() + } + op := &runtime.ClientOperation{ + ID: "QueryV2", + Method: "GET", + PathPattern: "/alerts/queries/alerts/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &QueryV2Reader{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.(*QueryV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for QueryV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateV3 performs actions on detections identified by detection ID s in request each action has a name and a description which describes what the action does if a request adds and removes tag in a single request the order of processing would be to remove tags before adding new ones in +*/ +func (a *Client) UpdateV3(params *UpdateV3Params, opts ...ClientOption) (*UpdateV3OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateV3Params() + } + op := &runtime.ClientOperation{ + ID: "UpdateV3", + Method: "PATCH", + PathPattern: "/alerts/entities/alerts/v3", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateV3Reader{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.(*UpdateV3OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for UpdateV3: 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/alerts/get_aggregate_v2_parameters.go b/falcon/client/alerts/get_aggregate_v2_parameters.go new file mode 100644 index 00000000..5bdc9d10 --- /dev/null +++ b/falcon/client/alerts/get_aggregate_v2_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetAggregateV2Params creates a new GetAggregateV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAggregateV2Params() *GetAggregateV2Params { + return &GetAggregateV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAggregateV2ParamsWithTimeout creates a new GetAggregateV2Params object +// with the ability to set a timeout on a request. +func NewGetAggregateV2ParamsWithTimeout(timeout time.Duration) *GetAggregateV2Params { + return &GetAggregateV2Params{ + timeout: timeout, + } +} + +// NewGetAggregateV2ParamsWithContext creates a new GetAggregateV2Params object +// with the ability to set a context for a request. +func NewGetAggregateV2ParamsWithContext(ctx context.Context) *GetAggregateV2Params { + return &GetAggregateV2Params{ + Context: ctx, + } +} + +// NewGetAggregateV2ParamsWithHTTPClient creates a new GetAggregateV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetAggregateV2ParamsWithHTTPClient(client *http.Client) *GetAggregateV2Params { + return &GetAggregateV2Params{ + HTTPClient: client, + } +} + +/* +GetAggregateV2Params contains all the parameters to send to the API endpoint + + for the get aggregate v2 operation. + + Typically these are written to a http.Request. +*/ +type GetAggregateV2Params struct { + + /* Body. + + request body takes a list of aggregate-alert query requests + */ + Body []*models.DetectsapiAggregateAlertQueryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get aggregate v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAggregateV2Params) WithDefaults() *GetAggregateV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get aggregate v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAggregateV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get aggregate v2 params +func (o *GetAggregateV2Params) WithTimeout(timeout time.Duration) *GetAggregateV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get aggregate v2 params +func (o *GetAggregateV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get aggregate v2 params +func (o *GetAggregateV2Params) WithContext(ctx context.Context) *GetAggregateV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get aggregate v2 params +func (o *GetAggregateV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get aggregate v2 params +func (o *GetAggregateV2Params) WithHTTPClient(client *http.Client) *GetAggregateV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get aggregate v2 params +func (o *GetAggregateV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get aggregate v2 params +func (o *GetAggregateV2Params) WithBody(body []*models.DetectsapiAggregateAlertQueryRequest) *GetAggregateV2Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get aggregate v2 params +func (o *GetAggregateV2Params) SetBody(body []*models.DetectsapiAggregateAlertQueryRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAggregateV2Params) 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/inventories/create_inventory_responses.go b/falcon/client/alerts/get_aggregate_v2_responses.go similarity index 52% rename from falcon/client/inventories/create_inventory_responses.go rename to falcon/client/alerts/get_aggregate_v2_responses.go index d7964bfa..24731deb 100644 --- a/falcon/client/inventories/create_inventory_responses.go +++ b/falcon/client/alerts/get_aggregate_v2_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package inventories +package alerts // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -17,60 +17,60 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// CreateInventoryReader is a Reader for the CreateInventory structure. -type CreateInventoryReader struct { +// GetAggregateV2Reader is a Reader for the GetAggregateV2 structure. +type GetAggregateV2Reader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *CreateInventoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *GetAggregateV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewCreateInventoryOK() + result := NewGetAggregateV2OK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: - result := NewCreateInventoryBadRequest() + result := NewGetAggregateV2BadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: - result := NewCreateInventoryForbidden() + result := NewGetAggregateV2Forbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewCreateInventoryTooManyRequests() + result := NewGetAggregateV2TooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: - result := NewCreateInventoryInternalServerError() + result := NewGetAggregateV2InternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[POST /snapshots/entities/inventories/v1] CreateInventory", response, response.Code()) + return nil, runtime.NewAPIError("[POST /alerts/aggregates/alerts/v2] GetAggregateV2", response, response.Code()) } } -// NewCreateInventoryOK creates a CreateInventoryOK with default headers values -func NewCreateInventoryOK() *CreateInventoryOK { - return &CreateInventoryOK{} +// NewGetAggregateV2OK creates a GetAggregateV2OK with default headers values +func NewGetAggregateV2OK() *GetAggregateV2OK { + return &GetAggregateV2OK{} } /* -CreateInventoryOK describes a response with status code 200, with default header values. +GetAggregateV2OK describes a response with status code 200, with default header values. OK */ -type CreateInventoryOK struct { +type GetAggregateV2OK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -84,52 +84,52 @@ type CreateInventoryOK struct { */ XRateLimitRemaining int64 - Payload *models.CommonEntitiesResponse + Payload *models.DetectsapiAggregatesResponse } -// IsSuccess returns true when this create inventory o k response has a 2xx status code -func (o *CreateInventoryOK) IsSuccess() bool { +// IsSuccess returns true when this get aggregate v2 o k response has a 2xx status code +func (o *GetAggregateV2OK) IsSuccess() bool { return true } -// IsRedirect returns true when this create inventory o k response has a 3xx status code -func (o *CreateInventoryOK) IsRedirect() bool { +// IsRedirect returns true when this get aggregate v2 o k response has a 3xx status code +func (o *GetAggregateV2OK) IsRedirect() bool { return false } -// IsClientError returns true when this create inventory o k response has a 4xx status code -func (o *CreateInventoryOK) IsClientError() bool { +// IsClientError returns true when this get aggregate v2 o k response has a 4xx status code +func (o *GetAggregateV2OK) IsClientError() bool { return false } -// IsServerError returns true when this create inventory o k response has a 5xx status code -func (o *CreateInventoryOK) IsServerError() bool { +// IsServerError returns true when this get aggregate v2 o k response has a 5xx status code +func (o *GetAggregateV2OK) IsServerError() bool { return false } -// IsCode returns true when this create inventory o k response a status code equal to that given -func (o *CreateInventoryOK) IsCode(code int) bool { +// IsCode returns true when this get aggregate v2 o k response a status code equal to that given +func (o *GetAggregateV2OK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the create inventory o k response -func (o *CreateInventoryOK) Code() int { +// Code gets the status code for the get aggregate v2 o k response +func (o *GetAggregateV2OK) Code() int { return 200 } -func (o *CreateInventoryOK) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryOK %+v", 200, o.Payload) +func (o *GetAggregateV2OK) Error() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2OK %+v", 200, o.Payload) } -func (o *CreateInventoryOK) String() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryOK %+v", 200, o.Payload) +func (o *GetAggregateV2OK) String() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2OK %+v", 200, o.Payload) } -func (o *CreateInventoryOK) GetPayload() *models.CommonEntitiesResponse { +func (o *GetAggregateV2OK) GetPayload() *models.DetectsapiAggregatesResponse { return o.Payload } -func (o *CreateInventoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetAggregateV2OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -160,7 +160,7 @@ func (o *CreateInventoryOK) readResponse(response runtime.ClientResponse, consum o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.CommonEntitiesResponse) + o.Payload = new(models.DetectsapiAggregatesResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -170,17 +170,17 @@ func (o *CreateInventoryOK) readResponse(response runtime.ClientResponse, consum return nil } -// NewCreateInventoryBadRequest creates a CreateInventoryBadRequest with default headers values -func NewCreateInventoryBadRequest() *CreateInventoryBadRequest { - return &CreateInventoryBadRequest{} +// NewGetAggregateV2BadRequest creates a GetAggregateV2BadRequest with default headers values +func NewGetAggregateV2BadRequest() *GetAggregateV2BadRequest { + return &GetAggregateV2BadRequest{} } /* -CreateInventoryBadRequest describes a response with status code 400, with default header values. +GetAggregateV2BadRequest describes a response with status code 400, with default header values. Bad Request */ -type CreateInventoryBadRequest struct { +type GetAggregateV2BadRequest struct { /* Trace-ID: submit to support if resolving an issue */ @@ -194,52 +194,52 @@ type CreateInventoryBadRequest struct { */ XRateLimitRemaining int64 - Payload *models.MsaspecResponseFields + Payload *models.DetectsapiAggregatesResponse } -// IsSuccess returns true when this create inventory bad request response has a 2xx status code -func (o *CreateInventoryBadRequest) IsSuccess() bool { +// IsSuccess returns true when this get aggregate v2 bad request response has a 2xx status code +func (o *GetAggregateV2BadRequest) IsSuccess() bool { return false } -// IsRedirect returns true when this create inventory bad request response has a 3xx status code -func (o *CreateInventoryBadRequest) IsRedirect() bool { +// IsRedirect returns true when this get aggregate v2 bad request response has a 3xx status code +func (o *GetAggregateV2BadRequest) IsRedirect() bool { return false } -// IsClientError returns true when this create inventory bad request response has a 4xx status code -func (o *CreateInventoryBadRequest) IsClientError() bool { +// IsClientError returns true when this get aggregate v2 bad request response has a 4xx status code +func (o *GetAggregateV2BadRequest) IsClientError() bool { return true } -// IsServerError returns true when this create inventory bad request response has a 5xx status code -func (o *CreateInventoryBadRequest) IsServerError() bool { +// IsServerError returns true when this get aggregate v2 bad request response has a 5xx status code +func (o *GetAggregateV2BadRequest) IsServerError() bool { return false } -// IsCode returns true when this create inventory bad request response a status code equal to that given -func (o *CreateInventoryBadRequest) IsCode(code int) bool { +// IsCode returns true when this get aggregate v2 bad request response a status code equal to that given +func (o *GetAggregateV2BadRequest) IsCode(code int) bool { return code == 400 } -// Code gets the status code for the create inventory bad request response -func (o *CreateInventoryBadRequest) Code() int { +// Code gets the status code for the get aggregate v2 bad request response +func (o *GetAggregateV2BadRequest) Code() int { return 400 } -func (o *CreateInventoryBadRequest) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryBadRequest %+v", 400, o.Payload) +func (o *GetAggregateV2BadRequest) Error() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2BadRequest %+v", 400, o.Payload) } -func (o *CreateInventoryBadRequest) String() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryBadRequest %+v", 400, o.Payload) +func (o *GetAggregateV2BadRequest) String() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2BadRequest %+v", 400, o.Payload) } -func (o *CreateInventoryBadRequest) GetPayload() *models.MsaspecResponseFields { +func (o *GetAggregateV2BadRequest) GetPayload() *models.DetectsapiAggregatesResponse { return o.Payload } -func (o *CreateInventoryBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetAggregateV2BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -270,7 +270,7 @@ func (o *CreateInventoryBadRequest) readResponse(response runtime.ClientResponse o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaspecResponseFields) + o.Payload = new(models.DetectsapiAggregatesResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -280,17 +280,17 @@ func (o *CreateInventoryBadRequest) readResponse(response runtime.ClientResponse return nil } -// NewCreateInventoryForbidden creates a CreateInventoryForbidden with default headers values -func NewCreateInventoryForbidden() *CreateInventoryForbidden { - return &CreateInventoryForbidden{} +// NewGetAggregateV2Forbidden creates a GetAggregateV2Forbidden with default headers values +func NewGetAggregateV2Forbidden() *GetAggregateV2Forbidden { + return &GetAggregateV2Forbidden{} } /* -CreateInventoryForbidden describes a response with status code 403, with default header values. +GetAggregateV2Forbidden describes a response with status code 403, with default header values. Forbidden */ -type CreateInventoryForbidden struct { +type GetAggregateV2Forbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -304,52 +304,52 @@ type CreateInventoryForbidden struct { */ XRateLimitRemaining int64 - Payload *models.MsaspecResponseFields + Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this create inventory forbidden response has a 2xx status code -func (o *CreateInventoryForbidden) IsSuccess() bool { +// IsSuccess returns true when this get aggregate v2 forbidden response has a 2xx status code +func (o *GetAggregateV2Forbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this create inventory forbidden response has a 3xx status code -func (o *CreateInventoryForbidden) IsRedirect() bool { +// IsRedirect returns true when this get aggregate v2 forbidden response has a 3xx status code +func (o *GetAggregateV2Forbidden) IsRedirect() bool { return false } -// IsClientError returns true when this create inventory forbidden response has a 4xx status code -func (o *CreateInventoryForbidden) IsClientError() bool { +// IsClientError returns true when this get aggregate v2 forbidden response has a 4xx status code +func (o *GetAggregateV2Forbidden) IsClientError() bool { return true } -// IsServerError returns true when this create inventory forbidden response has a 5xx status code -func (o *CreateInventoryForbidden) IsServerError() bool { +// IsServerError returns true when this get aggregate v2 forbidden response has a 5xx status code +func (o *GetAggregateV2Forbidden) IsServerError() bool { return false } -// IsCode returns true when this create inventory forbidden response a status code equal to that given -func (o *CreateInventoryForbidden) IsCode(code int) bool { +// IsCode returns true when this get aggregate v2 forbidden response a status code equal to that given +func (o *GetAggregateV2Forbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the create inventory forbidden response -func (o *CreateInventoryForbidden) Code() int { +// Code gets the status code for the get aggregate v2 forbidden response +func (o *GetAggregateV2Forbidden) Code() int { return 403 } -func (o *CreateInventoryForbidden) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryForbidden %+v", 403, o.Payload) +func (o *GetAggregateV2Forbidden) Error() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2Forbidden %+v", 403, o.Payload) } -func (o *CreateInventoryForbidden) String() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryForbidden %+v", 403, o.Payload) +func (o *GetAggregateV2Forbidden) String() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2Forbidden %+v", 403, o.Payload) } -func (o *CreateInventoryForbidden) GetPayload() *models.MsaspecResponseFields { +func (o *GetAggregateV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *CreateInventoryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetAggregateV2Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -380,7 +380,7 @@ func (o *CreateInventoryForbidden) readResponse(response runtime.ClientResponse, o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaspecResponseFields) + o.Payload = new(models.MsaReplyMetaOnly) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -390,17 +390,17 @@ func (o *CreateInventoryForbidden) readResponse(response runtime.ClientResponse, return nil } -// NewCreateInventoryTooManyRequests creates a CreateInventoryTooManyRequests with default headers values -func NewCreateInventoryTooManyRequests() *CreateInventoryTooManyRequests { - return &CreateInventoryTooManyRequests{} +// NewGetAggregateV2TooManyRequests creates a GetAggregateV2TooManyRequests with default headers values +func NewGetAggregateV2TooManyRequests() *GetAggregateV2TooManyRequests { + return &GetAggregateV2TooManyRequests{} } /* -CreateInventoryTooManyRequests describes a response with status code 429, with default header values. +GetAggregateV2TooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type CreateInventoryTooManyRequests struct { +type GetAggregateV2TooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -421,49 +421,49 @@ type CreateInventoryTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this create inventory too many requests response has a 2xx status code -func (o *CreateInventoryTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this get aggregate v2 too many requests response has a 2xx status code +func (o *GetAggregateV2TooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this create inventory too many requests response has a 3xx status code -func (o *CreateInventoryTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this get aggregate v2 too many requests response has a 3xx status code +func (o *GetAggregateV2TooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this create inventory too many requests response has a 4xx status code -func (o *CreateInventoryTooManyRequests) IsClientError() bool { +// IsClientError returns true when this get aggregate v2 too many requests response has a 4xx status code +func (o *GetAggregateV2TooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this create inventory too many requests response has a 5xx status code -func (o *CreateInventoryTooManyRequests) IsServerError() bool { +// IsServerError returns true when this get aggregate v2 too many requests response has a 5xx status code +func (o *GetAggregateV2TooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this create inventory too many requests response a status code equal to that given -func (o *CreateInventoryTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this get aggregate v2 too many requests response a status code equal to that given +func (o *GetAggregateV2TooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the create inventory too many requests response -func (o *CreateInventoryTooManyRequests) Code() int { +// Code gets the status code for the get aggregate v2 too many requests response +func (o *GetAggregateV2TooManyRequests) Code() int { return 429 } -func (o *CreateInventoryTooManyRequests) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryTooManyRequests %+v", 429, o.Payload) +func (o *GetAggregateV2TooManyRequests) Error() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2TooManyRequests %+v", 429, o.Payload) } -func (o *CreateInventoryTooManyRequests) String() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryTooManyRequests %+v", 429, o.Payload) +func (o *GetAggregateV2TooManyRequests) String() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2TooManyRequests %+v", 429, o.Payload) } -func (o *CreateInventoryTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetAggregateV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *CreateInventoryTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetAggregateV2TooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -515,17 +515,17 @@ func (o *CreateInventoryTooManyRequests) readResponse(response runtime.ClientRes return nil } -// NewCreateInventoryInternalServerError creates a CreateInventoryInternalServerError with default headers values -func NewCreateInventoryInternalServerError() *CreateInventoryInternalServerError { - return &CreateInventoryInternalServerError{} +// NewGetAggregateV2InternalServerError creates a GetAggregateV2InternalServerError with default headers values +func NewGetAggregateV2InternalServerError() *GetAggregateV2InternalServerError { + return &GetAggregateV2InternalServerError{} } /* -CreateInventoryInternalServerError describes a response with status code 500, with default header values. +GetAggregateV2InternalServerError describes a response with status code 500, with default header values. Internal Server Error */ -type CreateInventoryInternalServerError struct { +type GetAggregateV2InternalServerError struct { /* Trace-ID: submit to support if resolving an issue */ @@ -539,52 +539,52 @@ type CreateInventoryInternalServerError struct { */ XRateLimitRemaining int64 - Payload *models.MsaspecResponseFields + Payload *models.DetectsapiAggregatesResponse } -// IsSuccess returns true when this create inventory internal server error response has a 2xx status code -func (o *CreateInventoryInternalServerError) IsSuccess() bool { +// IsSuccess returns true when this get aggregate v2 internal server error response has a 2xx status code +func (o *GetAggregateV2InternalServerError) IsSuccess() bool { return false } -// IsRedirect returns true when this create inventory internal server error response has a 3xx status code -func (o *CreateInventoryInternalServerError) IsRedirect() bool { +// IsRedirect returns true when this get aggregate v2 internal server error response has a 3xx status code +func (o *GetAggregateV2InternalServerError) IsRedirect() bool { return false } -// IsClientError returns true when this create inventory internal server error response has a 4xx status code -func (o *CreateInventoryInternalServerError) IsClientError() bool { +// IsClientError returns true when this get aggregate v2 internal server error response has a 4xx status code +func (o *GetAggregateV2InternalServerError) IsClientError() bool { return false } -// IsServerError returns true when this create inventory internal server error response has a 5xx status code -func (o *CreateInventoryInternalServerError) IsServerError() bool { +// IsServerError returns true when this get aggregate v2 internal server error response has a 5xx status code +func (o *GetAggregateV2InternalServerError) IsServerError() bool { return true } -// IsCode returns true when this create inventory internal server error response a status code equal to that given -func (o *CreateInventoryInternalServerError) IsCode(code int) bool { +// IsCode returns true when this get aggregate v2 internal server error response a status code equal to that given +func (o *GetAggregateV2InternalServerError) IsCode(code int) bool { return code == 500 } -// Code gets the status code for the create inventory internal server error response -func (o *CreateInventoryInternalServerError) Code() int { +// Code gets the status code for the get aggregate v2 internal server error response +func (o *GetAggregateV2InternalServerError) Code() int { return 500 } -func (o *CreateInventoryInternalServerError) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryInternalServerError %+v", 500, o.Payload) +func (o *GetAggregateV2InternalServerError) Error() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2InternalServerError %+v", 500, o.Payload) } -func (o *CreateInventoryInternalServerError) String() string { - return fmt.Sprintf("[POST /snapshots/entities/inventories/v1][%d] createInventoryInternalServerError %+v", 500, o.Payload) +func (o *GetAggregateV2InternalServerError) String() string { + return fmt.Sprintf("[POST /alerts/aggregates/alerts/v2][%d] getAggregateV2InternalServerError %+v", 500, o.Payload) } -func (o *CreateInventoryInternalServerError) GetPayload() *models.MsaspecResponseFields { +func (o *GetAggregateV2InternalServerError) GetPayload() *models.DetectsapiAggregatesResponse { return o.Payload } -func (o *CreateInventoryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetAggregateV2InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -615,7 +615,7 @@ func (o *CreateInventoryInternalServerError) readResponse(response runtime.Clien o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.MsaspecResponseFields) + o.Payload = new(models.DetectsapiAggregatesResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/falcon/client/alerts/get_v2_parameters.go b/falcon/client/alerts/get_v2_parameters.go new file mode 100644 index 00000000..b9f29e75 --- /dev/null +++ b/falcon/client/alerts/get_v2_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetV2Params creates a new GetV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetV2Params() *GetV2Params { + return &GetV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetV2ParamsWithTimeout creates a new GetV2Params object +// with the ability to set a timeout on a request. +func NewGetV2ParamsWithTimeout(timeout time.Duration) *GetV2Params { + return &GetV2Params{ + timeout: timeout, + } +} + +// NewGetV2ParamsWithContext creates a new GetV2Params object +// with the ability to set a context for a request. +func NewGetV2ParamsWithContext(ctx context.Context) *GetV2Params { + return &GetV2Params{ + Context: ctx, + } +} + +// NewGetV2ParamsWithHTTPClient creates a new GetV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewGetV2ParamsWithHTTPClient(client *http.Client) *GetV2Params { + return &GetV2Params{ + HTTPClient: client, + } +} + +/* +GetV2Params contains all the parameters to send to the API endpoint + + for the get v2 operation. + + Typically these are written to a http.Request. +*/ +type GetV2Params struct { + + // Body. + Body *models.DetectsapiPostEntitiesAlertsV2Request + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV2Params) WithDefaults() *GetV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get v2 params +func (o *GetV2Params) WithTimeout(timeout time.Duration) *GetV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get v2 params +func (o *GetV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get v2 params +func (o *GetV2Params) WithContext(ctx context.Context) *GetV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get v2 params +func (o *GetV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get v2 params +func (o *GetV2Params) WithHTTPClient(client *http.Client) *GetV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get v2 params +func (o *GetV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get v2 params +func (o *GetV2Params) WithBody(body *models.DetectsapiPostEntitiesAlertsV2Request) *GetV2Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get v2 params +func (o *GetV2Params) SetBody(body *models.DetectsapiPostEntitiesAlertsV2Request) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetV2Params) 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/alerts/get_v2_responses.go b/falcon/client/alerts/get_v2_responses.go new file mode 100644 index 00000000..ac99407b --- /dev/null +++ b/falcon/client/alerts/get_v2_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by 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" +) + +// GetV2Reader is a Reader for the GetV2 structure. +type GetV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGetV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetV2InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /alerts/entities/alerts/v2] GetV2", response, response.Code()) + } +} + +// NewGetV2OK creates a GetV2OK with default headers values +func NewGetV2OK() *GetV2OK { + return &GetV2OK{} +} + +/* +GetV2OK describes a response with status code 200, with default header values. + +OK +*/ +type GetV2OK 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.DetectsapiPostEntitiesAlertsV2Response +} + +// IsSuccess returns true when this get v2 o k response has a 2xx status code +func (o *GetV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get v2 o k response has a 3xx status code +func (o *GetV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v2 o k response has a 4xx status code +func (o *GetV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get v2 o k response has a 5xx status code +func (o *GetV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this get v2 o k response a status code equal to that given +func (o *GetV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get v2 o k response +func (o *GetV2OK) Code() int { + return 200 +} + +func (o *GetV2OK) Error() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2OK %+v", 200, o.Payload) +} + +func (o *GetV2OK) String() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2OK %+v", 200, o.Payload) +} + +func (o *GetV2OK) GetPayload() *models.DetectsapiPostEntitiesAlertsV2Response { + return o.Payload +} + +func (o *GetV2OK) 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.DetectsapiPostEntitiesAlertsV2Response) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetV2BadRequest creates a GetV2BadRequest with default headers values +func NewGetV2BadRequest() *GetV2BadRequest { + return &GetV2BadRequest{} +} + +/* +GetV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type GetV2BadRequest 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.DetectsapiPostEntitiesAlertsV2Response +} + +// IsSuccess returns true when this get v2 bad request response has a 2xx status code +func (o *GetV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get v2 bad request response has a 3xx status code +func (o *GetV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v2 bad request response has a 4xx status code +func (o *GetV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get v2 bad request response has a 5xx status code +func (o *GetV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get v2 bad request response a status code equal to that given +func (o *GetV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get v2 bad request response +func (o *GetV2BadRequest) Code() int { + return 400 +} + +func (o *GetV2BadRequest) Error() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetV2BadRequest) String() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2BadRequest %+v", 400, o.Payload) +} + +func (o *GetV2BadRequest) GetPayload() *models.DetectsapiPostEntitiesAlertsV2Response { + return o.Payload +} + +func (o *GetV2BadRequest) 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.DetectsapiPostEntitiesAlertsV2Response) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetV2Forbidden creates a GetV2Forbidden with default headers values +func NewGetV2Forbidden() *GetV2Forbidden { + return &GetV2Forbidden{} +} + +/* +GetV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GetV2Forbidden 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 v2 forbidden response has a 2xx status code +func (o *GetV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get v2 forbidden response has a 3xx status code +func (o *GetV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v2 forbidden response has a 4xx status code +func (o *GetV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get v2 forbidden response has a 5xx status code +func (o *GetV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get v2 forbidden response a status code equal to that given +func (o *GetV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get v2 forbidden response +func (o *GetV2Forbidden) Code() int { + return 403 +} + +func (o *GetV2Forbidden) Error() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetV2Forbidden) String() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2Forbidden %+v", 403, o.Payload) +} + +func (o *GetV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetV2Forbidden) 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 +} + +// NewGetV2TooManyRequests creates a GetV2TooManyRequests with default headers values +func NewGetV2TooManyRequests() *GetV2TooManyRequests { + return &GetV2TooManyRequests{} +} + +/* +GetV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GetV2TooManyRequests 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 v2 too many requests response has a 2xx status code +func (o *GetV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get v2 too many requests response has a 3xx status code +func (o *GetV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v2 too many requests response has a 4xx status code +func (o *GetV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this get v2 too many requests response has a 5xx status code +func (o *GetV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this get v2 too many requests response a status code equal to that given +func (o *GetV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the get v2 too many requests response +func (o *GetV2TooManyRequests) Code() int { + return 429 +} + +func (o *GetV2TooManyRequests) Error() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetV2TooManyRequests) String() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *GetV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GetV2TooManyRequests) 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 +} + +// NewGetV2InternalServerError creates a GetV2InternalServerError with default headers values +func NewGetV2InternalServerError() *GetV2InternalServerError { + return &GetV2InternalServerError{} +} + +/* +GetV2InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GetV2InternalServerError 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.DetectsapiPostEntitiesAlertsV2Response +} + +// IsSuccess returns true when this get v2 internal server error response has a 2xx status code +func (o *GetV2InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get v2 internal server error response has a 3xx status code +func (o *GetV2InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v2 internal server error response has a 4xx status code +func (o *GetV2InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get v2 internal server error response has a 5xx status code +func (o *GetV2InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get v2 internal server error response a status code equal to that given +func (o *GetV2InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get v2 internal server error response +func (o *GetV2InternalServerError) Code() int { + return 500 +} + +func (o *GetV2InternalServerError) Error() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2InternalServerError %+v", 500, o.Payload) +} + +func (o *GetV2InternalServerError) String() string { + return fmt.Sprintf("[POST /alerts/entities/alerts/v2][%d] getV2InternalServerError %+v", 500, o.Payload) +} + +func (o *GetV2InternalServerError) GetPayload() *models.DetectsapiPostEntitiesAlertsV2Response { + return o.Payload +} + +func (o *GetV2InternalServerError) 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.DetectsapiPostEntitiesAlertsV2Response) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/alerts/query_v2_parameters.go b/falcon/client/alerts/query_v2_parameters.go new file mode 100644 index 00000000..90a95b45 --- /dev/null +++ b/falcon/client/alerts/query_v2_parameters.go @@ -0,0 +1,312 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewQueryV2Params creates a new QueryV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewQueryV2Params() *QueryV2Params { + return &QueryV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewQueryV2ParamsWithTimeout creates a new QueryV2Params object +// with the ability to set a timeout on a request. +func NewQueryV2ParamsWithTimeout(timeout time.Duration) *QueryV2Params { + return &QueryV2Params{ + timeout: timeout, + } +} + +// NewQueryV2ParamsWithContext creates a new QueryV2Params object +// with the ability to set a context for a request. +func NewQueryV2ParamsWithContext(ctx context.Context) *QueryV2Params { + return &QueryV2Params{ + Context: ctx, + } +} + +// NewQueryV2ParamsWithHTTPClient creates a new QueryV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewQueryV2ParamsWithHTTPClient(client *http.Client) *QueryV2Params { + return &QueryV2Params{ + HTTPClient: client, + } +} + +/* +QueryV2Params contains all the parameters to send to the API endpoint + + for the query v2 operation. + + Typically these are written to a http.Request. +*/ +type QueryV2Params struct { + + /* Filter. + + Filter Alerts using a query in Falcon Query Language (FQL).Filter fields can be any keyword field that is part of #domain.Alert + An asterisk wildcard `*` includes all results. + Empty value means to not filter on anything. + Most commonly used filter fields that supports exact match: cid, id, aggregate_id, product, type, pattern_id, platform ... + Most commonly used filter fields that supports wildcard (*): assigned_to_name, assigned_to_uuid, tactic_id, technique ... + Most commonly filter fields that supports range comparisons (>, <, >=, <=): severity, created_timestamp, timestamp, updated_timestamp... + All filter fields and operations support negation (!). + + + The full list of valid filter options is extensive. Review it in our [documentation inside the Falcon console](https://falcon.crowdstrike.com/documentation/45/falcon-query-language-fql). + */ + Filter *string + + /* Limit. + + The maximum number of detections to return in this response (default: 100; max: 10000). Use with the `offset` parameter to manage pagination of results. + */ + Limit *int64 + + /* Offset. + + The first detection to return, where `0` is the latest detection. Use with the `offset` parameter to manage pagination of results. + */ + Offset *int64 + + /* Q. + + Search all detection metadata for the provided string + */ + Q *string + + /* Sort. + + Sort parameter takes the form . Direction can be either `asc` (ascending) or `desc` (descending) order. For example: `status|asc` or `status|desc`. + + The sorting fields can be any keyword field that is part of #domain.Alert except for the text based fields. Most commonly used fields are status, cid, aggregate_id, timestamp, created_timestamp, updated_timestamp, assigned_to_name, assigned_to_uid, assigned_to_uuid, show_in_ui, tactic_id, tactic, technique, technique_id, pattern_id, product, comment, tags + If the fields are missing from the Alerts, the service will fallback to its default ordering + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the query v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryV2Params) WithDefaults() *QueryV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the query v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the query v2 params +func (o *QueryV2Params) WithTimeout(timeout time.Duration) *QueryV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the query v2 params +func (o *QueryV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the query v2 params +func (o *QueryV2Params) WithContext(ctx context.Context) *QueryV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the query v2 params +func (o *QueryV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the query v2 params +func (o *QueryV2Params) WithHTTPClient(client *http.Client) *QueryV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the query v2 params +func (o *QueryV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the query v2 params +func (o *QueryV2Params) WithFilter(filter *string) *QueryV2Params { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the query v2 params +func (o *QueryV2Params) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the query v2 params +func (o *QueryV2Params) WithLimit(limit *int64) *QueryV2Params { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the query v2 params +func (o *QueryV2Params) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the query v2 params +func (o *QueryV2Params) WithOffset(offset *int64) *QueryV2Params { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the query v2 params +func (o *QueryV2Params) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the query v2 params +func (o *QueryV2Params) WithQ(q *string) *QueryV2Params { + o.SetQ(q) + return o +} + +// SetQ adds the q to the query v2 params +func (o *QueryV2Params) SetQ(q *string) { + o.Q = q +} + +// WithSort adds the sort to the query v2 params +func (o *QueryV2Params) WithSort(sort *string) *QueryV2Params { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the query v2 params +func (o *QueryV2Params) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *QueryV2Params) 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/alerts/query_v2_responses.go b/falcon/client/alerts/query_v2_responses.go new file mode 100644 index 00000000..d06b3f5f --- /dev/null +++ b/falcon/client/alerts/query_v2_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by 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" +) + +// QueryV2Reader is a Reader for the QueryV2 structure. +type QueryV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *QueryV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewQueryV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewQueryV2BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewQueryV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewQueryV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewQueryV2InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /alerts/queries/alerts/v2] QueryV2", response, response.Code()) + } +} + +// NewQueryV2OK creates a QueryV2OK with default headers values +func NewQueryV2OK() *QueryV2OK { + return &QueryV2OK{} +} + +/* +QueryV2OK describes a response with status code 200, with default header values. + +OK +*/ +type QueryV2OK 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.DetectsapiAlertQueryResponse +} + +// IsSuccess returns true when this query v2 o k response has a 2xx status code +func (o *QueryV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this query v2 o k response has a 3xx status code +func (o *QueryV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query v2 o k response has a 4xx status code +func (o *QueryV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this query v2 o k response has a 5xx status code +func (o *QueryV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this query v2 o k response a status code equal to that given +func (o *QueryV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the query v2 o k response +func (o *QueryV2OK) Code() int { + return 200 +} + +func (o *QueryV2OK) Error() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2OK %+v", 200, o.Payload) +} + +func (o *QueryV2OK) String() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2OK %+v", 200, o.Payload) +} + +func (o *QueryV2OK) GetPayload() *models.DetectsapiAlertQueryResponse { + return o.Payload +} + +func (o *QueryV2OK) 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.DetectsapiAlertQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryV2BadRequest creates a QueryV2BadRequest with default headers values +func NewQueryV2BadRequest() *QueryV2BadRequest { + return &QueryV2BadRequest{} +} + +/* +QueryV2BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type QueryV2BadRequest 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.DetectsapiAlertQueryResponse +} + +// IsSuccess returns true when this query v2 bad request response has a 2xx status code +func (o *QueryV2BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query v2 bad request response has a 3xx status code +func (o *QueryV2BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query v2 bad request response has a 4xx status code +func (o *QueryV2BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this query v2 bad request response has a 5xx status code +func (o *QueryV2BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this query v2 bad request response a status code equal to that given +func (o *QueryV2BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the query v2 bad request response +func (o *QueryV2BadRequest) Code() int { + return 400 +} + +func (o *QueryV2BadRequest) Error() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2BadRequest %+v", 400, o.Payload) +} + +func (o *QueryV2BadRequest) String() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2BadRequest %+v", 400, o.Payload) +} + +func (o *QueryV2BadRequest) GetPayload() *models.DetectsapiAlertQueryResponse { + return o.Payload +} + +func (o *QueryV2BadRequest) 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.DetectsapiAlertQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryV2Forbidden creates a QueryV2Forbidden with default headers values +func NewQueryV2Forbidden() *QueryV2Forbidden { + return &QueryV2Forbidden{} +} + +/* +QueryV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type QueryV2Forbidden 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 v2 forbidden response has a 2xx status code +func (o *QueryV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query v2 forbidden response has a 3xx status code +func (o *QueryV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query v2 forbidden response has a 4xx status code +func (o *QueryV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this query v2 forbidden response has a 5xx status code +func (o *QueryV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this query v2 forbidden response a status code equal to that given +func (o *QueryV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the query v2 forbidden response +func (o *QueryV2Forbidden) Code() int { + return 403 +} + +func (o *QueryV2Forbidden) Error() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2Forbidden %+v", 403, o.Payload) +} + +func (o *QueryV2Forbidden) String() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2Forbidden %+v", 403, o.Payload) +} + +func (o *QueryV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryV2Forbidden) 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 +} + +// NewQueryV2TooManyRequests creates a QueryV2TooManyRequests with default headers values +func NewQueryV2TooManyRequests() *QueryV2TooManyRequests { + return &QueryV2TooManyRequests{} +} + +/* +QueryV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type QueryV2TooManyRequests 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 v2 too many requests response has a 2xx status code +func (o *QueryV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query v2 too many requests response has a 3xx status code +func (o *QueryV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query v2 too many requests response has a 4xx status code +func (o *QueryV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this query v2 too many requests response has a 5xx status code +func (o *QueryV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this query v2 too many requests response a status code equal to that given +func (o *QueryV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the query v2 too many requests response +func (o *QueryV2TooManyRequests) Code() int { + return 429 +} + +func (o *QueryV2TooManyRequests) Error() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryV2TooManyRequests) String() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryV2TooManyRequests) 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 +} + +// NewQueryV2InternalServerError creates a QueryV2InternalServerError with default headers values +func NewQueryV2InternalServerError() *QueryV2InternalServerError { + return &QueryV2InternalServerError{} +} + +/* +QueryV2InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type QueryV2InternalServerError 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.DetectsapiAlertQueryResponse +} + +// IsSuccess returns true when this query v2 internal server error response has a 2xx status code +func (o *QueryV2InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query v2 internal server error response has a 3xx status code +func (o *QueryV2InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query v2 internal server error response has a 4xx status code +func (o *QueryV2InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this query v2 internal server error response has a 5xx status code +func (o *QueryV2InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this query v2 internal server error response a status code equal to that given +func (o *QueryV2InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the query v2 internal server error response +func (o *QueryV2InternalServerError) Code() int { + return 500 +} + +func (o *QueryV2InternalServerError) Error() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2InternalServerError %+v", 500, o.Payload) +} + +func (o *QueryV2InternalServerError) String() string { + return fmt.Sprintf("[GET /alerts/queries/alerts/v2][%d] queryV2InternalServerError %+v", 500, o.Payload) +} + +func (o *QueryV2InternalServerError) GetPayload() *models.DetectsapiAlertQueryResponse { + return o.Payload +} + +func (o *QueryV2InternalServerError) 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.DetectsapiAlertQueryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/alerts/update_v3_parameters.go b/falcon/client/alerts/update_v3_parameters.go new file mode 100644 index 00000000..cb9479fb --- /dev/null +++ b/falcon/client/alerts/update_v3_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewUpdateV3Params creates a new UpdateV3Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateV3Params() *UpdateV3Params { + return &UpdateV3Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateV3ParamsWithTimeout creates a new UpdateV3Params object +// with the ability to set a timeout on a request. +func NewUpdateV3ParamsWithTimeout(timeout time.Duration) *UpdateV3Params { + return &UpdateV3Params{ + timeout: timeout, + } +} + +// NewUpdateV3ParamsWithContext creates a new UpdateV3Params object +// with the ability to set a context for a request. +func NewUpdateV3ParamsWithContext(ctx context.Context) *UpdateV3Params { + return &UpdateV3Params{ + Context: ctx, + } +} + +// NewUpdateV3ParamsWithHTTPClient creates a new UpdateV3Params object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateV3ParamsWithHTTPClient(client *http.Client) *UpdateV3Params { + return &UpdateV3Params{ + HTTPClient: client, + } +} + +/* +UpdateV3Params contains all the parameters to send to the API endpoint + + for the update v3 operation. + + Typically these are written to a http.Request. +*/ +type UpdateV3Params struct { + + /* Body. + + request body takes a list of action parameter request that is applied against all "ids" provided + */ + Body *models.DetectsapiPatchEntitiesAlertsV3Request + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update v3 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateV3Params) WithDefaults() *UpdateV3Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update v3 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateV3Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update v3 params +func (o *UpdateV3Params) WithTimeout(timeout time.Duration) *UpdateV3Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update v3 params +func (o *UpdateV3Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update v3 params +func (o *UpdateV3Params) WithContext(ctx context.Context) *UpdateV3Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update v3 params +func (o *UpdateV3Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update v3 params +func (o *UpdateV3Params) WithHTTPClient(client *http.Client) *UpdateV3Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update v3 params +func (o *UpdateV3Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update v3 params +func (o *UpdateV3Params) WithBody(body *models.DetectsapiPatchEntitiesAlertsV3Request) *UpdateV3Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update v3 params +func (o *UpdateV3Params) SetBody(body *models.DetectsapiPatchEntitiesAlertsV3Request) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateV3Params) 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/alerts/update_v3_responses.go b/falcon/client/alerts/update_v3_responses.go new file mode 100644 index 00000000..24b6b05d --- /dev/null +++ b/falcon/client/alerts/update_v3_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by 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" +) + +// UpdateV3Reader is a Reader for the UpdateV3 structure. +type UpdateV3Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateV3Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateV3OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateV3BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateV3Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewUpdateV3TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateV3InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /alerts/entities/alerts/v3] UpdateV3", response, response.Code()) + } +} + +// NewUpdateV3OK creates a UpdateV3OK with default headers values +func NewUpdateV3OK() *UpdateV3OK { + return &UpdateV3OK{} +} + +/* +UpdateV3OK describes a response with status code 200, with default header values. + +OK +*/ +type UpdateV3OK 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.DetectsapiResponseFields +} + +// IsSuccess returns true when this update v3 o k response has a 2xx status code +func (o *UpdateV3OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update v3 o k response has a 3xx status code +func (o *UpdateV3OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update v3 o k response has a 4xx status code +func (o *UpdateV3OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update v3 o k response has a 5xx status code +func (o *UpdateV3OK) IsServerError() bool { + return false +} + +// IsCode returns true when this update v3 o k response a status code equal to that given +func (o *UpdateV3OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update v3 o k response +func (o *UpdateV3OK) Code() int { + return 200 +} + +func (o *UpdateV3OK) Error() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3OK %+v", 200, o.Payload) +} + +func (o *UpdateV3OK) String() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3OK %+v", 200, o.Payload) +} + +func (o *UpdateV3OK) GetPayload() *models.DetectsapiResponseFields { + return o.Payload +} + +func (o *UpdateV3OK) 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.DetectsapiResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateV3BadRequest creates a UpdateV3BadRequest with default headers values +func NewUpdateV3BadRequest() *UpdateV3BadRequest { + return &UpdateV3BadRequest{} +} + +/* +UpdateV3BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateV3BadRequest 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.DetectsapiResponseFields +} + +// IsSuccess returns true when this update v3 bad request response has a 2xx status code +func (o *UpdateV3BadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update v3 bad request response has a 3xx status code +func (o *UpdateV3BadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update v3 bad request response has a 4xx status code +func (o *UpdateV3BadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update v3 bad request response has a 5xx status code +func (o *UpdateV3BadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update v3 bad request response a status code equal to that given +func (o *UpdateV3BadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update v3 bad request response +func (o *UpdateV3BadRequest) Code() int { + return 400 +} + +func (o *UpdateV3BadRequest) Error() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3BadRequest %+v", 400, o.Payload) +} + +func (o *UpdateV3BadRequest) String() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3BadRequest %+v", 400, o.Payload) +} + +func (o *UpdateV3BadRequest) GetPayload() *models.DetectsapiResponseFields { + return o.Payload +} + +func (o *UpdateV3BadRequest) 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.DetectsapiResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateV3Forbidden creates a UpdateV3Forbidden with default headers values +func NewUpdateV3Forbidden() *UpdateV3Forbidden { + return &UpdateV3Forbidden{} +} + +/* +UpdateV3Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type UpdateV3Forbidden 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 update v3 forbidden response has a 2xx status code +func (o *UpdateV3Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update v3 forbidden response has a 3xx status code +func (o *UpdateV3Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update v3 forbidden response has a 4xx status code +func (o *UpdateV3Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update v3 forbidden response has a 5xx status code +func (o *UpdateV3Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update v3 forbidden response a status code equal to that given +func (o *UpdateV3Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update v3 forbidden response +func (o *UpdateV3Forbidden) Code() int { + return 403 +} + +func (o *UpdateV3Forbidden) Error() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3Forbidden %+v", 403, o.Payload) +} + +func (o *UpdateV3Forbidden) String() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3Forbidden %+v", 403, o.Payload) +} + +func (o *UpdateV3Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *UpdateV3Forbidden) 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 +} + +// NewUpdateV3TooManyRequests creates a UpdateV3TooManyRequests with default headers values +func NewUpdateV3TooManyRequests() *UpdateV3TooManyRequests { + return &UpdateV3TooManyRequests{} +} + +/* +UpdateV3TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type UpdateV3TooManyRequests 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 v3 too many requests response has a 2xx status code +func (o *UpdateV3TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update v3 too many requests response has a 3xx status code +func (o *UpdateV3TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update v3 too many requests response has a 4xx status code +func (o *UpdateV3TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this update v3 too many requests response has a 5xx status code +func (o *UpdateV3TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this update v3 too many requests response a status code equal to that given +func (o *UpdateV3TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the update v3 too many requests response +func (o *UpdateV3TooManyRequests) Code() int { + return 429 +} + +func (o *UpdateV3TooManyRequests) Error() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3TooManyRequests %+v", 429, o.Payload) +} + +func (o *UpdateV3TooManyRequests) String() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3TooManyRequests %+v", 429, o.Payload) +} + +func (o *UpdateV3TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *UpdateV3TooManyRequests) 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 +} + +// NewUpdateV3InternalServerError creates a UpdateV3InternalServerError with default headers values +func NewUpdateV3InternalServerError() *UpdateV3InternalServerError { + return &UpdateV3InternalServerError{} +} + +/* +UpdateV3InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type UpdateV3InternalServerError 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.DetectsapiResponseFields +} + +// IsSuccess returns true when this update v3 internal server error response has a 2xx status code +func (o *UpdateV3InternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update v3 internal server error response has a 3xx status code +func (o *UpdateV3InternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update v3 internal server error response has a 4xx status code +func (o *UpdateV3InternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update v3 internal server error response has a 5xx status code +func (o *UpdateV3InternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update v3 internal server error response a status code equal to that given +func (o *UpdateV3InternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update v3 internal server error response +func (o *UpdateV3InternalServerError) Code() int { + return 500 +} + +func (o *UpdateV3InternalServerError) Error() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3InternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateV3InternalServerError) String() string { + return fmt.Sprintf("[PATCH /alerts/entities/alerts/v3][%d] updateV3InternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateV3InternalServerError) GetPayload() *models.DetectsapiResponseFields { + return o.Payload +} + +func (o *UpdateV3InternalServerError) 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.DetectsapiResponseFields) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/configuration_assessment/configuration_assessment_client.go b/falcon/client/configuration_assessment/configuration_assessment_client.go index 725f7763..c77775ac 100644 --- a/falcon/client/configuration_assessment/configuration_assessment_client.go +++ b/falcon/client/configuration_assessment/configuration_assessment_client.go @@ -32,6 +32,8 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { GetCombinedAssessmentsQuery(params *GetCombinedAssessmentsQueryParams, opts ...ClientOption) (*GetCombinedAssessmentsQueryOK, error) + GetRuleDetails(params *GetRuleDetailsParams, opts ...ClientOption) (*GetRuleDetailsOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -73,6 +75,44 @@ func (a *Client) GetCombinedAssessmentsQuery(params *GetCombinedAssessmentsQuery panic(msg) } +/* +GetRuleDetails gets rules details for provided one or more rule i ds +*/ +func (a *Client) GetRuleDetails(params *GetRuleDetailsParams, opts ...ClientOption) (*GetRuleDetailsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRuleDetailsParams() + } + op := &runtime.ClientOperation{ + ID: "getRuleDetails", + Method: "GET", + PathPattern: "/configuration-assessment/entities/rule-details/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetRuleDetailsReader{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.(*GetRuleDetailsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getRuleDetails: 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/configuration_assessment/get_rule_details_parameters.go b/falcon/client/configuration_assessment/get_rule_details_parameters.go new file mode 100644 index 00000000..eadbc054 --- /dev/null +++ b/falcon/client/configuration_assessment/get_rule_details_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package configuration_assessment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewGetRuleDetailsParams creates a new GetRuleDetailsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetRuleDetailsParams() *GetRuleDetailsParams { + return &GetRuleDetailsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetRuleDetailsParamsWithTimeout creates a new GetRuleDetailsParams object +// with the ability to set a timeout on a request. +func NewGetRuleDetailsParamsWithTimeout(timeout time.Duration) *GetRuleDetailsParams { + return &GetRuleDetailsParams{ + timeout: timeout, + } +} + +// NewGetRuleDetailsParamsWithContext creates a new GetRuleDetailsParams object +// with the ability to set a context for a request. +func NewGetRuleDetailsParamsWithContext(ctx context.Context) *GetRuleDetailsParams { + return &GetRuleDetailsParams{ + Context: ctx, + } +} + +// NewGetRuleDetailsParamsWithHTTPClient creates a new GetRuleDetailsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetRuleDetailsParamsWithHTTPClient(client *http.Client) *GetRuleDetailsParams { + return &GetRuleDetailsParams{ + HTTPClient: client, + } +} + +/* +GetRuleDetailsParams contains all the parameters to send to the API endpoint + + for the get rule details operation. + + Typically these are written to a http.Request. +*/ +type GetRuleDetailsParams struct { + + /* Ids. + + One or more rules IDs (max: 400) + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get rule details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRuleDetailsParams) WithDefaults() *GetRuleDetailsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get rule details params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRuleDetailsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get rule details params +func (o *GetRuleDetailsParams) WithTimeout(timeout time.Duration) *GetRuleDetailsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get rule details params +func (o *GetRuleDetailsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get rule details params +func (o *GetRuleDetailsParams) WithContext(ctx context.Context) *GetRuleDetailsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get rule details params +func (o *GetRuleDetailsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get rule details params +func (o *GetRuleDetailsParams) WithHTTPClient(client *http.Client) *GetRuleDetailsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get rule details params +func (o *GetRuleDetailsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the get rule details params +func (o *GetRuleDetailsParams) WithIds(ids []string) *GetRuleDetailsParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the get rule details params +func (o *GetRuleDetailsParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRuleDetailsParams) 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 +} + +// bindParamGetRuleDetails binds the parameter ids +func (o *GetRuleDetailsParams) 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/custom_storage/put_object_responses.go b/falcon/client/configuration_assessment/get_rule_details_responses.go similarity index 51% rename from falcon/client/custom_storage/put_object_responses.go rename to falcon/client/configuration_assessment/get_rule_details_responses.go index ccb44f71..21cfbca3 100644 --- a/falcon/client/custom_storage/put_object_responses.go +++ b/falcon/client/configuration_assessment/get_rule_details_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package custom_storage +package configuration_assessment // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// PutObjectReader is a Reader for the PutObject structure. -type PutObjectReader struct { +// GetRuleDetailsReader is a Reader for the GetRuleDetails structure. +type GetRuleDetailsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *PutObjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *GetRuleDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewPutObjectOK() + result := NewGetRuleDetailsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewPutObjectForbidden() + result := NewGetRuleDetailsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewPutObjectTooManyRequests() + result := NewGetRuleDetailsTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}] PutObject", response, response.Code()) + return nil, runtime.NewAPIError("[GET /configuration-assessment/entities/rule-details/v1] getRuleDetails", response, response.Code()) } } -// NewPutObjectOK creates a PutObjectOK with default headers values -func NewPutObjectOK() *PutObjectOK { - return &PutObjectOK{} +// NewGetRuleDetailsOK creates a GetRuleDetailsOK with default headers values +func NewGetRuleDetailsOK() *GetRuleDetailsOK { + return &GetRuleDetailsOK{} } /* - PutObjectOK describes a response with status code 200, with default header values. +GetRuleDetailsOK describes a response with status code 200, with default header values. OK */ -type PutObjectOK struct { +type GetRuleDetailsOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type PutObjectOK struct { */ XRateLimitRemaining int64 - Payload *models.CustomStorageResponsePayload + Payload *models.DomainAPIRuleDetailsResponseV1 } -// IsSuccess returns true when this put object o k response has a 2xx status code -func (o *PutObjectOK) IsSuccess() bool { +// IsSuccess returns true when this get rule details o k response has a 2xx status code +func (o *GetRuleDetailsOK) IsSuccess() bool { return true } -// IsRedirect returns true when this put object o k response has a 3xx status code -func (o *PutObjectOK) IsRedirect() bool { +// IsRedirect returns true when this get rule details o k response has a 3xx status code +func (o *GetRuleDetailsOK) IsRedirect() bool { return false } -// IsClientError returns true when this put object o k response has a 4xx status code -func (o *PutObjectOK) IsClientError() bool { +// IsClientError returns true when this get rule details o k response has a 4xx status code +func (o *GetRuleDetailsOK) IsClientError() bool { return false } -// IsServerError returns true when this put object o k response has a 5xx status code -func (o *PutObjectOK) IsServerError() bool { +// IsServerError returns true when this get rule details o k response has a 5xx status code +func (o *GetRuleDetailsOK) IsServerError() bool { return false } -// IsCode returns true when this put object o k response a status code equal to that given -func (o *PutObjectOK) IsCode(code int) bool { +// IsCode returns true when this get rule details o k response a status code equal to that given +func (o *GetRuleDetailsOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the put object o k response -func (o *PutObjectOK) Code() int { +// Code gets the status code for the get rule details o k response +func (o *GetRuleDetailsOK) Code() int { return 200 } -func (o *PutObjectOK) Error() string { - return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] putObjectOK %+v", 200, o.Payload) +func (o *GetRuleDetailsOK) Error() string { + return fmt.Sprintf("[GET /configuration-assessment/entities/rule-details/v1][%d] getRuleDetailsOK %+v", 200, o.Payload) } -func (o *PutObjectOK) String() string { - return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] putObjectOK %+v", 200, o.Payload) +func (o *GetRuleDetailsOK) String() string { + return fmt.Sprintf("[GET /configuration-assessment/entities/rule-details/v1][%d] getRuleDetailsOK %+v", 200, o.Payload) } -func (o *PutObjectOK) GetPayload() *models.CustomStorageResponsePayload { +func (o *GetRuleDetailsOK) GetPayload() *models.DomainAPIRuleDetailsResponseV1 { return o.Payload } -func (o *PutObjectOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetRuleDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *PutObjectOK) readResponse(response runtime.ClientResponse, consumer run o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.CustomStorageResponsePayload) + o.Payload = new(models.DomainAPIRuleDetailsResponseV1) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *PutObjectOK) readResponse(response runtime.ClientResponse, consumer run return nil } -// NewPutObjectForbidden creates a PutObjectForbidden with default headers values -func NewPutObjectForbidden() *PutObjectForbidden { - return &PutObjectForbidden{} +// NewGetRuleDetailsForbidden creates a GetRuleDetailsForbidden with default headers values +func NewGetRuleDetailsForbidden() *GetRuleDetailsForbidden { + return &GetRuleDetailsForbidden{} } /* - PutObjectForbidden describes a response with status code 403, with default header values. +GetRuleDetailsForbidden describes a response with status code 403, with default header values. Forbidden */ -type PutObjectForbidden struct { +type GetRuleDetailsForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type PutObjectForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this put object forbidden response has a 2xx status code -func (o *PutObjectForbidden) IsSuccess() bool { +// IsSuccess returns true when this get rule details forbidden response has a 2xx status code +func (o *GetRuleDetailsForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this put object forbidden response has a 3xx status code -func (o *PutObjectForbidden) IsRedirect() bool { +// IsRedirect returns true when this get rule details forbidden response has a 3xx status code +func (o *GetRuleDetailsForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this put object forbidden response has a 4xx status code -func (o *PutObjectForbidden) IsClientError() bool { +// IsClientError returns true when this get rule details forbidden response has a 4xx status code +func (o *GetRuleDetailsForbidden) IsClientError() bool { return true } -// IsServerError returns true when this put object forbidden response has a 5xx status code -func (o *PutObjectForbidden) IsServerError() bool { +// IsServerError returns true when this get rule details forbidden response has a 5xx status code +func (o *GetRuleDetailsForbidden) IsServerError() bool { return false } -// IsCode returns true when this put object forbidden response a status code equal to that given -func (o *PutObjectForbidden) IsCode(code int) bool { +// IsCode returns true when this get rule details forbidden response a status code equal to that given +func (o *GetRuleDetailsForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the put object forbidden response -func (o *PutObjectForbidden) Code() int { +// Code gets the status code for the get rule details forbidden response +func (o *GetRuleDetailsForbidden) Code() int { return 403 } -func (o *PutObjectForbidden) Error() string { - return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] putObjectForbidden %+v", 403, o.Payload) +func (o *GetRuleDetailsForbidden) Error() string { + return fmt.Sprintf("[GET /configuration-assessment/entities/rule-details/v1][%d] getRuleDetailsForbidden %+v", 403, o.Payload) } -func (o *PutObjectForbidden) String() string { - return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] putObjectForbidden %+v", 403, o.Payload) +func (o *GetRuleDetailsForbidden) String() string { + return fmt.Sprintf("[GET /configuration-assessment/entities/rule-details/v1][%d] getRuleDetailsForbidden %+v", 403, o.Payload) } -func (o *PutObjectForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetRuleDetailsForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *PutObjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetRuleDetailsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *PutObjectForbidden) readResponse(response runtime.ClientResponse, consu return nil } -// NewPutObjectTooManyRequests creates a PutObjectTooManyRequests with default headers values -func NewPutObjectTooManyRequests() *PutObjectTooManyRequests { - return &PutObjectTooManyRequests{} +// NewGetRuleDetailsTooManyRequests creates a GetRuleDetailsTooManyRequests with default headers values +func NewGetRuleDetailsTooManyRequests() *GetRuleDetailsTooManyRequests { + return &GetRuleDetailsTooManyRequests{} } /* - PutObjectTooManyRequests describes a response with status code 429, with default header values. +GetRuleDetailsTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type PutObjectTooManyRequests struct { +type GetRuleDetailsTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type PutObjectTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this put object too many requests response has a 2xx status code -func (o *PutObjectTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this get rule details too many requests response has a 2xx status code +func (o *GetRuleDetailsTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this put object too many requests response has a 3xx status code -func (o *PutObjectTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this get rule details too many requests response has a 3xx status code +func (o *GetRuleDetailsTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this put object too many requests response has a 4xx status code -func (o *PutObjectTooManyRequests) IsClientError() bool { +// IsClientError returns true when this get rule details too many requests response has a 4xx status code +func (o *GetRuleDetailsTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this put object too many requests response has a 5xx status code -func (o *PutObjectTooManyRequests) IsServerError() bool { +// IsServerError returns true when this get rule details too many requests response has a 5xx status code +func (o *GetRuleDetailsTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this put object too many requests response a status code equal to that given -func (o *PutObjectTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this get rule details too many requests response a status code equal to that given +func (o *GetRuleDetailsTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the put object too many requests response -func (o *PutObjectTooManyRequests) Code() int { +// Code gets the status code for the get rule details too many requests response +func (o *GetRuleDetailsTooManyRequests) Code() int { return 429 } -func (o *PutObjectTooManyRequests) Error() string { - return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] putObjectTooManyRequests %+v", 429, o.Payload) +func (o *GetRuleDetailsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /configuration-assessment/entities/rule-details/v1][%d] getRuleDetailsTooManyRequests %+v", 429, o.Payload) } -func (o *PutObjectTooManyRequests) String() string { - return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] putObjectTooManyRequests %+v", 429, o.Payload) +func (o *GetRuleDetailsTooManyRequests) String() string { + return fmt.Sprintf("[GET /configuration-assessment/entities/rule-details/v1][%d] getRuleDetailsTooManyRequests %+v", 429, o.Payload) } -func (o *PutObjectTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetRuleDetailsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *PutObjectTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetRuleDetailsTooManyRequests) 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/crowd_strike_api_specification_client.go b/falcon/client/crowd_strike_api_specification_client.go index e63d0059..c7c825d9 100644 --- a/falcon/client/crowd_strike_api_specification_client.go +++ b/falcon/client/crowd_strike_api_specification_client.go @@ -33,6 +33,7 @@ import ( "github.com/crowdstrike/gofalcon/falcon/client/filevantage" "github.com/crowdstrike/gofalcon/falcon/client/firewall_management" "github.com/crowdstrike/gofalcon/falcon/client/firewall_policies" + "github.com/crowdstrike/gofalcon/falcon/client/foundry_logscale" "github.com/crowdstrike/gofalcon/falcon/client/host_group" "github.com/crowdstrike/gofalcon/falcon/client/hosts" "github.com/crowdstrike/gofalcon/falcon/client/identity_entities" @@ -41,12 +42,10 @@ import ( "github.com/crowdstrike/gofalcon/falcon/client/installation_tokens" "github.com/crowdstrike/gofalcon/falcon/client/installation_tokens_settings" "github.com/crowdstrike/gofalcon/falcon/client/intel" - "github.com/crowdstrike/gofalcon/falcon/client/inventories" "github.com/crowdstrike/gofalcon/falcon/client/ioa_exclusions" "github.com/crowdstrike/gofalcon/falcon/client/ioc" "github.com/crowdstrike/gofalcon/falcon/client/iocs" "github.com/crowdstrike/gofalcon/falcon/client/kubernetes_protection" - "github.com/crowdstrike/gofalcon/falcon/client/logscale_management" "github.com/crowdstrike/gofalcon/falcon/client/malquery" "github.com/crowdstrike/gofalcon/falcon/client/message_center" "github.com/crowdstrike/gofalcon/falcon/client/ml_exclusions" @@ -63,19 +62,19 @@ import ( "github.com/crowdstrike/gofalcon/falcon/client/real_time_response_admin" "github.com/crowdstrike/gofalcon/falcon/client/real_time_response_audit" "github.com/crowdstrike/gofalcon/falcon/client/recon" - "github.com/crowdstrike/gofalcon/falcon/client/registration" "github.com/crowdstrike/gofalcon/falcon/client/report_executions" "github.com/crowdstrike/gofalcon/falcon/client/response_policies" "github.com/crowdstrike/gofalcon/falcon/client/sample_uploads" - "github.com/crowdstrike/gofalcon/falcon/client/saved_searches" "github.com/crowdstrike/gofalcon/falcon/client/scheduled_reports" "github.com/crowdstrike/gofalcon/falcon/client/sensor_download" "github.com/crowdstrike/gofalcon/falcon/client/sensor_update_policies" "github.com/crowdstrike/gofalcon/falcon/client/sensor_visibility_exclusions" + "github.com/crowdstrike/gofalcon/falcon/client/snapshots_registration" + "github.com/crowdstrike/gofalcon/falcon/client/spotlight_evaluation_logic" + "github.com/crowdstrike/gofalcon/falcon/client/spotlight_vulnerabilities" "github.com/crowdstrike/gofalcon/falcon/client/tailored_intelligence" + "github.com/crowdstrike/gofalcon/falcon/client/unidentified_containers" "github.com/crowdstrike/gofalcon/falcon/client/user_management" - "github.com/crowdstrike/gofalcon/falcon/client/vulnerabilities" - "github.com/crowdstrike/gofalcon/falcon/client/vulnerabilities_evaluation_logic" "github.com/crowdstrike/gofalcon/falcon/client/workflows" "github.com/crowdstrike/gofalcon/falcon/client/zero_trust_assessment" ) @@ -145,6 +144,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *CrowdStrik cli.Filevantage = filevantage.New(transport, formats) cli.FirewallManagement = firewall_management.New(transport, formats) cli.FirewallPolicies = firewall_policies.New(transport, formats) + cli.FoundryLogscale = foundry_logscale.New(transport, formats) cli.HostGroup = host_group.New(transport, formats) cli.Hosts = hosts.New(transport, formats) cli.IdentityEntities = identity_entities.New(transport, formats) @@ -153,12 +153,10 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *CrowdStrik cli.InstallationTokens = installation_tokens.New(transport, formats) cli.InstallationTokensSettings = installation_tokens_settings.New(transport, formats) cli.Intel = intel.New(transport, formats) - cli.Inventories = inventories.New(transport, formats) cli.IoaExclusions = ioa_exclusions.New(transport, formats) cli.Ioc = ioc.New(transport, formats) cli.Iocs = iocs.New(transport, formats) cli.KubernetesProtection = kubernetes_protection.New(transport, formats) - cli.LogscaleManagement = logscale_management.New(transport, formats) cli.Malquery = malquery.New(transport, formats) cli.MessageCenter = message_center.New(transport, formats) cli.MlExclusions = ml_exclusions.New(transport, formats) @@ -175,19 +173,19 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *CrowdStrik cli.RealTimeResponseAdmin = real_time_response_admin.New(transport, formats) cli.RealTimeResponseAudit = real_time_response_audit.New(transport, formats) cli.Recon = recon.New(transport, formats) - cli.Registration = registration.New(transport, formats) cli.ReportExecutions = report_executions.New(transport, formats) cli.ResponsePolicies = response_policies.New(transport, formats) cli.SampleUploads = sample_uploads.New(transport, formats) - cli.SavedSearches = saved_searches.New(transport, formats) cli.ScheduledReports = scheduled_reports.New(transport, formats) cli.SensorDownload = sensor_download.New(transport, formats) cli.SensorUpdatePolicies = sensor_update_policies.New(transport, formats) cli.SensorVisibilityExclusions = sensor_visibility_exclusions.New(transport, formats) + cli.SnapshotsRegistration = snapshots_registration.New(transport, formats) + cli.SpotlightEvaluationLogic = spotlight_evaluation_logic.New(transport, formats) + cli.SpotlightVulnerabilities = spotlight_vulnerabilities.New(transport, formats) cli.TailoredIntelligence = tailored_intelligence.New(transport, formats) + cli.UnidentifiedContainers = unidentified_containers.New(transport, formats) cli.UserManagement = user_management.New(transport, formats) - cli.Vulnerabilities = vulnerabilities.New(transport, formats) - cli.VulnerabilitiesEvaluationLogic = vulnerabilities_evaluation_logic.New(transport, formats) cli.Workflows = workflows.New(transport, formats) cli.ZeroTrustAssessment = zero_trust_assessment.New(transport, formats) return cli @@ -280,6 +278,8 @@ type CrowdStrikeAPISpecification struct { FirewallPolicies firewall_policies.ClientService + FoundryLogscale foundry_logscale.ClientService + HostGroup host_group.ClientService Hosts hosts.ClientService @@ -296,8 +296,6 @@ type CrowdStrikeAPISpecification struct { Intel intel.ClientService - Inventories inventories.ClientService - IoaExclusions ioa_exclusions.ClientService Ioc ioc.ClientService @@ -306,8 +304,6 @@ type CrowdStrikeAPISpecification struct { KubernetesProtection kubernetes_protection.ClientService - LogscaleManagement logscale_management.ClientService - Malquery malquery.ClientService MessageCenter message_center.ClientService @@ -340,16 +336,12 @@ type CrowdStrikeAPISpecification struct { Recon recon.ClientService - Registration registration.ClientService - ReportExecutions report_executions.ClientService ResponsePolicies response_policies.ClientService SampleUploads sample_uploads.ClientService - SavedSearches saved_searches.ClientService - ScheduledReports scheduled_reports.ClientService SensorDownload sensor_download.ClientService @@ -358,13 +350,17 @@ type CrowdStrikeAPISpecification struct { SensorVisibilityExclusions sensor_visibility_exclusions.ClientService - TailoredIntelligence tailored_intelligence.ClientService + SnapshotsRegistration snapshots_registration.ClientService - UserManagement user_management.ClientService + SpotlightEvaluationLogic spotlight_evaluation_logic.ClientService + + SpotlightVulnerabilities spotlight_vulnerabilities.ClientService - Vulnerabilities vulnerabilities.ClientService + TailoredIntelligence tailored_intelligence.ClientService - VulnerabilitiesEvaluationLogic vulnerabilities_evaluation_logic.ClientService + UnidentifiedContainers unidentified_containers.ClientService + + UserManagement user_management.ClientService Workflows workflows.ClientService @@ -399,6 +395,7 @@ func (c *CrowdStrikeAPISpecification) SetTransport(transport runtime.ClientTrans c.Filevantage.SetTransport(transport) c.FirewallManagement.SetTransport(transport) c.FirewallPolicies.SetTransport(transport) + c.FoundryLogscale.SetTransport(transport) c.HostGroup.SetTransport(transport) c.Hosts.SetTransport(transport) c.IdentityEntities.SetTransport(transport) @@ -407,12 +404,10 @@ func (c *CrowdStrikeAPISpecification) SetTransport(transport runtime.ClientTrans c.InstallationTokens.SetTransport(transport) c.InstallationTokensSettings.SetTransport(transport) c.Intel.SetTransport(transport) - c.Inventories.SetTransport(transport) c.IoaExclusions.SetTransport(transport) c.Ioc.SetTransport(transport) c.Iocs.SetTransport(transport) c.KubernetesProtection.SetTransport(transport) - c.LogscaleManagement.SetTransport(transport) c.Malquery.SetTransport(transport) c.MessageCenter.SetTransport(transport) c.MlExclusions.SetTransport(transport) @@ -429,19 +424,19 @@ func (c *CrowdStrikeAPISpecification) SetTransport(transport runtime.ClientTrans c.RealTimeResponseAdmin.SetTransport(transport) c.RealTimeResponseAudit.SetTransport(transport) c.Recon.SetTransport(transport) - c.Registration.SetTransport(transport) c.ReportExecutions.SetTransport(transport) c.ResponsePolicies.SetTransport(transport) c.SampleUploads.SetTransport(transport) - c.SavedSearches.SetTransport(transport) c.ScheduledReports.SetTransport(transport) c.SensorDownload.SetTransport(transport) c.SensorUpdatePolicies.SetTransport(transport) c.SensorVisibilityExclusions.SetTransport(transport) + c.SnapshotsRegistration.SetTransport(transport) + c.SpotlightEvaluationLogic.SetTransport(transport) + c.SpotlightVulnerabilities.SetTransport(transport) c.TailoredIntelligence.SetTransport(transport) + c.UnidentifiedContainers.SetTransport(transport) c.UserManagement.SetTransport(transport) - c.Vulnerabilities.SetTransport(transport) - c.VulnerabilitiesEvaluationLogic.SetTransport(transport) c.Workflows.SetTransport(transport) c.ZeroTrustAssessment.SetTransport(transport) } 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..5e049808 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: {name, created_by, created_on, modified_by, modified_on, enabled} */ 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..b7303bc8 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: {name, created_by, created_on, modified_by, modified_on, enabled} */ 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 6d064205..15300487 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.created_by, rules.created_on, rules.current_version.name, rules.current_version.description, rules.current_version.action_label, rules.current_version.modified_by, rules.current_version.modified_on, rules.ruletype_name, rules.enabled, rules.current_version.pattern_severity} + Possible order by fields: {rules.created_on, rules.current_version.action_label, rules.current_version.modified_by, rules.current_version.modified_on, rules.ruletype_name, rules.enabled, rules.current_version.description, rules.current_version.pattern_severity, rules.created_by, rules.current_version.name} */ Sort *string diff --git a/falcon/client/custom_storage/custom_storage_client.go b/falcon/client/custom_storage/custom_storage_client.go index 185c818f..1c2a6328 100644 --- a/falcon/client/custom_storage/custom_storage_client.go +++ b/falcon/client/custom_storage/custom_storage_client.go @@ -31,38 +31,38 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteObject(params *DeleteObjectParams, opts ...ClientOption) (*DeleteObjectOK, error) + Delete(params *DeleteParams, opts ...ClientOption) (*DeleteOK, error) - GetObject(params *GetObjectParams, writer io.Writer, opts ...ClientOption) (*GetObjectOK, error) + Get(params *GetParams, writer io.Writer, opts ...ClientOption) (*GetOK, error) - GetObjectMetadata(params *GetObjectMetadataParams, opts ...ClientOption) (*GetObjectMetadataOK, error) + List(params *ListParams, opts ...ClientOption) (*ListOK, error) - ListObjects(params *ListObjectsParams, opts ...ClientOption) (*ListObjectsOK, error) + Metadata(params *MetadataParams, opts ...ClientOption) (*MetadataOK, error) - PutObject(params *PutObjectParams, opts ...ClientOption) (*PutObjectOK, error) + Search(params *SearchParams, opts ...ClientOption) (*SearchOK, error) - SearchObjects(params *SearchObjectsParams, opts ...ClientOption) (*SearchObjectsOK, error) + Upload(params *UploadParams, opts ...ClientOption) (*UploadOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteObject deletes the specified object +Delete deletes the specified object */ -func (a *Client) DeleteObject(params *DeleteObjectParams, opts ...ClientOption) (*DeleteObjectOK, error) { +func (a *Client) Delete(params *DeleteParams, opts ...ClientOption) (*DeleteOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteObjectParams() + params = NewDeleteParams() } op := &runtime.ClientOperation{ - ID: "DeleteObject", + ID: "delete", Method: "DELETE", PathPattern: "/customobjects/v1/collections/{collection_name}/objects/{object_key}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteObjectReader{formats: a.formats}, + Reader: &DeleteReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -74,33 +74,33 @@ func (a *Client) DeleteObject(params *DeleteObjectParams, opts ...ClientOption) if err != nil { return nil, err } - success, ok := result.(*DeleteObjectOK) + success, ok := result.(*DeleteOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteObject: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetObject gets the bytes for the specified object +Get gets the bytes for the specified object */ -func (a *Client) GetObject(params *GetObjectParams, writer io.Writer, opts ...ClientOption) (*GetObjectOK, error) { +func (a *Client) Get(params *GetParams, writer io.Writer, opts ...ClientOption) (*GetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetObjectParams() + params = NewGetParams() } op := &runtime.ClientOperation{ - ID: "GetObject", + ID: "get", Method: "GET", PathPattern: "/customobjects/v1/collections/{collection_name}/objects/{object_key}", ProducesMediaTypes: []string{"application/json", "application/octet-stream"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetObjectReader{formats: a.formats, writer: writer}, + Reader: &GetReader{formats: a.formats, writer: writer}, Context: params.Context, Client: params.HTTPClient, } @@ -112,33 +112,33 @@ func (a *Client) GetObject(params *GetObjectParams, writer io.Writer, opts ...Cl if err != nil { return nil, err } - success, ok := result.(*GetObjectOK) + success, ok := result.(*GetOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetObject: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetObjectMetadata gets the metadata for the specified object +List lists the object keys in the specified collection in alphabetical order */ -func (a *Client) GetObjectMetadata(params *GetObjectMetadataParams, opts ...ClientOption) (*GetObjectMetadataOK, error) { +func (a *Client) List(params *ListParams, opts ...ClientOption) (*ListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetObjectMetadataParams() + params = NewListParams() } op := &runtime.ClientOperation{ - ID: "GetObjectMetadata", + ID: "list", Method: "GET", - PathPattern: "/customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata", + PathPattern: "/customobjects/v1/collections/{collection_name}/objects", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetObjectMetadataReader{formats: a.formats}, + Reader: &ListReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -150,33 +150,33 @@ func (a *Client) GetObjectMetadata(params *GetObjectMetadataParams, opts ...Clie if err != nil { return nil, err } - success, ok := result.(*GetObjectMetadataOK) + success, ok := result.(*ListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for GetObjectMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -ListObjects lists the object keys in the specified collection in alphabetical order +Metadata gets the metadata for the specified object */ -func (a *Client) ListObjects(params *ListObjectsParams, opts ...ClientOption) (*ListObjectsOK, error) { +func (a *Client) Metadata(params *MetadataParams, opts ...ClientOption) (*MetadataOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewListObjectsParams() + params = NewMetadataParams() } op := &runtime.ClientOperation{ - ID: "ListObjects", + ID: "metadata", Method: "GET", - PathPattern: "/customobjects/v1/collections/{collection_name}/objects", + PathPattern: "/customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &ListObjectsReader{formats: a.formats}, + Reader: &MetadataReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -188,33 +188,33 @@ func (a *Client) ListObjects(params *ListObjectsParams, opts ...ClientOption) (* if err != nil { return nil, err } - success, ok := result.(*ListObjectsOK) + success, ok := result.(*MetadataOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ListObjects: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for metadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutObject puts the specified new object at the given key or overwrite an existing object at the given key +Search searches for objects that match the specified filter criteria returns metadata not actual objects */ -func (a *Client) PutObject(params *PutObjectParams, opts ...ClientOption) (*PutObjectOK, error) { +func (a *Client) Search(params *SearchParams, opts ...ClientOption) (*SearchOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutObjectParams() + params = NewSearchParams() } op := &runtime.ClientOperation{ - ID: "PutObject", - Method: "PUT", - PathPattern: "/customobjects/v1/collections/{collection_name}/objects/{object_key}", + ID: "search", + Method: "POST", + PathPattern: "/customobjects/v1/collections/{collection_name}/objects", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json", "application/octet-stream"}, Schemes: []string{"https"}, Params: params, - Reader: &PutObjectReader{formats: a.formats}, + Reader: &SearchReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -226,33 +226,33 @@ func (a *Client) PutObject(params *PutObjectParams, opts ...ClientOption) (*PutO if err != nil { return nil, err } - success, ok := result.(*PutObjectOK) + success, ok := result.(*SearchOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for PutObject: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for search: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -SearchObjects searches for objects that match the specified filter criteria returns metadata not actual objects +Upload puts the specified new object at the given key or overwrite an existing object at the given key */ -func (a *Client) SearchObjects(params *SearchObjectsParams, opts ...ClientOption) (*SearchObjectsOK, error) { +func (a *Client) Upload(params *UploadParams, opts ...ClientOption) (*UploadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewSearchObjectsParams() + params = NewUploadParams() } op := &runtime.ClientOperation{ - ID: "SearchObjects", - Method: "POST", - PathPattern: "/customobjects/v1/collections/{collection_name}/objects", + ID: "upload", + Method: "PUT", + PathPattern: "/customobjects/v1/collections/{collection_name}/objects/{object_key}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json", "application/octet-stream"}, Schemes: []string{"https"}, Params: params, - Reader: &SearchObjectsReader{formats: a.formats}, + Reader: &UploadReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -264,13 +264,13 @@ func (a *Client) SearchObjects(params *SearchObjectsParams, opts ...ClientOption if err != nil { return nil, err } - success, ok := result.(*SearchObjectsOK) + success, ok := result.(*UploadOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for SearchObjects: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for upload: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/falcon/client/custom_storage/delete_object_parameters.go b/falcon/client/custom_storage/delete_object_parameters.go deleted file mode 100644 index 528a2dd4..00000000 --- a/falcon/client/custom_storage/delete_object_parameters.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewDeleteObjectParams creates a new DeleteObjectParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteObjectParams() *DeleteObjectParams { - return &DeleteObjectParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteObjectParamsWithTimeout creates a new DeleteObjectParams object -// with the ability to set a timeout on a request. -func NewDeleteObjectParamsWithTimeout(timeout time.Duration) *DeleteObjectParams { - return &DeleteObjectParams{ - timeout: timeout, - } -} - -// NewDeleteObjectParamsWithContext creates a new DeleteObjectParams object -// with the ability to set a context for a request. -func NewDeleteObjectParamsWithContext(ctx context.Context) *DeleteObjectParams { - return &DeleteObjectParams{ - Context: ctx, - } -} - -// NewDeleteObjectParamsWithHTTPClient creates a new DeleteObjectParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteObjectParamsWithHTTPClient(client *http.Client) *DeleteObjectParams { - return &DeleteObjectParams{ - HTTPClient: client, - } -} - -/* -DeleteObjectParams contains all the parameters to send to the API endpoint - - for the delete object operation. - - Typically these are written to a http.Request. -*/ -type DeleteObjectParams struct { - - /* XCSADBNAMESPACE. - - The name of the namespace the collection belongs to - */ - XCSADBNAMESPACE string - - /* XCSAPPID. - - The id of the app the collection belongs to. This will map to the namespace of the collection - */ - XCSAPPID *string - - /* CollectionName. - - The name of the collection - */ - CollectionName string - - /* DryRun. - - If false, run the operation as normal. If true, validate that the request *would* succeed, but don't execute it. - */ - DryRun bool - - /* ObjectKey. - - The object key - */ - ObjectKey string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteObjectParams) WithDefaults() *DeleteObjectParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteObjectParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete object params -func (o *DeleteObjectParams) WithTimeout(timeout time.Duration) *DeleteObjectParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete object params -func (o *DeleteObjectParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete object params -func (o *DeleteObjectParams) WithContext(ctx context.Context) *DeleteObjectParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete object params -func (o *DeleteObjectParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete object params -func (o *DeleteObjectParams) WithHTTPClient(client *http.Client) *DeleteObjectParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete object params -func (o *DeleteObjectParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSADBNAMESPACE adds the xCSADBNAMESPACE to the delete object params -func (o *DeleteObjectParams) WithXCSADBNAMESPACE(xCSADBNAMESPACE string) *DeleteObjectParams { - o.SetXCSADBNAMESPACE(xCSADBNAMESPACE) - return o -} - -// SetXCSADBNAMESPACE adds the xCSADBNAMESPACE to the delete object params -func (o *DeleteObjectParams) SetXCSADBNAMESPACE(xCSADBNAMESPACE string) { - o.XCSADBNAMESPACE = xCSADBNAMESPACE -} - -// WithXCSAPPID adds the xCSAPPID to the delete object params -func (o *DeleteObjectParams) WithXCSAPPID(xCSAPPID *string) *DeleteObjectParams { - o.SetXCSAPPID(xCSAPPID) - return o -} - -// SetXCSAPPID adds the xCSAPPId to the delete object params -func (o *DeleteObjectParams) SetXCSAPPID(xCSAPPID *string) { - o.XCSAPPID = xCSAPPID -} - -// WithCollectionName adds the collectionName to the delete object params -func (o *DeleteObjectParams) WithCollectionName(collectionName string) *DeleteObjectParams { - o.SetCollectionName(collectionName) - return o -} - -// SetCollectionName adds the collectionName to the delete object params -func (o *DeleteObjectParams) SetCollectionName(collectionName string) { - o.CollectionName = collectionName -} - -// WithDryRun adds the dryRun to the delete object params -func (o *DeleteObjectParams) WithDryRun(dryRun bool) *DeleteObjectParams { - o.SetDryRun(dryRun) - return o -} - -// SetDryRun adds the dryRun to the delete object params -func (o *DeleteObjectParams) SetDryRun(dryRun bool) { - o.DryRun = dryRun -} - -// WithObjectKey adds the objectKey to the delete object params -func (o *DeleteObjectParams) WithObjectKey(objectKey string) *DeleteObjectParams { - o.SetObjectKey(objectKey) - return o -} - -// SetObjectKey adds the objectKey to the delete object params -func (o *DeleteObjectParams) SetObjectKey(objectKey string) { - o.ObjectKey = objectKey -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteObjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-CS-ADB-NAMESPACE - if err := r.SetHeaderParam("X-CS-ADB-NAMESPACE", o.XCSADBNAMESPACE); err != nil { - return err - } - - if o.XCSAPPID != nil { - - // header param X-CS-APP-ID - if err := r.SetHeaderParam("X-CS-APP-ID", *o.XCSAPPID); err != nil { - return err - } - } - - // path param collection_name - if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { - return err - } - - // query param dry_run - qrDryRun := o.DryRun - qDryRun := swag.FormatBool(qrDryRun) - - if err := r.SetQueryParam("dry_run", qDryRun); err != nil { - return err - } - - // path param object_key - if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/custom_storage/delete_object_responses.go b/falcon/client/custom_storage/delete_object_responses.go deleted file mode 100644 index e75a70bd..00000000 --- a/falcon/client/custom_storage/delete_object_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by 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" -) - -// DeleteObjectReader is a Reader for the DeleteObject structure. -type DeleteObjectReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteObjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteObjectOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewDeleteObjectForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewDeleteObjectTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}] DeleteObject", response, response.Code()) - } -} - -// NewDeleteObjectOK creates a DeleteObjectOK with default headers values -func NewDeleteObjectOK() *DeleteObjectOK { - return &DeleteObjectOK{} -} - -/* - DeleteObjectOK describes a response with status code 200, with default header values. - -OK -*/ -type DeleteObjectOK 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.CustomStorageResponsePayload -} - -// IsSuccess returns true when this delete object o k response has a 2xx status code -func (o *DeleteObjectOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete object o k response has a 3xx status code -func (o *DeleteObjectOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete object o k response has a 4xx status code -func (o *DeleteObjectOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete object o k response has a 5xx status code -func (o *DeleteObjectOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete object o k response a status code equal to that given -func (o *DeleteObjectOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete object o k response -func (o *DeleteObjectOK) Code() int { - return 200 -} - -func (o *DeleteObjectOK) Error() string { - return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteObjectOK %+v", 200, o.Payload) -} - -func (o *DeleteObjectOK) String() string { - return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteObjectOK %+v", 200, o.Payload) -} - -func (o *DeleteObjectOK) GetPayload() *models.CustomStorageResponsePayload { - return o.Payload -} - -func (o *DeleteObjectOK) 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.CustomStorageResponsePayload) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteObjectForbidden creates a DeleteObjectForbidden with default headers values -func NewDeleteObjectForbidden() *DeleteObjectForbidden { - return &DeleteObjectForbidden{} -} - -/* - DeleteObjectForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeleteObjectForbidden 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 delete object forbidden response has a 2xx status code -func (o *DeleteObjectForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete object forbidden response has a 3xx status code -func (o *DeleteObjectForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete object forbidden response has a 4xx status code -func (o *DeleteObjectForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete object forbidden response has a 5xx status code -func (o *DeleteObjectForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this delete object forbidden response a status code equal to that given -func (o *DeleteObjectForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the delete object forbidden response -func (o *DeleteObjectForbidden) Code() int { - return 403 -} - -func (o *DeleteObjectForbidden) Error() string { - return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteObjectForbidden %+v", 403, o.Payload) -} - -func (o *DeleteObjectForbidden) String() string { - return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteObjectForbidden %+v", 403, o.Payload) -} - -func (o *DeleteObjectForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeleteObjectForbidden) 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 -} - -// NewDeleteObjectTooManyRequests creates a DeleteObjectTooManyRequests with default headers values -func NewDeleteObjectTooManyRequests() *DeleteObjectTooManyRequests { - return &DeleteObjectTooManyRequests{} -} - -/* - DeleteObjectTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type DeleteObjectTooManyRequests 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 object too many requests response has a 2xx status code -func (o *DeleteObjectTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete object too many requests response has a 3xx status code -func (o *DeleteObjectTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete object too many requests response has a 4xx status code -func (o *DeleteObjectTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete object too many requests response has a 5xx status code -func (o *DeleteObjectTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this delete object too many requests response a status code equal to that given -func (o *DeleteObjectTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the delete object too many requests response -func (o *DeleteObjectTooManyRequests) Code() int { - return 429 -} - -func (o *DeleteObjectTooManyRequests) Error() string { - return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteObjectTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeleteObjectTooManyRequests) String() string { - return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteObjectTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeleteObjectTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeleteObjectTooManyRequests) 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/custom_storage/delete_parameters.go b/falcon/client/custom_storage/delete_parameters.go new file mode 100644 index 00000000..a448df56 --- /dev/null +++ b/falcon/client/custom_storage/delete_parameters.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_storage + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewDeleteParams creates a new DeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteParams() *DeleteParams { + return &DeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteParamsWithTimeout creates a new DeleteParams object +// with the ability to set a timeout on a request. +func NewDeleteParamsWithTimeout(timeout time.Duration) *DeleteParams { + return &DeleteParams{ + timeout: timeout, + } +} + +// NewDeleteParamsWithContext creates a new DeleteParams object +// with the ability to set a context for a request. +func NewDeleteParamsWithContext(ctx context.Context) *DeleteParams { + return &DeleteParams{ + Context: ctx, + } +} + +// NewDeleteParamsWithHTTPClient creates a new DeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteParamsWithHTTPClient(client *http.Client) *DeleteParams { + return &DeleteParams{ + HTTPClient: client, + } +} + +/* +DeleteParams contains all the parameters to send to the API endpoint + + for the delete operation. + + Typically these are written to a http.Request. +*/ +type DeleteParams struct { + + /* CollectionName. + + The name of the collection + */ + CollectionName string + + /* DryRun. + + If false, run the operation as normal. If true, validate that the request *would* succeed, but don't execute it. + */ + DryRun bool + + /* ObjectKey. + + The object key + */ + ObjectKey string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteParams) WithDefaults() *DeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete params +func (o *DeleteParams) WithTimeout(timeout time.Duration) *DeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete params +func (o *DeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete params +func (o *DeleteParams) WithContext(ctx context.Context) *DeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete params +func (o *DeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) WithHTTPClient(client *http.Client) *DeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete params +func (o *DeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCollectionName adds the collectionName to the delete params +func (o *DeleteParams) WithCollectionName(collectionName string) *DeleteParams { + o.SetCollectionName(collectionName) + return o +} + +// SetCollectionName adds the collectionName to the delete params +func (o *DeleteParams) SetCollectionName(collectionName string) { + o.CollectionName = collectionName +} + +// WithDryRun adds the dryRun to the delete params +func (o *DeleteParams) WithDryRun(dryRun bool) *DeleteParams { + o.SetDryRun(dryRun) + return o +} + +// SetDryRun adds the dryRun to the delete params +func (o *DeleteParams) SetDryRun(dryRun bool) { + o.DryRun = dryRun +} + +// WithObjectKey adds the objectKey to the delete params +func (o *DeleteParams) WithObjectKey(objectKey string) *DeleteParams { + o.SetObjectKey(objectKey) + return o +} + +// SetObjectKey adds the objectKey to the delete params +func (o *DeleteParams) SetObjectKey(objectKey string) { + o.ObjectKey = objectKey +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param collection_name + if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { + return err + } + + // query param dry_run + qrDryRun := o.DryRun + qDryRun := swag.FormatBool(qrDryRun) + + if err := r.SetQueryParam("dry_run", qDryRun); err != nil { + return err + } + + // path param object_key + if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/saved_searches/result_responses.go b/falcon/client/custom_storage/delete_responses.go similarity index 59% rename from falcon/client/saved_searches/result_responses.go rename to falcon/client/custom_storage/delete_responses.go index 616eaf23..850679e2 100644 --- a/falcon/client/saved_searches/result_responses.go +++ b/falcon/client/custom_storage/delete_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +package custom_storage // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// ResultReader is a Reader for the Result structure. -type ResultReader struct { +// DeleteReader is a Reader for the Delete structure. +type DeleteReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *ResultReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewResultOK() + result := NewDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewResultForbidden() + result := NewDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewResultTooManyRequests() + result := NewDeleteTooManyRequests() 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] Result", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}] delete", response, response.Code()) } } -// NewResultOK creates a ResultOK with default headers values -func NewResultOK() *ResultOK { - return &ResultOK{} +// NewDeleteOK creates a DeleteOK with default headers values +func NewDeleteOK() *DeleteOK { + return &DeleteOK{} } /* -ResultOK describes a response with status code 200, with default header values. +DeleteOK describes a response with status code 200, with default header values. OK */ -type ResultOK struct { +type DeleteOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type ResultOK struct { */ XRateLimitRemaining int64 - Payload *models.ApidomainQueryResponseWrapperV1 + Payload *models.CustomStorageResponse } -// IsSuccess returns true when this result o k response has a 2xx status code -func (o *ResultOK) IsSuccess() bool { +// IsSuccess returns true when this delete o k response has a 2xx status code +func (o *DeleteOK) IsSuccess() bool { return true } -// IsRedirect returns true when this result o k response has a 3xx status code -func (o *ResultOK) IsRedirect() bool { +// IsRedirect returns true when this delete o k response has a 3xx status code +func (o *DeleteOK) IsRedirect() bool { return false } -// IsClientError returns true when this result o k response has a 4xx status code -func (o *ResultOK) IsClientError() bool { +// IsClientError returns true when this delete o k response has a 4xx status code +func (o *DeleteOK) IsClientError() bool { return false } -// IsServerError returns true when this result o k response has a 5xx status code -func (o *ResultOK) IsServerError() bool { +// IsServerError returns true when this delete o k response has a 5xx status code +func (o *DeleteOK) IsServerError() bool { return false } -// IsCode returns true when this result o k response a status code equal to that given -func (o *ResultOK) IsCode(code int) bool { +// IsCode returns true when this delete o k response a status code equal to that given +func (o *DeleteOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the result o k response -func (o *ResultOK) Code() int { +// Code gets the status code for the delete o k response +func (o *DeleteOK) Code() int { return 200 } -func (o *ResultOK) Error() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] resultOK %+v", 200, o.Payload) +func (o *DeleteOK) Error() string { + return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteOK %+v", 200, o.Payload) } -func (o *ResultOK) String() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] resultOK %+v", 200, o.Payload) +func (o *DeleteOK) String() string { + return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteOK %+v", 200, o.Payload) } -func (o *ResultOK) GetPayload() *models.ApidomainQueryResponseWrapperV1 { +func (o *DeleteOK) GetPayload() *models.CustomStorageResponse { return o.Payload } -func (o *ResultOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *ResultOK) readResponse(response runtime.ClientResponse, consumer runtim o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.ApidomainQueryResponseWrapperV1) + o.Payload = new(models.CustomStorageResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *ResultOK) readResponse(response runtime.ClientResponse, consumer runtim return nil } -// NewResultForbidden creates a ResultForbidden with default headers values -func NewResultForbidden() *ResultForbidden { - return &ResultForbidden{} +// NewDeleteForbidden creates a DeleteForbidden with default headers values +func NewDeleteForbidden() *DeleteForbidden { + return &DeleteForbidden{} } /* -ResultForbidden describes a response with status code 403, with default header values. +DeleteForbidden describes a response with status code 403, with default header values. Forbidden */ -type ResultForbidden struct { +type DeleteForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type ResultForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this result forbidden response has a 2xx status code -func (o *ResultForbidden) IsSuccess() bool { +// IsSuccess returns true when this delete forbidden response has a 2xx status code +func (o *DeleteForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this result forbidden response has a 3xx status code -func (o *ResultForbidden) IsRedirect() bool { +// IsRedirect returns true when this delete forbidden response has a 3xx status code +func (o *DeleteForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this result forbidden response has a 4xx status code -func (o *ResultForbidden) IsClientError() bool { +// IsClientError returns true when this delete forbidden response has a 4xx status code +func (o *DeleteForbidden) IsClientError() bool { return true } -// IsServerError returns true when this result forbidden response has a 5xx status code -func (o *ResultForbidden) IsServerError() bool { +// IsServerError returns true when this delete forbidden response has a 5xx status code +func (o *DeleteForbidden) IsServerError() bool { return false } -// IsCode returns true when this result forbidden response a status code equal to that given -func (o *ResultForbidden) IsCode(code int) bool { +// IsCode returns true when this delete forbidden response a status code equal to that given +func (o *DeleteForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the result forbidden response -func (o *ResultForbidden) Code() int { +// Code gets the status code for the delete forbidden response +func (o *DeleteForbidden) Code() int { return 403 } -func (o *ResultForbidden) Error() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] resultForbidden %+v", 403, o.Payload) +func (o *DeleteForbidden) Error() string { + return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteForbidden %+v", 403, o.Payload) } -func (o *ResultForbidden) String() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] resultForbidden %+v", 403, o.Payload) +func (o *DeleteForbidden) String() string { + return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteForbidden %+v", 403, o.Payload) } -func (o *ResultForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *DeleteForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ResultForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *ResultForbidden) readResponse(response runtime.ClientResponse, consumer return nil } -// NewResultTooManyRequests creates a ResultTooManyRequests with default headers values -func NewResultTooManyRequests() *ResultTooManyRequests { - return &ResultTooManyRequests{} +// NewDeleteTooManyRequests creates a DeleteTooManyRequests with default headers values +func NewDeleteTooManyRequests() *DeleteTooManyRequests { + return &DeleteTooManyRequests{} } /* -ResultTooManyRequests describes a response with status code 429, with default header values. +DeleteTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type ResultTooManyRequests struct { +type DeleteTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type ResultTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this result too many requests response has a 2xx status code -func (o *ResultTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this delete too many requests response has a 2xx status code +func (o *DeleteTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this result too many requests response has a 3xx status code -func (o *ResultTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this delete too many requests response has a 3xx status code +func (o *DeleteTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this result too many requests response has a 4xx status code -func (o *ResultTooManyRequests) IsClientError() bool { +// IsClientError returns true when this delete too many requests response has a 4xx status code +func (o *DeleteTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this result too many requests response has a 5xx status code -func (o *ResultTooManyRequests) IsServerError() bool { +// IsServerError returns true when this delete too many requests response has a 5xx status code +func (o *DeleteTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this result too many requests response a status code equal to that given -func (o *ResultTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this delete too many requests response a status code equal to that given +func (o *DeleteTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the result too many requests response -func (o *ResultTooManyRequests) Code() int { +// Code gets the status code for the delete too many requests response +func (o *DeleteTooManyRequests) Code() int { return 429 } -func (o *ResultTooManyRequests) Error() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] resultTooManyRequests %+v", 429, o.Payload) +func (o *DeleteTooManyRequests) Error() string { + return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteTooManyRequests %+v", 429, o.Payload) } -func (o *ResultTooManyRequests) String() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches-execute/v1][%d] resultTooManyRequests %+v", 429, o.Payload) +func (o *DeleteTooManyRequests) String() string { + return fmt.Sprintf("[DELETE /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] deleteTooManyRequests %+v", 429, o.Payload) } -func (o *ResultTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *DeleteTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ResultTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DeleteTooManyRequests) 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/custom_storage/get_object_metadata_parameters.go b/falcon/client/custom_storage/get_object_metadata_parameters.go deleted file mode 100644 index b502caa1..00000000 --- a/falcon/client/custom_storage/get_object_metadata_parameters.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetObjectMetadataParams creates a new GetObjectMetadataParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetObjectMetadataParams() *GetObjectMetadataParams { - return &GetObjectMetadataParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetObjectMetadataParamsWithTimeout creates a new GetObjectMetadataParams object -// with the ability to set a timeout on a request. -func NewGetObjectMetadataParamsWithTimeout(timeout time.Duration) *GetObjectMetadataParams { - return &GetObjectMetadataParams{ - timeout: timeout, - } -} - -// NewGetObjectMetadataParamsWithContext creates a new GetObjectMetadataParams object -// with the ability to set a context for a request. -func NewGetObjectMetadataParamsWithContext(ctx context.Context) *GetObjectMetadataParams { - return &GetObjectMetadataParams{ - Context: ctx, - } -} - -// NewGetObjectMetadataParamsWithHTTPClient creates a new GetObjectMetadataParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetObjectMetadataParamsWithHTTPClient(client *http.Client) *GetObjectMetadataParams { - return &GetObjectMetadataParams{ - HTTPClient: client, - } -} - -/* -GetObjectMetadataParams contains all the parameters to send to the API endpoint - - for the get object metadata operation. - - Typically these are written to a http.Request. -*/ -type GetObjectMetadataParams struct { - - /* XCSADBNAMESPACE. - - The name of the namespace the collection belongs to - */ - XCSADBNAMESPACE string - - /* XCSAPPID. - - The id of the app the collection belongs to. This will map to the namespace of the collection - */ - XCSAPPID *string - - /* CollectionName. - - The name of the collection - */ - CollectionName string - - /* ObjectKey. - - The object key - */ - ObjectKey string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get object metadata params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectMetadataParams) WithDefaults() *GetObjectMetadataParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get object metadata params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectMetadataParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get object metadata params -func (o *GetObjectMetadataParams) WithTimeout(timeout time.Duration) *GetObjectMetadataParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get object metadata params -func (o *GetObjectMetadataParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get object metadata params -func (o *GetObjectMetadataParams) WithContext(ctx context.Context) *GetObjectMetadataParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get object metadata params -func (o *GetObjectMetadataParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get object metadata params -func (o *GetObjectMetadataParams) WithHTTPClient(client *http.Client) *GetObjectMetadataParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get object metadata params -func (o *GetObjectMetadataParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSADBNAMESPACE adds the xCSADBNAMESPACE to the get object metadata params -func (o *GetObjectMetadataParams) WithXCSADBNAMESPACE(xCSADBNAMESPACE string) *GetObjectMetadataParams { - o.SetXCSADBNAMESPACE(xCSADBNAMESPACE) - return o -} - -// SetXCSADBNAMESPACE adds the xCSADBNAMESPACE to the get object metadata params -func (o *GetObjectMetadataParams) SetXCSADBNAMESPACE(xCSADBNAMESPACE string) { - o.XCSADBNAMESPACE = xCSADBNAMESPACE -} - -// WithXCSAPPID adds the xCSAPPID to the get object metadata params -func (o *GetObjectMetadataParams) WithXCSAPPID(xCSAPPID *string) *GetObjectMetadataParams { - o.SetXCSAPPID(xCSAPPID) - return o -} - -// SetXCSAPPID adds the xCSAPPId to the get object metadata params -func (o *GetObjectMetadataParams) SetXCSAPPID(xCSAPPID *string) { - o.XCSAPPID = xCSAPPID -} - -// WithCollectionName adds the collectionName to the get object metadata params -func (o *GetObjectMetadataParams) WithCollectionName(collectionName string) *GetObjectMetadataParams { - o.SetCollectionName(collectionName) - return o -} - -// SetCollectionName adds the collectionName to the get object metadata params -func (o *GetObjectMetadataParams) SetCollectionName(collectionName string) { - o.CollectionName = collectionName -} - -// WithObjectKey adds the objectKey to the get object metadata params -func (o *GetObjectMetadataParams) WithObjectKey(objectKey string) *GetObjectMetadataParams { - o.SetObjectKey(objectKey) - return o -} - -// SetObjectKey adds the objectKey to the get object metadata params -func (o *GetObjectMetadataParams) SetObjectKey(objectKey string) { - o.ObjectKey = objectKey -} - -// WriteToRequest writes these params to a swagger request -func (o *GetObjectMetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-CS-ADB-NAMESPACE - if err := r.SetHeaderParam("X-CS-ADB-NAMESPACE", o.XCSADBNAMESPACE); err != nil { - return err - } - - if o.XCSAPPID != nil { - - // header param X-CS-APP-ID - if err := r.SetHeaderParam("X-CS-APP-ID", *o.XCSAPPID); err != nil { - return err - } - } - - // path param collection_name - if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { - return err - } - - // path param object_key - if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/custom_storage/get_object_metadata_responses.go b/falcon/client/custom_storage/get_object_metadata_responses.go deleted file mode 100644 index 9631fa5f..00000000 --- a/falcon/client/custom_storage/get_object_metadata_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by 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" -) - -// GetObjectMetadataReader is a Reader for the GetObjectMetadata structure. -type GetObjectMetadataReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetObjectMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetObjectMetadataOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewGetObjectMetadataForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewGetObjectMetadataTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata] GetObjectMetadata", response, response.Code()) - } -} - -// NewGetObjectMetadataOK creates a GetObjectMetadataOK with default headers values -func NewGetObjectMetadataOK() *GetObjectMetadataOK { - return &GetObjectMetadataOK{} -} - -/* - GetObjectMetadataOK describes a response with status code 200, with default header values. - -OK -*/ -type GetObjectMetadataOK 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.CustomStorageResponsePayload -} - -// IsSuccess returns true when this get object metadata o k response has a 2xx status code -func (o *GetObjectMetadataOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get object metadata o k response has a 3xx status code -func (o *GetObjectMetadataOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get object metadata o k response has a 4xx status code -func (o *GetObjectMetadataOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get object metadata o k response has a 5xx status code -func (o *GetObjectMetadataOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get object metadata o k response a status code equal to that given -func (o *GetObjectMetadataOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get object metadata o k response -func (o *GetObjectMetadataOK) Code() int { - return 200 -} - -func (o *GetObjectMetadataOK) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] getObjectMetadataOK %+v", 200, o.Payload) -} - -func (o *GetObjectMetadataOK) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] getObjectMetadataOK %+v", 200, o.Payload) -} - -func (o *GetObjectMetadataOK) GetPayload() *models.CustomStorageResponsePayload { - return o.Payload -} - -func (o *GetObjectMetadataOK) 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.CustomStorageResponsePayload) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetObjectMetadataForbidden creates a GetObjectMetadataForbidden with default headers values -func NewGetObjectMetadataForbidden() *GetObjectMetadataForbidden { - return &GetObjectMetadataForbidden{} -} - -/* - GetObjectMetadataForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type GetObjectMetadataForbidden 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 object metadata forbidden response has a 2xx status code -func (o *GetObjectMetadataForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get object metadata forbidden response has a 3xx status code -func (o *GetObjectMetadataForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get object metadata forbidden response has a 4xx status code -func (o *GetObjectMetadataForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get object metadata forbidden response has a 5xx status code -func (o *GetObjectMetadataForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get object metadata forbidden response a status code equal to that given -func (o *GetObjectMetadataForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get object metadata forbidden response -func (o *GetObjectMetadataForbidden) Code() int { - return 403 -} - -func (o *GetObjectMetadataForbidden) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] getObjectMetadataForbidden %+v", 403, o.Payload) -} - -func (o *GetObjectMetadataForbidden) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] getObjectMetadataForbidden %+v", 403, o.Payload) -} - -func (o *GetObjectMetadataForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *GetObjectMetadataForbidden) 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 -} - -// NewGetObjectMetadataTooManyRequests creates a GetObjectMetadataTooManyRequests with default headers values -func NewGetObjectMetadataTooManyRequests() *GetObjectMetadataTooManyRequests { - return &GetObjectMetadataTooManyRequests{} -} - -/* - GetObjectMetadataTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type GetObjectMetadataTooManyRequests 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 object metadata too many requests response has a 2xx status code -func (o *GetObjectMetadataTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get object metadata too many requests response has a 3xx status code -func (o *GetObjectMetadataTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get object metadata too many requests response has a 4xx status code -func (o *GetObjectMetadataTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this get object metadata too many requests response has a 5xx status code -func (o *GetObjectMetadataTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this get object metadata too many requests response a status code equal to that given -func (o *GetObjectMetadataTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the get object metadata too many requests response -func (o *GetObjectMetadataTooManyRequests) Code() int { - return 429 -} - -func (o *GetObjectMetadataTooManyRequests) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] getObjectMetadataTooManyRequests %+v", 429, o.Payload) -} - -func (o *GetObjectMetadataTooManyRequests) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] getObjectMetadataTooManyRequests %+v", 429, o.Payload) -} - -func (o *GetObjectMetadataTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *GetObjectMetadataTooManyRequests) 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/custom_storage/get_object_parameters.go b/falcon/client/custom_storage/get_object_parameters.go deleted file mode 100644 index 03e35559..00000000 --- a/falcon/client/custom_storage/get_object_parameters.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetObjectParams creates a new GetObjectParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetObjectParams() *GetObjectParams { - return &GetObjectParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetObjectParamsWithTimeout creates a new GetObjectParams object -// with the ability to set a timeout on a request. -func NewGetObjectParamsWithTimeout(timeout time.Duration) *GetObjectParams { - return &GetObjectParams{ - timeout: timeout, - } -} - -// NewGetObjectParamsWithContext creates a new GetObjectParams object -// with the ability to set a context for a request. -func NewGetObjectParamsWithContext(ctx context.Context) *GetObjectParams { - return &GetObjectParams{ - Context: ctx, - } -} - -// NewGetObjectParamsWithHTTPClient creates a new GetObjectParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetObjectParamsWithHTTPClient(client *http.Client) *GetObjectParams { - return &GetObjectParams{ - HTTPClient: client, - } -} - -/* -GetObjectParams contains all the parameters to send to the API endpoint - - for the get object operation. - - Typically these are written to a http.Request. -*/ -type GetObjectParams struct { - - /* XCSADBNAMESPACE. - - The name of the namespace the collection belongs to - */ - XCSADBNAMESPACE string - - /* XCSAPPID. - - The id of the app the collection belongs to. This will map to the namespace of the collection - */ - XCSAPPID *string - - /* CollectionName. - - The name of the collection - */ - CollectionName string - - /* ObjectKey. - - The object key - */ - ObjectKey string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectParams) WithDefaults() *GetObjectParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetObjectParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get object params -func (o *GetObjectParams) WithTimeout(timeout time.Duration) *GetObjectParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get object params -func (o *GetObjectParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get object params -func (o *GetObjectParams) WithContext(ctx context.Context) *GetObjectParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get object params -func (o *GetObjectParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get object params -func (o *GetObjectParams) WithHTTPClient(client *http.Client) *GetObjectParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get object params -func (o *GetObjectParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSADBNAMESPACE adds the xCSADBNAMESPACE to the get object params -func (o *GetObjectParams) WithXCSADBNAMESPACE(xCSADBNAMESPACE string) *GetObjectParams { - o.SetXCSADBNAMESPACE(xCSADBNAMESPACE) - return o -} - -// SetXCSADBNAMESPACE adds the xCSADBNAMESPACE to the get object params -func (o *GetObjectParams) SetXCSADBNAMESPACE(xCSADBNAMESPACE string) { - o.XCSADBNAMESPACE = xCSADBNAMESPACE -} - -// WithXCSAPPID adds the xCSAPPID to the get object params -func (o *GetObjectParams) WithXCSAPPID(xCSAPPID *string) *GetObjectParams { - o.SetXCSAPPID(xCSAPPID) - return o -} - -// SetXCSAPPID adds the xCSAPPId to the get object params -func (o *GetObjectParams) SetXCSAPPID(xCSAPPID *string) { - o.XCSAPPID = xCSAPPID -} - -// WithCollectionName adds the collectionName to the get object params -func (o *GetObjectParams) WithCollectionName(collectionName string) *GetObjectParams { - o.SetCollectionName(collectionName) - return o -} - -// SetCollectionName adds the collectionName to the get object params -func (o *GetObjectParams) SetCollectionName(collectionName string) { - o.CollectionName = collectionName -} - -// WithObjectKey adds the objectKey to the get object params -func (o *GetObjectParams) WithObjectKey(objectKey string) *GetObjectParams { - o.SetObjectKey(objectKey) - return o -} - -// SetObjectKey adds the objectKey to the get object params -func (o *GetObjectParams) SetObjectKey(objectKey string) { - o.ObjectKey = objectKey -} - -// WriteToRequest writes these params to a swagger request -func (o *GetObjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-CS-ADB-NAMESPACE - if err := r.SetHeaderParam("X-CS-ADB-NAMESPACE", o.XCSADBNAMESPACE); err != nil { - return err - } - - if o.XCSAPPID != nil { - - // header param X-CS-APP-ID - if err := r.SetHeaderParam("X-CS-APP-ID", *o.XCSAPPID); err != nil { - return err - } - } - - // path param collection_name - if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { - return err - } - - // path param object_key - if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/custom_storage/get_parameters.go b/falcon/client/custom_storage/get_parameters.go new file mode 100644 index 00000000..85a0ed23 --- /dev/null +++ b/falcon/client/custom_storage/get_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_storage + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetParams creates a new GetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetParams() *GetParams { + return &GetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetParamsWithTimeout creates a new GetParams object +// with the ability to set a timeout on a request. +func NewGetParamsWithTimeout(timeout time.Duration) *GetParams { + return &GetParams{ + timeout: timeout, + } +} + +// NewGetParamsWithContext creates a new GetParams object +// with the ability to set a context for a request. +func NewGetParamsWithContext(ctx context.Context) *GetParams { + return &GetParams{ + Context: ctx, + } +} + +// NewGetParamsWithHTTPClient creates a new GetParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetParamsWithHTTPClient(client *http.Client) *GetParams { + return &GetParams{ + HTTPClient: client, + } +} + +/* +GetParams contains all the parameters to send to the API endpoint + + for the get operation. + + Typically these are written to a http.Request. +*/ +type GetParams struct { + + /* CollectionName. + + The name of the collection + */ + CollectionName string + + /* ObjectKey. + + The object key + */ + ObjectKey string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetParams) WithDefaults() *GetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get params +func (o *GetParams) WithTimeout(timeout time.Duration) *GetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get params +func (o *GetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get params +func (o *GetParams) WithContext(ctx context.Context) *GetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get params +func (o *GetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get params +func (o *GetParams) WithHTTPClient(client *http.Client) *GetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get params +func (o *GetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCollectionName adds the collectionName to the get params +func (o *GetParams) WithCollectionName(collectionName string) *GetParams { + o.SetCollectionName(collectionName) + return o +} + +// SetCollectionName adds the collectionName to the get params +func (o *GetParams) SetCollectionName(collectionName string) { + o.CollectionName = collectionName +} + +// WithObjectKey adds the objectKey to the get params +func (o *GetParams) WithObjectKey(objectKey string) *GetParams { + o.SetObjectKey(objectKey) + return o +} + +// SetObjectKey adds the objectKey to the get params +func (o *GetParams) SetObjectKey(objectKey string) { + o.ObjectKey = objectKey +} + +// WriteToRequest writes these params to a swagger request +func (o *GetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param collection_name + if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { + return err + } + + // path param object_key + if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/custom_storage/get_object_responses.go b/falcon/client/custom_storage/get_responses.go similarity index 57% rename from falcon/client/custom_storage/get_object_responses.go rename to falcon/client/custom_storage/get_responses.go index 6423f51a..87893f63 100644 --- a/falcon/client/custom_storage/get_object_responses.go +++ b/falcon/client/custom_storage/get_responses.go @@ -17,52 +17,52 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// GetObjectReader is a Reader for the GetObject structure. -type GetObjectReader struct { +// GetReader is a Reader for the Get structure. +type GetReader struct { formats strfmt.Registry writer io.Writer } // ReadResponse reads a server response into the received o. -func (o *GetObjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *GetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewGetObjectOK(o.writer) + result := NewGetOK(o.writer) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewGetObjectForbidden() + result := NewGetForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewGetObjectTooManyRequests() + result := NewGetTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}] GetObject", response, response.Code()) + return nil, runtime.NewAPIError("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}] get", response, response.Code()) } } -// NewGetObjectOK creates a GetObjectOK with default headers values -func NewGetObjectOK(writer io.Writer) *GetObjectOK { - return &GetObjectOK{ +// NewGetOK creates a GetOK with default headers values +func NewGetOK(writer io.Writer) *GetOK { + return &GetOK{ Payload: writer, } } /* - GetObjectOK describes a response with status code 200, with default header values. +GetOK describes a response with status code 200, with default header values. OK */ -type GetObjectOK struct { +type GetOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -79,49 +79,49 @@ type GetObjectOK struct { Payload io.Writer } -// IsSuccess returns true when this get object o k response has a 2xx status code -func (o *GetObjectOK) IsSuccess() bool { +// IsSuccess returns true when this get o k response has a 2xx status code +func (o *GetOK) IsSuccess() bool { return true } -// IsRedirect returns true when this get object o k response has a 3xx status code -func (o *GetObjectOK) IsRedirect() bool { +// IsRedirect returns true when this get o k response has a 3xx status code +func (o *GetOK) IsRedirect() bool { return false } -// IsClientError returns true when this get object o k response has a 4xx status code -func (o *GetObjectOK) IsClientError() bool { +// IsClientError returns true when this get o k response has a 4xx status code +func (o *GetOK) IsClientError() bool { return false } -// IsServerError returns true when this get object o k response has a 5xx status code -func (o *GetObjectOK) IsServerError() bool { +// IsServerError returns true when this get o k response has a 5xx status code +func (o *GetOK) IsServerError() bool { return false } -// IsCode returns true when this get object o k response a status code equal to that given -func (o *GetObjectOK) IsCode(code int) bool { +// IsCode returns true when this get o k response a status code equal to that given +func (o *GetOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the get object o k response -func (o *GetObjectOK) Code() int { +// Code gets the status code for the get o k response +func (o *GetOK) Code() int { return 200 } -func (o *GetObjectOK) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getObjectOK %+v", 200, o.Payload) +func (o *GetOK) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getOK %+v", 200, o.Payload) } -func (o *GetObjectOK) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getObjectOK %+v", 200, o.Payload) +func (o *GetOK) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getOK %+v", 200, o.Payload) } -func (o *GetObjectOK) GetPayload() io.Writer { +func (o *GetOK) GetPayload() io.Writer { return o.Payload } -func (o *GetObjectOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -160,17 +160,17 @@ func (o *GetObjectOK) readResponse(response runtime.ClientResponse, consumer run return nil } -// NewGetObjectForbidden creates a GetObjectForbidden with default headers values -func NewGetObjectForbidden() *GetObjectForbidden { - return &GetObjectForbidden{} +// NewGetForbidden creates a GetForbidden with default headers values +func NewGetForbidden() *GetForbidden { + return &GetForbidden{} } /* - GetObjectForbidden describes a response with status code 403, with default header values. +GetForbidden describes a response with status code 403, with default header values. Forbidden */ -type GetObjectForbidden struct { +type GetForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -187,49 +187,49 @@ type GetObjectForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this get object forbidden response has a 2xx status code -func (o *GetObjectForbidden) IsSuccess() bool { +// IsSuccess returns true when this get forbidden response has a 2xx status code +func (o *GetForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this get object forbidden response has a 3xx status code -func (o *GetObjectForbidden) IsRedirect() bool { +// IsRedirect returns true when this get forbidden response has a 3xx status code +func (o *GetForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this get object forbidden response has a 4xx status code -func (o *GetObjectForbidden) IsClientError() bool { +// IsClientError returns true when this get forbidden response has a 4xx status code +func (o *GetForbidden) IsClientError() bool { return true } -// IsServerError returns true when this get object forbidden response has a 5xx status code -func (o *GetObjectForbidden) IsServerError() bool { +// IsServerError returns true when this get forbidden response has a 5xx status code +func (o *GetForbidden) IsServerError() bool { return false } -// IsCode returns true when this get object forbidden response a status code equal to that given -func (o *GetObjectForbidden) IsCode(code int) bool { +// IsCode returns true when this get forbidden response a status code equal to that given +func (o *GetForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the get object forbidden response -func (o *GetObjectForbidden) Code() int { +// Code gets the status code for the get forbidden response +func (o *GetForbidden) Code() int { return 403 } -func (o *GetObjectForbidden) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getObjectForbidden %+v", 403, o.Payload) +func (o *GetForbidden) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getForbidden %+v", 403, o.Payload) } -func (o *GetObjectForbidden) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getObjectForbidden %+v", 403, o.Payload) +func (o *GetForbidden) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getForbidden %+v", 403, o.Payload) } -func (o *GetObjectForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *GetObjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -270,17 +270,17 @@ func (o *GetObjectForbidden) readResponse(response runtime.ClientResponse, consu return nil } -// NewGetObjectTooManyRequests creates a GetObjectTooManyRequests with default headers values -func NewGetObjectTooManyRequests() *GetObjectTooManyRequests { - return &GetObjectTooManyRequests{} +// NewGetTooManyRequests creates a GetTooManyRequests with default headers values +func NewGetTooManyRequests() *GetTooManyRequests { + return &GetTooManyRequests{} } /* - GetObjectTooManyRequests describes a response with status code 429, with default header values. +GetTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type GetObjectTooManyRequests struct { +type GetTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -301,49 +301,49 @@ type GetObjectTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this get object too many requests response has a 2xx status code -func (o *GetObjectTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this get too many requests response has a 2xx status code +func (o *GetTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this get object too many requests response has a 3xx status code -func (o *GetObjectTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this get too many requests response has a 3xx status code +func (o *GetTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this get object too many requests response has a 4xx status code -func (o *GetObjectTooManyRequests) IsClientError() bool { +// IsClientError returns true when this get too many requests response has a 4xx status code +func (o *GetTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this get object too many requests response has a 5xx status code -func (o *GetObjectTooManyRequests) IsServerError() bool { +// IsServerError returns true when this get too many requests response has a 5xx status code +func (o *GetTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this get object too many requests response a status code equal to that given -func (o *GetObjectTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this get too many requests response a status code equal to that given +func (o *GetTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the get object too many requests response -func (o *GetObjectTooManyRequests) Code() int { +// Code gets the status code for the get too many requests response +func (o *GetTooManyRequests) Code() int { return 429 } -func (o *GetObjectTooManyRequests) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getObjectTooManyRequests %+v", 429, o.Payload) +func (o *GetTooManyRequests) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getTooManyRequests %+v", 429, o.Payload) } -func (o *GetObjectTooManyRequests) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getObjectTooManyRequests %+v", 429, o.Payload) +func (o *GetTooManyRequests) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] getTooManyRequests %+v", 429, o.Payload) } -func (o *GetObjectTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *GetObjectTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetTooManyRequests) 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/custom_storage/list_objects_parameters.go b/falcon/client/custom_storage/list_objects_parameters.go deleted file mode 100644 index dce093bd..00000000 --- a/falcon/client/custom_storage/list_objects_parameters.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewListObjectsParams creates a new ListObjectsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListObjectsParams() *ListObjectsParams { - return &ListObjectsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListObjectsParamsWithTimeout creates a new ListObjectsParams object -// with the ability to set a timeout on a request. -func NewListObjectsParamsWithTimeout(timeout time.Duration) *ListObjectsParams { - return &ListObjectsParams{ - timeout: timeout, - } -} - -// NewListObjectsParamsWithContext creates a new ListObjectsParams object -// with the ability to set a context for a request. -func NewListObjectsParamsWithContext(ctx context.Context) *ListObjectsParams { - return &ListObjectsParams{ - Context: ctx, - } -} - -// NewListObjectsParamsWithHTTPClient creates a new ListObjectsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListObjectsParamsWithHTTPClient(client *http.Client) *ListObjectsParams { - return &ListObjectsParams{ - HTTPClient: client, - } -} - -/* -ListObjectsParams contains all the parameters to send to the API endpoint - - for the list objects operation. - - Typically these are written to a http.Request. -*/ -type ListObjectsParams struct { - - /* XCSADBNAMESPACE. - - The name of the namespace the collection belongs to - */ - XCSADBNAMESPACE string - - /* XCSAPPID. - - The id of the app the collection belongs to. This will map to the namespace of the collection - */ - XCSAPPID *string - - /* CollectionName. - - The name of the collection - */ - CollectionName string - - /* End. - - The end key to end listing to - */ - End string - - /* Limit. - - The limit of results to return - */ - Limit int64 - - /* Start. - - The start key to start listing from - */ - Start string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListObjectsParams) WithDefaults() *ListObjectsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListObjectsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list objects params -func (o *ListObjectsParams) WithTimeout(timeout time.Duration) *ListObjectsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list objects params -func (o *ListObjectsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list objects params -func (o *ListObjectsParams) WithContext(ctx context.Context) *ListObjectsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list objects params -func (o *ListObjectsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list objects params -func (o *ListObjectsParams) WithHTTPClient(client *http.Client) *ListObjectsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list objects params -func (o *ListObjectsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSADBNAMESPACE adds the xCSADBNAMESPACE to the list objects params -func (o *ListObjectsParams) WithXCSADBNAMESPACE(xCSADBNAMESPACE string) *ListObjectsParams { - o.SetXCSADBNAMESPACE(xCSADBNAMESPACE) - return o -} - -// SetXCSADBNAMESPACE adds the xCSADBNAMESPACE to the list objects params -func (o *ListObjectsParams) SetXCSADBNAMESPACE(xCSADBNAMESPACE string) { - o.XCSADBNAMESPACE = xCSADBNAMESPACE -} - -// WithXCSAPPID adds the xCSAPPID to the list objects params -func (o *ListObjectsParams) WithXCSAPPID(xCSAPPID *string) *ListObjectsParams { - o.SetXCSAPPID(xCSAPPID) - return o -} - -// SetXCSAPPID adds the xCSAPPId to the list objects params -func (o *ListObjectsParams) SetXCSAPPID(xCSAPPID *string) { - o.XCSAPPID = xCSAPPID -} - -// WithCollectionName adds the collectionName to the list objects params -func (o *ListObjectsParams) WithCollectionName(collectionName string) *ListObjectsParams { - o.SetCollectionName(collectionName) - return o -} - -// SetCollectionName adds the collectionName to the list objects params -func (o *ListObjectsParams) SetCollectionName(collectionName string) { - o.CollectionName = collectionName -} - -// WithEnd adds the end to the list objects params -func (o *ListObjectsParams) WithEnd(end string) *ListObjectsParams { - o.SetEnd(end) - return o -} - -// SetEnd adds the end to the list objects params -func (o *ListObjectsParams) SetEnd(end string) { - o.End = end -} - -// WithLimit adds the limit to the list objects params -func (o *ListObjectsParams) WithLimit(limit int64) *ListObjectsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list objects params -func (o *ListObjectsParams) SetLimit(limit int64) { - o.Limit = limit -} - -// WithStart adds the start to the list objects params -func (o *ListObjectsParams) WithStart(start string) *ListObjectsParams { - o.SetStart(start) - return o -} - -// SetStart adds the start to the list objects params -func (o *ListObjectsParams) SetStart(start string) { - o.Start = start -} - -// WriteToRequest writes these params to a swagger request -func (o *ListObjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-CS-ADB-NAMESPACE - if err := r.SetHeaderParam("X-CS-ADB-NAMESPACE", o.XCSADBNAMESPACE); err != nil { - return err - } - - if o.XCSAPPID != nil { - - // header param X-CS-APP-ID - if err := r.SetHeaderParam("X-CS-APP-ID", *o.XCSAPPID); err != nil { - return err - } - } - - // path param collection_name - if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { - return err - } - - // query param end - qrEnd := o.End - qEnd := qrEnd - - if err := r.SetQueryParam("end", qEnd); err != nil { - return err - } - - // query param limit - qrLimit := o.Limit - qLimit := swag.FormatInt64(qrLimit) - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - - // query param start - qrStart := o.Start - qStart := qrStart - - if err := r.SetQueryParam("start", qStart); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/custom_storage/list_parameters.go b/falcon/client/custom_storage/list_parameters.go new file mode 100644 index 00000000..7be7478e --- /dev/null +++ b/falcon/client/custom_storage/list_parameters.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_storage + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewListParams creates a new ListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListParams() *ListParams { + return &ListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListParamsWithTimeout creates a new ListParams object +// with the ability to set a timeout on a request. +func NewListParamsWithTimeout(timeout time.Duration) *ListParams { + return &ListParams{ + timeout: timeout, + } +} + +// NewListParamsWithContext creates a new ListParams object +// with the ability to set a context for a request. +func NewListParamsWithContext(ctx context.Context) *ListParams { + return &ListParams{ + Context: ctx, + } +} + +// NewListParamsWithHTTPClient creates a new ListParams object +// with the ability to set a custom HTTPClient for a request. +func NewListParamsWithHTTPClient(client *http.Client) *ListParams { + return &ListParams{ + HTTPClient: client, + } +} + +/* +ListParams contains all the parameters to send to the API endpoint + + for the list operation. + + Typically these are written to a http.Request. +*/ +type ListParams struct { + + /* CollectionName. + + The name of the collection + */ + CollectionName string + + /* End. + + The end key to end listing to + */ + End string + + /* Limit. + + The limit of results to return + */ + Limit int64 + + /* Start. + + The start key to start listing from + */ + Start string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListParams) WithDefaults() *ListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list params +func (o *ListParams) WithTimeout(timeout time.Duration) *ListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list params +func (o *ListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list params +func (o *ListParams) WithContext(ctx context.Context) *ListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list params +func (o *ListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list params +func (o *ListParams) WithHTTPClient(client *http.Client) *ListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list params +func (o *ListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCollectionName adds the collectionName to the list params +func (o *ListParams) WithCollectionName(collectionName string) *ListParams { + o.SetCollectionName(collectionName) + return o +} + +// SetCollectionName adds the collectionName to the list params +func (o *ListParams) SetCollectionName(collectionName string) { + o.CollectionName = collectionName +} + +// WithEnd adds the end to the list params +func (o *ListParams) WithEnd(end string) *ListParams { + o.SetEnd(end) + return o +} + +// SetEnd adds the end to the list params +func (o *ListParams) SetEnd(end string) { + o.End = end +} + +// WithLimit adds the limit to the list params +func (o *ListParams) WithLimit(limit int64) *ListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the list params +func (o *ListParams) SetLimit(limit int64) { + o.Limit = limit +} + +// WithStart adds the start to the list params +func (o *ListParams) WithStart(start string) *ListParams { + o.SetStart(start) + return o +} + +// SetStart adds the start to the list params +func (o *ListParams) SetStart(start string) { + o.Start = start +} + +// WriteToRequest writes these params to a swagger request +func (o *ListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param collection_name + if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { + return err + } + + // query param end + qrEnd := o.End + qEnd := qrEnd + + if err := r.SetQueryParam("end", qEnd); err != nil { + return err + } + + // query param limit + qrLimit := o.Limit + qLimit := swag.FormatInt64(qrLimit) + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + + // query param start + qrStart := o.Start + qStart := qrStart + + if err := r.SetQueryParam("start", qStart); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/custom_storage/list_objects_responses.go b/falcon/client/custom_storage/list_responses.go similarity index 57% rename from falcon/client/custom_storage/list_objects_responses.go rename to falcon/client/custom_storage/list_responses.go index 70abc2e0..517e3689 100644 --- a/falcon/client/custom_storage/list_objects_responses.go +++ b/falcon/client/custom_storage/list_responses.go @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// ListObjectsReader is a Reader for the ListObjects structure. -type ListObjectsReader struct { +// ListReader is a Reader for the List structure. +type ListReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *ListObjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewListObjectsOK() + result := NewListOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewListObjectsForbidden() + result := NewListForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewListObjectsTooManyRequests() + result := NewListTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[GET /customobjects/v1/collections/{collection_name}/objects] ListObjects", response, response.Code()) + return nil, runtime.NewAPIError("[GET /customobjects/v1/collections/{collection_name}/objects] list", response, response.Code()) } } -// NewListObjectsOK creates a ListObjectsOK with default headers values -func NewListObjectsOK() *ListObjectsOK { - return &ListObjectsOK{} +// NewListOK creates a ListOK with default headers values +func NewListOK() *ListOK { + return &ListOK{} } /* -ListObjectsOK describes a response with status code 200, with default header values. +ListOK describes a response with status code 200, with default header values. OK */ -type ListObjectsOK struct { +type ListOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type ListObjectsOK struct { */ XRateLimitRemaining int64 - Payload *models.CustomType3747358178 + Payload *models.CustomStorageObjectKeys } -// IsSuccess returns true when this list objects o k response has a 2xx status code -func (o *ListObjectsOK) IsSuccess() bool { +// IsSuccess returns true when this list o k response has a 2xx status code +func (o *ListOK) IsSuccess() bool { return true } -// IsRedirect returns true when this list objects o k response has a 3xx status code -func (o *ListObjectsOK) IsRedirect() bool { +// IsRedirect returns true when this list o k response has a 3xx status code +func (o *ListOK) IsRedirect() bool { return false } -// IsClientError returns true when this list objects o k response has a 4xx status code -func (o *ListObjectsOK) IsClientError() bool { +// IsClientError returns true when this list o k response has a 4xx status code +func (o *ListOK) IsClientError() bool { return false } -// IsServerError returns true when this list objects o k response has a 5xx status code -func (o *ListObjectsOK) IsServerError() bool { +// IsServerError returns true when this list o k response has a 5xx status code +func (o *ListOK) IsServerError() bool { return false } -// IsCode returns true when this list objects o k response a status code equal to that given -func (o *ListObjectsOK) IsCode(code int) bool { +// IsCode returns true when this list o k response a status code equal to that given +func (o *ListOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the list objects o k response -func (o *ListObjectsOK) Code() int { +// Code gets the status code for the list o k response +func (o *ListOK) Code() int { return 200 } -func (o *ListObjectsOK) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listObjectsOK %+v", 200, o.Payload) +func (o *ListOK) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listOK %+v", 200, o.Payload) } -func (o *ListObjectsOK) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listObjectsOK %+v", 200, o.Payload) +func (o *ListOK) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listOK %+v", 200, o.Payload) } -func (o *ListObjectsOK) GetPayload() *models.CustomType3747358178 { +func (o *ListOK) GetPayload() *models.CustomStorageObjectKeys { return o.Payload } -func (o *ListObjectsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *ListObjectsOK) readResponse(response runtime.ClientResponse, consumer r o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.CustomType3747358178) + o.Payload = new(models.CustomStorageObjectKeys) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *ListObjectsOK) readResponse(response runtime.ClientResponse, consumer r return nil } -// NewListObjectsForbidden creates a ListObjectsForbidden with default headers values -func NewListObjectsForbidden() *ListObjectsForbidden { - return &ListObjectsForbidden{} +// NewListForbidden creates a ListForbidden with default headers values +func NewListForbidden() *ListForbidden { + return &ListForbidden{} } /* -ListObjectsForbidden describes a response with status code 403, with default header values. +ListForbidden describes a response with status code 403, with default header values. Forbidden */ -type ListObjectsForbidden struct { +type ListForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type ListObjectsForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this list objects forbidden response has a 2xx status code -func (o *ListObjectsForbidden) IsSuccess() bool { +// IsSuccess returns true when this list forbidden response has a 2xx status code +func (o *ListForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this list objects forbidden response has a 3xx status code -func (o *ListObjectsForbidden) IsRedirect() bool { +// IsRedirect returns true when this list forbidden response has a 3xx status code +func (o *ListForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this list objects forbidden response has a 4xx status code -func (o *ListObjectsForbidden) IsClientError() bool { +// IsClientError returns true when this list forbidden response has a 4xx status code +func (o *ListForbidden) IsClientError() bool { return true } -// IsServerError returns true when this list objects forbidden response has a 5xx status code -func (o *ListObjectsForbidden) IsServerError() bool { +// IsServerError returns true when this list forbidden response has a 5xx status code +func (o *ListForbidden) IsServerError() bool { return false } -// IsCode returns true when this list objects forbidden response a status code equal to that given -func (o *ListObjectsForbidden) IsCode(code int) bool { +// IsCode returns true when this list forbidden response a status code equal to that given +func (o *ListForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the list objects forbidden response -func (o *ListObjectsForbidden) Code() int { +// Code gets the status code for the list forbidden response +func (o *ListForbidden) Code() int { return 403 } -func (o *ListObjectsForbidden) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listObjectsForbidden %+v", 403, o.Payload) +func (o *ListForbidden) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listForbidden %+v", 403, o.Payload) } -func (o *ListObjectsForbidden) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listObjectsForbidden %+v", 403, o.Payload) +func (o *ListForbidden) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listForbidden %+v", 403, o.Payload) } -func (o *ListObjectsForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *ListForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ListObjectsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ListForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *ListObjectsForbidden) readResponse(response runtime.ClientResponse, con return nil } -// NewListObjectsTooManyRequests creates a ListObjectsTooManyRequests with default headers values -func NewListObjectsTooManyRequests() *ListObjectsTooManyRequests { - return &ListObjectsTooManyRequests{} +// NewListTooManyRequests creates a ListTooManyRequests with default headers values +func NewListTooManyRequests() *ListTooManyRequests { + return &ListTooManyRequests{} } /* -ListObjectsTooManyRequests describes a response with status code 429, with default header values. +ListTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type ListObjectsTooManyRequests struct { +type ListTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type ListObjectsTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this list objects too many requests response has a 2xx status code -func (o *ListObjectsTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this list too many requests response has a 2xx status code +func (o *ListTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this list objects too many requests response has a 3xx status code -func (o *ListObjectsTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this list too many requests response has a 3xx status code +func (o *ListTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this list objects too many requests response has a 4xx status code -func (o *ListObjectsTooManyRequests) IsClientError() bool { +// IsClientError returns true when this list too many requests response has a 4xx status code +func (o *ListTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this list objects too many requests response has a 5xx status code -func (o *ListObjectsTooManyRequests) IsServerError() bool { +// IsServerError returns true when this list too many requests response has a 5xx status code +func (o *ListTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this list objects too many requests response a status code equal to that given -func (o *ListObjectsTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this list too many requests response a status code equal to that given +func (o *ListTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the list objects too many requests response -func (o *ListObjectsTooManyRequests) Code() int { +// Code gets the status code for the list too many requests response +func (o *ListTooManyRequests) Code() int { return 429 } -func (o *ListObjectsTooManyRequests) Error() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listObjectsTooManyRequests %+v", 429, o.Payload) +func (o *ListTooManyRequests) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listTooManyRequests %+v", 429, o.Payload) } -func (o *ListObjectsTooManyRequests) String() string { - return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listObjectsTooManyRequests %+v", 429, o.Payload) +func (o *ListTooManyRequests) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects][%d] listTooManyRequests %+v", 429, o.Payload) } -func (o *ListObjectsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *ListTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ListObjectsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ListTooManyRequests) 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/custom_storage/metadata_parameters.go b/falcon/client/custom_storage/metadata_parameters.go new file mode 100644 index 00000000..82cdea8a --- /dev/null +++ b/falcon/client/custom_storage/metadata_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_storage + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMetadataParams creates a new MetadataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewMetadataParams() *MetadataParams { + return &MetadataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewMetadataParamsWithTimeout creates a new MetadataParams object +// with the ability to set a timeout on a request. +func NewMetadataParamsWithTimeout(timeout time.Duration) *MetadataParams { + return &MetadataParams{ + timeout: timeout, + } +} + +// NewMetadataParamsWithContext creates a new MetadataParams object +// with the ability to set a context for a request. +func NewMetadataParamsWithContext(ctx context.Context) *MetadataParams { + return &MetadataParams{ + Context: ctx, + } +} + +// NewMetadataParamsWithHTTPClient creates a new MetadataParams object +// with the ability to set a custom HTTPClient for a request. +func NewMetadataParamsWithHTTPClient(client *http.Client) *MetadataParams { + return &MetadataParams{ + HTTPClient: client, + } +} + +/* +MetadataParams contains all the parameters to send to the API endpoint + + for the metadata operation. + + Typically these are written to a http.Request. +*/ +type MetadataParams struct { + + /* CollectionName. + + The name of the collection + */ + CollectionName string + + /* ObjectKey. + + The object key + */ + ObjectKey string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MetadataParams) WithDefaults() *MetadataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the metadata params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MetadataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the metadata params +func (o *MetadataParams) WithTimeout(timeout time.Duration) *MetadataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the metadata params +func (o *MetadataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the metadata params +func (o *MetadataParams) WithContext(ctx context.Context) *MetadataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the metadata params +func (o *MetadataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the metadata params +func (o *MetadataParams) WithHTTPClient(client *http.Client) *MetadataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the metadata params +func (o *MetadataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCollectionName adds the collectionName to the metadata params +func (o *MetadataParams) WithCollectionName(collectionName string) *MetadataParams { + o.SetCollectionName(collectionName) + return o +} + +// SetCollectionName adds the collectionName to the metadata params +func (o *MetadataParams) SetCollectionName(collectionName string) { + o.CollectionName = collectionName +} + +// WithObjectKey adds the objectKey to the metadata params +func (o *MetadataParams) WithObjectKey(objectKey string) *MetadataParams { + o.SetObjectKey(objectKey) + return o +} + +// SetObjectKey adds the objectKey to the metadata params +func (o *MetadataParams) SetObjectKey(objectKey string) { + o.ObjectKey = objectKey +} + +// WriteToRequest writes these params to a swagger request +func (o *MetadataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param collection_name + if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { + return err + } + + // path param object_key + if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/custom_storage/metadata_responses.go b/falcon/client/custom_storage/metadata_responses.go new file mode 100644 index 00000000..0aa85e39 --- /dev/null +++ b/falcon/client/custom_storage/metadata_responses.go @@ -0,0 +1,394 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_storage + +// This file was generated by 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" +) + +// MetadataReader is a Reader for the Metadata structure. +type MetadataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMetadataOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewMetadataForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewMetadataTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata] metadata", response, response.Code()) + } +} + +// NewMetadataOK creates a MetadataOK with default headers values +func NewMetadataOK() *MetadataOK { + return &MetadataOK{} +} + +/* +MetadataOK describes a response with status code 200, with default header values. + +OK +*/ +type MetadataOK 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.CustomStorageResponse +} + +// IsSuccess returns true when this metadata o k response has a 2xx status code +func (o *MetadataOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this metadata o k response has a 3xx status code +func (o *MetadataOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this metadata o k response has a 4xx status code +func (o *MetadataOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this metadata o k response has a 5xx status code +func (o *MetadataOK) IsServerError() bool { + return false +} + +// IsCode returns true when this metadata o k response a status code equal to that given +func (o *MetadataOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the metadata o k response +func (o *MetadataOK) Code() int { + return 200 +} + +func (o *MetadataOK) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] metadataOK %+v", 200, o.Payload) +} + +func (o *MetadataOK) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] metadataOK %+v", 200, o.Payload) +} + +func (o *MetadataOK) GetPayload() *models.CustomStorageResponse { + return o.Payload +} + +func (o *MetadataOK) 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.CustomStorageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMetadataForbidden creates a MetadataForbidden with default headers values +func NewMetadataForbidden() *MetadataForbidden { + return &MetadataForbidden{} +} + +/* +MetadataForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type MetadataForbidden 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 metadata forbidden response has a 2xx status code +func (o *MetadataForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this metadata forbidden response has a 3xx status code +func (o *MetadataForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this metadata forbidden response has a 4xx status code +func (o *MetadataForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this metadata forbidden response has a 5xx status code +func (o *MetadataForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this metadata forbidden response a status code equal to that given +func (o *MetadataForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the metadata forbidden response +func (o *MetadataForbidden) Code() int { + return 403 +} + +func (o *MetadataForbidden) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] metadataForbidden %+v", 403, o.Payload) +} + +func (o *MetadataForbidden) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] metadataForbidden %+v", 403, o.Payload) +} + +func (o *MetadataForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *MetadataForbidden) 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 +} + +// NewMetadataTooManyRequests creates a MetadataTooManyRequests with default headers values +func NewMetadataTooManyRequests() *MetadataTooManyRequests { + return &MetadataTooManyRequests{} +} + +/* +MetadataTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type MetadataTooManyRequests 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 metadata too many requests response has a 2xx status code +func (o *MetadataTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this metadata too many requests response has a 3xx status code +func (o *MetadataTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this metadata too many requests response has a 4xx status code +func (o *MetadataTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this metadata too many requests response has a 5xx status code +func (o *MetadataTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this metadata too many requests response a status code equal to that given +func (o *MetadataTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the metadata too many requests response +func (o *MetadataTooManyRequests) Code() int { + return 429 +} + +func (o *MetadataTooManyRequests) Error() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] metadataTooManyRequests %+v", 429, o.Payload) +} + +func (o *MetadataTooManyRequests) String() string { + return fmt.Sprintf("[GET /customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata][%d] metadataTooManyRequests %+v", 429, o.Payload) +} + +func (o *MetadataTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *MetadataTooManyRequests) 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/custom_storage/put_object_parameters.go b/falcon/client/custom_storage/put_object_parameters.go deleted file mode 100644 index 9fb1c206..00000000 --- a/falcon/client/custom_storage/put_object_parameters.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - "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" -) - -// NewPutObjectParams creates a new PutObjectParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPutObjectParams() *PutObjectParams { - return &PutObjectParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPutObjectParamsWithTimeout creates a new PutObjectParams object -// with the ability to set a timeout on a request. -func NewPutObjectParamsWithTimeout(timeout time.Duration) *PutObjectParams { - return &PutObjectParams{ - timeout: timeout, - } -} - -// NewPutObjectParamsWithContext creates a new PutObjectParams object -// with the ability to set a context for a request. -func NewPutObjectParamsWithContext(ctx context.Context) *PutObjectParams { - return &PutObjectParams{ - Context: ctx, - } -} - -// NewPutObjectParamsWithHTTPClient creates a new PutObjectParams object -// with the ability to set a custom HTTPClient for a request. -func NewPutObjectParamsWithHTTPClient(client *http.Client) *PutObjectParams { - return &PutObjectParams{ - HTTPClient: client, - } -} - -/* -PutObjectParams contains all the parameters to send to the API endpoint - - for the put object operation. - - Typically these are written to a http.Request. -*/ -type PutObjectParams struct { - - /* XCSADBNAMESPACE. - - The name of the namespace the collection belongs to - */ - XCSADBNAMESPACE string - - /* XCSAPPID. - - The id of the app the collection belongs to. This will map to the namespace of the collection - */ - XCSAPPID *string - - // Body. - // - // Format: binary - Body io.ReadCloser - - /* CollectionName. - - The name of the collection - */ - CollectionName string - - /* DryRun. - - If false, run the operation as normal. If true, validate that the request *would* succeed, but don't execute it. - */ - DryRun bool - - /* ObjectKey. - - The object key - */ - ObjectKey string - - /* SchemaVersion. - - The version of the collection schema - */ - SchemaVersion string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the put object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PutObjectParams) WithDefaults() *PutObjectParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the put object params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PutObjectParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the put object params -func (o *PutObjectParams) WithTimeout(timeout time.Duration) *PutObjectParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the put object params -func (o *PutObjectParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the put object params -func (o *PutObjectParams) WithContext(ctx context.Context) *PutObjectParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the put object params -func (o *PutObjectParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the put object params -func (o *PutObjectParams) WithHTTPClient(client *http.Client) *PutObjectParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the put object params -func (o *PutObjectParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSADBNAMESPACE adds the xCSADBNAMESPACE to the put object params -func (o *PutObjectParams) WithXCSADBNAMESPACE(xCSADBNAMESPACE string) *PutObjectParams { - o.SetXCSADBNAMESPACE(xCSADBNAMESPACE) - return o -} - -// SetXCSADBNAMESPACE adds the xCSADBNAMESPACE to the put object params -func (o *PutObjectParams) SetXCSADBNAMESPACE(xCSADBNAMESPACE string) { - o.XCSADBNAMESPACE = xCSADBNAMESPACE -} - -// WithXCSAPPID adds the xCSAPPID to the put object params -func (o *PutObjectParams) WithXCSAPPID(xCSAPPID *string) *PutObjectParams { - o.SetXCSAPPID(xCSAPPID) - return o -} - -// SetXCSAPPID adds the xCSAPPId to the put object params -func (o *PutObjectParams) SetXCSAPPID(xCSAPPID *string) { - o.XCSAPPID = xCSAPPID -} - -// WithBody adds the body to the put object params -func (o *PutObjectParams) WithBody(body io.ReadCloser) *PutObjectParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the put object params -func (o *PutObjectParams) SetBody(body io.ReadCloser) { - o.Body = body -} - -// WithCollectionName adds the collectionName to the put object params -func (o *PutObjectParams) WithCollectionName(collectionName string) *PutObjectParams { - o.SetCollectionName(collectionName) - return o -} - -// SetCollectionName adds the collectionName to the put object params -func (o *PutObjectParams) SetCollectionName(collectionName string) { - o.CollectionName = collectionName -} - -// WithDryRun adds the dryRun to the put object params -func (o *PutObjectParams) WithDryRun(dryRun bool) *PutObjectParams { - o.SetDryRun(dryRun) - return o -} - -// SetDryRun adds the dryRun to the put object params -func (o *PutObjectParams) SetDryRun(dryRun bool) { - o.DryRun = dryRun -} - -// WithObjectKey adds the objectKey to the put object params -func (o *PutObjectParams) WithObjectKey(objectKey string) *PutObjectParams { - o.SetObjectKey(objectKey) - return o -} - -// SetObjectKey adds the objectKey to the put object params -func (o *PutObjectParams) SetObjectKey(objectKey string) { - o.ObjectKey = objectKey -} - -// WithSchemaVersion adds the schemaVersion to the put object params -func (o *PutObjectParams) WithSchemaVersion(schemaVersion string) *PutObjectParams { - o.SetSchemaVersion(schemaVersion) - return o -} - -// SetSchemaVersion adds the schemaVersion to the put object params -func (o *PutObjectParams) SetSchemaVersion(schemaVersion string) { - o.SchemaVersion = schemaVersion -} - -// WriteToRequest writes these params to a swagger request -func (o *PutObjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-CS-ADB-NAMESPACE - if err := r.SetHeaderParam("X-CS-ADB-NAMESPACE", o.XCSADBNAMESPACE); err != nil { - return err - } - - if o.XCSAPPID != nil { - - // header param X-CS-APP-ID - if err := r.SetHeaderParam("X-CS-APP-ID", *o.XCSAPPID); err != nil { - return err - } - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param collection_name - if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { - return err - } - - // query param dry_run - qrDryRun := o.DryRun - qDryRun := swag.FormatBool(qrDryRun) - - if err := r.SetQueryParam("dry_run", qDryRun); err != nil { - return err - } - - // path param object_key - if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { - return err - } - - // query param schema_version - qrSchemaVersion := o.SchemaVersion - qSchemaVersion := qrSchemaVersion - if qSchemaVersion != "" { - - if err := r.SetQueryParam("schema_version", qSchemaVersion); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/custom_storage/search_objects_parameters.go b/falcon/client/custom_storage/search_objects_parameters.go deleted file mode 100644 index 6f4d183a..00000000 --- a/falcon/client/custom_storage/search_objects_parameters.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewSearchObjectsParams creates a new SearchObjectsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewSearchObjectsParams() *SearchObjectsParams { - return &SearchObjectsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewSearchObjectsParamsWithTimeout creates a new SearchObjectsParams object -// with the ability to set a timeout on a request. -func NewSearchObjectsParamsWithTimeout(timeout time.Duration) *SearchObjectsParams { - return &SearchObjectsParams{ - timeout: timeout, - } -} - -// NewSearchObjectsParamsWithContext creates a new SearchObjectsParams object -// with the ability to set a context for a request. -func NewSearchObjectsParamsWithContext(ctx context.Context) *SearchObjectsParams { - return &SearchObjectsParams{ - Context: ctx, - } -} - -// NewSearchObjectsParamsWithHTTPClient creates a new SearchObjectsParams object -// with the ability to set a custom HTTPClient for a request. -func NewSearchObjectsParamsWithHTTPClient(client *http.Client) *SearchObjectsParams { - return &SearchObjectsParams{ - HTTPClient: client, - } -} - -/* -SearchObjectsParams contains all the parameters to send to the API endpoint - - for the search objects operation. - - Typically these are written to a http.Request. -*/ -type SearchObjectsParams struct { - - /* XCSADBNAMESPACE. - - The name of the namespace the collection belongs to - */ - XCSADBNAMESPACE string - - /* XCSAPPID. - - The id of the app the collection belongs to. This will map to the namespace of the collection - */ - XCSAPPID *string - - /* CollectionName. - - The name of the collection - */ - CollectionName string - - /* Filter. - - The filter to limit the returned results. - */ - Filter string - - /* Limit. - - The limit of results to return - */ - Limit int64 - - /* Offset. - - The offset of results to return - */ - Offset int64 - - /* Sort. - - The sort order for the returned results. - */ - Sort *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the search objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SearchObjectsParams) WithDefaults() *SearchObjectsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the search objects params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *SearchObjectsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the search objects params -func (o *SearchObjectsParams) WithTimeout(timeout time.Duration) *SearchObjectsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the search objects params -func (o *SearchObjectsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the search objects params -func (o *SearchObjectsParams) WithContext(ctx context.Context) *SearchObjectsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the search objects params -func (o *SearchObjectsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the search objects params -func (o *SearchObjectsParams) WithHTTPClient(client *http.Client) *SearchObjectsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the search objects params -func (o *SearchObjectsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSADBNAMESPACE adds the xCSADBNAMESPACE to the search objects params -func (o *SearchObjectsParams) WithXCSADBNAMESPACE(xCSADBNAMESPACE string) *SearchObjectsParams { - o.SetXCSADBNAMESPACE(xCSADBNAMESPACE) - return o -} - -// SetXCSADBNAMESPACE adds the xCSADBNAMESPACE to the search objects params -func (o *SearchObjectsParams) SetXCSADBNAMESPACE(xCSADBNAMESPACE string) { - o.XCSADBNAMESPACE = xCSADBNAMESPACE -} - -// WithXCSAPPID adds the xCSAPPID to the search objects params -func (o *SearchObjectsParams) WithXCSAPPID(xCSAPPID *string) *SearchObjectsParams { - o.SetXCSAPPID(xCSAPPID) - return o -} - -// SetXCSAPPID adds the xCSAPPId to the search objects params -func (o *SearchObjectsParams) SetXCSAPPID(xCSAPPID *string) { - o.XCSAPPID = xCSAPPID -} - -// WithCollectionName adds the collectionName to the search objects params -func (o *SearchObjectsParams) WithCollectionName(collectionName string) *SearchObjectsParams { - o.SetCollectionName(collectionName) - return o -} - -// SetCollectionName adds the collectionName to the search objects params -func (o *SearchObjectsParams) SetCollectionName(collectionName string) { - o.CollectionName = collectionName -} - -// WithFilter adds the filter to the search objects params -func (o *SearchObjectsParams) WithFilter(filter string) *SearchObjectsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the search objects params -func (o *SearchObjectsParams) SetFilter(filter string) { - o.Filter = filter -} - -// WithLimit adds the limit to the search objects params -func (o *SearchObjectsParams) WithLimit(limit int64) *SearchObjectsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the search objects params -func (o *SearchObjectsParams) SetLimit(limit int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the search objects params -func (o *SearchObjectsParams) WithOffset(offset int64) *SearchObjectsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the search objects params -func (o *SearchObjectsParams) SetOffset(offset int64) { - o.Offset = offset -} - -// WithSort adds the sort to the search objects params -func (o *SearchObjectsParams) WithSort(sort *string) *SearchObjectsParams { - o.SetSort(sort) - return o -} - -// SetSort adds the sort to the search objects params -func (o *SearchObjectsParams) SetSort(sort *string) { - o.Sort = sort -} - -// WriteToRequest writes these params to a swagger request -func (o *SearchObjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param X-CS-ADB-NAMESPACE - if err := r.SetHeaderParam("X-CS-ADB-NAMESPACE", o.XCSADBNAMESPACE); err != nil { - return err - } - - if o.XCSAPPID != nil { - - // header param X-CS-APP-ID - if err := r.SetHeaderParam("X-CS-APP-ID", *o.XCSAPPID); err != nil { - return err - } - } - - // path param collection_name - if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { - return err - } - - // query param filter - qrFilter := o.Filter - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - - // query param limit - qrLimit := o.Limit - qLimit := swag.FormatInt64(qrLimit) - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - - // query param offset - qrOffset := o.Offset - qOffset := swag.FormatInt64(qrOffset) - - 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/custom_storage/search_objects_responses.go b/falcon/client/custom_storage/search_objects_responses.go deleted file mode 100644 index 09e63a80..00000000 --- a/falcon/client/custom_storage/search_objects_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package custom_storage - -// This file was generated by 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" -) - -// SearchObjectsReader is a Reader for the SearchObjects structure. -type SearchObjectsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SearchObjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewSearchObjectsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewSearchObjectsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewSearchObjectsTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /customobjects/v1/collections/{collection_name}/objects] SearchObjects", response, response.Code()) - } -} - -// NewSearchObjectsOK creates a SearchObjectsOK with default headers values -func NewSearchObjectsOK() *SearchObjectsOK { - return &SearchObjectsOK{} -} - -/* -SearchObjectsOK describes a response with status code 200, with default header values. - -OK -*/ -type SearchObjectsOK 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.CustomStorageResponsePayload -} - -// IsSuccess returns true when this search objects o k response has a 2xx status code -func (o *SearchObjectsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this search objects o k response has a 3xx status code -func (o *SearchObjectsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this search objects o k response has a 4xx status code -func (o *SearchObjectsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this search objects o k response has a 5xx status code -func (o *SearchObjectsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this search objects o k response a status code equal to that given -func (o *SearchObjectsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the search objects o k response -func (o *SearchObjectsOK) Code() int { - return 200 -} - -func (o *SearchObjectsOK) Error() string { - return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchObjectsOK %+v", 200, o.Payload) -} - -func (o *SearchObjectsOK) String() string { - return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchObjectsOK %+v", 200, o.Payload) -} - -func (o *SearchObjectsOK) GetPayload() *models.CustomStorageResponsePayload { - return o.Payload -} - -func (o *SearchObjectsOK) 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.CustomStorageResponsePayload) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewSearchObjectsForbidden creates a SearchObjectsForbidden with default headers values -func NewSearchObjectsForbidden() *SearchObjectsForbidden { - return &SearchObjectsForbidden{} -} - -/* -SearchObjectsForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type SearchObjectsForbidden 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 search objects forbidden response has a 2xx status code -func (o *SearchObjectsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this search objects forbidden response has a 3xx status code -func (o *SearchObjectsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this search objects forbidden response has a 4xx status code -func (o *SearchObjectsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this search objects forbidden response has a 5xx status code -func (o *SearchObjectsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this search objects forbidden response a status code equal to that given -func (o *SearchObjectsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the search objects forbidden response -func (o *SearchObjectsForbidden) Code() int { - return 403 -} - -func (o *SearchObjectsForbidden) Error() string { - return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchObjectsForbidden %+v", 403, o.Payload) -} - -func (o *SearchObjectsForbidden) String() string { - return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchObjectsForbidden %+v", 403, o.Payload) -} - -func (o *SearchObjectsForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *SearchObjectsForbidden) 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 -} - -// NewSearchObjectsTooManyRequests creates a SearchObjectsTooManyRequests with default headers values -func NewSearchObjectsTooManyRequests() *SearchObjectsTooManyRequests { - return &SearchObjectsTooManyRequests{} -} - -/* -SearchObjectsTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type SearchObjectsTooManyRequests 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 search objects too many requests response has a 2xx status code -func (o *SearchObjectsTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this search objects too many requests response has a 3xx status code -func (o *SearchObjectsTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this search objects too many requests response has a 4xx status code -func (o *SearchObjectsTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this search objects too many requests response has a 5xx status code -func (o *SearchObjectsTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this search objects too many requests response a status code equal to that given -func (o *SearchObjectsTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the search objects too many requests response -func (o *SearchObjectsTooManyRequests) Code() int { - return 429 -} - -func (o *SearchObjectsTooManyRequests) Error() string { - return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchObjectsTooManyRequests %+v", 429, o.Payload) -} - -func (o *SearchObjectsTooManyRequests) String() string { - return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchObjectsTooManyRequests %+v", 429, o.Payload) -} - -func (o *SearchObjectsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *SearchObjectsTooManyRequests) 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/custom_storage/search_parameters.go b/falcon/client/custom_storage/search_parameters.go new file mode 100644 index 00000000..9261e68a --- /dev/null +++ b/falcon/client/custom_storage/search_parameters.go @@ -0,0 +1,263 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_storage + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewSearchParams creates a new SearchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSearchParams() *SearchParams { + return &SearchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSearchParamsWithTimeout creates a new SearchParams object +// with the ability to set a timeout on a request. +func NewSearchParamsWithTimeout(timeout time.Duration) *SearchParams { + return &SearchParams{ + timeout: timeout, + } +} + +// NewSearchParamsWithContext creates a new SearchParams object +// with the ability to set a context for a request. +func NewSearchParamsWithContext(ctx context.Context) *SearchParams { + return &SearchParams{ + Context: ctx, + } +} + +// NewSearchParamsWithHTTPClient creates a new SearchParams object +// with the ability to set a custom HTTPClient for a request. +func NewSearchParamsWithHTTPClient(client *http.Client) *SearchParams { + return &SearchParams{ + HTTPClient: client, + } +} + +/* +SearchParams contains all the parameters to send to the API endpoint + + for the search operation. + + Typically these are written to a http.Request. +*/ +type SearchParams struct { + + /* CollectionName. + + The name of the collection + */ + CollectionName string + + /* Filter. + + The filter to limit the returned results. + */ + Filter string + + /* Limit. + + The limit of results to return + */ + Limit int64 + + /* Offset. + + The offset of results to return + */ + Offset int64 + + /* Sort. + + The sort order for the returned results. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchParams) WithDefaults() *SearchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the search params +func (o *SearchParams) WithTimeout(timeout time.Duration) *SearchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the search params +func (o *SearchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the search params +func (o *SearchParams) WithContext(ctx context.Context) *SearchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the search params +func (o *SearchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the search params +func (o *SearchParams) WithHTTPClient(client *http.Client) *SearchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the search params +func (o *SearchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCollectionName adds the collectionName to the search params +func (o *SearchParams) WithCollectionName(collectionName string) *SearchParams { + o.SetCollectionName(collectionName) + return o +} + +// SetCollectionName adds the collectionName to the search params +func (o *SearchParams) SetCollectionName(collectionName string) { + o.CollectionName = collectionName +} + +// WithFilter adds the filter to the search params +func (o *SearchParams) WithFilter(filter string) *SearchParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the search params +func (o *SearchParams) SetFilter(filter string) { + o.Filter = filter +} + +// WithLimit adds the limit to the search params +func (o *SearchParams) WithLimit(limit int64) *SearchParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the search params +func (o *SearchParams) SetLimit(limit int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the search params +func (o *SearchParams) WithOffset(offset int64) *SearchParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the search params +func (o *SearchParams) SetOffset(offset int64) { + o.Offset = offset +} + +// WithSort adds the sort to the search params +func (o *SearchParams) WithSort(sort *string) *SearchParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the search params +func (o *SearchParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *SearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param collection_name + if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { + return err + } + + // query param filter + qrFilter := o.Filter + qFilter := qrFilter + if qFilter != "" { + + if err := r.SetQueryParam("filter", qFilter); err != nil { + return err + } + } + + // query param limit + qrLimit := o.Limit + qLimit := swag.FormatInt64(qrLimit) + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + + // query param offset + qrOffset := o.Offset + qOffset := swag.FormatInt64(qrOffset) + + 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/saved_searches/deploy_responses.go b/falcon/client/custom_storage/search_responses.go similarity index 59% rename from falcon/client/saved_searches/deploy_responses.go rename to falcon/client/custom_storage/search_responses.go index 6ae3a2cd..fa489088 100644 --- a/falcon/client/saved_searches/deploy_responses.go +++ b/falcon/client/custom_storage/search_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +package custom_storage // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// DeployReader is a Reader for the Deploy structure. -type DeployReader struct { +// SearchReader is a Reader for the Search structure. +type SearchReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *DeployReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *SearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewDeployOK() + result := NewSearchOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewDeployForbidden() + result := NewSearchForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewDeployTooManyRequests() + result := NewSearchTooManyRequests() 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-deploy/v1] Deploy", response, response.Code()) + return nil, runtime.NewAPIError("[POST /customobjects/v1/collections/{collection_name}/objects] search", response, response.Code()) } } -// NewDeployOK creates a DeployOK with default headers values -func NewDeployOK() *DeployOK { - return &DeployOK{} +// NewSearchOK creates a SearchOK with default headers values +func NewSearchOK() *SearchOK { + return &SearchOK{} } /* -DeployOK describes a response with status code 200, with default header values. +SearchOK describes a response with status code 200, with default header values. OK */ -type DeployOK struct { +type SearchOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type DeployOK struct { */ XRateLimitRemaining int64 - Payload *models.ApidomainQueryResponseWrapperV1 + Payload *models.CustomStorageResponse } -// IsSuccess returns true when this deploy o k response has a 2xx status code -func (o *DeployOK) IsSuccess() bool { +// IsSuccess returns true when this search o k response has a 2xx status code +func (o *SearchOK) IsSuccess() bool { return true } -// IsRedirect returns true when this deploy o k response has a 3xx status code -func (o *DeployOK) IsRedirect() bool { +// IsRedirect returns true when this search o k response has a 3xx status code +func (o *SearchOK) IsRedirect() bool { return false } -// IsClientError returns true when this deploy o k response has a 4xx status code -func (o *DeployOK) IsClientError() bool { +// IsClientError returns true when this search o k response has a 4xx status code +func (o *SearchOK) IsClientError() bool { return false } -// IsServerError returns true when this deploy o k response has a 5xx status code -func (o *DeployOK) IsServerError() bool { +// IsServerError returns true when this search o k response has a 5xx status code +func (o *SearchOK) IsServerError() bool { return false } -// IsCode returns true when this deploy o k response a status code equal to that given -func (o *DeployOK) IsCode(code int) bool { +// IsCode returns true when this search o k response a status code equal to that given +func (o *SearchOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the deploy o k response -func (o *DeployOK) Code() int { +// Code gets the status code for the search o k response +func (o *SearchOK) Code() int { return 200 } -func (o *DeployOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-deploy/v1][%d] deployOK %+v", 200, o.Payload) +func (o *SearchOK) Error() string { + return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchOK %+v", 200, o.Payload) } -func (o *DeployOK) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-deploy/v1][%d] deployOK %+v", 200, o.Payload) +func (o *SearchOK) String() string { + return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchOK %+v", 200, o.Payload) } -func (o *DeployOK) GetPayload() *models.ApidomainQueryResponseWrapperV1 { +func (o *SearchOK) GetPayload() *models.CustomStorageResponse { return o.Payload } -func (o *DeployOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *SearchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *DeployOK) readResponse(response runtime.ClientResponse, consumer runtim o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.ApidomainQueryResponseWrapperV1) + o.Payload = new(models.CustomStorageResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *DeployOK) readResponse(response runtime.ClientResponse, consumer runtim return nil } -// NewDeployForbidden creates a DeployForbidden with default headers values -func NewDeployForbidden() *DeployForbidden { - return &DeployForbidden{} +// NewSearchForbidden creates a SearchForbidden with default headers values +func NewSearchForbidden() *SearchForbidden { + return &SearchForbidden{} } /* -DeployForbidden describes a response with status code 403, with default header values. +SearchForbidden describes a response with status code 403, with default header values. Forbidden */ -type DeployForbidden struct { +type SearchForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type DeployForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this deploy forbidden response has a 2xx status code -func (o *DeployForbidden) IsSuccess() bool { +// IsSuccess returns true when this search forbidden response has a 2xx status code +func (o *SearchForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this deploy forbidden response has a 3xx status code -func (o *DeployForbidden) IsRedirect() bool { +// IsRedirect returns true when this search forbidden response has a 3xx status code +func (o *SearchForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this deploy forbidden response has a 4xx status code -func (o *DeployForbidden) IsClientError() bool { +// IsClientError returns true when this search forbidden response has a 4xx status code +func (o *SearchForbidden) IsClientError() bool { return true } -// IsServerError returns true when this deploy forbidden response has a 5xx status code -func (o *DeployForbidden) IsServerError() bool { +// IsServerError returns true when this search forbidden response has a 5xx status code +func (o *SearchForbidden) IsServerError() bool { return false } -// IsCode returns true when this deploy forbidden response a status code equal to that given -func (o *DeployForbidden) IsCode(code int) bool { +// IsCode returns true when this search forbidden response a status code equal to that given +func (o *SearchForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the deploy forbidden response -func (o *DeployForbidden) Code() int { +// Code gets the status code for the search forbidden response +func (o *SearchForbidden) Code() int { return 403 } -func (o *DeployForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-deploy/v1][%d] deployForbidden %+v", 403, o.Payload) +func (o *SearchForbidden) Error() string { + return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchForbidden %+v", 403, o.Payload) } -func (o *DeployForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-deploy/v1][%d] deployForbidden %+v", 403, o.Payload) +func (o *SearchForbidden) String() string { + return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchForbidden %+v", 403, o.Payload) } -func (o *DeployForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *SearchForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *DeployForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *SearchForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *DeployForbidden) readResponse(response runtime.ClientResponse, consumer return nil } -// NewDeployTooManyRequests creates a DeployTooManyRequests with default headers values -func NewDeployTooManyRequests() *DeployTooManyRequests { - return &DeployTooManyRequests{} +// NewSearchTooManyRequests creates a SearchTooManyRequests with default headers values +func NewSearchTooManyRequests() *SearchTooManyRequests { + return &SearchTooManyRequests{} } /* -DeployTooManyRequests describes a response with status code 429, with default header values. +SearchTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type DeployTooManyRequests struct { +type SearchTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type DeployTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this deploy too many requests response has a 2xx status code -func (o *DeployTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this search too many requests response has a 2xx status code +func (o *SearchTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this deploy too many requests response has a 3xx status code -func (o *DeployTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this search too many requests response has a 3xx status code +func (o *SearchTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this deploy too many requests response has a 4xx status code -func (o *DeployTooManyRequests) IsClientError() bool { +// IsClientError returns true when this search too many requests response has a 4xx status code +func (o *SearchTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this deploy too many requests response has a 5xx status code -func (o *DeployTooManyRequests) IsServerError() bool { +// IsServerError returns true when this search too many requests response has a 5xx status code +func (o *SearchTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this deploy too many requests response a status code equal to that given -func (o *DeployTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this search too many requests response a status code equal to that given +func (o *SearchTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the deploy too many requests response -func (o *DeployTooManyRequests) Code() int { +// Code gets the status code for the search too many requests response +func (o *SearchTooManyRequests) Code() int { return 429 } -func (o *DeployTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-deploy/v1][%d] deployTooManyRequests %+v", 429, o.Payload) +func (o *SearchTooManyRequests) Error() string { + return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchTooManyRequests %+v", 429, o.Payload) } -func (o *DeployTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-deploy/v1][%d] deployTooManyRequests %+v", 429, o.Payload) +func (o *SearchTooManyRequests) String() string { + return fmt.Sprintf("[POST /customobjects/v1/collections/{collection_name}/objects][%d] searchTooManyRequests %+v", 429, o.Payload) } -func (o *DeployTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *SearchTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *DeployTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *SearchTooManyRequests) 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/custom_storage/upload_parameters.go b/falcon/client/custom_storage/upload_parameters.go new file mode 100644 index 00000000..6408ca92 --- /dev/null +++ b/falcon/client/custom_storage/upload_parameters.go @@ -0,0 +1,255 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package custom_storage + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "io" + "net/http" + "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" +) + +// NewUploadParams creates a new UploadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUploadParams() *UploadParams { + return &UploadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUploadParamsWithTimeout creates a new UploadParams object +// with the ability to set a timeout on a request. +func NewUploadParamsWithTimeout(timeout time.Duration) *UploadParams { + return &UploadParams{ + timeout: timeout, + } +} + +// NewUploadParamsWithContext creates a new UploadParams object +// with the ability to set a context for a request. +func NewUploadParamsWithContext(ctx context.Context) *UploadParams { + return &UploadParams{ + Context: ctx, + } +} + +// NewUploadParamsWithHTTPClient creates a new UploadParams object +// with the ability to set a custom HTTPClient for a request. +func NewUploadParamsWithHTTPClient(client *http.Client) *UploadParams { + return &UploadParams{ + HTTPClient: client, + } +} + +/* +UploadParams contains all the parameters to send to the API endpoint + + for the upload operation. + + Typically these are written to a http.Request. +*/ +type UploadParams struct { + + // Body. + // + // Format: binary + Body io.ReadCloser + + /* CollectionName. + + The name of the collection + */ + CollectionName string + + /* DryRun. + + If false, run the operation as normal. If true, validate that the request *would* succeed, but don't execute it. + */ + DryRun bool + + /* ObjectKey. + + The object key + */ + ObjectKey string + + /* SchemaVersion. + + The version of the collection schema + */ + SchemaVersion *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadParams) WithDefaults() *UploadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UploadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the upload params +func (o *UploadParams) WithTimeout(timeout time.Duration) *UploadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the upload params +func (o *UploadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the upload params +func (o *UploadParams) WithContext(ctx context.Context) *UploadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the upload params +func (o *UploadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the upload params +func (o *UploadParams) WithHTTPClient(client *http.Client) *UploadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the upload params +func (o *UploadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the upload params +func (o *UploadParams) WithBody(body io.ReadCloser) *UploadParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the upload params +func (o *UploadParams) SetBody(body io.ReadCloser) { + o.Body = body +} + +// WithCollectionName adds the collectionName to the upload params +func (o *UploadParams) WithCollectionName(collectionName string) *UploadParams { + o.SetCollectionName(collectionName) + return o +} + +// SetCollectionName adds the collectionName to the upload params +func (o *UploadParams) SetCollectionName(collectionName string) { + o.CollectionName = collectionName +} + +// WithDryRun adds the dryRun to the upload params +func (o *UploadParams) WithDryRun(dryRun bool) *UploadParams { + o.SetDryRun(dryRun) + return o +} + +// SetDryRun adds the dryRun to the upload params +func (o *UploadParams) SetDryRun(dryRun bool) { + o.DryRun = dryRun +} + +// WithObjectKey adds the objectKey to the upload params +func (o *UploadParams) WithObjectKey(objectKey string) *UploadParams { + o.SetObjectKey(objectKey) + return o +} + +// SetObjectKey adds the objectKey to the upload params +func (o *UploadParams) SetObjectKey(objectKey string) { + o.ObjectKey = objectKey +} + +// WithSchemaVersion adds the schemaVersion to the upload params +func (o *UploadParams) WithSchemaVersion(schemaVersion *string) *UploadParams { + o.SetSchemaVersion(schemaVersion) + return o +} + +// SetSchemaVersion adds the schemaVersion to the upload params +func (o *UploadParams) SetSchemaVersion(schemaVersion *string) { + o.SchemaVersion = schemaVersion +} + +// WriteToRequest writes these params to a swagger request +func (o *UploadParams) 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 + } + } + + // path param collection_name + if err := r.SetPathParam("collection_name", o.CollectionName); err != nil { + return err + } + + // query param dry_run + qrDryRun := o.DryRun + qDryRun := swag.FormatBool(qrDryRun) + + if err := r.SetQueryParam("dry_run", qDryRun); err != nil { + return err + } + + // path param object_key + if err := r.SetPathParam("object_key", o.ObjectKey); err != nil { + return err + } + + if o.SchemaVersion != nil { + + // query param schema_version + var qrSchemaVersion string + + if o.SchemaVersion != nil { + qrSchemaVersion = *o.SchemaVersion + } + qSchemaVersion := qrSchemaVersion + if qSchemaVersion != "" { + + if err := r.SetQueryParam("schema_version", qSchemaVersion); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/saved_searches/ingest_responses.go b/falcon/client/custom_storage/upload_responses.go similarity index 59% rename from falcon/client/saved_searches/ingest_responses.go rename to falcon/client/custom_storage/upload_responses.go index 1355670e..885590af 100644 --- a/falcon/client/saved_searches/ingest_responses.go +++ b/falcon/client/custom_storage/upload_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +package custom_storage // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// IngestReader is a Reader for the Ingest structure. -type IngestReader struct { +// UploadReader is a Reader for the Upload structure. +type UploadReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IngestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *UploadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIngestOK() + result := NewUploadOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewIngestForbidden() + result := NewUploadForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewIngestTooManyRequests() + result := NewUploadTooManyRequests() 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] Ingest", response, response.Code()) + return nil, runtime.NewAPIError("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}] upload", response, response.Code()) } } -// NewIngestOK creates a IngestOK with default headers values -func NewIngestOK() *IngestOK { - return &IngestOK{} +// NewUploadOK creates a UploadOK with default headers values +func NewUploadOK() *UploadOK { + return &UploadOK{} } /* -IngestOK describes a response with status code 200, with default header values. +UploadOK describes a response with status code 200, with default header values. OK */ -type IngestOK struct { +type UploadOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type IngestOK struct { */ XRateLimitRemaining int64 - Payload *models.ApidomainDataIngestResponseWrapperV1 + Payload *models.CustomStorageResponse } -// IsSuccess returns true when this ingest o k response has a 2xx status code -func (o *IngestOK) IsSuccess() bool { +// IsSuccess returns true when this upload o k response has a 2xx status code +func (o *UploadOK) IsSuccess() bool { return true } -// IsRedirect returns true when this ingest o k response has a 3xx status code -func (o *IngestOK) IsRedirect() bool { +// IsRedirect returns true when this upload o k response has a 3xx status code +func (o *UploadOK) IsRedirect() bool { return false } -// IsClientError returns true when this ingest o k response has a 4xx status code -func (o *IngestOK) IsClientError() bool { +// IsClientError returns true when this upload o k response has a 4xx status code +func (o *UploadOK) IsClientError() bool { return false } -// IsServerError returns true when this ingest o k response has a 5xx status code -func (o *IngestOK) IsServerError() bool { +// IsServerError returns true when this upload o k response has a 5xx status code +func (o *UploadOK) IsServerError() bool { return false } -// IsCode returns true when this ingest o k response a status code equal to that given -func (o *IngestOK) IsCode(code int) bool { +// IsCode returns true when this upload o k response a status code equal to that given +func (o *UploadOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the ingest o k response -func (o *IngestOK) Code() int { +// Code gets the status code for the upload o k response +func (o *UploadOK) Code() int { return 200 } -func (o *IngestOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] ingestOK %+v", 200, o.Payload) +func (o *UploadOK) Error() string { + return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] uploadOK %+v", 200, o.Payload) } -func (o *IngestOK) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] ingestOK %+v", 200, o.Payload) +func (o *UploadOK) String() string { + return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] uploadOK %+v", 200, o.Payload) } -func (o *IngestOK) GetPayload() *models.ApidomainDataIngestResponseWrapperV1 { +func (o *UploadOK) GetPayload() *models.CustomStorageResponse { return o.Payload } -func (o *IngestOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UploadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *IngestOK) readResponse(response runtime.ClientResponse, consumer runtim o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.ApidomainDataIngestResponseWrapperV1) + o.Payload = new(models.CustomStorageResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *IngestOK) readResponse(response runtime.ClientResponse, consumer runtim return nil } -// NewIngestForbidden creates a IngestForbidden with default headers values -func NewIngestForbidden() *IngestForbidden { - return &IngestForbidden{} +// NewUploadForbidden creates a UploadForbidden with default headers values +func NewUploadForbidden() *UploadForbidden { + return &UploadForbidden{} } /* -IngestForbidden describes a response with status code 403, with default header values. +UploadForbidden describes a response with status code 403, with default header values. Forbidden */ -type IngestForbidden struct { +type UploadForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type IngestForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this ingest forbidden response has a 2xx status code -func (o *IngestForbidden) IsSuccess() bool { +// IsSuccess returns true when this upload forbidden response has a 2xx status code +func (o *UploadForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this ingest forbidden response has a 3xx status code -func (o *IngestForbidden) IsRedirect() bool { +// IsRedirect returns true when this upload forbidden response has a 3xx status code +func (o *UploadForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this ingest forbidden response has a 4xx status code -func (o *IngestForbidden) IsClientError() bool { +// IsClientError returns true when this upload forbidden response has a 4xx status code +func (o *UploadForbidden) IsClientError() bool { return true } -// IsServerError returns true when this ingest forbidden response has a 5xx status code -func (o *IngestForbidden) IsServerError() bool { +// IsServerError returns true when this upload forbidden response has a 5xx status code +func (o *UploadForbidden) IsServerError() bool { return false } -// IsCode returns true when this ingest forbidden response a status code equal to that given -func (o *IngestForbidden) IsCode(code int) bool { +// IsCode returns true when this upload forbidden response a status code equal to that given +func (o *UploadForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the ingest forbidden response -func (o *IngestForbidden) Code() int { +// Code gets the status code for the upload forbidden response +func (o *UploadForbidden) Code() int { return 403 } -func (o *IngestForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] ingestForbidden %+v", 403, o.Payload) +func (o *UploadForbidden) Error() string { + return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] uploadForbidden %+v", 403, o.Payload) } -func (o *IngestForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] ingestForbidden %+v", 403, o.Payload) +func (o *UploadForbidden) String() string { + return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] uploadForbidden %+v", 403, o.Payload) } -func (o *IngestForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *UploadForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *IngestForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UploadForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *IngestForbidden) readResponse(response runtime.ClientResponse, consumer return nil } -// NewIngestTooManyRequests creates a IngestTooManyRequests with default headers values -func NewIngestTooManyRequests() *IngestTooManyRequests { - return &IngestTooManyRequests{} +// NewUploadTooManyRequests creates a UploadTooManyRequests with default headers values +func NewUploadTooManyRequests() *UploadTooManyRequests { + return &UploadTooManyRequests{} } /* -IngestTooManyRequests describes a response with status code 429, with default header values. +UploadTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type IngestTooManyRequests struct { +type UploadTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type IngestTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this ingest too many requests response has a 2xx status code -func (o *IngestTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this upload too many requests response has a 2xx status code +func (o *UploadTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this ingest too many requests response has a 3xx status code -func (o *IngestTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this upload too many requests response has a 3xx status code +func (o *UploadTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this ingest too many requests response has a 4xx status code -func (o *IngestTooManyRequests) IsClientError() bool { +// IsClientError returns true when this upload too many requests response has a 4xx status code +func (o *UploadTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this ingest too many requests response has a 5xx status code -func (o *IngestTooManyRequests) IsServerError() bool { +// IsServerError returns true when this upload too many requests response has a 5xx status code +func (o *UploadTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this ingest too many requests response a status code equal to that given -func (o *IngestTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this upload too many requests response a status code equal to that given +func (o *UploadTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the ingest too many requests response -func (o *IngestTooManyRequests) Code() int { +// Code gets the status code for the upload too many requests response +func (o *UploadTooManyRequests) Code() int { return 429 } -func (o *IngestTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] ingestTooManyRequests %+v", 429, o.Payload) +func (o *UploadTooManyRequests) Error() string { + return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] uploadTooManyRequests %+v", 429, o.Payload) } -func (o *IngestTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-ingest/v1][%d] ingestTooManyRequests %+v", 429, o.Payload) +func (o *UploadTooManyRequests) String() string { + return fmt.Sprintf("[PUT /customobjects/v1/collections/{collection_name}/objects/{object_key}][%d] uploadTooManyRequests %+v", 429, o.Payload) } -func (o *IngestTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *UploadTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *IngestTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UploadTooManyRequests) 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/falcon_complete_dashboard/aggregate_prevention_policy_parameters.go b/falcon/client/falcon_complete_dashboard/aggregate_prevention_policy_parameters.go new file mode 100644 index 00000000..413d505d --- /dev/null +++ b/falcon/client/falcon_complete_dashboard/aggregate_prevention_policy_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" +) + +// NewAggregatePreventionPolicyParams creates a new AggregatePreventionPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAggregatePreventionPolicyParams() *AggregatePreventionPolicyParams { + return &AggregatePreventionPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAggregatePreventionPolicyParamsWithTimeout creates a new AggregatePreventionPolicyParams object +// with the ability to set a timeout on a request. +func NewAggregatePreventionPolicyParamsWithTimeout(timeout time.Duration) *AggregatePreventionPolicyParams { + return &AggregatePreventionPolicyParams{ + timeout: timeout, + } +} + +// NewAggregatePreventionPolicyParamsWithContext creates a new AggregatePreventionPolicyParams object +// with the ability to set a context for a request. +func NewAggregatePreventionPolicyParamsWithContext(ctx context.Context) *AggregatePreventionPolicyParams { + return &AggregatePreventionPolicyParams{ + Context: ctx, + } +} + +// NewAggregatePreventionPolicyParamsWithHTTPClient creates a new AggregatePreventionPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewAggregatePreventionPolicyParamsWithHTTPClient(client *http.Client) *AggregatePreventionPolicyParams { + return &AggregatePreventionPolicyParams{ + HTTPClient: client, + } +} + +/* +AggregatePreventionPolicyParams contains all the parameters to send to the API endpoint + + for the aggregate prevention policy operation. + + Typically these are written to a http.Request. +*/ +type AggregatePreventionPolicyParams struct { + + // Body. + Body []*models.MsaAggregateQueryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the aggregate prevention policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregatePreventionPolicyParams) WithDefaults() *AggregatePreventionPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the aggregate prevention policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregatePreventionPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) WithTimeout(timeout time.Duration) *AggregatePreventionPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) WithContext(ctx context.Context) *AggregatePreventionPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) WithHTTPClient(client *http.Client) *AggregatePreventionPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregatePreventionPolicyParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the aggregate prevention policy params +func (o *AggregatePreventionPolicyParams) SetBody(body []*models.MsaAggregateQueryRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AggregatePreventionPolicyParams) 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_prevention_policy_responses.go b/falcon/client/falcon_complete_dashboard/aggregate_prevention_policy_responses.go new file mode 100644 index 00000000..a3318937 --- /dev/null +++ b/falcon/client/falcon_complete_dashboard/aggregate_prevention_policy_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" +) + +// AggregatePreventionPolicyReader is a Reader for the AggregatePreventionPolicy structure. +type AggregatePreventionPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AggregatePreventionPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAggregatePreventionPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAggregatePreventionPolicyBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewAggregatePreventionPolicyForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewAggregatePreventionPolicyTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewAggregatePreventionPolicyInternalServerError() + 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/prevention-policies/v1] AggregatePreventionPolicy", response, response.Code()) + } +} + +// NewAggregatePreventionPolicyOK creates a AggregatePreventionPolicyOK with default headers values +func NewAggregatePreventionPolicyOK() *AggregatePreventionPolicyOK { + return &AggregatePreventionPolicyOK{} +} + +/* +AggregatePreventionPolicyOK describes a response with status code 200, with default header values. + +OK +*/ +type AggregatePreventionPolicyOK 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 prevention policy o k response has a 2xx status code +func (o *AggregatePreventionPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this aggregate prevention policy o k response has a 3xx status code +func (o *AggregatePreventionPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate prevention policy o k response has a 4xx status code +func (o *AggregatePreventionPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate prevention policy o k response has a 5xx status code +func (o *AggregatePreventionPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate prevention policy o k response a status code equal to that given +func (o *AggregatePreventionPolicyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the aggregate prevention policy o k response +func (o *AggregatePreventionPolicyOK) Code() int { + return 200 +} + +func (o *AggregatePreventionPolicyOK) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyOK %+v", 200, o.Payload) +} + +func (o *AggregatePreventionPolicyOK) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyOK %+v", 200, o.Payload) +} + +func (o *AggregatePreventionPolicyOK) GetPayload() *models.MsaAggregatesResponse { + return o.Payload +} + +func (o *AggregatePreventionPolicyOK) 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 +} + +// NewAggregatePreventionPolicyBadRequest creates a AggregatePreventionPolicyBadRequest with default headers values +func NewAggregatePreventionPolicyBadRequest() *AggregatePreventionPolicyBadRequest { + return &AggregatePreventionPolicyBadRequest{} +} + +/* +AggregatePreventionPolicyBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type AggregatePreventionPolicyBadRequest 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 prevention policy bad request response has a 2xx status code +func (o *AggregatePreventionPolicyBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate prevention policy bad request response has a 3xx status code +func (o *AggregatePreventionPolicyBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate prevention policy bad request response has a 4xx status code +func (o *AggregatePreventionPolicyBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate prevention policy bad request response has a 5xx status code +func (o *AggregatePreventionPolicyBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate prevention policy bad request response a status code equal to that given +func (o *AggregatePreventionPolicyBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the aggregate prevention policy bad request response +func (o *AggregatePreventionPolicyBadRequest) Code() int { + return 400 +} + +func (o *AggregatePreventionPolicyBadRequest) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyBadRequest %+v", 400, o.Payload) +} + +func (o *AggregatePreventionPolicyBadRequest) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyBadRequest %+v", 400, o.Payload) +} + +func (o *AggregatePreventionPolicyBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregatePreventionPolicyBadRequest) 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 +} + +// NewAggregatePreventionPolicyForbidden creates a AggregatePreventionPolicyForbidden with default headers values +func NewAggregatePreventionPolicyForbidden() *AggregatePreventionPolicyForbidden { + return &AggregatePreventionPolicyForbidden{} +} + +/* +AggregatePreventionPolicyForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type AggregatePreventionPolicyForbidden 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 prevention policy forbidden response has a 2xx status code +func (o *AggregatePreventionPolicyForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate prevention policy forbidden response has a 3xx status code +func (o *AggregatePreventionPolicyForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate prevention policy forbidden response has a 4xx status code +func (o *AggregatePreventionPolicyForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate prevention policy forbidden response has a 5xx status code +func (o *AggregatePreventionPolicyForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate prevention policy forbidden response a status code equal to that given +func (o *AggregatePreventionPolicyForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the aggregate prevention policy forbidden response +func (o *AggregatePreventionPolicyForbidden) Code() int { + return 403 +} + +func (o *AggregatePreventionPolicyForbidden) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyForbidden %+v", 403, o.Payload) +} + +func (o *AggregatePreventionPolicyForbidden) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyForbidden %+v", 403, o.Payload) +} + +func (o *AggregatePreventionPolicyForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregatePreventionPolicyForbidden) 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 +} + +// NewAggregatePreventionPolicyTooManyRequests creates a AggregatePreventionPolicyTooManyRequests with default headers values +func NewAggregatePreventionPolicyTooManyRequests() *AggregatePreventionPolicyTooManyRequests { + return &AggregatePreventionPolicyTooManyRequests{} +} + +/* +AggregatePreventionPolicyTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type AggregatePreventionPolicyTooManyRequests 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 prevention policy too many requests response has a 2xx status code +func (o *AggregatePreventionPolicyTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate prevention policy too many requests response has a 3xx status code +func (o *AggregatePreventionPolicyTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate prevention policy too many requests response has a 4xx status code +func (o *AggregatePreventionPolicyTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate prevention policy too many requests response has a 5xx status code +func (o *AggregatePreventionPolicyTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate prevention policy too many requests response a status code equal to that given +func (o *AggregatePreventionPolicyTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the aggregate prevention policy too many requests response +func (o *AggregatePreventionPolicyTooManyRequests) Code() int { + return 429 +} + +func (o *AggregatePreventionPolicyTooManyRequests) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregatePreventionPolicyTooManyRequests) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregatePreventionPolicyTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *AggregatePreventionPolicyTooManyRequests) 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 +} + +// NewAggregatePreventionPolicyInternalServerError creates a AggregatePreventionPolicyInternalServerError with default headers values +func NewAggregatePreventionPolicyInternalServerError() *AggregatePreventionPolicyInternalServerError { + return &AggregatePreventionPolicyInternalServerError{} +} + +/* +AggregatePreventionPolicyInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type AggregatePreventionPolicyInternalServerError 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 prevention policy internal server error response has a 2xx status code +func (o *AggregatePreventionPolicyInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate prevention policy internal server error response has a 3xx status code +func (o *AggregatePreventionPolicyInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate prevention policy internal server error response has a 4xx status code +func (o *AggregatePreventionPolicyInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate prevention policy internal server error response has a 5xx status code +func (o *AggregatePreventionPolicyInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this aggregate prevention policy internal server error response a status code equal to that given +func (o *AggregatePreventionPolicyInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the aggregate prevention policy internal server error response +func (o *AggregatePreventionPolicyInternalServerError) Code() int { + return 500 +} + +func (o *AggregatePreventionPolicyInternalServerError) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregatePreventionPolicyInternalServerError) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/prevention-policies/v1][%d] aggregatePreventionPolicyInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregatePreventionPolicyInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregatePreventionPolicyInternalServerError) 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_sensor_update_policy_parameters.go b/falcon/client/falcon_complete_dashboard/aggregate_sensor_update_policy_parameters.go new file mode 100644 index 00000000..e5470a69 --- /dev/null +++ b/falcon/client/falcon_complete_dashboard/aggregate_sensor_update_policy_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" +) + +// NewAggregateSensorUpdatePolicyParams creates a new AggregateSensorUpdatePolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAggregateSensorUpdatePolicyParams() *AggregateSensorUpdatePolicyParams { + return &AggregateSensorUpdatePolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAggregateSensorUpdatePolicyParamsWithTimeout creates a new AggregateSensorUpdatePolicyParams object +// with the ability to set a timeout on a request. +func NewAggregateSensorUpdatePolicyParamsWithTimeout(timeout time.Duration) *AggregateSensorUpdatePolicyParams { + return &AggregateSensorUpdatePolicyParams{ + timeout: timeout, + } +} + +// NewAggregateSensorUpdatePolicyParamsWithContext creates a new AggregateSensorUpdatePolicyParams object +// with the ability to set a context for a request. +func NewAggregateSensorUpdatePolicyParamsWithContext(ctx context.Context) *AggregateSensorUpdatePolicyParams { + return &AggregateSensorUpdatePolicyParams{ + Context: ctx, + } +} + +// NewAggregateSensorUpdatePolicyParamsWithHTTPClient creates a new AggregateSensorUpdatePolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewAggregateSensorUpdatePolicyParamsWithHTTPClient(client *http.Client) *AggregateSensorUpdatePolicyParams { + return &AggregateSensorUpdatePolicyParams{ + HTTPClient: client, + } +} + +/* +AggregateSensorUpdatePolicyParams contains all the parameters to send to the API endpoint + + for the aggregate sensor update policy operation. + + Typically these are written to a http.Request. +*/ +type AggregateSensorUpdatePolicyParams struct { + + // Body. + Body []*models.MsaAggregateQueryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the aggregate sensor update policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateSensorUpdatePolicyParams) WithDefaults() *AggregateSensorUpdatePolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the aggregate sensor update policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateSensorUpdatePolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) WithTimeout(timeout time.Duration) *AggregateSensorUpdatePolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) WithContext(ctx context.Context) *AggregateSensorUpdatePolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) WithHTTPClient(client *http.Client) *AggregateSensorUpdatePolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregateSensorUpdatePolicyParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the aggregate sensor update policy params +func (o *AggregateSensorUpdatePolicyParams) SetBody(body []*models.MsaAggregateQueryRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AggregateSensorUpdatePolicyParams) 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/registration/register_cspm_snapshot_account_responses.go b/falcon/client/falcon_complete_dashboard/aggregate_sensor_update_policy_responses.go similarity index 50% rename from falcon/client/registration/register_cspm_snapshot_account_responses.go rename to falcon/client/falcon_complete_dashboard/aggregate_sensor_update_policy_responses.go index 69748cf2..72783b17 100644 --- a/falcon/client/registration/register_cspm_snapshot_account_responses.go +++ b/falcon/client/falcon_complete_dashboard/aggregate_sensor_update_policy_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package registration +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 @@ -17,60 +17,60 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// RegisterCspmSnapshotAccountReader is a Reader for the RegisterCspmSnapshotAccount structure. -type RegisterCspmSnapshotAccountReader struct { +// AggregateSensorUpdatePolicyReader is a Reader for the AggregateSensorUpdatePolicy structure. +type AggregateSensorUpdatePolicyReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *RegisterCspmSnapshotAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *AggregateSensorUpdatePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewRegisterCspmSnapshotAccountOK() + result := NewAggregateSensorUpdatePolicyOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: - result := NewRegisterCspmSnapshotAccountBadRequest() + result := NewAggregateSensorUpdatePolicyBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: - result := NewRegisterCspmSnapshotAccountForbidden() + result := NewAggregateSensorUpdatePolicyForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewRegisterCspmSnapshotAccountTooManyRequests() + result := NewAggregateSensorUpdatePolicyTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: - result := NewRegisterCspmSnapshotAccountInternalServerError() + result := NewAggregateSensorUpdatePolicyInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[POST /snapshots/entities/accounts/v1] RegisterCspmSnapshotAccount", response, response.Code()) + return nil, runtime.NewAPIError("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1] AggregateSensorUpdatePolicy", response, response.Code()) } } -// NewRegisterCspmSnapshotAccountOK creates a RegisterCspmSnapshotAccountOK with default headers values -func NewRegisterCspmSnapshotAccountOK() *RegisterCspmSnapshotAccountOK { - return &RegisterCspmSnapshotAccountOK{} +// NewAggregateSensorUpdatePolicyOK creates a AggregateSensorUpdatePolicyOK with default headers values +func NewAggregateSensorUpdatePolicyOK() *AggregateSensorUpdatePolicyOK { + return &AggregateSensorUpdatePolicyOK{} } /* -RegisterCspmSnapshotAccountOK describes a response with status code 200, with default header values. +AggregateSensorUpdatePolicyOK describes a response with status code 200, with default header values. OK */ -type RegisterCspmSnapshotAccountOK struct { +type AggregateSensorUpdatePolicyOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -84,52 +84,52 @@ type RegisterCspmSnapshotAccountOK struct { */ XRateLimitRemaining int64 - Payload *models.ModelsAccountStatusResponse + Payload *models.MsaAggregatesResponse } -// IsSuccess returns true when this register cspm snapshot account o k response has a 2xx status code -func (o *RegisterCspmSnapshotAccountOK) IsSuccess() bool { +// IsSuccess returns true when this aggregate sensor update policy o k response has a 2xx status code +func (o *AggregateSensorUpdatePolicyOK) IsSuccess() bool { return true } -// IsRedirect returns true when this register cspm snapshot account o k response has a 3xx status code -func (o *RegisterCspmSnapshotAccountOK) IsRedirect() bool { +// IsRedirect returns true when this aggregate sensor update policy o k response has a 3xx status code +func (o *AggregateSensorUpdatePolicyOK) IsRedirect() bool { return false } -// IsClientError returns true when this register cspm snapshot account o k response has a 4xx status code -func (o *RegisterCspmSnapshotAccountOK) IsClientError() bool { +// IsClientError returns true when this aggregate sensor update policy o k response has a 4xx status code +func (o *AggregateSensorUpdatePolicyOK) IsClientError() bool { return false } -// IsServerError returns true when this register cspm snapshot account o k response has a 5xx status code -func (o *RegisterCspmSnapshotAccountOK) IsServerError() bool { +// IsServerError returns true when this aggregate sensor update policy o k response has a 5xx status code +func (o *AggregateSensorUpdatePolicyOK) IsServerError() bool { return false } -// IsCode returns true when this register cspm snapshot account o k response a status code equal to that given -func (o *RegisterCspmSnapshotAccountOK) IsCode(code int) bool { +// IsCode returns true when this aggregate sensor update policy o k response a status code equal to that given +func (o *AggregateSensorUpdatePolicyOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the register cspm snapshot account o k response -func (o *RegisterCspmSnapshotAccountOK) Code() int { +// Code gets the status code for the aggregate sensor update policy o k response +func (o *AggregateSensorUpdatePolicyOK) Code() int { return 200 } -func (o *RegisterCspmSnapshotAccountOK) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountOK %+v", 200, o.Payload) +func (o *AggregateSensorUpdatePolicyOK) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyOK %+v", 200, o.Payload) } -func (o *RegisterCspmSnapshotAccountOK) String() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountOK %+v", 200, o.Payload) +func (o *AggregateSensorUpdatePolicyOK) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyOK %+v", 200, o.Payload) } -func (o *RegisterCspmSnapshotAccountOK) GetPayload() *models.ModelsAccountStatusResponse { +func (o *AggregateSensorUpdatePolicyOK) GetPayload() *models.MsaAggregatesResponse { return o.Payload } -func (o *RegisterCspmSnapshotAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *AggregateSensorUpdatePolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -160,7 +160,7 @@ func (o *RegisterCspmSnapshotAccountOK) readResponse(response runtime.ClientResp o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.ModelsAccountStatusResponse) + o.Payload = new(models.MsaAggregatesResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -170,17 +170,17 @@ func (o *RegisterCspmSnapshotAccountOK) readResponse(response runtime.ClientResp return nil } -// NewRegisterCspmSnapshotAccountBadRequest creates a RegisterCspmSnapshotAccountBadRequest with default headers values -func NewRegisterCspmSnapshotAccountBadRequest() *RegisterCspmSnapshotAccountBadRequest { - return &RegisterCspmSnapshotAccountBadRequest{} +// NewAggregateSensorUpdatePolicyBadRequest creates a AggregateSensorUpdatePolicyBadRequest with default headers values +func NewAggregateSensorUpdatePolicyBadRequest() *AggregateSensorUpdatePolicyBadRequest { + return &AggregateSensorUpdatePolicyBadRequest{} } /* -RegisterCspmSnapshotAccountBadRequest describes a response with status code 400, with default header values. +AggregateSensorUpdatePolicyBadRequest describes a response with status code 400, with default header values. Bad Request */ -type RegisterCspmSnapshotAccountBadRequest struct { +type AggregateSensorUpdatePolicyBadRequest struct { /* Trace-ID: submit to support if resolving an issue */ @@ -197,49 +197,49 @@ type RegisterCspmSnapshotAccountBadRequest struct { Payload *models.MsaspecResponseFields } -// IsSuccess returns true when this register cspm snapshot account bad request response has a 2xx status code -func (o *RegisterCspmSnapshotAccountBadRequest) IsSuccess() bool { +// IsSuccess returns true when this aggregate sensor update policy bad request response has a 2xx status code +func (o *AggregateSensorUpdatePolicyBadRequest) IsSuccess() bool { return false } -// IsRedirect returns true when this register cspm snapshot account bad request response has a 3xx status code -func (o *RegisterCspmSnapshotAccountBadRequest) IsRedirect() bool { +// IsRedirect returns true when this aggregate sensor update policy bad request response has a 3xx status code +func (o *AggregateSensorUpdatePolicyBadRequest) IsRedirect() bool { return false } -// IsClientError returns true when this register cspm snapshot account bad request response has a 4xx status code -func (o *RegisterCspmSnapshotAccountBadRequest) IsClientError() bool { +// IsClientError returns true when this aggregate sensor update policy bad request response has a 4xx status code +func (o *AggregateSensorUpdatePolicyBadRequest) IsClientError() bool { return true } -// IsServerError returns true when this register cspm snapshot account bad request response has a 5xx status code -func (o *RegisterCspmSnapshotAccountBadRequest) IsServerError() bool { +// IsServerError returns true when this aggregate sensor update policy bad request response has a 5xx status code +func (o *AggregateSensorUpdatePolicyBadRequest) IsServerError() bool { return false } -// IsCode returns true when this register cspm snapshot account bad request response a status code equal to that given -func (o *RegisterCspmSnapshotAccountBadRequest) IsCode(code int) bool { +// IsCode returns true when this aggregate sensor update policy bad request response a status code equal to that given +func (o *AggregateSensorUpdatePolicyBadRequest) IsCode(code int) bool { return code == 400 } -// Code gets the status code for the register cspm snapshot account bad request response -func (o *RegisterCspmSnapshotAccountBadRequest) Code() int { +// Code gets the status code for the aggregate sensor update policy bad request response +func (o *AggregateSensorUpdatePolicyBadRequest) Code() int { return 400 } -func (o *RegisterCspmSnapshotAccountBadRequest) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountBadRequest %+v", 400, o.Payload) +func (o *AggregateSensorUpdatePolicyBadRequest) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyBadRequest %+v", 400, o.Payload) } -func (o *RegisterCspmSnapshotAccountBadRequest) String() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountBadRequest %+v", 400, o.Payload) +func (o *AggregateSensorUpdatePolicyBadRequest) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyBadRequest %+v", 400, o.Payload) } -func (o *RegisterCspmSnapshotAccountBadRequest) GetPayload() *models.MsaspecResponseFields { +func (o *AggregateSensorUpdatePolicyBadRequest) GetPayload() *models.MsaspecResponseFields { return o.Payload } -func (o *RegisterCspmSnapshotAccountBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *AggregateSensorUpdatePolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -280,17 +280,17 @@ func (o *RegisterCspmSnapshotAccountBadRequest) readResponse(response runtime.Cl return nil } -// NewRegisterCspmSnapshotAccountForbidden creates a RegisterCspmSnapshotAccountForbidden with default headers values -func NewRegisterCspmSnapshotAccountForbidden() *RegisterCspmSnapshotAccountForbidden { - return &RegisterCspmSnapshotAccountForbidden{} +// NewAggregateSensorUpdatePolicyForbidden creates a AggregateSensorUpdatePolicyForbidden with default headers values +func NewAggregateSensorUpdatePolicyForbidden() *AggregateSensorUpdatePolicyForbidden { + return &AggregateSensorUpdatePolicyForbidden{} } /* -RegisterCspmSnapshotAccountForbidden describes a response with status code 403, with default header values. +AggregateSensorUpdatePolicyForbidden describes a response with status code 403, with default header values. Forbidden */ -type RegisterCspmSnapshotAccountForbidden struct { +type AggregateSensorUpdatePolicyForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -307,49 +307,49 @@ type RegisterCspmSnapshotAccountForbidden struct { Payload *models.MsaspecResponseFields } -// IsSuccess returns true when this register cspm snapshot account forbidden response has a 2xx status code -func (o *RegisterCspmSnapshotAccountForbidden) IsSuccess() bool { +// IsSuccess returns true when this aggregate sensor update policy forbidden response has a 2xx status code +func (o *AggregateSensorUpdatePolicyForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this register cspm snapshot account forbidden response has a 3xx status code -func (o *RegisterCspmSnapshotAccountForbidden) IsRedirect() bool { +// IsRedirect returns true when this aggregate sensor update policy forbidden response has a 3xx status code +func (o *AggregateSensorUpdatePolicyForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this register cspm snapshot account forbidden response has a 4xx status code -func (o *RegisterCspmSnapshotAccountForbidden) IsClientError() bool { +// IsClientError returns true when this aggregate sensor update policy forbidden response has a 4xx status code +func (o *AggregateSensorUpdatePolicyForbidden) IsClientError() bool { return true } -// IsServerError returns true when this register cspm snapshot account forbidden response has a 5xx status code -func (o *RegisterCspmSnapshotAccountForbidden) IsServerError() bool { +// IsServerError returns true when this aggregate sensor update policy forbidden response has a 5xx status code +func (o *AggregateSensorUpdatePolicyForbidden) IsServerError() bool { return false } -// IsCode returns true when this register cspm snapshot account forbidden response a status code equal to that given -func (o *RegisterCspmSnapshotAccountForbidden) IsCode(code int) bool { +// IsCode returns true when this aggregate sensor update policy forbidden response a status code equal to that given +func (o *AggregateSensorUpdatePolicyForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the register cspm snapshot account forbidden response -func (o *RegisterCspmSnapshotAccountForbidden) Code() int { +// Code gets the status code for the aggregate sensor update policy forbidden response +func (o *AggregateSensorUpdatePolicyForbidden) Code() int { return 403 } -func (o *RegisterCspmSnapshotAccountForbidden) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountForbidden %+v", 403, o.Payload) +func (o *AggregateSensorUpdatePolicyForbidden) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyForbidden %+v", 403, o.Payload) } -func (o *RegisterCspmSnapshotAccountForbidden) String() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountForbidden %+v", 403, o.Payload) +func (o *AggregateSensorUpdatePolicyForbidden) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyForbidden %+v", 403, o.Payload) } -func (o *RegisterCspmSnapshotAccountForbidden) GetPayload() *models.MsaspecResponseFields { +func (o *AggregateSensorUpdatePolicyForbidden) GetPayload() *models.MsaspecResponseFields { return o.Payload } -func (o *RegisterCspmSnapshotAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *AggregateSensorUpdatePolicyForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -390,17 +390,17 @@ func (o *RegisterCspmSnapshotAccountForbidden) readResponse(response runtime.Cli return nil } -// NewRegisterCspmSnapshotAccountTooManyRequests creates a RegisterCspmSnapshotAccountTooManyRequests with default headers values -func NewRegisterCspmSnapshotAccountTooManyRequests() *RegisterCspmSnapshotAccountTooManyRequests { - return &RegisterCspmSnapshotAccountTooManyRequests{} +// NewAggregateSensorUpdatePolicyTooManyRequests creates a AggregateSensorUpdatePolicyTooManyRequests with default headers values +func NewAggregateSensorUpdatePolicyTooManyRequests() *AggregateSensorUpdatePolicyTooManyRequests { + return &AggregateSensorUpdatePolicyTooManyRequests{} } /* -RegisterCspmSnapshotAccountTooManyRequests describes a response with status code 429, with default header values. +AggregateSensorUpdatePolicyTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type RegisterCspmSnapshotAccountTooManyRequests struct { +type AggregateSensorUpdatePolicyTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -421,49 +421,49 @@ type RegisterCspmSnapshotAccountTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this register cspm snapshot account too many requests response has a 2xx status code -func (o *RegisterCspmSnapshotAccountTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this aggregate sensor update policy too many requests response has a 2xx status code +func (o *AggregateSensorUpdatePolicyTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this register cspm snapshot account too many requests response has a 3xx status code -func (o *RegisterCspmSnapshotAccountTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this aggregate sensor update policy too many requests response has a 3xx status code +func (o *AggregateSensorUpdatePolicyTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this register cspm snapshot account too many requests response has a 4xx status code -func (o *RegisterCspmSnapshotAccountTooManyRequests) IsClientError() bool { +// IsClientError returns true when this aggregate sensor update policy too many requests response has a 4xx status code +func (o *AggregateSensorUpdatePolicyTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this register cspm snapshot account too many requests response has a 5xx status code -func (o *RegisterCspmSnapshotAccountTooManyRequests) IsServerError() bool { +// IsServerError returns true when this aggregate sensor update policy too many requests response has a 5xx status code +func (o *AggregateSensorUpdatePolicyTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this register cspm snapshot account too many requests response a status code equal to that given -func (o *RegisterCspmSnapshotAccountTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this aggregate sensor update policy too many requests response a status code equal to that given +func (o *AggregateSensorUpdatePolicyTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the register cspm snapshot account too many requests response -func (o *RegisterCspmSnapshotAccountTooManyRequests) Code() int { +// Code gets the status code for the aggregate sensor update policy too many requests response +func (o *AggregateSensorUpdatePolicyTooManyRequests) Code() int { return 429 } -func (o *RegisterCspmSnapshotAccountTooManyRequests) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountTooManyRequests %+v", 429, o.Payload) +func (o *AggregateSensorUpdatePolicyTooManyRequests) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyTooManyRequests %+v", 429, o.Payload) } -func (o *RegisterCspmSnapshotAccountTooManyRequests) String() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountTooManyRequests %+v", 429, o.Payload) +func (o *AggregateSensorUpdatePolicyTooManyRequests) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyTooManyRequests %+v", 429, o.Payload) } -func (o *RegisterCspmSnapshotAccountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *AggregateSensorUpdatePolicyTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *RegisterCspmSnapshotAccountTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *AggregateSensorUpdatePolicyTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -515,17 +515,17 @@ func (o *RegisterCspmSnapshotAccountTooManyRequests) readResponse(response runti return nil } -// NewRegisterCspmSnapshotAccountInternalServerError creates a RegisterCspmSnapshotAccountInternalServerError with default headers values -func NewRegisterCspmSnapshotAccountInternalServerError() *RegisterCspmSnapshotAccountInternalServerError { - return &RegisterCspmSnapshotAccountInternalServerError{} +// NewAggregateSensorUpdatePolicyInternalServerError creates a AggregateSensorUpdatePolicyInternalServerError with default headers values +func NewAggregateSensorUpdatePolicyInternalServerError() *AggregateSensorUpdatePolicyInternalServerError { + return &AggregateSensorUpdatePolicyInternalServerError{} } /* -RegisterCspmSnapshotAccountInternalServerError describes a response with status code 500, with default header values. +AggregateSensorUpdatePolicyInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ -type RegisterCspmSnapshotAccountInternalServerError struct { +type AggregateSensorUpdatePolicyInternalServerError struct { /* Trace-ID: submit to support if resolving an issue */ @@ -542,49 +542,49 @@ type RegisterCspmSnapshotAccountInternalServerError struct { Payload *models.MsaspecResponseFields } -// IsSuccess returns true when this register cspm snapshot account internal server error response has a 2xx status code -func (o *RegisterCspmSnapshotAccountInternalServerError) IsSuccess() bool { +// IsSuccess returns true when this aggregate sensor update policy internal server error response has a 2xx status code +func (o *AggregateSensorUpdatePolicyInternalServerError) IsSuccess() bool { return false } -// IsRedirect returns true when this register cspm snapshot account internal server error response has a 3xx status code -func (o *RegisterCspmSnapshotAccountInternalServerError) IsRedirect() bool { +// IsRedirect returns true when this aggregate sensor update policy internal server error response has a 3xx status code +func (o *AggregateSensorUpdatePolicyInternalServerError) IsRedirect() bool { return false } -// IsClientError returns true when this register cspm snapshot account internal server error response has a 4xx status code -func (o *RegisterCspmSnapshotAccountInternalServerError) IsClientError() bool { +// IsClientError returns true when this aggregate sensor update policy internal server error response has a 4xx status code +func (o *AggregateSensorUpdatePolicyInternalServerError) IsClientError() bool { return false } -// IsServerError returns true when this register cspm snapshot account internal server error response has a 5xx status code -func (o *RegisterCspmSnapshotAccountInternalServerError) IsServerError() bool { +// IsServerError returns true when this aggregate sensor update policy internal server error response has a 5xx status code +func (o *AggregateSensorUpdatePolicyInternalServerError) IsServerError() bool { return true } -// IsCode returns true when this register cspm snapshot account internal server error response a status code equal to that given -func (o *RegisterCspmSnapshotAccountInternalServerError) IsCode(code int) bool { +// IsCode returns true when this aggregate sensor update policy internal server error response a status code equal to that given +func (o *AggregateSensorUpdatePolicyInternalServerError) IsCode(code int) bool { return code == 500 } -// Code gets the status code for the register cspm snapshot account internal server error response -func (o *RegisterCspmSnapshotAccountInternalServerError) Code() int { +// Code gets the status code for the aggregate sensor update policy internal server error response +func (o *AggregateSensorUpdatePolicyInternalServerError) Code() int { return 500 } -func (o *RegisterCspmSnapshotAccountInternalServerError) Error() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountInternalServerError %+v", 500, o.Payload) +func (o *AggregateSensorUpdatePolicyInternalServerError) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyInternalServerError %+v", 500, o.Payload) } -func (o *RegisterCspmSnapshotAccountInternalServerError) String() string { - return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerCspmSnapshotAccountInternalServerError %+v", 500, o.Payload) +func (o *AggregateSensorUpdatePolicyInternalServerError) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/sensor-update-policies/v1][%d] aggregateSensorUpdatePolicyInternalServerError %+v", 500, o.Payload) } -func (o *RegisterCspmSnapshotAccountInternalServerError) GetPayload() *models.MsaspecResponseFields { +func (o *AggregateSensorUpdatePolicyInternalServerError) GetPayload() *models.MsaspecResponseFields { return o.Payload } -func (o *RegisterCspmSnapshotAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *AggregateSensorUpdatePolicyInternalServerError) 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/falcon_complete_dashboard/aggregate_total_device_counts_parameters.go b/falcon/client/falcon_complete_dashboard/aggregate_total_device_counts_parameters.go new file mode 100644 index 00000000..fc112fdf --- /dev/null +++ b/falcon/client/falcon_complete_dashboard/aggregate_total_device_counts_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" +) + +// NewAggregateTotalDeviceCountsParams creates a new AggregateTotalDeviceCountsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAggregateTotalDeviceCountsParams() *AggregateTotalDeviceCountsParams { + return &AggregateTotalDeviceCountsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAggregateTotalDeviceCountsParamsWithTimeout creates a new AggregateTotalDeviceCountsParams object +// with the ability to set a timeout on a request. +func NewAggregateTotalDeviceCountsParamsWithTimeout(timeout time.Duration) *AggregateTotalDeviceCountsParams { + return &AggregateTotalDeviceCountsParams{ + timeout: timeout, + } +} + +// NewAggregateTotalDeviceCountsParamsWithContext creates a new AggregateTotalDeviceCountsParams object +// with the ability to set a context for a request. +func NewAggregateTotalDeviceCountsParamsWithContext(ctx context.Context) *AggregateTotalDeviceCountsParams { + return &AggregateTotalDeviceCountsParams{ + Context: ctx, + } +} + +// NewAggregateTotalDeviceCountsParamsWithHTTPClient creates a new AggregateTotalDeviceCountsParams object +// with the ability to set a custom HTTPClient for a request. +func NewAggregateTotalDeviceCountsParamsWithHTTPClient(client *http.Client) *AggregateTotalDeviceCountsParams { + return &AggregateTotalDeviceCountsParams{ + HTTPClient: client, + } +} + +/* +AggregateTotalDeviceCountsParams contains all the parameters to send to the API endpoint + + for the aggregate total device counts operation. + + Typically these are written to a http.Request. +*/ +type AggregateTotalDeviceCountsParams struct { + + // Body. + Body []*models.MsaAggregateQueryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the aggregate total device counts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateTotalDeviceCountsParams) WithDefaults() *AggregateTotalDeviceCountsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the aggregate total device counts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AggregateTotalDeviceCountsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) WithTimeout(timeout time.Duration) *AggregateTotalDeviceCountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) WithContext(ctx context.Context) *AggregateTotalDeviceCountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) WithHTTPClient(client *http.Client) *AggregateTotalDeviceCountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregateTotalDeviceCountsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the aggregate total device counts params +func (o *AggregateTotalDeviceCountsParams) SetBody(body []*models.MsaAggregateQueryRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AggregateTotalDeviceCountsParams) 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_total_device_counts_responses.go b/falcon/client/falcon_complete_dashboard/aggregate_total_device_counts_responses.go new file mode 100644 index 00000000..d6dee742 --- /dev/null +++ b/falcon/client/falcon_complete_dashboard/aggregate_total_device_counts_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" +) + +// AggregateTotalDeviceCountsReader is a Reader for the AggregateTotalDeviceCounts structure. +type AggregateTotalDeviceCountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AggregateTotalDeviceCountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAggregateTotalDeviceCountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAggregateTotalDeviceCountsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewAggregateTotalDeviceCountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewAggregateTotalDeviceCountsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewAggregateTotalDeviceCountsInternalServerError() + 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/total-device-counts/v1] AggregateTotalDeviceCounts", response, response.Code()) + } +} + +// NewAggregateTotalDeviceCountsOK creates a AggregateTotalDeviceCountsOK with default headers values +func NewAggregateTotalDeviceCountsOK() *AggregateTotalDeviceCountsOK { + return &AggregateTotalDeviceCountsOK{} +} + +/* +AggregateTotalDeviceCountsOK describes a response with status code 200, with default header values. + +OK +*/ +type AggregateTotalDeviceCountsOK 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 total device counts o k response has a 2xx status code +func (o *AggregateTotalDeviceCountsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this aggregate total device counts o k response has a 3xx status code +func (o *AggregateTotalDeviceCountsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate total device counts o k response has a 4xx status code +func (o *AggregateTotalDeviceCountsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate total device counts o k response has a 5xx status code +func (o *AggregateTotalDeviceCountsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate total device counts o k response a status code equal to that given +func (o *AggregateTotalDeviceCountsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the aggregate total device counts o k response +func (o *AggregateTotalDeviceCountsOK) Code() int { + return 200 +} + +func (o *AggregateTotalDeviceCountsOK) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsOK %+v", 200, o.Payload) +} + +func (o *AggregateTotalDeviceCountsOK) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsOK %+v", 200, o.Payload) +} + +func (o *AggregateTotalDeviceCountsOK) GetPayload() *models.MsaAggregatesResponse { + return o.Payload +} + +func (o *AggregateTotalDeviceCountsOK) 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 +} + +// NewAggregateTotalDeviceCountsBadRequest creates a AggregateTotalDeviceCountsBadRequest with default headers values +func NewAggregateTotalDeviceCountsBadRequest() *AggregateTotalDeviceCountsBadRequest { + return &AggregateTotalDeviceCountsBadRequest{} +} + +/* +AggregateTotalDeviceCountsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type AggregateTotalDeviceCountsBadRequest 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 total device counts bad request response has a 2xx status code +func (o *AggregateTotalDeviceCountsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate total device counts bad request response has a 3xx status code +func (o *AggregateTotalDeviceCountsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate total device counts bad request response has a 4xx status code +func (o *AggregateTotalDeviceCountsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate total device counts bad request response has a 5xx status code +func (o *AggregateTotalDeviceCountsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate total device counts bad request response a status code equal to that given +func (o *AggregateTotalDeviceCountsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the aggregate total device counts bad request response +func (o *AggregateTotalDeviceCountsBadRequest) Code() int { + return 400 +} + +func (o *AggregateTotalDeviceCountsBadRequest) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsBadRequest %+v", 400, o.Payload) +} + +func (o *AggregateTotalDeviceCountsBadRequest) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsBadRequest %+v", 400, o.Payload) +} + +func (o *AggregateTotalDeviceCountsBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateTotalDeviceCountsBadRequest) 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 +} + +// NewAggregateTotalDeviceCountsForbidden creates a AggregateTotalDeviceCountsForbidden with default headers values +func NewAggregateTotalDeviceCountsForbidden() *AggregateTotalDeviceCountsForbidden { + return &AggregateTotalDeviceCountsForbidden{} +} + +/* +AggregateTotalDeviceCountsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type AggregateTotalDeviceCountsForbidden 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 total device counts forbidden response has a 2xx status code +func (o *AggregateTotalDeviceCountsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate total device counts forbidden response has a 3xx status code +func (o *AggregateTotalDeviceCountsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate total device counts forbidden response has a 4xx status code +func (o *AggregateTotalDeviceCountsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate total device counts forbidden response has a 5xx status code +func (o *AggregateTotalDeviceCountsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate total device counts forbidden response a status code equal to that given +func (o *AggregateTotalDeviceCountsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the aggregate total device counts forbidden response +func (o *AggregateTotalDeviceCountsForbidden) Code() int { + return 403 +} + +func (o *AggregateTotalDeviceCountsForbidden) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsForbidden %+v", 403, o.Payload) +} + +func (o *AggregateTotalDeviceCountsForbidden) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsForbidden %+v", 403, o.Payload) +} + +func (o *AggregateTotalDeviceCountsForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateTotalDeviceCountsForbidden) 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 +} + +// NewAggregateTotalDeviceCountsTooManyRequests creates a AggregateTotalDeviceCountsTooManyRequests with default headers values +func NewAggregateTotalDeviceCountsTooManyRequests() *AggregateTotalDeviceCountsTooManyRequests { + return &AggregateTotalDeviceCountsTooManyRequests{} +} + +/* +AggregateTotalDeviceCountsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type AggregateTotalDeviceCountsTooManyRequests 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 total device counts too many requests response has a 2xx status code +func (o *AggregateTotalDeviceCountsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate total device counts too many requests response has a 3xx status code +func (o *AggregateTotalDeviceCountsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate total device counts too many requests response has a 4xx status code +func (o *AggregateTotalDeviceCountsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this aggregate total device counts too many requests response has a 5xx status code +func (o *AggregateTotalDeviceCountsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this aggregate total device counts too many requests response a status code equal to that given +func (o *AggregateTotalDeviceCountsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the aggregate total device counts too many requests response +func (o *AggregateTotalDeviceCountsTooManyRequests) Code() int { + return 429 +} + +func (o *AggregateTotalDeviceCountsTooManyRequests) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregateTotalDeviceCountsTooManyRequests) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsTooManyRequests %+v", 429, o.Payload) +} + +func (o *AggregateTotalDeviceCountsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *AggregateTotalDeviceCountsTooManyRequests) 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 +} + +// NewAggregateTotalDeviceCountsInternalServerError creates a AggregateTotalDeviceCountsInternalServerError with default headers values +func NewAggregateTotalDeviceCountsInternalServerError() *AggregateTotalDeviceCountsInternalServerError { + return &AggregateTotalDeviceCountsInternalServerError{} +} + +/* +AggregateTotalDeviceCountsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type AggregateTotalDeviceCountsInternalServerError 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 total device counts internal server error response has a 2xx status code +func (o *AggregateTotalDeviceCountsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this aggregate total device counts internal server error response has a 3xx status code +func (o *AggregateTotalDeviceCountsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this aggregate total device counts internal server error response has a 4xx status code +func (o *AggregateTotalDeviceCountsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this aggregate total device counts internal server error response has a 5xx status code +func (o *AggregateTotalDeviceCountsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this aggregate total device counts internal server error response a status code equal to that given +func (o *AggregateTotalDeviceCountsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the aggregate total device counts internal server error response +func (o *AggregateTotalDeviceCountsInternalServerError) Code() int { + return 500 +} + +func (o *AggregateTotalDeviceCountsInternalServerError) Error() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregateTotalDeviceCountsInternalServerError) String() string { + return fmt.Sprintf("[POST /falcon-complete-dashboards/aggregates/total-device-counts/v1][%d] aggregateTotalDeviceCountsInternalServerError %+v", 500, o.Payload) +} + +func (o *AggregateTotalDeviceCountsInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *AggregateTotalDeviceCountsInternalServerError) 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 904ec359..c4775a00 100644 --- a/falcon/client/falcon_complete_dashboard/falcon_complete_dashboard_client.go +++ b/falcon/client/falcon_complete_dashboard/falcon_complete_dashboard_client.go @@ -44,8 +44,14 @@ type ClientService interface { AggregateFCIncidents(params *AggregateFCIncidentsParams, opts ...ClientOption) (*AggregateFCIncidentsOK, error) + AggregatePreventionPolicy(params *AggregatePreventionPolicyParams, opts ...ClientOption) (*AggregatePreventionPolicyOK, error) + AggregateRemediations(params *AggregateRemediationsParams, opts ...ClientOption) (*AggregateRemediationsOK, error) + AggregateSensorUpdatePolicy(params *AggregateSensorUpdatePolicyParams, opts ...ClientOption) (*AggregateSensorUpdatePolicyOK, error) + + AggregateTotalDeviceCounts(params *AggregateTotalDeviceCountsParams, opts ...ClientOption) (*AggregateTotalDeviceCountsOK, error) + GetDeviceCountCollectionQueriesByFilter(params *GetDeviceCountCollectionQueriesByFilterParams, opts ...ClientOption) (*GetDeviceCountCollectionQueriesByFilterOK, error) QueryAlertIdsByFilter(params *QueryAlertIdsByFilterParams, opts ...ClientOption) (*QueryAlertIdsByFilterOK, error) @@ -385,6 +391,44 @@ func (a *Client) AggregateFCIncidents(params *AggregateFCIncidentsParams, opts . panic(msg) } +/* +AggregatePreventionPolicy retrieves prevention policies aggregate values based on the matched filter +*/ +func (a *Client) AggregatePreventionPolicy(params *AggregatePreventionPolicyParams, opts ...ClientOption) (*AggregatePreventionPolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAggregatePreventionPolicyParams() + } + op := &runtime.ClientOperation{ + ID: "AggregatePreventionPolicy", + Method: "POST", + PathPattern: "/falcon-complete-dashboards/aggregates/prevention-policies/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AggregatePreventionPolicyReader{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.(*AggregatePreventionPolicyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for AggregatePreventionPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* AggregateRemediations retrieves aggregate remediation ticket values based on the matched filter */ @@ -423,6 +467,82 @@ func (a *Client) AggregateRemediations(params *AggregateRemediationsParams, opts panic(msg) } +/* +AggregateSensorUpdatePolicy retrieves sensor update policies aggregate values +*/ +func (a *Client) AggregateSensorUpdatePolicy(params *AggregateSensorUpdatePolicyParams, opts ...ClientOption) (*AggregateSensorUpdatePolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAggregateSensorUpdatePolicyParams() + } + op := &runtime.ClientOperation{ + ID: "AggregateSensorUpdatePolicy", + Method: "POST", + PathPattern: "/falcon-complete-dashboards/aggregates/sensor-update-policies/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AggregateSensorUpdatePolicyReader{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.(*AggregateSensorUpdatePolicyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for AggregateSensorUpdatePolicy: 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 +*/ +func (a *Client) AggregateTotalDeviceCounts(params *AggregateTotalDeviceCountsParams, opts ...ClientOption) (*AggregateTotalDeviceCountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAggregateTotalDeviceCountsParams() + } + op := &runtime.ClientOperation{ + ID: "AggregateTotalDeviceCounts", + Method: "POST", + PathPattern: "/falcon-complete-dashboards/aggregates/total-device-counts/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &AggregateTotalDeviceCountsReader{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.(*AggregateTotalDeviceCountsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for AggregateTotalDeviceCounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetDeviceCountCollectionQueriesByFilter retrieves device count collection ids that match the provided f q l filter criteria with scrolling enabled */ diff --git a/falcon/client/filevantage/create_rules_parameters.go b/falcon/client/filevantage/create_rules_parameters.go index 40826e66..c84fbfba 100644 --- a/falcon/client/filevantage/create_rules_parameters.go +++ b/falcon/client/filevantage/create_rules_parameters.go @@ -83,7 +83,7 @@ type CreateRulesParams struct { * `depth` below the base path to monitor; must be one of: `1`, `2`, `3`, `4`, `5` or `ANY` - * `precedence` - is not supported for creation of a rule, new rules will be added last in precedence order.will result this rule being placed before that existing rule. + * `precedence` - is not supported for creation of a rule, new rules will be added last in precedence order. Falcon GLOB syntax is supported for the following 6 properties. Allowed rule group configuration is based on the type of rule group the rule group is added to. @@ -99,6 +99,12 @@ type CreateRulesParams struct { * `exclude_processes` represents the changes performed by specific processes that will be `NOT` monitored. + * `content_files` represents the files whose content will be monitored. Listed files must match the file include pattern and not match the file exclude pattern + + * `content_registry_values` represents the registry values whose content will be monitored. Listed registry values must match the registry include pattern and not match the registry exclude pattern + + * `enable_content_capture` + File system directory monitoring: * `watch_delete_directory_changes` diff --git a/falcon/client/filevantage/create_scheduled_exclusions_parameters.go b/falcon/client/filevantage/create_scheduled_exclusions_parameters.go index 0faa1a59..a2e05766 100644 --- a/falcon/client/filevantage/create_scheduled_exclusions_parameters.go +++ b/falcon/client/filevantage/create_scheduled_exclusions_parameters.go @@ -86,6 +86,28 @@ type CreateScheduledExclusionsParams struct { * `schedule_start` must be provided to indicate the start of the schedule. This date/time must be an rfc3339 formatted string https://datatracker.ietf.org/doc/html/rfc3339. * `schedule_end` optionally provided to indicate the end of the schedule. This date/time must be an rfc3339 formatted string https://datatracker.ietf.org/doc/html/rfc3339. + + * `timezone` must be provided to indicate the TimeZone Name set for the provided `scheduled_start` and `scheduled_end` values. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. + + * `repeated` optionally provided to indicate that the exclusion is applied repeatedly within the `scheduled_start` and `scheduled_end` time. + + * `start_time` must be the hour(00-23) and minute(00-59) of the day formatted as `HH:MM`. Required if `all_day` is not set to `true` + + * `end_time` must be the hour(00-23) and minute(00-59) of the day formatted as `HH:MM`. Required if `all_day` is not set to `true` + + * `all_day` must be `true` or `false` to indicate the exclusion is applied all day. + + * `frequency` must be one of `daily`, `weekly` or `monthly`. + + * `occurrence` must be one of the following when `frequency` is set to `monthly`: + + * `1st`, `2nd`, `3rd`, `4th` or `Last` represents the week. + + * `Days` represents specific calendar days. + + * `weekly_days` must be one or more of `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday` or `Sunday` when `frequency` is set to `weekly` or `frequency` is set to `monthly` and `occurrence` is NOT set to `Days`. + + * `monthly_days` must be set to one or more calendar days, between 1 and 31 when `frequency` is set to `monthly` and `occurrence` is set to `Days`. */ Body *models.ScheduledexclusionsCreateRequest diff --git a/falcon/client/filevantage/update_rules_parameters.go b/falcon/client/filevantage/update_rules_parameters.go index 85c6e7fc..10712490 100644 --- a/falcon/client/filevantage/update_rules_parameters.go +++ b/falcon/client/filevantage/update_rules_parameters.go @@ -99,6 +99,12 @@ type UpdateRulesParams struct { * `exclude_processes` represents the changes performed by specific processes that will be `NOT` monitored. + * `content_files` represents the files that will be monitored. Listed files must match the file include pattern and not match the file exclude pattern + + * `content_registry_values` represents the registry values whose content will be monitored. Listed registry values must match the registry include pattern and not match the registry exclude pattern + + * `enable_content_capture` + File system directory monitoring: * `watch_delete_directory_changes` diff --git a/falcon/client/filevantage/update_scheduled_exclusions_parameters.go b/falcon/client/filevantage/update_scheduled_exclusions_parameters.go index 0979b215..a6d5784b 100644 --- a/falcon/client/filevantage/update_scheduled_exclusions_parameters.go +++ b/falcon/client/filevantage/update_scheduled_exclusions_parameters.go @@ -69,9 +69,7 @@ type UpdateScheduledExclusionsParams struct { - * `id` representing the scheduled exclusion to update. - - * `policy_id` which the scheduled exclusion is assigned. + * `policy_id` to add the scheduled exclusion to. * `name` must be between 1 and 100 characters. @@ -88,6 +86,28 @@ type UpdateScheduledExclusionsParams struct { * `schedule_start` must be provided to indicate the start of the schedule. This date/time must be an rfc3339 formatted string https://datatracker.ietf.org/doc/html/rfc3339. * `schedule_end` optionally provided to indicate the end of the schedule. This date/time must be an rfc3339 formatted string https://datatracker.ietf.org/doc/html/rfc3339. + + * `timezone` must be provided to indicate the TimeZone Name set for the provided `scheduled_start` and `scheduled_end` values. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. + + * `repeated` optionally provided to indicate that the exclusion is applied repeatedly within the `scheduled_start` and `scheduled_end` time. + + * `start_time` must be the hour(00-23) and minute(00-59) of the day formatted as `HH:MM`. Required if `all_day` is not set to `true` + + * `end_time` must be the hour(00-23) and minute(00-59) of the day formatted as `HH:MM`. Required if `all_day` is not set to `true` + + * `all_day` must be `true` or `false` to indicate the exclusion is applied all day. + + * `frequency` must be one of `daily`, `weekly` or `monthly`. + + * `occurrence` must be one of the following when `frequency` is set to `monthly`: + + * `1st`, `2nd`, `3rd`, `4th` or `Last` represents the week. + + * `Days` represents specific calendar days. + + * `weekly_days` must be one or more of `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday` or `Sunday` when `frequency` is set to `weekly` or `frequency` is set to `monthly` and `occurrence` is NOT set to `Days`. + + * `monthly_days` must be set to one or more calendar days, between 1 and 31 when `frequency` is set to `monthly` and `occurrence` is set to `Days`. */ Body *models.ScheduledexclusionsUpdateRequest diff --git a/falcon/client/foundry_logscale/download_results_parameters.go b/falcon/client/foundry_logscale/download_results_parameters.go new file mode 100644 index 00000000..74c8a201 --- /dev/null +++ b/falcon/client/foundry_logscale/download_results_parameters.go @@ -0,0 +1,190 @@ +// 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" +) + +// NewDownloadResultsParams creates a new DownloadResultsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDownloadResultsParams() *DownloadResultsParams { + return &DownloadResultsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDownloadResultsParamsWithTimeout creates a new DownloadResultsParams object +// with the ability to set a timeout on a request. +func NewDownloadResultsParamsWithTimeout(timeout time.Duration) *DownloadResultsParams { + return &DownloadResultsParams{ + timeout: timeout, + } +} + +// NewDownloadResultsParamsWithContext creates a new DownloadResultsParams object +// with the ability to set a context for a request. +func NewDownloadResultsParamsWithContext(ctx context.Context) *DownloadResultsParams { + return &DownloadResultsParams{ + Context: ctx, + } +} + +// NewDownloadResultsParamsWithHTTPClient creates a new DownloadResultsParams object +// with the ability to set a custom HTTPClient for a request. +func NewDownloadResultsParamsWithHTTPClient(client *http.Client) *DownloadResultsParams { + return &DownloadResultsParams{ + HTTPClient: client, + } +} + +/* +DownloadResultsParams contains all the parameters to send to the API endpoint + + for the download results operation. + + Typically these are written to a http.Request. +*/ +type DownloadResultsParams struct { + + /* JobID. + + Job ID for a previously executed async query + */ + JobID string + + /* ResultFormat. + + Result Format + */ + ResultFormat *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the download results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadResultsParams) WithDefaults() *DownloadResultsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadResultsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the download results params +func (o *DownloadResultsParams) WithTimeout(timeout time.Duration) *DownloadResultsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the download results params +func (o *DownloadResultsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the download results params +func (o *DownloadResultsParams) WithContext(ctx context.Context) *DownloadResultsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the download results params +func (o *DownloadResultsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the download results params +func (o *DownloadResultsParams) WithHTTPClient(client *http.Client) *DownloadResultsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the download results params +func (o *DownloadResultsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobID adds the jobID to the download results params +func (o *DownloadResultsParams) WithJobID(jobID string) *DownloadResultsParams { + o.SetJobID(jobID) + return o +} + +// SetJobID adds the jobId to the download results params +func (o *DownloadResultsParams) SetJobID(jobID string) { + o.JobID = jobID +} + +// WithResultFormat adds the resultFormat to the download results params +func (o *DownloadResultsParams) WithResultFormat(resultFormat *string) *DownloadResultsParams { + o.SetResultFormat(resultFormat) + return o +} + +// SetResultFormat adds the resultFormat to the download results params +func (o *DownloadResultsParams) SetResultFormat(resultFormat *string) { + o.ResultFormat = resultFormat +} + +// WriteToRequest writes these params to a swagger request +func (o *DownloadResultsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param job_id + qrJobID := o.JobID + qJobID := qrJobID + if qJobID != "" { + + if err := r.SetQueryParam("job_id", qJobID); err != nil { + return err + } + } + + if o.ResultFormat != nil { + + // query param result_format + var qrResultFormat string + + if o.ResultFormat != nil { + qrResultFormat = *o.ResultFormat + } + qResultFormat := qrResultFormat + if qResultFormat != "" { + + if err := r.SetQueryParam("result_format", qResultFormat); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/foundry_logscale/download_results_responses.go b/falcon/client/foundry_logscale/download_results_responses.go new file mode 100644 index 00000000..fb2b541d --- /dev/null +++ b/falcon/client/foundry_logscale/download_results_responses.go @@ -0,0 +1,860 @@ +// 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" +) + +// DownloadResultsReader is a Reader for the DownloadResults structure. +type DownloadResultsReader struct { + formats strfmt.Registry + writer io.Writer +} + +// ReadResponse reads a server response into the received o. +func (o *DownloadResultsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDownloadResultsOK(o.writer) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDownloadResultsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewDownloadResultsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDownloadResultsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDownloadResultsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewDownloadResultsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDownloadResultsInternalServerError() + 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/job-results-download/v1] DownloadResults", response, response.Code()) + } +} + +// NewDownloadResultsOK creates a DownloadResultsOK with default headers values +func NewDownloadResultsOK(writer io.Writer) *DownloadResultsOK { + return &DownloadResultsOK{ + + Payload: writer, + } +} + +/* +DownloadResultsOK describes a response with status code 200, with default header values. + +OK +*/ +type DownloadResultsOK 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 results o k response has a 2xx status code +func (o *DownloadResultsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this download results o k response has a 3xx status code +func (o *DownloadResultsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download results o k response has a 4xx status code +func (o *DownloadResultsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this download results o k response has a 5xx status code +func (o *DownloadResultsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this download results o k response a status code equal to that given +func (o *DownloadResultsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the download results o k response +func (o *DownloadResultsOK) Code() int { + return 200 +} + +func (o *DownloadResultsOK) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsOK %+v", 200, o.Payload) +} + +func (o *DownloadResultsOK) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsOK %+v", 200, o.Payload) +} + +func (o *DownloadResultsOK) GetPayload() io.Writer { + return o.Payload +} + +func (o *DownloadResultsOK) 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 +} + +// NewDownloadResultsBadRequest creates a DownloadResultsBadRequest with default headers values +func NewDownloadResultsBadRequest() *DownloadResultsBadRequest { + return &DownloadResultsBadRequest{} +} + +/* +DownloadResultsBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type DownloadResultsBadRequest 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.APIEntitiesResponse +} + +// IsSuccess returns true when this download results bad request response has a 2xx status code +func (o *DownloadResultsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download results bad request response has a 3xx status code +func (o *DownloadResultsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download results bad request response has a 4xx status code +func (o *DownloadResultsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this download results bad request response has a 5xx status code +func (o *DownloadResultsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this download results bad request response a status code equal to that given +func (o *DownloadResultsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the download results bad request response +func (o *DownloadResultsBadRequest) Code() int { + return 400 +} + +func (o *DownloadResultsBadRequest) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsBadRequest %+v", 400, o.Payload) +} + +func (o *DownloadResultsBadRequest) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsBadRequest %+v", 400, o.Payload) +} + +func (o *DownloadResultsBadRequest) GetPayload() *models.APIEntitiesResponse { + return o.Payload +} + +func (o *DownloadResultsBadRequest) 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.APIEntitiesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadResultsUnauthorized creates a DownloadResultsUnauthorized with default headers values +func NewDownloadResultsUnauthorized() *DownloadResultsUnauthorized { + return &DownloadResultsUnauthorized{} +} + +/* +DownloadResultsUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type DownloadResultsUnauthorized 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.APIEntitiesResponse +} + +// IsSuccess returns true when this download results unauthorized response has a 2xx status code +func (o *DownloadResultsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download results unauthorized response has a 3xx status code +func (o *DownloadResultsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download results unauthorized response has a 4xx status code +func (o *DownloadResultsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this download results unauthorized response has a 5xx status code +func (o *DownloadResultsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this download results unauthorized response a status code equal to that given +func (o *DownloadResultsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the download results unauthorized response +func (o *DownloadResultsUnauthorized) Code() int { + return 401 +} + +func (o *DownloadResultsUnauthorized) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsUnauthorized %+v", 401, o.Payload) +} + +func (o *DownloadResultsUnauthorized) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsUnauthorized %+v", 401, o.Payload) +} + +func (o *DownloadResultsUnauthorized) GetPayload() *models.APIEntitiesResponse { + return o.Payload +} + +func (o *DownloadResultsUnauthorized) 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.APIEntitiesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadResultsForbidden creates a DownloadResultsForbidden with default headers values +func NewDownloadResultsForbidden() *DownloadResultsForbidden { + return &DownloadResultsForbidden{} +} + +/* +DownloadResultsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DownloadResultsForbidden 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 results forbidden response has a 2xx status code +func (o *DownloadResultsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download results forbidden response has a 3xx status code +func (o *DownloadResultsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download results forbidden response has a 4xx status code +func (o *DownloadResultsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this download results forbidden response has a 5xx status code +func (o *DownloadResultsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this download results forbidden response a status code equal to that given +func (o *DownloadResultsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the download results forbidden response +func (o *DownloadResultsForbidden) Code() int { + return 403 +} + +func (o *DownloadResultsForbidden) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsForbidden %+v", 403, o.Payload) +} + +func (o *DownloadResultsForbidden) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsForbidden %+v", 403, o.Payload) +} + +func (o *DownloadResultsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *DownloadResultsForbidden) 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 +} + +// NewDownloadResultsNotFound creates a DownloadResultsNotFound with default headers values +func NewDownloadResultsNotFound() *DownloadResultsNotFound { + return &DownloadResultsNotFound{} +} + +/* +DownloadResultsNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type DownloadResultsNotFound 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.APIEntitiesResponse +} + +// IsSuccess returns true when this download results not found response has a 2xx status code +func (o *DownloadResultsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download results not found response has a 3xx status code +func (o *DownloadResultsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download results not found response has a 4xx status code +func (o *DownloadResultsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this download results not found response has a 5xx status code +func (o *DownloadResultsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this download results not found response a status code equal to that given +func (o *DownloadResultsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the download results not found response +func (o *DownloadResultsNotFound) Code() int { + return 404 +} + +func (o *DownloadResultsNotFound) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsNotFound %+v", 404, o.Payload) +} + +func (o *DownloadResultsNotFound) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsNotFound %+v", 404, o.Payload) +} + +func (o *DownloadResultsNotFound) GetPayload() *models.APIEntitiesResponse { + return o.Payload +} + +func (o *DownloadResultsNotFound) 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.APIEntitiesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadResultsTooManyRequests creates a DownloadResultsTooManyRequests with default headers values +func NewDownloadResultsTooManyRequests() *DownloadResultsTooManyRequests { + return &DownloadResultsTooManyRequests{} +} + +/* +DownloadResultsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type DownloadResultsTooManyRequests 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 results too many requests response has a 2xx status code +func (o *DownloadResultsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download results too many requests response has a 3xx status code +func (o *DownloadResultsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download results too many requests response has a 4xx status code +func (o *DownloadResultsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this download results too many requests response has a 5xx status code +func (o *DownloadResultsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this download results too many requests response a status code equal to that given +func (o *DownloadResultsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the download results too many requests response +func (o *DownloadResultsTooManyRequests) Code() int { + return 429 +} + +func (o *DownloadResultsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsTooManyRequests %+v", 429, o.Payload) +} + +func (o *DownloadResultsTooManyRequests) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsTooManyRequests %+v", 429, o.Payload) +} + +func (o *DownloadResultsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *DownloadResultsTooManyRequests) 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 +} + +// NewDownloadResultsInternalServerError creates a DownloadResultsInternalServerError with default headers values +func NewDownloadResultsInternalServerError() *DownloadResultsInternalServerError { + return &DownloadResultsInternalServerError{} +} + +/* +DownloadResultsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type DownloadResultsInternalServerError 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.APIEntitiesResponse +} + +// IsSuccess returns true when this download results internal server error response has a 2xx status code +func (o *DownloadResultsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download results internal server error response has a 3xx status code +func (o *DownloadResultsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download results internal server error response has a 4xx status code +func (o *DownloadResultsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this download results internal server error response has a 5xx status code +func (o *DownloadResultsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this download results internal server error response a status code equal to that given +func (o *DownloadResultsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the download results internal server error response +func (o *DownloadResultsInternalServerError) Code() int { + return 500 +} + +func (o *DownloadResultsInternalServerError) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsInternalServerError %+v", 500, o.Payload) +} + +func (o *DownloadResultsInternalServerError) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/job-results-download/v1][%d] downloadResultsInternalServerError %+v", 500, o.Payload) +} + +func (o *DownloadResultsInternalServerError) GetPayload() *models.APIEntitiesResponse { + return o.Payload +} + +func (o *DownloadResultsInternalServerError) 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.APIEntitiesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/client/saved_searches/execute_dynamic_parameters.go b/falcon/client/foundry_logscale/execute_dynamic_parameters.go similarity index 92% rename from falcon/client/saved_searches/execute_dynamic_parameters.go rename to falcon/client/foundry_logscale/execute_dynamic_parameters.go index df3720ec..25cae311 100644 --- a/falcon/client/saved_searches/execute_dynamic_parameters.go +++ b/falcon/client/foundry_logscale/execute_dynamic_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +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 @@ -64,6 +64,12 @@ ExecuteDynamicParams contains all the parameters to send to the API endpoint */ type ExecuteDynamicParams struct { + /* AppID. + + Application ID. + */ + AppID *string + // Body. Body *models.ApidomainDynamicExecuteSearchRequestV1 @@ -161,6 +167,17 @@ func (o *ExecuteDynamicParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAppID adds the appID to the execute dynamic params +func (o *ExecuteDynamicParams) WithAppID(appID *string) *ExecuteDynamicParams { + o.SetAppID(appID) + return o +} + +// SetAppID adds the appId to the execute dynamic params +func (o *ExecuteDynamicParams) SetAppID(appID *string) { + o.AppID = appID +} + // WithBody adds the body to the execute dynamic params func (o *ExecuteDynamicParams) WithBody(body *models.ApidomainDynamicExecuteSearchRequestV1) *ExecuteDynamicParams { o.SetBody(body) @@ -223,6 +240,23 @@ func (o *ExecuteDynamicParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error + + if o.AppID != nil { + + // query param app_id + var qrAppID string + + if o.AppID != nil { + qrAppID = *o.AppID + } + qAppID := qrAppID + if qAppID != "" { + + if err := r.SetQueryParam("app_id", qAppID); err != nil { + return err + } + } + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/falcon/client/saved_searches/execute_dynamic_responses.go b/falcon/client/foundry_logscale/execute_dynamic_responses.go similarity index 92% rename from falcon/client/saved_searches/execute_dynamic_responses.go rename to falcon/client/foundry_logscale/execute_dynamic_responses.go index d36633ca..55eefd76 100644 --- a/falcon/client/saved_searches/execute_dynamic_responses.go +++ b/falcon/client/foundry_logscale/execute_dynamic_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +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 @@ -44,7 +44,7 @@ func (o *ExecuteDynamicReader) ReadResponse(response runtime.ClientResponse, con } return nil, result default: - return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1] ExecuteDynamic", response, response.Code()) + return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1] ExecuteDynamic", response, response.Code()) } } @@ -106,11 +106,11 @@ func (o *ExecuteDynamicOK) Code() int { } func (o *ExecuteDynamicOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] executeDynamicOK %+v", 200, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicOK %+v", 200, o.Payload) } func (o *ExecuteDynamicOK) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] executeDynamicOK %+v", 200, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicOK %+v", 200, o.Payload) } func (o *ExecuteDynamicOK) GetPayload() *models.ApidomainQueryResponseWrapperV1 { @@ -216,11 +216,11 @@ func (o *ExecuteDynamicForbidden) Code() int { } func (o *ExecuteDynamicForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] executeDynamicForbidden %+v", 403, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicForbidden %+v", 403, o.Payload) } func (o *ExecuteDynamicForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] executeDynamicForbidden %+v", 403, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicForbidden %+v", 403, o.Payload) } func (o *ExecuteDynamicForbidden) GetPayload() *models.MsaReplyMetaOnly { @@ -330,11 +330,11 @@ func (o *ExecuteDynamicTooManyRequests) Code() int { } func (o *ExecuteDynamicTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] executeDynamicTooManyRequests %+v", 429, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicTooManyRequests %+v", 429, o.Payload) } func (o *ExecuteDynamicTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-dynamic-execute/v1][%d] executeDynamicTooManyRequests %+v", 429, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute-dynamic/v1][%d] executeDynamicTooManyRequests %+v", 429, o.Payload) } func (o *ExecuteDynamicTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { diff --git a/falcon/client/saved_searches/execute_parameters.go b/falcon/client/foundry_logscale/execute_parameters.go similarity index 84% rename from falcon/client/saved_searches/execute_parameters.go rename to falcon/client/foundry_logscale/execute_parameters.go index ad5f0625..8c772ee1 100644 --- a/falcon/client/saved_searches/execute_parameters.go +++ b/falcon/client/foundry_logscale/execute_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +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 @@ -64,6 +64,12 @@ ExecuteParams contains all the parameters to send to the API endpoint */ type ExecuteParams struct { + /* AppID. + + Application ID. + */ + AppID *string + // Body. Body *models.ApidomainSavedSearchExecuteRequestV1 @@ -85,18 +91,6 @@ type ExecuteParams struct { */ Metadata *bool - /* Mode. - - Mode to execute the query under. If provided, takes precedence over the mode provided in the body. - */ - Mode *string - - /* Version. - - Version of resource being created - */ - Version *string - timeout time.Duration Context context.Context HTTPClient *http.Client @@ -167,6 +161,17 @@ func (o *ExecuteParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAppID adds the appID to the execute params +func (o *ExecuteParams) WithAppID(appID *string) *ExecuteParams { + o.SetAppID(appID) + return o +} + +// SetAppID adds the appId to the execute params +func (o *ExecuteParams) SetAppID(appID *string) { + o.AppID = appID +} + // WithBody adds the body to the execute params func (o *ExecuteParams) WithBody(body *models.ApidomainSavedSearchExecuteRequestV1) *ExecuteParams { o.SetBody(body) @@ -211,28 +216,6 @@ func (o *ExecuteParams) SetMetadata(metadata *bool) { o.Metadata = metadata } -// WithMode adds the mode to the execute params -func (o *ExecuteParams) WithMode(mode *string) *ExecuteParams { - o.SetMode(mode) - return o -} - -// SetMode adds the mode to the execute params -func (o *ExecuteParams) SetMode(mode *string) { - o.Mode = mode -} - -// WithVersion adds the version to the execute params -func (o *ExecuteParams) WithVersion(version *string) *ExecuteParams { - o.SetVersion(version) - return o -} - -// SetVersion adds the version to the execute params -func (o *ExecuteParams) SetVersion(version *string) { - o.Version = version -} - // WriteToRequest writes these params to a swagger request func (o *ExecuteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -240,6 +223,23 @@ func (o *ExecuteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis return err } var res []error + + if o.AppID != nil { + + // query param app_id + var qrAppID string + + if o.AppID != nil { + qrAppID = *o.AppID + } + qAppID := qrAppID + if qAppID != "" { + + if err := r.SetQueryParam("app_id", qAppID); err != nil { + return err + } + } + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -297,40 +297,6 @@ func (o *ExecuteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis } } - if o.Mode != nil { - - // query param mode - var qrMode string - - if o.Mode != nil { - qrMode = *o.Mode - } - qMode := qrMode - if qMode != "" { - - if err := r.SetQueryParam("mode", qMode); err != nil { - return err - } - } - } - - if o.Version != nil { - - // query param version - var qrVersion string - - if o.Version != nil { - qrVersion = *o.Version - } - qVersion := qrVersion - if qVersion != "" { - - if err := r.SetQueryParam("version", qVersion); err != nil { - return err - } - } - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/falcon/client/saved_searches/execute_responses.go b/falcon/client/foundry_logscale/execute_responses.go similarity index 95% rename from falcon/client/saved_searches/execute_responses.go rename to falcon/client/foundry_logscale/execute_responses.go index 2a767a50..55799c9e 100644 --- a/falcon/client/saved_searches/execute_responses.go +++ b/falcon/client/foundry_logscale/execute_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +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 @@ -44,7 +44,7 @@ func (o *ExecuteReader) ReadResponse(response runtime.ClientResponse, consumer r } return nil, result default: - return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches-execute/v1] Execute", response, response.Code()) + return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches/execute/v1] Execute", response, response.Code()) } } @@ -106,11 +106,11 @@ func (o *ExecuteOK) Code() int { } func (o *ExecuteOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] executeOK %+v", 200, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeOK %+v", 200, o.Payload) } func (o *ExecuteOK) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] executeOK %+v", 200, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeOK %+v", 200, o.Payload) } func (o *ExecuteOK) GetPayload() *models.ApidomainQueryResponseWrapperV1 { @@ -216,11 +216,11 @@ func (o *ExecuteForbidden) Code() int { } func (o *ExecuteForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] executeForbidden %+v", 403, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeForbidden %+v", 403, o.Payload) } func (o *ExecuteForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] executeForbidden %+v", 403, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeForbidden %+v", 403, o.Payload) } func (o *ExecuteForbidden) GetPayload() *models.MsaReplyMetaOnly { @@ -330,11 +330,11 @@ func (o *ExecuteTooManyRequests) Code() int { } func (o *ExecuteTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] executeTooManyRequests %+v", 429, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeTooManyRequests %+v", 429, o.Payload) } func (o *ExecuteTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-execute/v1][%d] executeTooManyRequests %+v", 429, o.Payload) + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/execute/v1][%d] executeTooManyRequests %+v", 429, o.Payload) } func (o *ExecuteTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { diff --git a/falcon/client/foundry_logscale/foundry_logscale_client.go b/falcon/client/foundry_logscale/foundry_logscale_client.go new file mode 100644 index 00000000..66720253 --- /dev/null +++ b/falcon/client/foundry_logscale/foundry_logscale_client.go @@ -0,0 +1,360 @@ +// 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/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new foundry logscale API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for foundry logscale 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 { + DownloadResults(params *DownloadResultsParams, writer io.Writer, opts ...ClientOption) (*DownloadResultsOK, error) + + Execute(params *ExecuteParams, opts ...ClientOption) (*ExecuteOK, error) + + ExecuteDynamic(params *ExecuteDynamicParams, opts ...ClientOption) (*ExecuteDynamicOK, error) + + GetSearchResults(params *GetSearchResultsParams, opts ...ClientOption) (*GetSearchResultsOK, error) + + IngestData(params *IngestDataParams, opts ...ClientOption) (*IngestDataOK, error) + + ListRepos(params *ListReposParams, opts ...ClientOption) (*ListReposOK, error) + + ListViews(params *ListViewsParams, opts ...ClientOption) (*ListViewsOK, error) + + Populate(params *PopulateParams, opts ...ClientOption) (*PopulateOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +DownloadResults gets the results of a saved search as a file +*/ +func (a *Client) DownloadResults(params *DownloadResultsParams, writer io.Writer, opts ...ClientOption) (*DownloadResultsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDownloadResultsParams() + } + op := &runtime.ClientOperation{ + ID: "DownloadResults", + Method: "GET", + PathPattern: "/loggingapi/entities/saved-searches/job-results-download/v1", + ProducesMediaTypes: []string{"application/octet-stream"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DownloadResultsReader{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.(*DownloadResultsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DownloadResults: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Execute executes a saved search +*/ +func (a *Client) Execute(params *ExecuteParams, opts ...ClientOption) (*ExecuteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExecuteParams() + } + op := &runtime.ClientOperation{ + ID: "Execute", + Method: "POST", + PathPattern: "/loggingapi/entities/saved-searches/execute/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ExecuteReader{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.(*ExecuteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for Execute: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ExecuteDynamic executes a dynamic saved search +*/ +func (a *Client) ExecuteDynamic(params *ExecuteDynamicParams, opts ...ClientOption) (*ExecuteDynamicOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExecuteDynamicParams() + } + op := &runtime.ClientOperation{ + ID: "ExecuteDynamic", + Method: "POST", + PathPattern: "/loggingapi/entities/saved-searches/execute-dynamic/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ExecuteDynamicReader{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.(*ExecuteDynamicOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ExecuteDynamic: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetSearchResults gets the results of a saved search +*/ +func (a *Client) GetSearchResults(params *GetSearchResultsParams, opts ...ClientOption) (*GetSearchResultsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSearchResultsParams() + } + op := &runtime.ClientOperation{ + ID: "GetSearchResults", + Method: "GET", + PathPattern: "/loggingapi/entities/saved-searches/execute/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSearchResultsReader{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.(*GetSearchResultsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GetSearchResults: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +IngestData ingests data into the application repository +*/ +func (a *Client) IngestData(params *IngestDataParams, opts ...ClientOption) (*IngestDataOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestDataParams() + } + op := &runtime.ClientOperation{ + ID: "IngestData", + Method: "POST", + PathPattern: "/loggingapi/entities/data-ingestion/ingest/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"https"}, + Params: params, + Reader: &IngestDataReader{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.(*IngestDataOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for IngestData: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListRepos lists available repositories and views +*/ +func (a *Client) ListRepos(params *ListReposParams, opts ...ClientOption) (*ListReposOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListReposParams() + } + op := &runtime.ClientOperation{ + ID: "ListRepos", + Method: "GET", + PathPattern: "/loggingapi/combined/repos/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListReposReader{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.(*ListReposOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ListRepos: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListViews lists views +*/ +func (a *Client) ListViews(params *ListViewsParams, opts ...ClientOption) (*ListViewsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListViewsParams() + } + op := &runtime.ClientOperation{ + ID: "ListViews", + Method: "GET", + PathPattern: "/loggingapi/entities/views/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListViewsReader{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.(*ListViewsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ListViews: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Populate populates a saved search +*/ +func (a *Client) Populate(params *PopulateParams, opts ...ClientOption) (*PopulateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPopulateParams() + } + op := &runtime.ClientOperation{ + ID: "Populate", + Method: "POST", + PathPattern: "/loggingapi/entities/saved-searches/ingest/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PopulateReader{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.(*PopulateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for Populate: 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/foundry_logscale/get_search_results_parameters.go b/falcon/client/foundry_logscale/get_search_results_parameters.go new file mode 100644 index 00000000..bed68dae --- /dev/null +++ b/falcon/client/foundry_logscale/get_search_results_parameters.go @@ -0,0 +1,304 @@ +// 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" +) + +// NewGetSearchResultsParams creates a new GetSearchResultsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSearchResultsParams() *GetSearchResultsParams { + return &GetSearchResultsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSearchResultsParamsWithTimeout creates a new GetSearchResultsParams object +// with the ability to set a timeout on a request. +func NewGetSearchResultsParamsWithTimeout(timeout time.Duration) *GetSearchResultsParams { + return &GetSearchResultsParams{ + timeout: timeout, + } +} + +// NewGetSearchResultsParamsWithContext creates a new GetSearchResultsParams object +// with the ability to set a context for a request. +func NewGetSearchResultsParamsWithContext(ctx context.Context) *GetSearchResultsParams { + return &GetSearchResultsParams{ + Context: ctx, + } +} + +// NewGetSearchResultsParamsWithHTTPClient creates a new GetSearchResultsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSearchResultsParamsWithHTTPClient(client *http.Client) *GetSearchResultsParams { + return &GetSearchResultsParams{ + HTTPClient: client, + } +} + +/* +GetSearchResultsParams contains all the parameters to send to the API endpoint + + for the get search results operation. + + Typically these are written to a http.Request. +*/ +type GetSearchResultsParams struct { + + /* AppID. + + Application ID. + */ + AppID *string + + /* JobID. + + Job ID for a previously executed async query + */ + JobID string + + /* Limit. + + Maximum number of records to return. + */ + Limit *string + + /* Metadata. + + Whether to include metadata in the response + */ + Metadata *bool + + /* Offset. + + Starting pagination offset of records to return. + */ + Offset *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get search results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSearchResultsParams) WithDefaults() *GetSearchResultsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get search results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSearchResultsParams) SetDefaults() { + var ( + metadataDefault = bool(false) + ) + + val := GetSearchResultsParams{ + Metadata: &metadataDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the get search results params +func (o *GetSearchResultsParams) WithTimeout(timeout time.Duration) *GetSearchResultsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get search results params +func (o *GetSearchResultsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get search results params +func (o *GetSearchResultsParams) WithContext(ctx context.Context) *GetSearchResultsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get search results params +func (o *GetSearchResultsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get search results params +func (o *GetSearchResultsParams) WithHTTPClient(client *http.Client) *GetSearchResultsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get search results params +func (o *GetSearchResultsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAppID adds the appID to the get search results params +func (o *GetSearchResultsParams) WithAppID(appID *string) *GetSearchResultsParams { + o.SetAppID(appID) + return o +} + +// SetAppID adds the appId to the get search results params +func (o *GetSearchResultsParams) SetAppID(appID *string) { + o.AppID = appID +} + +// WithJobID adds the jobID to the get search results params +func (o *GetSearchResultsParams) WithJobID(jobID string) *GetSearchResultsParams { + o.SetJobID(jobID) + return o +} + +// SetJobID adds the jobId to the get search results params +func (o *GetSearchResultsParams) SetJobID(jobID string) { + o.JobID = jobID +} + +// WithLimit adds the limit to the get search results params +func (o *GetSearchResultsParams) WithLimit(limit *string) *GetSearchResultsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get search results params +func (o *GetSearchResultsParams) SetLimit(limit *string) { + o.Limit = limit +} + +// WithMetadata adds the metadata to the get search results params +func (o *GetSearchResultsParams) WithMetadata(metadata *bool) *GetSearchResultsParams { + o.SetMetadata(metadata) + return o +} + +// SetMetadata adds the metadata to the get search results params +func (o *GetSearchResultsParams) SetMetadata(metadata *bool) { + o.Metadata = metadata +} + +// WithOffset adds the offset to the get search results params +func (o *GetSearchResultsParams) WithOffset(offset *string) *GetSearchResultsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get search results params +func (o *GetSearchResultsParams) SetOffset(offset *string) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSearchResultsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AppID != nil { + + // query param app_id + var qrAppID string + + if o.AppID != nil { + qrAppID = *o.AppID + } + qAppID := qrAppID + if qAppID != "" { + + if err := r.SetQueryParam("app_id", qAppID); err != nil { + return err + } + } + } + + // query param job_id + qrJobID := o.JobID + qJobID := qrJobID + if qJobID != "" { + + if err := r.SetQueryParam("job_id", qJobID); err != nil { + return err + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit string + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := qrLimit + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Metadata != nil { + + // query param metadata + var qrMetadata bool + + if o.Metadata != nil { + qrMetadata = *o.Metadata + } + qMetadata := swag.FormatBool(qrMetadata) + if qMetadata != "" { + + if err := r.SetQueryParam("metadata", qMetadata); 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/saved_searches/query_by_id_responses.go b/falcon/client/foundry_logscale/get_search_results_responses.go similarity index 50% rename from falcon/client/saved_searches/query_by_id_responses.go rename to falcon/client/foundry_logscale/get_search_results_responses.go index 35bfc166..01f10741 100644 --- a/falcon/client/saved_searches/query_by_id_responses.go +++ b/falcon/client/foundry_logscale/get_search_results_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +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 @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// QueryByIDReader is a Reader for the QueryByID structure. -type QueryByIDReader struct { +// GetSearchResultsReader is a Reader for the GetSearchResults structure. +type GetSearchResultsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *QueryByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *GetSearchResultsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewQueryByIDOK() + result := NewGetSearchResultsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewQueryByIDForbidden() + result := NewGetSearchResultsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewQueryByIDTooManyRequests() + result := NewGetSearchResultsTooManyRequests() 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/v1] QueryById", response, response.Code()) + return nil, runtime.NewAPIError("[GET /loggingapi/entities/saved-searches/execute/v1] GetSearchResults", response, response.Code()) } } -// NewQueryByIDOK creates a QueryByIDOK with default headers values -func NewQueryByIDOK() *QueryByIDOK { - return &QueryByIDOK{} +// NewGetSearchResultsOK creates a GetSearchResultsOK with default headers values +func NewGetSearchResultsOK() *GetSearchResultsOK { + return &GetSearchResultsOK{} } /* -QueryByIDOK describes a response with status code 200, with default header values. +GetSearchResultsOK describes a response with status code 200, with default header values. OK */ -type QueryByIDOK struct { +type GetSearchResultsOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type QueryByIDOK struct { */ XRateLimitRemaining int64 - Payload *models.DomainSavedSearchWrapper + Payload *models.ApidomainQueryResponseWrapperV1 } -// IsSuccess returns true when this query by Id o k response has a 2xx status code -func (o *QueryByIDOK) IsSuccess() bool { +// IsSuccess returns true when this get search results o k response has a 2xx status code +func (o *GetSearchResultsOK) IsSuccess() bool { return true } -// IsRedirect returns true when this query by Id o k response has a 3xx status code -func (o *QueryByIDOK) IsRedirect() bool { +// IsRedirect returns true when this get search results o k response has a 3xx status code +func (o *GetSearchResultsOK) IsRedirect() bool { return false } -// IsClientError returns true when this query by Id o k response has a 4xx status code -func (o *QueryByIDOK) IsClientError() bool { +// IsClientError returns true when this get search results o k response has a 4xx status code +func (o *GetSearchResultsOK) IsClientError() bool { return false } -// IsServerError returns true when this query by Id o k response has a 5xx status code -func (o *QueryByIDOK) IsServerError() bool { +// IsServerError returns true when this get search results o k response has a 5xx status code +func (o *GetSearchResultsOK) IsServerError() bool { return false } -// IsCode returns true when this query by Id o k response a status code equal to that given -func (o *QueryByIDOK) IsCode(code int) bool { +// IsCode returns true when this get search results o k response a status code equal to that given +func (o *GetSearchResultsOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the query by Id o k response -func (o *QueryByIDOK) Code() int { +// Code gets the status code for the get search results o k response +func (o *GetSearchResultsOK) Code() int { return 200 } -func (o *QueryByIDOK) Error() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/v1][%d] queryByIdOK %+v", 200, o.Payload) +func (o *GetSearchResultsOK) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsOK %+v", 200, o.Payload) } -func (o *QueryByIDOK) String() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/v1][%d] queryByIdOK %+v", 200, o.Payload) +func (o *GetSearchResultsOK) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsOK %+v", 200, o.Payload) } -func (o *QueryByIDOK) GetPayload() *models.DomainSavedSearchWrapper { +func (o *GetSearchResultsOK) GetPayload() *models.ApidomainQueryResponseWrapperV1 { return o.Payload } -func (o *QueryByIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetSearchResultsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *QueryByIDOK) readResponse(response runtime.ClientResponse, consumer run o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.DomainSavedSearchWrapper) + o.Payload = new(models.ApidomainQueryResponseWrapperV1) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *QueryByIDOK) readResponse(response runtime.ClientResponse, consumer run return nil } -// NewQueryByIDForbidden creates a QueryByIDForbidden with default headers values -func NewQueryByIDForbidden() *QueryByIDForbidden { - return &QueryByIDForbidden{} +// NewGetSearchResultsForbidden creates a GetSearchResultsForbidden with default headers values +func NewGetSearchResultsForbidden() *GetSearchResultsForbidden { + return &GetSearchResultsForbidden{} } /* -QueryByIDForbidden describes a response with status code 403, with default header values. +GetSearchResultsForbidden describes a response with status code 403, with default header values. Forbidden */ -type QueryByIDForbidden struct { +type GetSearchResultsForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type QueryByIDForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this query by Id forbidden response has a 2xx status code -func (o *QueryByIDForbidden) IsSuccess() bool { +// IsSuccess returns true when this get search results forbidden response has a 2xx status code +func (o *GetSearchResultsForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this query by Id forbidden response has a 3xx status code -func (o *QueryByIDForbidden) IsRedirect() bool { +// IsRedirect returns true when this get search results forbidden response has a 3xx status code +func (o *GetSearchResultsForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this query by Id forbidden response has a 4xx status code -func (o *QueryByIDForbidden) IsClientError() bool { +// IsClientError returns true when this get search results forbidden response has a 4xx status code +func (o *GetSearchResultsForbidden) IsClientError() bool { return true } -// IsServerError returns true when this query by Id forbidden response has a 5xx status code -func (o *QueryByIDForbidden) IsServerError() bool { +// IsServerError returns true when this get search results forbidden response has a 5xx status code +func (o *GetSearchResultsForbidden) IsServerError() bool { return false } -// IsCode returns true when this query by Id forbidden response a status code equal to that given -func (o *QueryByIDForbidden) IsCode(code int) bool { +// IsCode returns true when this get search results forbidden response a status code equal to that given +func (o *GetSearchResultsForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the query by Id forbidden response -func (o *QueryByIDForbidden) Code() int { +// Code gets the status code for the get search results forbidden response +func (o *GetSearchResultsForbidden) Code() int { return 403 } -func (o *QueryByIDForbidden) Error() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/v1][%d] queryByIdForbidden %+v", 403, o.Payload) +func (o *GetSearchResultsForbidden) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsForbidden %+v", 403, o.Payload) } -func (o *QueryByIDForbidden) String() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/v1][%d] queryByIdForbidden %+v", 403, o.Payload) +func (o *GetSearchResultsForbidden) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsForbidden %+v", 403, o.Payload) } -func (o *QueryByIDForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetSearchResultsForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *QueryByIDForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetSearchResultsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *QueryByIDForbidden) readResponse(response runtime.ClientResponse, consu return nil } -// NewQueryByIDTooManyRequests creates a QueryByIDTooManyRequests with default headers values -func NewQueryByIDTooManyRequests() *QueryByIDTooManyRequests { - return &QueryByIDTooManyRequests{} +// NewGetSearchResultsTooManyRequests creates a GetSearchResultsTooManyRequests with default headers values +func NewGetSearchResultsTooManyRequests() *GetSearchResultsTooManyRequests { + return &GetSearchResultsTooManyRequests{} } /* -QueryByIDTooManyRequests describes a response with status code 429, with default header values. +GetSearchResultsTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type QueryByIDTooManyRequests struct { +type GetSearchResultsTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type QueryByIDTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this query by Id too many requests response has a 2xx status code -func (o *QueryByIDTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this get search results too many requests response has a 2xx status code +func (o *GetSearchResultsTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this query by Id too many requests response has a 3xx status code -func (o *QueryByIDTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this get search results too many requests response has a 3xx status code +func (o *GetSearchResultsTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this query by Id too many requests response has a 4xx status code -func (o *QueryByIDTooManyRequests) IsClientError() bool { +// IsClientError returns true when this get search results too many requests response has a 4xx status code +func (o *GetSearchResultsTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this query by Id too many requests response has a 5xx status code -func (o *QueryByIDTooManyRequests) IsServerError() bool { +// IsServerError returns true when this get search results too many requests response has a 5xx status code +func (o *GetSearchResultsTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this query by Id too many requests response a status code equal to that given -func (o *QueryByIDTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this get search results too many requests response a status code equal to that given +func (o *GetSearchResultsTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the query by Id too many requests response -func (o *QueryByIDTooManyRequests) Code() int { +// Code gets the status code for the get search results too many requests response +func (o *GetSearchResultsTooManyRequests) Code() int { return 429 } -func (o *QueryByIDTooManyRequests) Error() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/v1][%d] queryByIdTooManyRequests %+v", 429, o.Payload) +func (o *GetSearchResultsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsTooManyRequests %+v", 429, o.Payload) } -func (o *QueryByIDTooManyRequests) String() string { - return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/v1][%d] queryByIdTooManyRequests %+v", 429, o.Payload) +func (o *GetSearchResultsTooManyRequests) String() string { + return fmt.Sprintf("[GET /loggingapi/entities/saved-searches/execute/v1][%d] getSearchResultsTooManyRequests %+v", 429, o.Payload) } -func (o *QueryByIDTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *GetSearchResultsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *QueryByIDTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetSearchResultsTooManyRequests) 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/foundry_logscale/ingest_data_parameters.go b/falcon/client/foundry_logscale/ingest_data_parameters.go new file mode 100644 index 00000000..1c619626 --- /dev/null +++ b/falcon/client/foundry_logscale/ingest_data_parameters.go @@ -0,0 +1,271 @@ +// 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" +) + +// NewIngestDataParams creates a new IngestDataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIngestDataParams() *IngestDataParams { + return &IngestDataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIngestDataParamsWithTimeout creates a new IngestDataParams object +// with the ability to set a timeout on a request. +func NewIngestDataParamsWithTimeout(timeout time.Duration) *IngestDataParams { + return &IngestDataParams{ + timeout: timeout, + } +} + +// NewIngestDataParamsWithContext creates a new IngestDataParams object +// with the ability to set a context for a request. +func NewIngestDataParamsWithContext(ctx context.Context) *IngestDataParams { + return &IngestDataParams{ + Context: ctx, + } +} + +// NewIngestDataParamsWithHTTPClient creates a new IngestDataParams object +// with the ability to set a custom HTTPClient for a request. +func NewIngestDataParamsWithHTTPClient(client *http.Client) *IngestDataParams { + return &IngestDataParams{ + HTTPClient: client, + } +} + +/* +IngestDataParams contains all the parameters to send to the API endpoint + + for the ingest data operation. + + Typically these are written to a http.Request. +*/ +type IngestDataParams struct { + + /* DataFile. + + Data file to ingest + */ + DataFile runtime.NamedReadCloser + + /* 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 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestDataParams) WithDefaults() *IngestDataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ingest data params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestDataParams) SetDefaults() { + var ( + testDataDefault = bool(false) + ) + + val := IngestDataParams{ + TestData: &testDataDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the ingest data params +func (o *IngestDataParams) WithTimeout(timeout time.Duration) *IngestDataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ingest data params +func (o *IngestDataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ingest data params +func (o *IngestDataParams) WithContext(ctx context.Context) *IngestDataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ingest data params +func (o *IngestDataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ingest data params +func (o *IngestDataParams) WithHTTPClient(client *http.Client) *IngestDataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ingest data params +func (o *IngestDataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDataFile adds the dataFile to the ingest data params +func (o *IngestDataParams) WithDataFile(dataFile runtime.NamedReadCloser) *IngestDataParams { + o.SetDataFile(dataFile) + return o +} + +// SetDataFile adds the dataFile to the ingest data params +func (o *IngestDataParams) SetDataFile(dataFile runtime.NamedReadCloser) { + o.DataFile = dataFile +} + +// WithTag adds the tag to the ingest data params +func (o *IngestDataParams) WithTag(tag []string) *IngestDataParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ingest data params +func (o *IngestDataParams) SetTag(tag []string) { + o.Tag = tag +} + +// WithTagSource adds the tagSource to the ingest data params +func (o *IngestDataParams) WithTagSource(tagSource *string) *IngestDataParams { + o.SetTagSource(tagSource) + return o +} + +// SetTagSource adds the tagSource to the ingest data params +func (o *IngestDataParams) SetTagSource(tagSource *string) { + o.TagSource = tagSource +} + +// WithTestData adds the testData to the ingest data params +func (o *IngestDataParams) WithTestData(testData *bool) *IngestDataParams { + o.SetTestData(testData) + return o +} + +// SetTestData adds the testData to the ingest data params +func (o *IngestDataParams) SetTestData(testData *bool) { + o.TestData = testData +} + +// WriteToRequest writes these params to a swagger request +func (o *IngestDataParams) 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.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 +} + +// bindParamIngestData binds the parameter tag +func (o *IngestDataParams) 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/logscale_management/create_view_responses.go b/falcon/client/foundry_logscale/ingest_data_responses.go similarity index 59% rename from falcon/client/logscale_management/create_view_responses.go rename to falcon/client/foundry_logscale/ingest_data_responses.go index 30e045d1..423f65bd 100644 --- a/falcon/client/logscale_management/create_view_responses.go +++ b/falcon/client/foundry_logscale/ingest_data_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package logscale_management +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 @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// CreateViewReader is a Reader for the CreateView structure. -type CreateViewReader struct { +// IngestDataReader is a Reader for the IngestData structure. +type IngestDataReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *CreateViewReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *IngestDataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewCreateViewOK() + result := NewIngestDataOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewCreateViewForbidden() + result := NewIngestDataForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewCreateViewTooManyRequests() + result := NewIngestDataTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[POST /loggingapi/entities/views/v1] CreateView", response, response.Code()) + return nil, runtime.NewAPIError("[POST /loggingapi/entities/data-ingestion/ingest/v1] IngestData", response, response.Code()) } } -// NewCreateViewOK creates a CreateViewOK with default headers values -func NewCreateViewOK() *CreateViewOK { - return &CreateViewOK{} +// NewIngestDataOK creates a IngestDataOK with default headers values +func NewIngestDataOK() *IngestDataOK { + return &IngestDataOK{} } /* -CreateViewOK describes a response with status code 200, with default header values. +IngestDataOK describes a response with status code 200, with default header values. OK */ -type CreateViewOK struct { +type IngestDataOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type CreateViewOK struct { */ XRateLimitRemaining int64 - Payload *models.HumioViewWrapper + Payload *models.ClientDataIngestResponseWrapperV1 } -// IsSuccess returns true when this create view o k response has a 2xx status code -func (o *CreateViewOK) IsSuccess() bool { +// IsSuccess returns true when this ingest data o k response has a 2xx status code +func (o *IngestDataOK) IsSuccess() bool { return true } -// IsRedirect returns true when this create view o k response has a 3xx status code -func (o *CreateViewOK) IsRedirect() bool { +// IsRedirect returns true when this ingest data o k response has a 3xx status code +func (o *IngestDataOK) IsRedirect() bool { return false } -// IsClientError returns true when this create view o k response has a 4xx status code -func (o *CreateViewOK) IsClientError() bool { +// IsClientError returns true when this ingest data o k response has a 4xx status code +func (o *IngestDataOK) IsClientError() bool { return false } -// IsServerError returns true when this create view o k response has a 5xx status code -func (o *CreateViewOK) IsServerError() bool { +// IsServerError returns true when this ingest data o k response has a 5xx status code +func (o *IngestDataOK) IsServerError() bool { return false } -// IsCode returns true when this create view o k response a status code equal to that given -func (o *CreateViewOK) IsCode(code int) bool { +// IsCode returns true when this ingest data o k response a status code equal to that given +func (o *IngestDataOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the create view o k response -func (o *CreateViewOK) Code() int { +// Code gets the status code for the ingest data o k response +func (o *IngestDataOK) Code() int { return 200 } -func (o *CreateViewOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/views/v1][%d] createViewOK %+v", 200, o.Payload) +func (o *IngestDataOK) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataOK %+v", 200, o.Payload) } -func (o *CreateViewOK) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/views/v1][%d] createViewOK %+v", 200, o.Payload) +func (o *IngestDataOK) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataOK %+v", 200, o.Payload) } -func (o *CreateViewOK) GetPayload() *models.HumioViewWrapper { +func (o *IngestDataOK) GetPayload() *models.ClientDataIngestResponseWrapperV1 { return o.Payload } -func (o *CreateViewOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *IngestDataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *CreateViewOK) readResponse(response runtime.ClientResponse, consumer ru o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.HumioViewWrapper) + o.Payload = new(models.ClientDataIngestResponseWrapperV1) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *CreateViewOK) readResponse(response runtime.ClientResponse, consumer ru return nil } -// NewCreateViewForbidden creates a CreateViewForbidden with default headers values -func NewCreateViewForbidden() *CreateViewForbidden { - return &CreateViewForbidden{} +// NewIngestDataForbidden creates a IngestDataForbidden with default headers values +func NewIngestDataForbidden() *IngestDataForbidden { + return &IngestDataForbidden{} } /* -CreateViewForbidden describes a response with status code 403, with default header values. +IngestDataForbidden describes a response with status code 403, with default header values. Forbidden */ -type CreateViewForbidden struct { +type IngestDataForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type CreateViewForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this create view forbidden response has a 2xx status code -func (o *CreateViewForbidden) IsSuccess() bool { +// IsSuccess returns true when this ingest data forbidden response has a 2xx status code +func (o *IngestDataForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this create view forbidden response has a 3xx status code -func (o *CreateViewForbidden) IsRedirect() bool { +// IsRedirect returns true when this ingest data forbidden response has a 3xx status code +func (o *IngestDataForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this create view forbidden response has a 4xx status code -func (o *CreateViewForbidden) IsClientError() bool { +// IsClientError returns true when this ingest data forbidden response has a 4xx status code +func (o *IngestDataForbidden) IsClientError() bool { return true } -// IsServerError returns true when this create view forbidden response has a 5xx status code -func (o *CreateViewForbidden) IsServerError() bool { +// IsServerError returns true when this ingest data forbidden response has a 5xx status code +func (o *IngestDataForbidden) IsServerError() bool { return false } -// IsCode returns true when this create view forbidden response a status code equal to that given -func (o *CreateViewForbidden) IsCode(code int) bool { +// IsCode returns true when this ingest data forbidden response a status code equal to that given +func (o *IngestDataForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the create view forbidden response -func (o *CreateViewForbidden) Code() int { +// Code gets the status code for the ingest data forbidden response +func (o *IngestDataForbidden) Code() int { return 403 } -func (o *CreateViewForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/views/v1][%d] createViewForbidden %+v", 403, o.Payload) +func (o *IngestDataForbidden) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataForbidden %+v", 403, o.Payload) } -func (o *CreateViewForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/views/v1][%d] createViewForbidden %+v", 403, o.Payload) +func (o *IngestDataForbidden) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataForbidden %+v", 403, o.Payload) } -func (o *CreateViewForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *IngestDataForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *CreateViewForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *IngestDataForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *CreateViewForbidden) readResponse(response runtime.ClientResponse, cons return nil } -// NewCreateViewTooManyRequests creates a CreateViewTooManyRequests with default headers values -func NewCreateViewTooManyRequests() *CreateViewTooManyRequests { - return &CreateViewTooManyRequests{} +// NewIngestDataTooManyRequests creates a IngestDataTooManyRequests with default headers values +func NewIngestDataTooManyRequests() *IngestDataTooManyRequests { + return &IngestDataTooManyRequests{} } /* -CreateViewTooManyRequests describes a response with status code 429, with default header values. +IngestDataTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type CreateViewTooManyRequests struct { +type IngestDataTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type CreateViewTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this create view too many requests response has a 2xx status code -func (o *CreateViewTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this ingest data too many requests response has a 2xx status code +func (o *IngestDataTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this create view too many requests response has a 3xx status code -func (o *CreateViewTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this ingest data too many requests response has a 3xx status code +func (o *IngestDataTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this create view too many requests response has a 4xx status code -func (o *CreateViewTooManyRequests) IsClientError() bool { +// IsClientError returns true when this ingest data too many requests response has a 4xx status code +func (o *IngestDataTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this create view too many requests response has a 5xx status code -func (o *CreateViewTooManyRequests) IsServerError() bool { +// IsServerError returns true when this ingest data too many requests response has a 5xx status code +func (o *IngestDataTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this create view too many requests response a status code equal to that given -func (o *CreateViewTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this ingest data too many requests response a status code equal to that given +func (o *IngestDataTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the create view too many requests response -func (o *CreateViewTooManyRequests) Code() int { +// Code gets the status code for the ingest data too many requests response +func (o *IngestDataTooManyRequests) Code() int { return 429 } -func (o *CreateViewTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/views/v1][%d] createViewTooManyRequests %+v", 429, o.Payload) +func (o *IngestDataTooManyRequests) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataTooManyRequests %+v", 429, o.Payload) } -func (o *CreateViewTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/views/v1][%d] createViewTooManyRequests %+v", 429, o.Payload) +func (o *IngestDataTooManyRequests) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/data-ingestion/ingest/v1][%d] ingestDataTooManyRequests %+v", 429, o.Payload) } -func (o *CreateViewTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *IngestDataTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *CreateViewTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *IngestDataTooManyRequests) 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/logscale_management/list_repos_parameters.go b/falcon/client/foundry_logscale/list_repos_parameters.go similarity index 76% rename from falcon/client/logscale_management/list_repos_parameters.go rename to falcon/client/foundry_logscale/list_repos_parameters.go index cf704377..79ec60c0 100644 --- a/falcon/client/logscale_management/list_repos_parameters.go +++ b/falcon/client/foundry_logscale/list_repos_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package logscale_management +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 @@ -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" ) // NewListReposParams creates a new ListReposParams object, @@ -60,6 +61,13 @@ ListReposParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListReposParams struct { + + /* CheckTestData. + + Include whether test data is present in the application repository + */ + CheckTestData *bool + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -77,7 +85,18 @@ func (o *ListReposParams) WithDefaults() *ListReposParams { // // All values with no default are reset to their zero value. func (o *ListReposParams) SetDefaults() { - // no default values defined for this parameter + var ( + checkTestDataDefault = bool(false) + ) + + val := ListReposParams{ + CheckTestData: &checkTestDataDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val } // WithTimeout adds the timeout to the list repos params @@ -113,6 +132,17 @@ func (o *ListReposParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithCheckTestData adds the checkTestData to the list repos params +func (o *ListReposParams) WithCheckTestData(checkTestData *bool) *ListReposParams { + o.SetCheckTestData(checkTestData) + return o +} + +// SetCheckTestData adds the checkTestData to the list repos params +func (o *ListReposParams) SetCheckTestData(checkTestData *bool) { + o.CheckTestData = checkTestData +} + // WriteToRequest writes these params to a swagger request func (o *ListReposParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -121,6 +151,23 @@ func (o *ListReposParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg } var res []error + if o.CheckTestData != nil { + + // query param check_test_data + var qrCheckTestData bool + + if o.CheckTestData != nil { + qrCheckTestData = *o.CheckTestData + } + qCheckTestData := swag.FormatBool(qrCheckTestData) + if qCheckTestData != "" { + + if err := r.SetQueryParam("check_test_data", qCheckTestData); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/falcon/client/logscale_management/list_repos_responses.go b/falcon/client/foundry_logscale/list_repos_responses.go similarity index 99% rename from falcon/client/logscale_management/list_repos_responses.go rename to falcon/client/foundry_logscale/list_repos_responses.go index da9cebba..26b9674c 100644 --- a/falcon/client/logscale_management/list_repos_responses.go +++ b/falcon/client/foundry_logscale/list_repos_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package logscale_management +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 diff --git a/falcon/client/logscale_management/list_views_parameters.go b/falcon/client/foundry_logscale/list_views_parameters.go similarity index 76% rename from falcon/client/logscale_management/list_views_parameters.go rename to falcon/client/foundry_logscale/list_views_parameters.go index 930184f7..00d9a0a8 100644 --- a/falcon/client/logscale_management/list_views_parameters.go +++ b/falcon/client/foundry_logscale/list_views_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package logscale_management +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 @@ -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" ) // NewListViewsParams creates a new ListViewsParams object, @@ -60,6 +61,13 @@ ListViewsParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type ListViewsParams struct { + + /* CheckTestData. + + Include whether test data is present in the application repository + */ + CheckTestData *bool + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -77,7 +85,18 @@ func (o *ListViewsParams) WithDefaults() *ListViewsParams { // // All values with no default are reset to their zero value. func (o *ListViewsParams) SetDefaults() { - // no default values defined for this parameter + var ( + checkTestDataDefault = bool(false) + ) + + val := ListViewsParams{ + CheckTestData: &checkTestDataDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val } // WithTimeout adds the timeout to the list views params @@ -113,6 +132,17 @@ func (o *ListViewsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithCheckTestData adds the checkTestData to the list views params +func (o *ListViewsParams) WithCheckTestData(checkTestData *bool) *ListViewsParams { + o.SetCheckTestData(checkTestData) + return o +} + +// SetCheckTestData adds the checkTestData to the list views params +func (o *ListViewsParams) SetCheckTestData(checkTestData *bool) { + o.CheckTestData = checkTestData +} + // WriteToRequest writes these params to a swagger request func (o *ListViewsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -121,6 +151,23 @@ func (o *ListViewsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg } var res []error + if o.CheckTestData != nil { + + // query param check_test_data + var qrCheckTestData bool + + if o.CheckTestData != nil { + qrCheckTestData = *o.CheckTestData + } + qCheckTestData := swag.FormatBool(qrCheckTestData) + if qCheckTestData != "" { + + if err := r.SetQueryParam("check_test_data", qCheckTestData); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/falcon/client/logscale_management/list_views_responses.go b/falcon/client/foundry_logscale/list_views_responses.go similarity index 99% rename from falcon/client/logscale_management/list_views_responses.go rename to falcon/client/foundry_logscale/list_views_responses.go index 9ddec45d..21dbf145 100644 --- a/falcon/client/logscale_management/list_views_responses.go +++ b/falcon/client/foundry_logscale/list_views_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package logscale_management +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 diff --git a/falcon/client/foundry_logscale/populate_parameters.go b/falcon/client/foundry_logscale/populate_parameters.go new file mode 100644 index 00000000..489bbe09 --- /dev/null +++ b/falcon/client/foundry_logscale/populate_parameters.go @@ -0,0 +1,163 @@ +// 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" +) + +// NewPopulateParams creates a new PopulateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPopulateParams() *PopulateParams { + return &PopulateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPopulateParamsWithTimeout creates a new PopulateParams object +// with the ability to set a timeout on a request. +func NewPopulateParamsWithTimeout(timeout time.Duration) *PopulateParams { + return &PopulateParams{ + timeout: timeout, + } +} + +// NewPopulateParamsWithContext creates a new PopulateParams object +// with the ability to set a context for a request. +func NewPopulateParamsWithContext(ctx context.Context) *PopulateParams { + return &PopulateParams{ + Context: ctx, + } +} + +// NewPopulateParamsWithHTTPClient creates a new PopulateParams object +// with the ability to set a custom HTTPClient for a request. +func NewPopulateParamsWithHTTPClient(client *http.Client) *PopulateParams { + return &PopulateParams{ + HTTPClient: client, + } +} + +/* +PopulateParams contains all the parameters to send to the API endpoint + + for the populate operation. + + Typically these are written to a http.Request. +*/ +type PopulateParams struct { + + /* AppID. + + Application ID. + */ + AppID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the populate params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PopulateParams) WithDefaults() *PopulateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the populate params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PopulateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the populate params +func (o *PopulateParams) WithTimeout(timeout time.Duration) *PopulateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the populate params +func (o *PopulateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the populate params +func (o *PopulateParams) WithContext(ctx context.Context) *PopulateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the populate params +func (o *PopulateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the populate params +func (o *PopulateParams) WithHTTPClient(client *http.Client) *PopulateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the populate params +func (o *PopulateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAppID adds the appID to the populate params +func (o *PopulateParams) WithAppID(appID *string) *PopulateParams { + o.SetAppID(appID) + return o +} + +// SetAppID adds the appId to the populate params +func (o *PopulateParams) SetAppID(appID *string) { + o.AppID = appID +} + +// WriteToRequest writes these params to a swagger request +func (o *PopulateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AppID != nil { + + // query param app_id + var qrAppID string + + if o.AppID != nil { + qrAppID = *o.AppID + } + qAppID := qrAppID + if qAppID != "" { + + if err := r.SetQueryParam("app_id", qAppID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/saved_searches/validate_responses.go b/falcon/client/foundry_logscale/populate_responses.go similarity index 59% rename from falcon/client/saved_searches/validate_responses.go rename to falcon/client/foundry_logscale/populate_responses.go index b4d0a3ed..63a6ce2d 100644 --- a/falcon/client/saved_searches/validate_responses.go +++ b/falcon/client/foundry_logscale/populate_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package saved_searches +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 @@ -17,48 +17,48 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// ValidateReader is a Reader for the Validate structure. -type ValidateReader struct { +// PopulateReader is a Reader for the Populate structure. +type PopulateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *ValidateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PopulateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewValidateOK() + result := NewPopulateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: - result := NewValidateForbidden() + result := NewPopulateForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewValidateTooManyRequests() + result := NewPopulateTooManyRequests() 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-validate/v1] Validate", response, response.Code()) + return nil, runtime.NewAPIError("[POST /loggingapi/entities/saved-searches/ingest/v1] Populate", response, response.Code()) } } -// NewValidateOK creates a ValidateOK with default headers values -func NewValidateOK() *ValidateOK { - return &ValidateOK{} +// NewPopulateOK creates a PopulateOK with default headers values +func NewPopulateOK() *PopulateOK { + return &PopulateOK{} } /* -ValidateOK describes a response with status code 200, with default header values. +PopulateOK describes a response with status code 200, with default header values. OK */ -type ValidateOK struct { +type PopulateOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -72,52 +72,52 @@ type ValidateOK struct { */ XRateLimitRemaining int64 - Payload *models.ApidomainValidationResponseWrapperV1 + Payload *models.ClientDataIngestResponseWrapperV1 } -// IsSuccess returns true when this validate o k response has a 2xx status code -func (o *ValidateOK) IsSuccess() bool { +// IsSuccess returns true when this populate o k response has a 2xx status code +func (o *PopulateOK) IsSuccess() bool { return true } -// IsRedirect returns true when this validate o k response has a 3xx status code -func (o *ValidateOK) IsRedirect() bool { +// IsRedirect returns true when this populate o k response has a 3xx status code +func (o *PopulateOK) IsRedirect() bool { return false } -// IsClientError returns true when this validate o k response has a 4xx status code -func (o *ValidateOK) IsClientError() bool { +// IsClientError returns true when this populate o k response has a 4xx status code +func (o *PopulateOK) IsClientError() bool { return false } -// IsServerError returns true when this validate o k response has a 5xx status code -func (o *ValidateOK) IsServerError() bool { +// IsServerError returns true when this populate o k response has a 5xx status code +func (o *PopulateOK) IsServerError() bool { return false } -// IsCode returns true when this validate o k response a status code equal to that given -func (o *ValidateOK) IsCode(code int) bool { +// IsCode returns true when this populate o k response a status code equal to that given +func (o *PopulateOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the validate o k response -func (o *ValidateOK) Code() int { +// Code gets the status code for the populate o k response +func (o *PopulateOK) Code() int { return 200 } -func (o *ValidateOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-validate/v1][%d] validateOK %+v", 200, o.Payload) +func (o *PopulateOK) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateOK %+v", 200, o.Payload) } -func (o *ValidateOK) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-validate/v1][%d] validateOK %+v", 200, o.Payload) +func (o *PopulateOK) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateOK %+v", 200, o.Payload) } -func (o *ValidateOK) GetPayload() *models.ApidomainValidationResponseWrapperV1 { +func (o *PopulateOK) GetPayload() *models.ClientDataIngestResponseWrapperV1 { return o.Payload } -func (o *ValidateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PopulateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -148,7 +148,7 @@ func (o *ValidateOK) readResponse(response runtime.ClientResponse, consumer runt o.XRateLimitRemaining = valxRateLimitRemaining } - o.Payload = new(models.ApidomainValidationResponseWrapperV1) + o.Payload = new(models.ClientDataIngestResponseWrapperV1) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -158,17 +158,17 @@ func (o *ValidateOK) readResponse(response runtime.ClientResponse, consumer runt return nil } -// NewValidateForbidden creates a ValidateForbidden with default headers values -func NewValidateForbidden() *ValidateForbidden { - return &ValidateForbidden{} +// NewPopulateForbidden creates a PopulateForbidden with default headers values +func NewPopulateForbidden() *PopulateForbidden { + return &PopulateForbidden{} } /* -ValidateForbidden describes a response with status code 403, with default header values. +PopulateForbidden describes a response with status code 403, with default header values. Forbidden */ -type ValidateForbidden struct { +type PopulateForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -185,49 +185,49 @@ type ValidateForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this validate forbidden response has a 2xx status code -func (o *ValidateForbidden) IsSuccess() bool { +// IsSuccess returns true when this populate forbidden response has a 2xx status code +func (o *PopulateForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this validate forbidden response has a 3xx status code -func (o *ValidateForbidden) IsRedirect() bool { +// IsRedirect returns true when this populate forbidden response has a 3xx status code +func (o *PopulateForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this validate forbidden response has a 4xx status code -func (o *ValidateForbidden) IsClientError() bool { +// IsClientError returns true when this populate forbidden response has a 4xx status code +func (o *PopulateForbidden) IsClientError() bool { return true } -// IsServerError returns true when this validate forbidden response has a 5xx status code -func (o *ValidateForbidden) IsServerError() bool { +// IsServerError returns true when this populate forbidden response has a 5xx status code +func (o *PopulateForbidden) IsServerError() bool { return false } -// IsCode returns true when this validate forbidden response a status code equal to that given -func (o *ValidateForbidden) IsCode(code int) bool { +// IsCode returns true when this populate forbidden response a status code equal to that given +func (o *PopulateForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the validate forbidden response -func (o *ValidateForbidden) Code() int { +// Code gets the status code for the populate forbidden response +func (o *PopulateForbidden) Code() int { return 403 } -func (o *ValidateForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-validate/v1][%d] validateForbidden %+v", 403, o.Payload) +func (o *PopulateForbidden) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateForbidden %+v", 403, o.Payload) } -func (o *ValidateForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-validate/v1][%d] validateForbidden %+v", 403, o.Payload) +func (o *PopulateForbidden) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateForbidden %+v", 403, o.Payload) } -func (o *ValidateForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *PopulateForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ValidateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PopulateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -268,17 +268,17 @@ func (o *ValidateForbidden) readResponse(response runtime.ClientResponse, consum return nil } -// NewValidateTooManyRequests creates a ValidateTooManyRequests with default headers values -func NewValidateTooManyRequests() *ValidateTooManyRequests { - return &ValidateTooManyRequests{} +// NewPopulateTooManyRequests creates a PopulateTooManyRequests with default headers values +func NewPopulateTooManyRequests() *PopulateTooManyRequests { + return &PopulateTooManyRequests{} } /* -ValidateTooManyRequests describes a response with status code 429, with default header values. +PopulateTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type ValidateTooManyRequests struct { +type PopulateTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -299,49 +299,49 @@ type ValidateTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this validate too many requests response has a 2xx status code -func (o *ValidateTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this populate too many requests response has a 2xx status code +func (o *PopulateTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this validate too many requests response has a 3xx status code -func (o *ValidateTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this populate too many requests response has a 3xx status code +func (o *PopulateTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this validate too many requests response has a 4xx status code -func (o *ValidateTooManyRequests) IsClientError() bool { +// IsClientError returns true when this populate too many requests response has a 4xx status code +func (o *PopulateTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this validate too many requests response has a 5xx status code -func (o *ValidateTooManyRequests) IsServerError() bool { +// IsServerError returns true when this populate too many requests response has a 5xx status code +func (o *PopulateTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this validate too many requests response a status code equal to that given -func (o *ValidateTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this populate too many requests response a status code equal to that given +func (o *PopulateTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the validate too many requests response -func (o *ValidateTooManyRequests) Code() int { +// Code gets the status code for the populate too many requests response +func (o *PopulateTooManyRequests) Code() int { return 429 } -func (o *ValidateTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-validate/v1][%d] validateTooManyRequests %+v", 429, o.Payload) +func (o *PopulateTooManyRequests) Error() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateTooManyRequests %+v", 429, o.Payload) } -func (o *ValidateTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches-validate/v1][%d] validateTooManyRequests %+v", 429, o.Payload) +func (o *PopulateTooManyRequests) String() string { + return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/ingest/v1][%d] populateTooManyRequests %+v", 429, o.Payload) } -func (o *ValidateTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *PopulateTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ValidateTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PopulateTooManyRequests) 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/hosts/hosts_client.go b/falcon/client/hosts/hosts_client.go index 145fb6d3..6996ae79 100644 --- a/falcon/client/hosts/hosts_client.go +++ b/falcon/client/hosts/hosts_client.go @@ -40,6 +40,8 @@ type ClientService interface { QueryDeviceLoginHistory(params *QueryDeviceLoginHistoryParams, opts ...ClientOption) (*QueryDeviceLoginHistoryOK, error) + QueryDeviceLoginHistoryV2(params *QueryDeviceLoginHistoryV2Params, opts ...ClientOption) (*QueryDeviceLoginHistoryV2OK, error) + QueryDevicesByFilter(params *QueryDevicesByFilterParams, opts ...ClientOption) (*QueryDevicesByFilterOK, error) QueryDevicesByFilterScroll(params *QueryDevicesByFilterScrollParams, opts ...ClientOption) (*QueryDevicesByFilterScrollOK, error) @@ -245,6 +247,44 @@ func (a *Client) QueryDeviceLoginHistory(params *QueryDeviceLoginHistoryParams, panic(msg) } +/* +QueryDeviceLoginHistoryV2 retrieves details about recent interactive login sessions for a set of devices powered by the host timeline a max of 10 device ids can be specified +*/ +func (a *Client) QueryDeviceLoginHistoryV2(params *QueryDeviceLoginHistoryV2Params, opts ...ClientOption) (*QueryDeviceLoginHistoryV2OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewQueryDeviceLoginHistoryV2Params() + } + op := &runtime.ClientOperation{ + ID: "QueryDeviceLoginHistoryV2", + Method: "POST", + PathPattern: "/devices/combined/devices/login-history/v2", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &QueryDeviceLoginHistoryV2Reader{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.(*QueryDeviceLoginHistoryV2OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for QueryDeviceLoginHistoryV2: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* QueryDevicesByFilter searches for hosts in your environment by platform hostname IP and other criteria */ diff --git a/falcon/client/hosts/query_device_login_history_v2_parameters.go b/falcon/client/hosts/query_device_login_history_v2_parameters.go new file mode 100644 index 00000000..44cc19cd --- /dev/null +++ b/falcon/client/hosts/query_device_login_history_v2_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package hosts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewQueryDeviceLoginHistoryV2Params creates a new QueryDeviceLoginHistoryV2Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewQueryDeviceLoginHistoryV2Params() *QueryDeviceLoginHistoryV2Params { + return &QueryDeviceLoginHistoryV2Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewQueryDeviceLoginHistoryV2ParamsWithTimeout creates a new QueryDeviceLoginHistoryV2Params object +// with the ability to set a timeout on a request. +func NewQueryDeviceLoginHistoryV2ParamsWithTimeout(timeout time.Duration) *QueryDeviceLoginHistoryV2Params { + return &QueryDeviceLoginHistoryV2Params{ + timeout: timeout, + } +} + +// NewQueryDeviceLoginHistoryV2ParamsWithContext creates a new QueryDeviceLoginHistoryV2Params object +// with the ability to set a context for a request. +func NewQueryDeviceLoginHistoryV2ParamsWithContext(ctx context.Context) *QueryDeviceLoginHistoryV2Params { + return &QueryDeviceLoginHistoryV2Params{ + Context: ctx, + } +} + +// NewQueryDeviceLoginHistoryV2ParamsWithHTTPClient creates a new QueryDeviceLoginHistoryV2Params object +// with the ability to set a custom HTTPClient for a request. +func NewQueryDeviceLoginHistoryV2ParamsWithHTTPClient(client *http.Client) *QueryDeviceLoginHistoryV2Params { + return &QueryDeviceLoginHistoryV2Params{ + HTTPClient: client, + } +} + +/* +QueryDeviceLoginHistoryV2Params contains all the parameters to send to the API endpoint + + for the query device login history v2 operation. + + Typically these are written to a http.Request. +*/ +type QueryDeviceLoginHistoryV2Params struct { + + // Body. + Body *models.MsaIdsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the query device login history v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryDeviceLoginHistoryV2Params) WithDefaults() *QueryDeviceLoginHistoryV2Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the query device login history v2 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *QueryDeviceLoginHistoryV2Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) WithTimeout(timeout time.Duration) *QueryDeviceLoginHistoryV2Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) WithContext(ctx context.Context) *QueryDeviceLoginHistoryV2Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) WithHTTPClient(client *http.Client) *QueryDeviceLoginHistoryV2Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) WithBody(body *models.MsaIdsRequest) *QueryDeviceLoginHistoryV2Params { + o.SetBody(body) + return o +} + +// SetBody adds the body to the query device login history v2 params +func (o *QueryDeviceLoginHistoryV2Params) SetBody(body *models.MsaIdsRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *QueryDeviceLoginHistoryV2Params) 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/hosts/query_device_login_history_v2_responses.go b/falcon/client/hosts/query_device_login_history_v2_responses.go new file mode 100644 index 00000000..fc6290a9 --- /dev/null +++ b/falcon/client/hosts/query_device_login_history_v2_responses.go @@ -0,0 +1,394 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package hosts + +// This file was generated by 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" +) + +// QueryDeviceLoginHistoryV2Reader is a Reader for the QueryDeviceLoginHistoryV2 structure. +type QueryDeviceLoginHistoryV2Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *QueryDeviceLoginHistoryV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewQueryDeviceLoginHistoryV2OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewQueryDeviceLoginHistoryV2Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewQueryDeviceLoginHistoryV2TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /devices/combined/devices/login-history/v2] QueryDeviceLoginHistoryV2", response, response.Code()) + } +} + +// NewQueryDeviceLoginHistoryV2OK creates a QueryDeviceLoginHistoryV2OK with default headers values +func NewQueryDeviceLoginHistoryV2OK() *QueryDeviceLoginHistoryV2OK { + return &QueryDeviceLoginHistoryV2OK{} +} + +/* +QueryDeviceLoginHistoryV2OK describes a response with status code 200, with default header values. + +OK +*/ +type QueryDeviceLoginHistoryV2OK 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.DeviceapiLoginHistoryResponseV1 +} + +// IsSuccess returns true when this query device login history v2 o k response has a 2xx status code +func (o *QueryDeviceLoginHistoryV2OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this query device login history v2 o k response has a 3xx status code +func (o *QueryDeviceLoginHistoryV2OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query device login history v2 o k response has a 4xx status code +func (o *QueryDeviceLoginHistoryV2OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this query device login history v2 o k response has a 5xx status code +func (o *QueryDeviceLoginHistoryV2OK) IsServerError() bool { + return false +} + +// IsCode returns true when this query device login history v2 o k response a status code equal to that given +func (o *QueryDeviceLoginHistoryV2OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the query device login history v2 o k response +func (o *QueryDeviceLoginHistoryV2OK) Code() int { + return 200 +} + +func (o *QueryDeviceLoginHistoryV2OK) Error() string { + return fmt.Sprintf("[POST /devices/combined/devices/login-history/v2][%d] queryDeviceLoginHistoryV2OK %+v", 200, o.Payload) +} + +func (o *QueryDeviceLoginHistoryV2OK) String() string { + return fmt.Sprintf("[POST /devices/combined/devices/login-history/v2][%d] queryDeviceLoginHistoryV2OK %+v", 200, o.Payload) +} + +func (o *QueryDeviceLoginHistoryV2OK) GetPayload() *models.DeviceapiLoginHistoryResponseV1 { + return o.Payload +} + +func (o *QueryDeviceLoginHistoryV2OK) 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.DeviceapiLoginHistoryResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewQueryDeviceLoginHistoryV2Forbidden creates a QueryDeviceLoginHistoryV2Forbidden with default headers values +func NewQueryDeviceLoginHistoryV2Forbidden() *QueryDeviceLoginHistoryV2Forbidden { + return &QueryDeviceLoginHistoryV2Forbidden{} +} + +/* +QueryDeviceLoginHistoryV2Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type QueryDeviceLoginHistoryV2Forbidden 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 device login history v2 forbidden response has a 2xx status code +func (o *QueryDeviceLoginHistoryV2Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query device login history v2 forbidden response has a 3xx status code +func (o *QueryDeviceLoginHistoryV2Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query device login history v2 forbidden response has a 4xx status code +func (o *QueryDeviceLoginHistoryV2Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this query device login history v2 forbidden response has a 5xx status code +func (o *QueryDeviceLoginHistoryV2Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this query device login history v2 forbidden response a status code equal to that given +func (o *QueryDeviceLoginHistoryV2Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the query device login history v2 forbidden response +func (o *QueryDeviceLoginHistoryV2Forbidden) Code() int { + return 403 +} + +func (o *QueryDeviceLoginHistoryV2Forbidden) Error() string { + return fmt.Sprintf("[POST /devices/combined/devices/login-history/v2][%d] queryDeviceLoginHistoryV2Forbidden %+v", 403, o.Payload) +} + +func (o *QueryDeviceLoginHistoryV2Forbidden) String() string { + return fmt.Sprintf("[POST /devices/combined/devices/login-history/v2][%d] queryDeviceLoginHistoryV2Forbidden %+v", 403, o.Payload) +} + +func (o *QueryDeviceLoginHistoryV2Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryDeviceLoginHistoryV2Forbidden) 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 +} + +// NewQueryDeviceLoginHistoryV2TooManyRequests creates a QueryDeviceLoginHistoryV2TooManyRequests with default headers values +func NewQueryDeviceLoginHistoryV2TooManyRequests() *QueryDeviceLoginHistoryV2TooManyRequests { + return &QueryDeviceLoginHistoryV2TooManyRequests{} +} + +/* +QueryDeviceLoginHistoryV2TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type QueryDeviceLoginHistoryV2TooManyRequests 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 device login history v2 too many requests response has a 2xx status code +func (o *QueryDeviceLoginHistoryV2TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this query device login history v2 too many requests response has a 3xx status code +func (o *QueryDeviceLoginHistoryV2TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this query device login history v2 too many requests response has a 4xx status code +func (o *QueryDeviceLoginHistoryV2TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this query device login history v2 too many requests response has a 5xx status code +func (o *QueryDeviceLoginHistoryV2TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this query device login history v2 too many requests response a status code equal to that given +func (o *QueryDeviceLoginHistoryV2TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the query device login history v2 too many requests response +func (o *QueryDeviceLoginHistoryV2TooManyRequests) Code() int { + return 429 +} + +func (o *QueryDeviceLoginHistoryV2TooManyRequests) Error() string { + return fmt.Sprintf("[POST /devices/combined/devices/login-history/v2][%d] queryDeviceLoginHistoryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryDeviceLoginHistoryV2TooManyRequests) String() string { + return fmt.Sprintf("[POST /devices/combined/devices/login-history/v2][%d] queryDeviceLoginHistoryV2TooManyRequests %+v", 429, o.Payload) +} + +func (o *QueryDeviceLoginHistoryV2TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *QueryDeviceLoginHistoryV2TooManyRequests) 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/query_intel_report_entities_parameters.go b/falcon/client/intel/query_intel_report_entities_parameters.go index 0fba0fdf..fc770927 100644 --- a/falcon/client/intel/query_intel_report_entities_parameters.go +++ b/falcon/client/intel/query_intel_report_entities_parameters.go @@ -78,7 +78,7 @@ type QueryIntelReportEntitiesParams struct { Filter your query by specifying FQL filter parameters. Filter parameters include: - actors, actors.id, actors.name, actors.slug, actors.url, created_date, description, id, last_modified_date, motivations, motivations.id, motivations.slug, motivations.value, name, name.raw, short_description, slug, sub_type, sub_type.id, sub_type.name, sub_type.slug, tags, tags.id, tags.slug, tags.value, target_countries, target_countries.id, target_countries.slug, target_countries.value, target_industries, target_industries.id, target_industries.slug, target_industries.value, type, type.id, type.name, type.slug, url. + actors, actors.id, actors.name, actors.slug, actors.url, created_date, description, id, last_modified_date, malware, malware.community_identifiers, malware.family_name, malware.slug, motivations, motivations.id, motivations.slug, motivations.value, name, name.raw, short_description, slug, sub_type, sub_type.id, sub_type.name, sub_type.slug, tags, tags.id, tags.slug, tags.value, target_countries, target_countries.id, target_countries.slug, target_countries.value, target_industries, target_industries.id, target_industries.slug, target_industries.value, type, type.id, type.name, type.slug, url. */ Filter *string diff --git a/falcon/client/intel/query_intel_report_ids_parameters.go b/falcon/client/intel/query_intel_report_ids_parameters.go index 1e95b393..41b5f5a0 100644 --- a/falcon/client/intel/query_intel_report_ids_parameters.go +++ b/falcon/client/intel/query_intel_report_ids_parameters.go @@ -66,7 +66,7 @@ type QueryIntelReportIdsParams struct { Filter your query by specifying FQL filter parameters. Filter parameters include: - actors, actors.id, actors.name, actors.slug, actors.url, created_date, description, id, last_modified_date, motivations, motivations.id, motivations.slug, motivations.value, name, name.raw, short_description, slug, sub_type, sub_type.id, sub_type.name, sub_type.slug, tags, tags.id, tags.slug, tags.value, target_countries, target_countries.id, target_countries.slug, target_countries.value, target_industries, target_industries.id, target_industries.slug, target_industries.value, type, type.id, type.name, type.slug, url. + actors, actors.id, actors.name, actors.slug, actors.url, created_date, description, id, last_modified_date, malware, malware.community_identifiers, malware.family_name, malware.slug, motivations, motivations.id, motivations.slug, motivations.value, name, name.raw, short_description, slug, sub_type, sub_type.id, sub_type.name, sub_type.slug, tags, tags.id, tags.slug, tags.value, target_countries, target_countries.id, target_countries.slug, target_countries.value, target_industries, target_industries.id, target_industries.slug, target_industries.value, type, type.id, type.name, type.slug, url. */ Filter *string diff --git a/falcon/client/inventories/create_inventory_parameters.go b/falcon/client/inventories/create_inventory_parameters.go deleted file mode 100644 index 7401baf8..00000000 --- a/falcon/client/inventories/create_inventory_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package inventories - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewCreateInventoryParams creates a new CreateInventoryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateInventoryParams() *CreateInventoryParams { - return &CreateInventoryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateInventoryParamsWithTimeout creates a new CreateInventoryParams object -// with the ability to set a timeout on a request. -func NewCreateInventoryParamsWithTimeout(timeout time.Duration) *CreateInventoryParams { - return &CreateInventoryParams{ - timeout: timeout, - } -} - -// NewCreateInventoryParamsWithContext creates a new CreateInventoryParams object -// with the ability to set a context for a request. -func NewCreateInventoryParamsWithContext(ctx context.Context) *CreateInventoryParams { - return &CreateInventoryParams{ - Context: ctx, - } -} - -// NewCreateInventoryParamsWithHTTPClient creates a new CreateInventoryParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateInventoryParamsWithHTTPClient(client *http.Client) *CreateInventoryParams { - return &CreateInventoryParams{ - HTTPClient: client, - } -} - -/* -CreateInventoryParams contains all the parameters to send to the API endpoint - - for the create inventory operation. - - Typically these are written to a http.Request. -*/ -type CreateInventoryParams struct { - - // Body. - Body *models.ModelsSnapshotInventoryPayload - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create inventory params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateInventoryParams) WithDefaults() *CreateInventoryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create inventory params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateInventoryParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create inventory params -func (o *CreateInventoryParams) WithTimeout(timeout time.Duration) *CreateInventoryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create inventory params -func (o *CreateInventoryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create inventory params -func (o *CreateInventoryParams) WithContext(ctx context.Context) *CreateInventoryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create inventory params -func (o *CreateInventoryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create inventory params -func (o *CreateInventoryParams) WithHTTPClient(client *http.Client) *CreateInventoryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create inventory params -func (o *CreateInventoryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create inventory params -func (o *CreateInventoryParams) WithBody(body *models.ModelsSnapshotInventoryPayload) *CreateInventoryParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create inventory params -func (o *CreateInventoryParams) SetBody(body *models.ModelsSnapshotInventoryPayload) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateInventoryParams) 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/ioc/indicator_get_device_count_v1_parameters.go b/falcon/client/ioc/indicator_get_device_count_v1_parameters.go new file mode 100644 index 00000000..dc2c9678 --- /dev/null +++ b/falcon/client/ioc/indicator_get_device_count_v1_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ioc + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewIndicatorGetDeviceCountV1Params creates a new IndicatorGetDeviceCountV1Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIndicatorGetDeviceCountV1Params() *IndicatorGetDeviceCountV1Params { + return &IndicatorGetDeviceCountV1Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewIndicatorGetDeviceCountV1ParamsWithTimeout creates a new IndicatorGetDeviceCountV1Params object +// with the ability to set a timeout on a request. +func NewIndicatorGetDeviceCountV1ParamsWithTimeout(timeout time.Duration) *IndicatorGetDeviceCountV1Params { + return &IndicatorGetDeviceCountV1Params{ + timeout: timeout, + } +} + +// NewIndicatorGetDeviceCountV1ParamsWithContext creates a new IndicatorGetDeviceCountV1Params object +// with the ability to set a context for a request. +func NewIndicatorGetDeviceCountV1ParamsWithContext(ctx context.Context) *IndicatorGetDeviceCountV1Params { + return &IndicatorGetDeviceCountV1Params{ + Context: ctx, + } +} + +// NewIndicatorGetDeviceCountV1ParamsWithHTTPClient creates a new IndicatorGetDeviceCountV1Params object +// with the ability to set a custom HTTPClient for a request. +func NewIndicatorGetDeviceCountV1ParamsWithHTTPClient(client *http.Client) *IndicatorGetDeviceCountV1Params { + return &IndicatorGetDeviceCountV1Params{ + HTTPClient: client, + } +} + +/* +IndicatorGetDeviceCountV1Params contains all the parameters to send to the API endpoint + + for the indicator get device count v1 operation. + + Typically these are written to a http.Request. +*/ +type IndicatorGetDeviceCountV1Params struct { + + /* Type. + + + The type of the indicator. Valid types include: + + sha256: A hex-encoded sha256 hash string. Length - min: 64, max: 64. + + md5: A hex-encoded md5 hash string. Length - min 32, max: 32. + + domain: A domain name. Length - min: 1, max: 200. + + ipv4: An IPv4 address. Must be a valid IP address. + + ipv6: An IPv6 address. Must be a valid IP address. + + */ + Type string + + /* Value. + + The string representation of the indicator + */ + Value string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the indicator get device count v1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IndicatorGetDeviceCountV1Params) WithDefaults() *IndicatorGetDeviceCountV1Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the indicator get device count v1 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IndicatorGetDeviceCountV1Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) WithTimeout(timeout time.Duration) *IndicatorGetDeviceCountV1Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) WithContext(ctx context.Context) *IndicatorGetDeviceCountV1Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) WithHTTPClient(client *http.Client) *IndicatorGetDeviceCountV1Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithType adds the typeVar to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) WithType(typeVar string) *IndicatorGetDeviceCountV1Params { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) SetType(typeVar string) { + o.Type = typeVar +} + +// WithValue adds the value to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) WithValue(value string) *IndicatorGetDeviceCountV1Params { + o.SetValue(value) + return o +} + +// SetValue adds the value to the indicator get device count v1 params +func (o *IndicatorGetDeviceCountV1Params) SetValue(value string) { + o.Value = value +} + +// WriteToRequest writes these params to a swagger request +func (o *IndicatorGetDeviceCountV1Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + // query param value + qrValue := o.Value + qValue := qrValue + if qValue != "" { + + if err := r.SetQueryParam("value", qValue); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/ioc/indicator_get_device_count_v1_responses.go b/falcon/client/ioc/indicator_get_device_count_v1_responses.go new file mode 100644 index 00000000..def0aedf --- /dev/null +++ b/falcon/client/ioc/indicator_get_device_count_v1_responses.go @@ -0,0 +1,394 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ioc + +// This file was generated by 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" +) + +// IndicatorGetDeviceCountV1Reader is a Reader for the IndicatorGetDeviceCountV1 structure. +type IndicatorGetDeviceCountV1Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IndicatorGetDeviceCountV1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIndicatorGetDeviceCountV1OK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewIndicatorGetDeviceCountV1Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewIndicatorGetDeviceCountV1TooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /iocs/aggregates/indicators/device-count/v1] indicator.get.device_count.v1", response, response.Code()) + } +} + +// NewIndicatorGetDeviceCountV1OK creates a IndicatorGetDeviceCountV1OK with default headers values +func NewIndicatorGetDeviceCountV1OK() *IndicatorGetDeviceCountV1OK { + return &IndicatorGetDeviceCountV1OK{} +} + +/* +IndicatorGetDeviceCountV1OK describes a response with status code 200, with default header values. + +OK +*/ +type IndicatorGetDeviceCountV1OK 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.APIDeviceCountRespV1 +} + +// IsSuccess returns true when this indicator get device count v1 o k response has a 2xx status code +func (o *IndicatorGetDeviceCountV1OK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this indicator get device count v1 o k response has a 3xx status code +func (o *IndicatorGetDeviceCountV1OK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this indicator get device count v1 o k response has a 4xx status code +func (o *IndicatorGetDeviceCountV1OK) IsClientError() bool { + return false +} + +// IsServerError returns true when this indicator get device count v1 o k response has a 5xx status code +func (o *IndicatorGetDeviceCountV1OK) IsServerError() bool { + return false +} + +// IsCode returns true when this indicator get device count v1 o k response a status code equal to that given +func (o *IndicatorGetDeviceCountV1OK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the indicator get device count v1 o k response +func (o *IndicatorGetDeviceCountV1OK) Code() int { + return 200 +} + +func (o *IndicatorGetDeviceCountV1OK) Error() string { + return fmt.Sprintf("[GET /iocs/aggregates/indicators/device-count/v1][%d] indicatorGetDeviceCountV1OK %+v", 200, o.Payload) +} + +func (o *IndicatorGetDeviceCountV1OK) String() string { + return fmt.Sprintf("[GET /iocs/aggregates/indicators/device-count/v1][%d] indicatorGetDeviceCountV1OK %+v", 200, o.Payload) +} + +func (o *IndicatorGetDeviceCountV1OK) GetPayload() *models.APIDeviceCountRespV1 { + return o.Payload +} + +func (o *IndicatorGetDeviceCountV1OK) 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.APIDeviceCountRespV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewIndicatorGetDeviceCountV1Forbidden creates a IndicatorGetDeviceCountV1Forbidden with default headers values +func NewIndicatorGetDeviceCountV1Forbidden() *IndicatorGetDeviceCountV1Forbidden { + return &IndicatorGetDeviceCountV1Forbidden{} +} + +/* +IndicatorGetDeviceCountV1Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type IndicatorGetDeviceCountV1Forbidden 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 indicator get device count v1 forbidden response has a 2xx status code +func (o *IndicatorGetDeviceCountV1Forbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this indicator get device count v1 forbidden response has a 3xx status code +func (o *IndicatorGetDeviceCountV1Forbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this indicator get device count v1 forbidden response has a 4xx status code +func (o *IndicatorGetDeviceCountV1Forbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this indicator get device count v1 forbidden response has a 5xx status code +func (o *IndicatorGetDeviceCountV1Forbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this indicator get device count v1 forbidden response a status code equal to that given +func (o *IndicatorGetDeviceCountV1Forbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the indicator get device count v1 forbidden response +func (o *IndicatorGetDeviceCountV1Forbidden) Code() int { + return 403 +} + +func (o *IndicatorGetDeviceCountV1Forbidden) Error() string { + return fmt.Sprintf("[GET /iocs/aggregates/indicators/device-count/v1][%d] indicatorGetDeviceCountV1Forbidden %+v", 403, o.Payload) +} + +func (o *IndicatorGetDeviceCountV1Forbidden) String() string { + return fmt.Sprintf("[GET /iocs/aggregates/indicators/device-count/v1][%d] indicatorGetDeviceCountV1Forbidden %+v", 403, o.Payload) +} + +func (o *IndicatorGetDeviceCountV1Forbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *IndicatorGetDeviceCountV1Forbidden) 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 +} + +// NewIndicatorGetDeviceCountV1TooManyRequests creates a IndicatorGetDeviceCountV1TooManyRequests with default headers values +func NewIndicatorGetDeviceCountV1TooManyRequests() *IndicatorGetDeviceCountV1TooManyRequests { + return &IndicatorGetDeviceCountV1TooManyRequests{} +} + +/* +IndicatorGetDeviceCountV1TooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type IndicatorGetDeviceCountV1TooManyRequests 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 indicator get device count v1 too many requests response has a 2xx status code +func (o *IndicatorGetDeviceCountV1TooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this indicator get device count v1 too many requests response has a 3xx status code +func (o *IndicatorGetDeviceCountV1TooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this indicator get device count v1 too many requests response has a 4xx status code +func (o *IndicatorGetDeviceCountV1TooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this indicator get device count v1 too many requests response has a 5xx status code +func (o *IndicatorGetDeviceCountV1TooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this indicator get device count v1 too many requests response a status code equal to that given +func (o *IndicatorGetDeviceCountV1TooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the indicator get device count v1 too many requests response +func (o *IndicatorGetDeviceCountV1TooManyRequests) Code() int { + return 429 +} + +func (o *IndicatorGetDeviceCountV1TooManyRequests) Error() string { + return fmt.Sprintf("[GET /iocs/aggregates/indicators/device-count/v1][%d] indicatorGetDeviceCountV1TooManyRequests %+v", 429, o.Payload) +} + +func (o *IndicatorGetDeviceCountV1TooManyRequests) String() string { + return fmt.Sprintf("[GET /iocs/aggregates/indicators/device-count/v1][%d] indicatorGetDeviceCountV1TooManyRequests %+v", 429, o.Payload) +} + +func (o *IndicatorGetDeviceCountV1TooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *IndicatorGetDeviceCountV1TooManyRequests) 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/ioc/ioc_client.go b/falcon/client/ioc/ioc_client.go index b05ec8c4..dbcaed9d 100644 --- a/falcon/client/ioc/ioc_client.go +++ b/falcon/client/ioc/ioc_client.go @@ -44,6 +44,8 @@ type ClientService interface { IndicatorDeleteV1(params *IndicatorDeleteV1Params, opts ...ClientOption) (*IndicatorDeleteV1OK, error) + IndicatorGetDeviceCountV1(params *IndicatorGetDeviceCountV1Params, opts ...ClientOption) (*IndicatorGetDeviceCountV1OK, error) + IndicatorGetDevicesRanOnV1(params *IndicatorGetDevicesRanOnV1Params, opts ...ClientOption) (*IndicatorGetDevicesRanOnV1OK, error) IndicatorGetProcessesRanOnV1(params *IndicatorGetProcessesRanOnV1Params, opts ...ClientOption) (*IndicatorGetProcessesRanOnV1OK, error) @@ -330,7 +332,45 @@ func (a *Client) IndicatorDeleteV1(params *IndicatorDeleteV1Params, opts ...Clie } /* -IndicatorGetDevicesRanOnV1 gets the number of devices the indicator has run on +IndicatorGetDeviceCountV1 gets the number of devices the indicator has run on +*/ +func (a *Client) IndicatorGetDeviceCountV1(params *IndicatorGetDeviceCountV1Params, opts ...ClientOption) (*IndicatorGetDeviceCountV1OK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIndicatorGetDeviceCountV1Params() + } + op := &runtime.ClientOperation{ + ID: "indicator.get.device_count.v1", + Method: "GET", + PathPattern: "/iocs/aggregates/indicators/device-count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &IndicatorGetDeviceCountV1Reader{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.(*IndicatorGetDeviceCountV1OK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for indicator.get.device_count.v1: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +IndicatorGetDevicesRanOnV1 gets the i ds of devices the indicator has run on */ func (a *Client) IndicatorGetDevicesRanOnV1(params *IndicatorGetDevicesRanOnV1Params, opts ...ClientOption) (*IndicatorGetDevicesRanOnV1OK, error) { // TODO: Validate the params before sending diff --git a/falcon/client/kubernetes_protection/find_containers_by_container_run_time_version_parameters.go b/falcon/client/kubernetes_protection/find_containers_by_container_run_time_version_parameters.go new file mode 100644 index 00000000..52e99399 --- /dev/null +++ b/falcon/client/kubernetes_protection/find_containers_by_container_run_time_version_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewFindContainersByContainerRunTimeVersionParams creates a new FindContainersByContainerRunTimeVersionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewFindContainersByContainerRunTimeVersionParams() *FindContainersByContainerRunTimeVersionParams { + return &FindContainersByContainerRunTimeVersionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewFindContainersByContainerRunTimeVersionParamsWithTimeout creates a new FindContainersByContainerRunTimeVersionParams object +// with the ability to set a timeout on a request. +func NewFindContainersByContainerRunTimeVersionParamsWithTimeout(timeout time.Duration) *FindContainersByContainerRunTimeVersionParams { + return &FindContainersByContainerRunTimeVersionParams{ + timeout: timeout, + } +} + +// NewFindContainersByContainerRunTimeVersionParamsWithContext creates a new FindContainersByContainerRunTimeVersionParams object +// with the ability to set a context for a request. +func NewFindContainersByContainerRunTimeVersionParamsWithContext(ctx context.Context) *FindContainersByContainerRunTimeVersionParams { + return &FindContainersByContainerRunTimeVersionParams{ + Context: ctx, + } +} + +// NewFindContainersByContainerRunTimeVersionParamsWithHTTPClient creates a new FindContainersByContainerRunTimeVersionParams object +// with the ability to set a custom HTTPClient for a request. +func NewFindContainersByContainerRunTimeVersionParamsWithHTTPClient(client *http.Client) *FindContainersByContainerRunTimeVersionParams { + return &FindContainersByContainerRunTimeVersionParams{ + HTTPClient: client, + } +} + +/* +FindContainersByContainerRunTimeVersionParams contains all the parameters to send to the API endpoint + + for the find containers by container run time version operation. + + Typically these are written to a http.Request. +*/ +type FindContainersByContainerRunTimeVersionParams struct { + + /* Filter. + + Retrieve count of Kubernetes containers that match a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + /* Limit. + + The upper-bound on the number of container records to retrieve. + */ + Limit *int64 + + /* Offset. + + It is used to get the offset + */ + Offset *int64 + + /* Sort. + + Field to sort results by + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the find containers by container run time version params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FindContainersByContainerRunTimeVersionParams) WithDefaults() *FindContainersByContainerRunTimeVersionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the find containers by container run time version params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FindContainersByContainerRunTimeVersionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) WithTimeout(timeout time.Duration) *FindContainersByContainerRunTimeVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) WithContext(ctx context.Context) *FindContainersByContainerRunTimeVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) WithHTTPClient(client *http.Client) *FindContainersByContainerRunTimeVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) WithFilter(filter *string) *FindContainersByContainerRunTimeVersionParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) WithLimit(limit *int64) *FindContainersByContainerRunTimeVersionParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) WithOffset(offset *int64) *FindContainersByContainerRunTimeVersionParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) WithSort(sort *string) *FindContainersByContainerRunTimeVersionParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the find containers by container run time version params +func (o *FindContainersByContainerRunTimeVersionParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *FindContainersByContainerRunTimeVersionParams) 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/kubernetes_protection/find_containers_by_container_run_time_version_responses.go b/falcon/client/kubernetes_protection/find_containers_by_container_run_time_version_responses.go new file mode 100644 index 00000000..ee640f19 --- /dev/null +++ b/falcon/client/kubernetes_protection/find_containers_by_container_run_time_version_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// FindContainersByContainerRunTimeVersionReader is a Reader for the FindContainersByContainerRunTimeVersion structure. +type FindContainersByContainerRunTimeVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindContainersByContainerRunTimeVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindContainersByContainerRunTimeVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewFindContainersByContainerRunTimeVersionForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewFindContainersByContainerRunTimeVersionTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewFindContainersByContainerRunTimeVersionInternalServerError() + 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/containers/find-by-runtimeversion/v1] FindContainersByContainerRunTimeVersion", response, response.Code()) + } +} + +// NewFindContainersByContainerRunTimeVersionOK creates a FindContainersByContainerRunTimeVersionOK with default headers values +func NewFindContainersByContainerRunTimeVersionOK() *FindContainersByContainerRunTimeVersionOK { + return &FindContainersByContainerRunTimeVersionOK{} +} + +/* +FindContainersByContainerRunTimeVersionOK describes a response with status code 200, with default header values. + +OK +*/ +type FindContainersByContainerRunTimeVersionOK 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.ModelsContainerRuntimePivotResponse +} + +// IsSuccess returns true when this find containers by container run time version o k response has a 2xx status code +func (o *FindContainersByContainerRunTimeVersionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this find containers by container run time version o k response has a 3xx status code +func (o *FindContainersByContainerRunTimeVersionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers by container run time version o k response has a 4xx status code +func (o *FindContainersByContainerRunTimeVersionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this find containers by container run time version o k response has a 5xx status code +func (o *FindContainersByContainerRunTimeVersionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this find containers by container run time version o k response a status code equal to that given +func (o *FindContainersByContainerRunTimeVersionOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the find containers by container run time version o k response +func (o *FindContainersByContainerRunTimeVersionOK) Code() int { + return 200 +} + +func (o *FindContainersByContainerRunTimeVersionOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionOK %+v", 200, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionOK %+v", 200, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionOK) GetPayload() *models.ModelsContainerRuntimePivotResponse { + return o.Payload +} + +func (o *FindContainersByContainerRunTimeVersionOK) 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.ModelsContainerRuntimePivotResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindContainersByContainerRunTimeVersionForbidden creates a FindContainersByContainerRunTimeVersionForbidden with default headers values +func NewFindContainersByContainerRunTimeVersionForbidden() *FindContainersByContainerRunTimeVersionForbidden { + return &FindContainersByContainerRunTimeVersionForbidden{} +} + +/* +FindContainersByContainerRunTimeVersionForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type FindContainersByContainerRunTimeVersionForbidden 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 find containers by container run time version forbidden response has a 2xx status code +func (o *FindContainersByContainerRunTimeVersionForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this find containers by container run time version forbidden response has a 3xx status code +func (o *FindContainersByContainerRunTimeVersionForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers by container run time version forbidden response has a 4xx status code +func (o *FindContainersByContainerRunTimeVersionForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this find containers by container run time version forbidden response has a 5xx status code +func (o *FindContainersByContainerRunTimeVersionForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this find containers by container run time version forbidden response a status code equal to that given +func (o *FindContainersByContainerRunTimeVersionForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the find containers by container run time version forbidden response +func (o *FindContainersByContainerRunTimeVersionForbidden) Code() int { + return 403 +} + +func (o *FindContainersByContainerRunTimeVersionForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionForbidden %+v", 403, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionForbidden %+v", 403, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *FindContainersByContainerRunTimeVersionForbidden) 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 +} + +// NewFindContainersByContainerRunTimeVersionTooManyRequests creates a FindContainersByContainerRunTimeVersionTooManyRequests with default headers values +func NewFindContainersByContainerRunTimeVersionTooManyRequests() *FindContainersByContainerRunTimeVersionTooManyRequests { + return &FindContainersByContainerRunTimeVersionTooManyRequests{} +} + +/* +FindContainersByContainerRunTimeVersionTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type FindContainersByContainerRunTimeVersionTooManyRequests 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 find containers by container run time version too many requests response has a 2xx status code +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this find containers by container run time version too many requests response has a 3xx status code +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers by container run time version too many requests response has a 4xx status code +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this find containers by container run time version too many requests response has a 5xx status code +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this find containers by container run time version too many requests response a status code equal to that given +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the find containers by container run time version too many requests response +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) Code() int { + return 429 +} + +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionTooManyRequests %+v", 429, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionTooManyRequests %+v", 429, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *FindContainersByContainerRunTimeVersionTooManyRequests) 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 +} + +// NewFindContainersByContainerRunTimeVersionInternalServerError creates a FindContainersByContainerRunTimeVersionInternalServerError with default headers values +func NewFindContainersByContainerRunTimeVersionInternalServerError() *FindContainersByContainerRunTimeVersionInternalServerError { + return &FindContainersByContainerRunTimeVersionInternalServerError{} +} + +/* +FindContainersByContainerRunTimeVersionInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type FindContainersByContainerRunTimeVersionInternalServerError 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 find containers by container run time version internal server error response has a 2xx status code +func (o *FindContainersByContainerRunTimeVersionInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this find containers by container run time version internal server error response has a 3xx status code +func (o *FindContainersByContainerRunTimeVersionInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers by container run time version internal server error response has a 4xx status code +func (o *FindContainersByContainerRunTimeVersionInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this find containers by container run time version internal server error response has a 5xx status code +func (o *FindContainersByContainerRunTimeVersionInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this find containers by container run time version internal server error response a status code equal to that given +func (o *FindContainersByContainerRunTimeVersionInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the find containers by container run time version internal server error response +func (o *FindContainersByContainerRunTimeVersionInternalServerError) Code() int { + return 500 +} + +func (o *FindContainersByContainerRunTimeVersionInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionInternalServerError %+v", 500, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/find-by-runtimeversion/v1][%d] findContainersByContainerRunTimeVersionInternalServerError %+v", 500, o.Payload) +} + +func (o *FindContainersByContainerRunTimeVersionInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *FindContainersByContainerRunTimeVersionInternalServerError) 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/find_containers_count_affected_by_zero_day_vulnerabilities_parameters.go b/falcon/client/kubernetes_protection/find_containers_count_affected_by_zero_day_vulnerabilities_parameters.go new file mode 100644 index 00000000..f8220475 --- /dev/null +++ b/falcon/client/kubernetes_protection/find_containers_count_affected_by_zero_day_vulnerabilities_parameters.go @@ -0,0 +1,128 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesParams creates a new FindContainersCountAffectedByZeroDayVulnerabilitiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesParams() *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesParamsWithTimeout creates a new FindContainersCountAffectedByZeroDayVulnerabilitiesParams object +// with the ability to set a timeout on a request. +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesParamsWithTimeout(timeout time.Duration) *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesParams{ + timeout: timeout, + } +} + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesParamsWithContext creates a new FindContainersCountAffectedByZeroDayVulnerabilitiesParams object +// with the ability to set a context for a request. +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesParamsWithContext(ctx context.Context) *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesParams{ + Context: ctx, + } +} + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesParamsWithHTTPClient creates a new FindContainersCountAffectedByZeroDayVulnerabilitiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesParamsWithHTTPClient(client *http.Client) *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesParams{ + HTTPClient: client, + } +} + +/* +FindContainersCountAffectedByZeroDayVulnerabilitiesParams contains all the parameters to send to the API endpoint + + for the find containers count affected by zero day vulnerabilities operation. + + Typically these are written to a http.Request. +*/ +type FindContainersCountAffectedByZeroDayVulnerabilitiesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the find containers count affected by zero day vulnerabilities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) WithDefaults() *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the find containers count affected by zero day vulnerabilities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the find containers count affected by zero day vulnerabilities params +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) WithTimeout(timeout time.Duration) *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find containers count affected by zero day vulnerabilities params +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find containers count affected by zero day vulnerabilities params +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) WithContext(ctx context.Context) *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find containers count affected by zero day vulnerabilities params +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find containers count affected by zero day vulnerabilities params +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) WithHTTPClient(client *http.Client) *FindContainersCountAffectedByZeroDayVulnerabilitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find containers count affected by zero day vulnerabilities params +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/find_containers_count_affected_by_zero_day_vulnerabilities_responses.go b/falcon/client/kubernetes_protection/find_containers_count_affected_by_zero_day_vulnerabilities_responses.go new file mode 100644 index 00000000..8292f871 --- /dev/null +++ b/falcon/client/kubernetes_protection/find_containers_count_affected_by_zero_day_vulnerabilities_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// FindContainersCountAffectedByZeroDayVulnerabilitiesReader is a Reader for the FindContainersCountAffectedByZeroDayVulnerabilities structure. +type FindContainersCountAffectedByZeroDayVulnerabilitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindContainersCountAffectedByZeroDayVulnerabilitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewFindContainersCountAffectedByZeroDayVulnerabilitiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewFindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewFindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError() + 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/containers/count-by-zero-day/v1] FindContainersCountAffectedByZeroDayVulnerabilities", response, response.Code()) + } +} + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesOK creates a FindContainersCountAffectedByZeroDayVulnerabilitiesOK with default headers values +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesOK() *FindContainersCountAffectedByZeroDayVulnerabilitiesOK { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesOK{} +} + +/* +FindContainersCountAffectedByZeroDayVulnerabilitiesOK describes a response with status code 200, with default header values. + +OK +*/ +type FindContainersCountAffectedByZeroDayVulnerabilitiesOK 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.CommonCountResponse +} + +// IsSuccess returns true when this find containers count affected by zero day vulnerabilities o k response has a 2xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this find containers count affected by zero day vulnerabilities o k response has a 3xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers count affected by zero day vulnerabilities o k response has a 4xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this find containers count affected by zero day vulnerabilities o k response has a 5xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this find containers count affected by zero day vulnerabilities o k response a status code equal to that given +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the find containers count affected by zero day vulnerabilities o k response +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) Code() int { + return 200 +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesOK %+v", 200, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesOK %+v", 200, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) GetPayload() *models.CommonCountResponse { + return o.Payload +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesOK) 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.CommonCountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesForbidden creates a FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden with default headers values +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesForbidden() *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden{} +} + +/* +FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden 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 find containers count affected by zero day vulnerabilities forbidden response has a 2xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this find containers count affected by zero day vulnerabilities forbidden response has a 3xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers count affected by zero day vulnerabilities forbidden response has a 4xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this find containers count affected by zero day vulnerabilities forbidden response has a 5xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this find containers count affected by zero day vulnerabilities forbidden response a status code equal to that given +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the find containers count affected by zero day vulnerabilities forbidden response +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) Code() int { + return 403 +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesForbidden %+v", 403, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesForbidden %+v", 403, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesForbidden) 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 +} + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests creates a FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests with default headers values +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests() *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests{} +} + +/* +FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests 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 find containers count affected by zero day vulnerabilities too many requests response has a 2xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this find containers count affected by zero day vulnerabilities too many requests response has a 3xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers count affected by zero day vulnerabilities too many requests response has a 4xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this find containers count affected by zero day vulnerabilities too many requests response has a 5xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this find containers count affected by zero day vulnerabilities too many requests response a status code equal to that given +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the find containers count affected by zero day vulnerabilities too many requests response +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) Code() int { + return 429 +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesTooManyRequests) 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 +} + +// NewFindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError creates a FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError with default headers values +func NewFindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError() *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError { + return &FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError{} +} + +/* +FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError 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 find containers count affected by zero day vulnerabilities internal server error response has a 2xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this find containers count affected by zero day vulnerabilities internal server error response has a 3xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this find containers count affected by zero day vulnerabilities internal server error response has a 4xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this find containers count affected by zero day vulnerabilities internal server error response has a 5xx status code +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this find containers count affected by zero day vulnerabilities internal server error response a status code equal to that given +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the find containers count affected by zero day vulnerabilities internal server error response +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) Code() int { + return 500 +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-zero-day/v1][%d] findContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *FindContainersCountAffectedByZeroDayVulnerabilitiesInternalServerError) 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/group_containers_by_managed_parameters.go b/falcon/client/kubernetes_protection/group_containers_by_managed_parameters.go new file mode 100644 index 00000000..e6a0195e --- /dev/null +++ b/falcon/client/kubernetes_protection/group_containers_by_managed_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGroupContainersByManagedParams creates a new GroupContainersByManagedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGroupContainersByManagedParams() *GroupContainersByManagedParams { + return &GroupContainersByManagedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGroupContainersByManagedParamsWithTimeout creates a new GroupContainersByManagedParams object +// with the ability to set a timeout on a request. +func NewGroupContainersByManagedParamsWithTimeout(timeout time.Duration) *GroupContainersByManagedParams { + return &GroupContainersByManagedParams{ + timeout: timeout, + } +} + +// NewGroupContainersByManagedParamsWithContext creates a new GroupContainersByManagedParams object +// with the ability to set a context for a request. +func NewGroupContainersByManagedParamsWithContext(ctx context.Context) *GroupContainersByManagedParams { + return &GroupContainersByManagedParams{ + Context: ctx, + } +} + +// NewGroupContainersByManagedParamsWithHTTPClient creates a new GroupContainersByManagedParams object +// with the ability to set a custom HTTPClient for a request. +func NewGroupContainersByManagedParamsWithHTTPClient(client *http.Client) *GroupContainersByManagedParams { + return &GroupContainersByManagedParams{ + HTTPClient: client, + } +} + +/* +GroupContainersByManagedParams contains all the parameters to send to the API endpoint + + for the group containers by managed operation. + + Typically these are written to a http.Request. +*/ +type GroupContainersByManagedParams struct { + + /* Filter. + + Retrieve count of Kubernetes containers that match a query in Falcon Query Language (FQL). Supported filters: agent_id,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the group containers by managed params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GroupContainersByManagedParams) WithDefaults() *GroupContainersByManagedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the group containers by managed params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GroupContainersByManagedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the group containers by managed params +func (o *GroupContainersByManagedParams) WithTimeout(timeout time.Duration) *GroupContainersByManagedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the group containers by managed params +func (o *GroupContainersByManagedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the group containers by managed params +func (o *GroupContainersByManagedParams) WithContext(ctx context.Context) *GroupContainersByManagedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the group containers by managed params +func (o *GroupContainersByManagedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the group containers by managed params +func (o *GroupContainersByManagedParams) WithHTTPClient(client *http.Client) *GroupContainersByManagedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the group containers by managed params +func (o *GroupContainersByManagedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the group containers by managed params +func (o *GroupContainersByManagedParams) WithFilter(filter *string) *GroupContainersByManagedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the group containers by managed params +func (o *GroupContainersByManagedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *GroupContainersByManagedParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/group_containers_by_managed_responses.go b/falcon/client/kubernetes_protection/group_containers_by_managed_responses.go new file mode 100644 index 00000000..d7896c75 --- /dev/null +++ b/falcon/client/kubernetes_protection/group_containers_by_managed_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// GroupContainersByManagedReader is a Reader for the GroupContainersByManaged structure. +type GroupContainersByManagedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GroupContainersByManagedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGroupContainersByManagedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewGroupContainersByManagedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewGroupContainersByManagedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGroupContainersByManagedInternalServerError() + 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/containers/group-by-managed/v1] GroupContainersByManaged", response, response.Code()) + } +} + +// NewGroupContainersByManagedOK creates a GroupContainersByManagedOK with default headers values +func NewGroupContainersByManagedOK() *GroupContainersByManagedOK { + return &GroupContainersByManagedOK{} +} + +/* +GroupContainersByManagedOK describes a response with status code 200, with default header values. + +OK +*/ +type GroupContainersByManagedOK 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.ModelsContainerCoverageResponseEntity +} + +// IsSuccess returns true when this group containers by managed o k response has a 2xx status code +func (o *GroupContainersByManagedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this group containers by managed o k response has a 3xx status code +func (o *GroupContainersByManagedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this group containers by managed o k response has a 4xx status code +func (o *GroupContainersByManagedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this group containers by managed o k response has a 5xx status code +func (o *GroupContainersByManagedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this group containers by managed o k response a status code equal to that given +func (o *GroupContainersByManagedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the group containers by managed o k response +func (o *GroupContainersByManagedOK) Code() int { + return 200 +} + +func (o *GroupContainersByManagedOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedOK %+v", 200, o.Payload) +} + +func (o *GroupContainersByManagedOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedOK %+v", 200, o.Payload) +} + +func (o *GroupContainersByManagedOK) GetPayload() *models.ModelsContainerCoverageResponseEntity { + return o.Payload +} + +func (o *GroupContainersByManagedOK) 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.ModelsContainerCoverageResponseEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGroupContainersByManagedForbidden creates a GroupContainersByManagedForbidden with default headers values +func NewGroupContainersByManagedForbidden() *GroupContainersByManagedForbidden { + return &GroupContainersByManagedForbidden{} +} + +/* +GroupContainersByManagedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type GroupContainersByManagedForbidden 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 group containers by managed forbidden response has a 2xx status code +func (o *GroupContainersByManagedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this group containers by managed forbidden response has a 3xx status code +func (o *GroupContainersByManagedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this group containers by managed forbidden response has a 4xx status code +func (o *GroupContainersByManagedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this group containers by managed forbidden response has a 5xx status code +func (o *GroupContainersByManagedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this group containers by managed forbidden response a status code equal to that given +func (o *GroupContainersByManagedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the group containers by managed forbidden response +func (o *GroupContainersByManagedForbidden) Code() int { + return 403 +} + +func (o *GroupContainersByManagedForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedForbidden %+v", 403, o.Payload) +} + +func (o *GroupContainersByManagedForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedForbidden %+v", 403, o.Payload) +} + +func (o *GroupContainersByManagedForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GroupContainersByManagedForbidden) 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 +} + +// NewGroupContainersByManagedTooManyRequests creates a GroupContainersByManagedTooManyRequests with default headers values +func NewGroupContainersByManagedTooManyRequests() *GroupContainersByManagedTooManyRequests { + return &GroupContainersByManagedTooManyRequests{} +} + +/* +GroupContainersByManagedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type GroupContainersByManagedTooManyRequests 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 group containers by managed too many requests response has a 2xx status code +func (o *GroupContainersByManagedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this group containers by managed too many requests response has a 3xx status code +func (o *GroupContainersByManagedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this group containers by managed too many requests response has a 4xx status code +func (o *GroupContainersByManagedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this group containers by managed too many requests response has a 5xx status code +func (o *GroupContainersByManagedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this group containers by managed too many requests response a status code equal to that given +func (o *GroupContainersByManagedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the group containers by managed too many requests response +func (o *GroupContainersByManagedTooManyRequests) Code() int { + return 429 +} + +func (o *GroupContainersByManagedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedTooManyRequests %+v", 429, o.Payload) +} + +func (o *GroupContainersByManagedTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedTooManyRequests %+v", 429, o.Payload) +} + +func (o *GroupContainersByManagedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *GroupContainersByManagedTooManyRequests) 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 +} + +// NewGroupContainersByManagedInternalServerError creates a GroupContainersByManagedInternalServerError with default headers values +func NewGroupContainersByManagedInternalServerError() *GroupContainersByManagedInternalServerError { + return &GroupContainersByManagedInternalServerError{} +} + +/* +GroupContainersByManagedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type GroupContainersByManagedInternalServerError 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 group containers by managed internal server error response has a 2xx status code +func (o *GroupContainersByManagedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this group containers by managed internal server error response has a 3xx status code +func (o *GroupContainersByManagedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this group containers by managed internal server error response has a 4xx status code +func (o *GroupContainersByManagedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this group containers by managed internal server error response has a 5xx status code +func (o *GroupContainersByManagedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this group containers by managed internal server error response a status code equal to that given +func (o *GroupContainersByManagedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the group containers by managed internal server error response +func (o *GroupContainersByManagedInternalServerError) Code() int { + return 500 +} + +func (o *GroupContainersByManagedInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedInternalServerError %+v", 500, o.Payload) +} + +func (o *GroupContainersByManagedInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/group-by-managed/v1][%d] groupContainersByManagedInternalServerError %+v", 500, o.Payload) +} + +func (o *GroupContainersByManagedInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *GroupContainersByManagedInternalServerError) 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_protection_client.go b/falcon/client/kubernetes_protection/kubernetes_protection_client.go index 541880f5..564e2d3c 100644 --- a/falcon/client/kubernetes_protection/kubernetes_protection_client.go +++ b/falcon/client/kubernetes_protection/kubernetes_protection_client.go @@ -38,6 +38,10 @@ type ClientService interface { DeleteAzureSubscription(params *DeleteAzureSubscriptionParams, opts ...ClientOption) (*DeleteAzureSubscriptionOK, *DeleteAzureSubscriptionMultiStatus, error) + FindContainersByContainerRunTimeVersion(params *FindContainersByContainerRunTimeVersionParams, opts ...ClientOption) (*FindContainersByContainerRunTimeVersionOK, error) + + FindContainersCountAffectedByZeroDayVulnerabilities(params *FindContainersCountAffectedByZeroDayVulnerabilitiesParams, opts ...ClientOption) (*FindContainersCountAffectedByZeroDayVulnerabilitiesOK, error) + GetAWSAccountsMixin0(params *GetAWSAccountsMixin0Params, opts ...ClientOption) (*GetAWSAccountsMixin0OK, *GetAWSAccountsMixin0MultiStatus, error) GetAzureInstallScript(params *GetAzureInstallScriptParams, opts ...ClientOption) (*GetAzureInstallScriptOK, *GetAzureInstallScriptMultiStatus, error) @@ -56,12 +60,90 @@ type ClientService interface { GetStaticScripts(params *GetStaticScriptsParams, opts ...ClientOption) (*GetStaticScriptsOK, *GetStaticScriptsMultiStatus, error) + GroupContainersByManaged(params *GroupContainersByManagedParams, opts ...ClientOption) (*GroupContainersByManagedOK, error) + ListAzureAccounts(params *ListAzureAccountsParams, opts ...ClientOption) (*ListAzureAccountsOK, *ListAzureAccountsMultiStatus, error) PatchAzureServicePrincipal(params *PatchAzureServicePrincipalParams, opts ...ClientOption) (*PatchAzureServicePrincipalCreated, *PatchAzureServicePrincipalMultiStatus, error) + ReadClusterCombined(params *ReadClusterCombinedParams, opts ...ClientOption) (*ReadClusterCombinedOK, error) + + ReadClusterCount(params *ReadClusterCountParams, opts ...ClientOption) (*ReadClusterCountOK, error) + + ReadClusterEnrichment(params *ReadClusterEnrichmentParams, opts ...ClientOption) (*ReadClusterEnrichmentOK, error) + + ReadClustersByDateRangeCount(params *ReadClustersByDateRangeCountParams, opts ...ClientOption) (*ReadClustersByDateRangeCountOK, error) + + ReadClustersByKubernetesVersionCount(params *ReadClustersByKubernetesVersionCountParams, opts ...ClientOption) (*ReadClustersByKubernetesVersionCountOK, error) + + ReadClustersByStatusCount(params *ReadClustersByStatusCountParams, opts ...ClientOption) (*ReadClustersByStatusCountOK, error) + + ReadContainerCombined(params *ReadContainerCombinedParams, opts ...ClientOption) (*ReadContainerCombinedOK, error) + + ReadContainerCount(params *ReadContainerCountParams, opts ...ClientOption) (*ReadContainerCountOK, error) + + ReadContainerCountByRegistry(params *ReadContainerCountByRegistryParams, opts ...ClientOption) (*ReadContainerCountByRegistryOK, error) + + ReadContainerEnrichment(params *ReadContainerEnrichmentParams, opts ...ClientOption) (*ReadContainerEnrichmentOK, error) + + ReadContainerImageDetectionsCountByDate(params *ReadContainerImageDetectionsCountByDateParams, opts ...ClientOption) (*ReadContainerImageDetectionsCountByDateOK, error) + + ReadContainerImagesByMostUsed(params *ReadContainerImagesByMostUsedParams, opts ...ClientOption) (*ReadContainerImagesByMostUsedOK, error) + + ReadContainerImagesByState(params *ReadContainerImagesByStateParams, opts ...ClientOption) (*ReadContainerImagesByStateOK, error) + + ReadContainerVulnerabilitiesBySeverityCount(params *ReadContainerVulnerabilitiesBySeverityCountParams, opts ...ClientOption) (*ReadContainerVulnerabilitiesBySeverityCountOK, error) + + ReadContainersByDateRangeCount(params *ReadContainersByDateRangeCountParams, opts ...ClientOption) (*ReadContainersByDateRangeCountOK, error) + + ReadContainersSensorCoverage(params *ReadContainersSensorCoverageParams, opts ...ClientOption) (*ReadContainersSensorCoverageOK, error) + + ReadDeploymentCombined(params *ReadDeploymentCombinedParams, opts ...ClientOption) (*ReadDeploymentCombinedOK, error) + + ReadDeploymentCount(params *ReadDeploymentCountParams, opts ...ClientOption) (*ReadDeploymentCountOK, error) + + ReadDeploymentEnrichment(params *ReadDeploymentEnrichmentParams, opts ...ClientOption) (*ReadDeploymentEnrichmentOK, error) + + ReadDeploymentsByDateRangeCount(params *ReadDeploymentsByDateRangeCountParams, opts ...ClientOption) (*ReadDeploymentsByDateRangeCountOK, error) + + ReadDistinctContainerImageCount(params *ReadDistinctContainerImageCountParams, opts ...ClientOption) (*ReadDistinctContainerImageCountOK, error) + + ReadKubernetesIomByDateRange(params *ReadKubernetesIomByDateRangeParams, opts ...ClientOption) (*ReadKubernetesIomByDateRangeOK, error) + + ReadKubernetesIomCount(params *ReadKubernetesIomCountParams, opts ...ClientOption) (*ReadKubernetesIomCountOK, error) + + ReadKubernetesIomEntities(params *ReadKubernetesIomEntitiesParams, opts ...ClientOption) (*ReadKubernetesIomEntitiesOK, error) + + ReadNodeCombined(params *ReadNodeCombinedParams, opts ...ClientOption) (*ReadNodeCombinedOK, error) + + ReadNodeCount(params *ReadNodeCountParams, opts ...ClientOption) (*ReadNodeCountOK, error) + + ReadNodeEnrichment(params *ReadNodeEnrichmentParams, opts ...ClientOption) (*ReadNodeEnrichmentOK, error) + + ReadNodesByCloudCount(params *ReadNodesByCloudCountParams, opts ...ClientOption) (*ReadNodesByCloudCountOK, error) + + ReadNodesByContainerEngineVersionCount(params *ReadNodesByContainerEngineVersionCountParams, opts ...ClientOption) (*ReadNodesByContainerEngineVersionCountOK, error) + + ReadNodesByDateRangeCount(params *ReadNodesByDateRangeCountParams, opts ...ClientOption) (*ReadNodesByDateRangeCountOK, error) + + ReadPodCombined(params *ReadPodCombinedParams, opts ...ClientOption) (*ReadPodCombinedOK, error) + + ReadPodCount(params *ReadPodCountParams, opts ...ClientOption) (*ReadPodCountOK, error) + + ReadPodEnrichment(params *ReadPodEnrichmentParams, opts ...ClientOption) (*ReadPodEnrichmentOK, error) + + ReadPodsByDateRangeCount(params *ReadPodsByDateRangeCountParams, opts ...ClientOption) (*ReadPodsByDateRangeCountOK, error) + + ReadRunningContainerImages(params *ReadRunningContainerImagesParams, opts ...ClientOption) (*ReadRunningContainerImagesOK, error) + + ReadVulnerableContainerImageCount(params *ReadVulnerableContainerImageCountParams, opts ...ClientOption) (*ReadVulnerableContainerImageCountOK, error) + RegenerateAPIKey(params *RegenerateAPIKeyParams, opts ...ClientOption) (*RegenerateAPIKeyOK, *RegenerateAPIKeyMultiStatus, error) + SearchAndReadKubernetesIomEntities(params *SearchAndReadKubernetesIomEntitiesParams, opts ...ClientOption) (*SearchAndReadKubernetesIomEntitiesOK, error) + + SearchKubernetesIoms(params *SearchKubernetesIomsParams, opts ...ClientOption) (*SearchKubernetesIomsOK, error) + TriggerScan(params *TriggerScanParams, opts ...ClientOption) (*TriggerScanCreated, *TriggerScanMultiStatus, error) UpdateAWSAccount(params *UpdateAWSAccountParams, opts ...ClientOption) (*UpdateAWSAccountOK, *UpdateAWSAccountMultiStatus, error) @@ -225,6 +307,82 @@ func (a *Client) DeleteAzureSubscription(params *DeleteAzureSubscriptionParams, panic(msg) } +/* +FindContainersByContainerRunTimeVersion retrieves containers by container runtime version +*/ +func (a *Client) FindContainersByContainerRunTimeVersion(params *FindContainersByContainerRunTimeVersionParams, opts ...ClientOption) (*FindContainersByContainerRunTimeVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindContainersByContainerRunTimeVersionParams() + } + op := &runtime.ClientOperation{ + ID: "FindContainersByContainerRunTimeVersion", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/find-by-runtimeversion/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &FindContainersByContainerRunTimeVersionReader{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.(*FindContainersByContainerRunTimeVersionOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for FindContainersByContainerRunTimeVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +FindContainersCountAffectedByZeroDayVulnerabilities retrieves containers count affected by zero day vulnerabilities +*/ +func (a *Client) FindContainersCountAffectedByZeroDayVulnerabilities(params *FindContainersCountAffectedByZeroDayVulnerabilitiesParams, opts ...ClientOption) (*FindContainersCountAffectedByZeroDayVulnerabilitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindContainersCountAffectedByZeroDayVulnerabilitiesParams() + } + op := &runtime.ClientOperation{ + ID: "FindContainersCountAffectedByZeroDayVulnerabilities", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/count-by-zero-day/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &FindContainersCountAffectedByZeroDayVulnerabilitiesReader{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.(*FindContainersCountAffectedByZeroDayVulnerabilitiesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for FindContainersCountAffectedByZeroDayVulnerabilities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetAWSAccountsMixin0 provides a list of a w s accounts */ @@ -575,6 +733,44 @@ func (a *Client) GetStaticScripts(params *GetStaticScriptsParams, opts ...Client panic(msg) } +/* +GroupContainersByManaged groups the containers by managed +*/ +func (a *Client) GroupContainersByManaged(params *GroupContainersByManagedParams, opts ...ClientOption) (*GroupContainersByManagedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGroupContainersByManagedParams() + } + op := &runtime.ClientOperation{ + ID: "GroupContainersByManaged", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/group-by-managed/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GroupContainersByManagedReader{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.(*GroupContainersByManagedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for GroupContainersByManaged: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ListAzureAccounts provides the azure subscriptions registered to kubernetes protection */ @@ -654,22 +850,22 @@ func (a *Client) PatchAzureServicePrincipal(params *PatchAzureServicePrincipalPa } /* -RegenerateAPIKey regenerates API key for docker registry integrations +ReadClusterCombined retrieves kubernetes clusters identified by the provided filter criteria */ -func (a *Client) RegenerateAPIKey(params *RegenerateAPIKeyParams, opts ...ClientOption) (*RegenerateAPIKeyOK, *RegenerateAPIKeyMultiStatus, error) { +func (a *Client) ReadClusterCombined(params *ReadClusterCombinedParams, opts ...ClientOption) (*ReadClusterCombinedOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewRegenerateAPIKeyParams() + params = NewReadClusterCombinedParams() } op := &runtime.ClientOperation{ - ID: "RegenerateAPIKey", - Method: "POST", - PathPattern: "/kubernetes-protection/entities/integration/api-key/v1", + ID: "ReadClusterCombined", + Method: "GET", + PathPattern: "/container-security/combined/clusters/v1", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/octet-stream"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &RegenerateAPIKeyReader{formats: a.formats}, + Reader: &ReadClusterCombinedReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -679,16 +875,1460 @@ func (a *Client) RegenerateAPIKey(params *RegenerateAPIKeyParams, opts ...Client result, err := a.transport.Submit(op) if err != nil { - return nil, nil, err + return nil, err } - switch value := result.(type) { - case *RegenerateAPIKeyOK: - return value, nil, nil - case *RegenerateAPIKeyMultiStatus: - return nil, value, nil + success, ok := result.(*ReadClusterCombinedOK) + if ok { + return success, nil } + // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for kubernetes_protection: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ReadClusterCombined: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadClusterCount retrieves cluster counts +*/ +func (a *Client) ReadClusterCount(params *ReadClusterCountParams, opts ...ClientOption) (*ReadClusterCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadClusterCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadClusterCount", + Method: "GET", + PathPattern: "/container-security/aggregates/clusters/count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadClusterCountReader{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.(*ReadClusterCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadClusterCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadClusterEnrichment retrieves cluster enrichment data +*/ +func (a *Client) ReadClusterEnrichment(params *ReadClusterEnrichmentParams, opts ...ClientOption) (*ReadClusterEnrichmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadClusterEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "ReadClusterEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/clusters/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadClusterEnrichmentReader{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.(*ReadClusterEnrichmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadClusterEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadClustersByDateRangeCount retrieves clusters by date range counts +*/ +func (a *Client) ReadClustersByDateRangeCount(params *ReadClustersByDateRangeCountParams, opts ...ClientOption) (*ReadClustersByDateRangeCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadClustersByDateRangeCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadClustersByDateRangeCount", + Method: "GET", + PathPattern: "/container-security/aggregates/clusters/count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadClustersByDateRangeCountReader{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.(*ReadClustersByDateRangeCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadClustersByDateRangeCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadClustersByKubernetesVersionCount buckets clusters by kubernetes version +*/ +func (a *Client) ReadClustersByKubernetesVersionCount(params *ReadClustersByKubernetesVersionCountParams, opts ...ClientOption) (*ReadClustersByKubernetesVersionCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadClustersByKubernetesVersionCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadClustersByKubernetesVersionCount", + Method: "GET", + PathPattern: "/container-security/aggregates/clusters/count-by-kubernetes-version/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadClustersByKubernetesVersionCountReader{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.(*ReadClustersByKubernetesVersionCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadClustersByKubernetesVersionCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadClustersByStatusCount buckets clusters by status +*/ +func (a *Client) ReadClustersByStatusCount(params *ReadClustersByStatusCountParams, opts ...ClientOption) (*ReadClustersByStatusCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadClustersByStatusCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadClustersByStatusCount", + Method: "GET", + PathPattern: "/container-security/aggregates/clusters/count-by-status/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadClustersByStatusCountReader{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.(*ReadClustersByStatusCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadClustersByStatusCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerCombined retrieves containers identified by the provided filter criteria +*/ +func (a *Client) ReadContainerCombined(params *ReadContainerCombinedParams, opts ...ClientOption) (*ReadContainerCombinedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerCombinedParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerCombined", + Method: "GET", + PathPattern: "/container-security/combined/containers/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerCombinedReader{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.(*ReadContainerCombinedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerCombined: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerCount retrieves container counts +*/ +func (a *Client) ReadContainerCount(params *ReadContainerCountParams, opts ...ClientOption) (*ReadContainerCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerCount", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerCountReader{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.(*ReadContainerCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerCountByRegistry retrieves top container image registries +*/ +func (a *Client) ReadContainerCountByRegistry(params *ReadContainerCountByRegistryParams, opts ...ClientOption) (*ReadContainerCountByRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerCountByRegistryParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerCountByRegistry", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/count-by-registry/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerCountByRegistryReader{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.(*ReadContainerCountByRegistryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerCountByRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerEnrichment retrieves container enrichment data +*/ +func (a *Client) ReadContainerEnrichment(params *ReadContainerEnrichmentParams, opts ...ClientOption) (*ReadContainerEnrichmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/containers/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerEnrichmentReader{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.(*ReadContainerEnrichmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerImageDetectionsCountByDate retrieves count of image assessment detections on running containers over a period of time +*/ +func (a *Client) ReadContainerImageDetectionsCountByDate(params *ReadContainerImageDetectionsCountByDateParams, opts ...ClientOption) (*ReadContainerImageDetectionsCountByDateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerImageDetectionsCountByDateParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerImageDetectionsCountByDate", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/image-detections-count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerImageDetectionsCountByDateReader{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.(*ReadContainerImageDetectionsCountByDateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerImageDetectionsCountByDate: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerImagesByMostUsed buckets container by image digest +*/ +func (a *Client) ReadContainerImagesByMostUsed(params *ReadContainerImagesByMostUsedParams, opts ...ClientOption) (*ReadContainerImagesByMostUsedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerImagesByMostUsedParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerImagesByMostUsed", + Method: "GET", + PathPattern: "/container-security/aggregates/images/most-used/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerImagesByMostUsedReader{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.(*ReadContainerImagesByMostUsedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerImagesByMostUsed: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerImagesByState retrieves count of image states running on containers +*/ +func (a *Client) ReadContainerImagesByState(params *ReadContainerImagesByStateParams, opts ...ClientOption) (*ReadContainerImagesByStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerImagesByStateParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerImagesByState", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/images-by-state/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerImagesByStateReader{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.(*ReadContainerImagesByStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerImagesByState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainerVulnerabilitiesBySeverityCount retrieves container vulnerabilities by severity counts +*/ +func (a *Client) ReadContainerVulnerabilitiesBySeverityCount(params *ReadContainerVulnerabilitiesBySeverityCountParams, opts ...ClientOption) (*ReadContainerVulnerabilitiesBySeverityCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainerVulnerabilitiesBySeverityCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainerVulnerabilitiesBySeverityCount", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/vulnerability-count-by-severity/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainerVulnerabilitiesBySeverityCountReader{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.(*ReadContainerVulnerabilitiesBySeverityCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainerVulnerabilitiesBySeverityCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainersByDateRangeCount retrieves containers by date range counts +*/ +func (a *Client) ReadContainersByDateRangeCount(params *ReadContainersByDateRangeCountParams, opts ...ClientOption) (*ReadContainersByDateRangeCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainersByDateRangeCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainersByDateRangeCount", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainersByDateRangeCountReader{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.(*ReadContainersByDateRangeCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainersByDateRangeCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadContainersSensorCoverage buckets containers by agent type and calculate sensor coverage +*/ +func (a *Client) ReadContainersSensorCoverage(params *ReadContainersSensorCoverageParams, opts ...ClientOption) (*ReadContainersSensorCoverageOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadContainersSensorCoverageParams() + } + op := &runtime.ClientOperation{ + ID: "ReadContainersSensorCoverage", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/sensor-coverage/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadContainersSensorCoverageReader{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.(*ReadContainersSensorCoverageOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadContainersSensorCoverage: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadDeploymentCombined retrieves kubernetes deployments identified by the provided filter criteria +*/ +func (a *Client) ReadDeploymentCombined(params *ReadDeploymentCombinedParams, opts ...ClientOption) (*ReadDeploymentCombinedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadDeploymentCombinedParams() + } + op := &runtime.ClientOperation{ + ID: "ReadDeploymentCombined", + Method: "GET", + PathPattern: "/container-security/combined/deployments/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadDeploymentCombinedReader{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.(*ReadDeploymentCombinedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadDeploymentCombined: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadDeploymentCount retrieves deployment counts +*/ +func (a *Client) ReadDeploymentCount(params *ReadDeploymentCountParams, opts ...ClientOption) (*ReadDeploymentCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadDeploymentCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadDeploymentCount", + Method: "GET", + PathPattern: "/container-security/aggregates/deployments/count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadDeploymentCountReader{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.(*ReadDeploymentCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadDeploymentCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadDeploymentEnrichment retrieves deployment enrichment data +*/ +func (a *Client) ReadDeploymentEnrichment(params *ReadDeploymentEnrichmentParams, opts ...ClientOption) (*ReadDeploymentEnrichmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadDeploymentEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "ReadDeploymentEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/deployments/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadDeploymentEnrichmentReader{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.(*ReadDeploymentEnrichmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadDeploymentEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadDeploymentsByDateRangeCount retrieves deployments by date range counts +*/ +func (a *Client) ReadDeploymentsByDateRangeCount(params *ReadDeploymentsByDateRangeCountParams, opts ...ClientOption) (*ReadDeploymentsByDateRangeCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadDeploymentsByDateRangeCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadDeploymentsByDateRangeCount", + Method: "GET", + PathPattern: "/container-security/aggregates/deployments/count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadDeploymentsByDateRangeCountReader{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.(*ReadDeploymentsByDateRangeCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadDeploymentsByDateRangeCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadDistinctContainerImageCount retrieves count of distinct images running on containers +*/ +func (a *Client) ReadDistinctContainerImageCount(params *ReadDistinctContainerImageCountParams, opts ...ClientOption) (*ReadDistinctContainerImageCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadDistinctContainerImageCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadDistinctContainerImageCount", + Method: "GET", + PathPattern: "/container-security/aggregates/images/count-by-distinct/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadDistinctContainerImageCountReader{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.(*ReadDistinctContainerImageCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadDistinctContainerImageCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadKubernetesIomByDateRange returns the count of kubernetes i o ms by the date by default it s for 7 days +*/ +func (a *Client) ReadKubernetesIomByDateRange(params *ReadKubernetesIomByDateRangeParams, opts ...ClientOption) (*ReadKubernetesIomByDateRangeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadKubernetesIomByDateRangeParams() + } + op := &runtime.ClientOperation{ + ID: "ReadKubernetesIomByDateRange", + Method: "GET", + PathPattern: "/container-security/aggregates/kubernetes-ioms/count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadKubernetesIomByDateRangeReader{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.(*ReadKubernetesIomByDateRangeOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadKubernetesIomByDateRange: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadKubernetesIomCount returns the total count of kubernetes i o ms over the past seven days +*/ +func (a *Client) ReadKubernetesIomCount(params *ReadKubernetesIomCountParams, opts ...ClientOption) (*ReadKubernetesIomCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadKubernetesIomCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadKubernetesIomCount", + Method: "GET", + PathPattern: "/container-security/aggregates/kubernetes-ioms/count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadKubernetesIomCountReader{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.(*ReadKubernetesIomCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadKubernetesIomCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadKubernetesIomEntities retrieves kubernetes i o m entities identified by the provided i ds +*/ +func (a *Client) ReadKubernetesIomEntities(params *ReadKubernetesIomEntitiesParams, opts ...ClientOption) (*ReadKubernetesIomEntitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadKubernetesIomEntitiesParams() + } + op := &runtime.ClientOperation{ + ID: "ReadKubernetesIomEntities", + Method: "GET", + PathPattern: "/container-security/entities/kubernetes-ioms/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadKubernetesIomEntitiesReader{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.(*ReadKubernetesIomEntitiesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadKubernetesIomEntities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadNodeCombined retrieves kubernetes nodes identified by the provided filter criteria +*/ +func (a *Client) ReadNodeCombined(params *ReadNodeCombinedParams, opts ...ClientOption) (*ReadNodeCombinedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadNodeCombinedParams() + } + op := &runtime.ClientOperation{ + ID: "ReadNodeCombined", + Method: "GET", + PathPattern: "/container-security/combined/nodes/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadNodeCombinedReader{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.(*ReadNodeCombinedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadNodeCombined: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadNodeCount retrieves node counts +*/ +func (a *Client) ReadNodeCount(params *ReadNodeCountParams, opts ...ClientOption) (*ReadNodeCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadNodeCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadNodeCount", + Method: "GET", + PathPattern: "/container-security/aggregates/nodes/count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadNodeCountReader{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.(*ReadNodeCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadNodeCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadNodeEnrichment retrieves node enrichment data +*/ +func (a *Client) ReadNodeEnrichment(params *ReadNodeEnrichmentParams, opts ...ClientOption) (*ReadNodeEnrichmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadNodeEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "ReadNodeEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/nodes/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadNodeEnrichmentReader{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.(*ReadNodeEnrichmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadNodeEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadNodesByCloudCount buckets nodes by cloud providers +*/ +func (a *Client) ReadNodesByCloudCount(params *ReadNodesByCloudCountParams, opts ...ClientOption) (*ReadNodesByCloudCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadNodesByCloudCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadNodesByCloudCount", + Method: "GET", + PathPattern: "/container-security/aggregates/nodes/count-by-cloud/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadNodesByCloudCountReader{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.(*ReadNodesByCloudCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadNodesByCloudCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadNodesByContainerEngineVersionCount buckets nodes by their container engine version +*/ +func (a *Client) ReadNodesByContainerEngineVersionCount(params *ReadNodesByContainerEngineVersionCountParams, opts ...ClientOption) (*ReadNodesByContainerEngineVersionCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadNodesByContainerEngineVersionCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadNodesByContainerEngineVersionCount", + Method: "GET", + PathPattern: "/container-security/aggregates/nodes/count-by-container-engine-version/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadNodesByContainerEngineVersionCountReader{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.(*ReadNodesByContainerEngineVersionCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadNodesByContainerEngineVersionCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadNodesByDateRangeCount retrieves nodes by date range counts +*/ +func (a *Client) ReadNodesByDateRangeCount(params *ReadNodesByDateRangeCountParams, opts ...ClientOption) (*ReadNodesByDateRangeCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadNodesByDateRangeCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadNodesByDateRangeCount", + Method: "GET", + PathPattern: "/container-security/aggregates/nodes/count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadNodesByDateRangeCountReader{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.(*ReadNodesByDateRangeCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadNodesByDateRangeCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadPodCombined retrieves kubernetes pods identified by the provided filter criteria +*/ +func (a *Client) ReadPodCombined(params *ReadPodCombinedParams, opts ...ClientOption) (*ReadPodCombinedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadPodCombinedParams() + } + op := &runtime.ClientOperation{ + ID: "ReadPodCombined", + Method: "GET", + PathPattern: "/container-security/combined/pods/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadPodCombinedReader{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.(*ReadPodCombinedOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadPodCombined: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadPodCount retrieves pod counts +*/ +func (a *Client) ReadPodCount(params *ReadPodCountParams, opts ...ClientOption) (*ReadPodCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadPodCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadPodCount", + Method: "GET", + PathPattern: "/container-security/aggregates/pods/count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadPodCountReader{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.(*ReadPodCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadPodCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadPodEnrichment retrieves pod enrichment data +*/ +func (a *Client) ReadPodEnrichment(params *ReadPodEnrichmentParams, opts ...ClientOption) (*ReadPodEnrichmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadPodEnrichmentParams() + } + op := &runtime.ClientOperation{ + ID: "ReadPodEnrichment", + Method: "GET", + PathPattern: "/container-security/aggregates/enrichment/pods/entities/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadPodEnrichmentReader{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.(*ReadPodEnrichmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadPodEnrichment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadPodsByDateRangeCount retrieves pods by date range counts +*/ +func (a *Client) ReadPodsByDateRangeCount(params *ReadPodsByDateRangeCountParams, opts ...ClientOption) (*ReadPodsByDateRangeCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadPodsByDateRangeCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadPodsByDateRangeCount", + Method: "GET", + PathPattern: "/container-security/aggregates/pods/count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadPodsByDateRangeCountReader{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.(*ReadPodsByDateRangeCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadPodsByDateRangeCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadRunningContainerImages retrieves images on running containers +*/ +func (a *Client) ReadRunningContainerImages(params *ReadRunningContainerImagesParams, opts ...ClientOption) (*ReadRunningContainerImagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadRunningContainerImagesParams() + } + op := &runtime.ClientOperation{ + ID: "ReadRunningContainerImages", + Method: "GET", + PathPattern: "/container-security/combined/container-images/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadRunningContainerImagesReader{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.(*ReadRunningContainerImagesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadRunningContainerImages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReadVulnerableContainerImageCount retrieves count of vulnerable images running on containers +*/ +func (a *Client) ReadVulnerableContainerImageCount(params *ReadVulnerableContainerImageCountParams, opts ...ClientOption) (*ReadVulnerableContainerImageCountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReadVulnerableContainerImageCountParams() + } + op := &runtime.ClientOperation{ + ID: "ReadVulnerableContainerImageCount", + Method: "GET", + PathPattern: "/container-security/aggregates/containers/count-vulnerable-images/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReadVulnerableContainerImageCountReader{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.(*ReadVulnerableContainerImageCountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ReadVulnerableContainerImageCount: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RegenerateAPIKey regenerates API key for docker registry integrations +*/ +func (a *Client) RegenerateAPIKey(params *RegenerateAPIKeyParams, opts ...ClientOption) (*RegenerateAPIKeyOK, *RegenerateAPIKeyMultiStatus, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRegenerateAPIKeyParams() + } + op := &runtime.ClientOperation{ + ID: "RegenerateAPIKey", + Method: "POST", + PathPattern: "/kubernetes-protection/entities/integration/api-key/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/octet-stream"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RegenerateAPIKeyReader{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 *RegenerateAPIKeyOK: + return value, nil, nil + case *RegenerateAPIKeyMultiStatus: + 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 kubernetes_protection: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +SearchAndReadKubernetesIomEntities searches kubernetes i o m by the provided search criteria +*/ +func (a *Client) SearchAndReadKubernetesIomEntities(params *SearchAndReadKubernetesIomEntitiesParams, opts ...ClientOption) (*SearchAndReadKubernetesIomEntitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSearchAndReadKubernetesIomEntitiesParams() + } + op := &runtime.ClientOperation{ + ID: "SearchAndReadKubernetesIomEntities", + Method: "GET", + PathPattern: "/container-security/combined/kubernetes-ioms/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SearchAndReadKubernetesIomEntitiesReader{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.(*SearchAndReadKubernetesIomEntitiesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for SearchAndReadKubernetesIomEntities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +SearchKubernetesIoms searches kubernetes i o ms by the provided search criteria this endpoint returns a list of kubernetes i o m u UI ds matching the query +*/ +func (a *Client) SearchKubernetesIoms(params *SearchKubernetesIomsParams, opts ...ClientOption) (*SearchKubernetesIomsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSearchKubernetesIomsParams() + } + op := &runtime.ClientOperation{ + ID: "SearchKubernetesIoms", + Method: "GET", + PathPattern: "/container-security/queries/kubernetes-ioms/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SearchKubernetesIomsReader{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.(*SearchKubernetesIomsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for SearchKubernetesIoms: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/falcon/client/kubernetes_protection/read_cluster_combined_parameters.go b/falcon/client/kubernetes_protection/read_cluster_combined_parameters.go new file mode 100644 index 00000000..a6d767dd --- /dev/null +++ b/falcon/client/kubernetes_protection/read_cluster_combined_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadClusterCombinedParams creates a new ReadClusterCombinedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadClusterCombinedParams() *ReadClusterCombinedParams { + return &ReadClusterCombinedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadClusterCombinedParamsWithTimeout creates a new ReadClusterCombinedParams object +// with the ability to set a timeout on a request. +func NewReadClusterCombinedParamsWithTimeout(timeout time.Duration) *ReadClusterCombinedParams { + return &ReadClusterCombinedParams{ + timeout: timeout, + } +} + +// NewReadClusterCombinedParamsWithContext creates a new ReadClusterCombinedParams object +// with the ability to set a context for a request. +func NewReadClusterCombinedParamsWithContext(ctx context.Context) *ReadClusterCombinedParams { + return &ReadClusterCombinedParams{ + Context: ctx, + } +} + +// NewReadClusterCombinedParamsWithHTTPClient creates a new ReadClusterCombinedParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadClusterCombinedParamsWithHTTPClient(client *http.Client) *ReadClusterCombinedParams { + return &ReadClusterCombinedParams{ + HTTPClient: client, + } +} + +/* +ReadClusterCombinedParams contains all the parameters to send to the API endpoint + + for the read cluster combined operation. + + Typically these are written to a http.Request. +*/ +type ReadClusterCombinedParams 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 + */ + 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. + + Field to sort results by + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read cluster combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClusterCombinedParams) WithDefaults() *ReadClusterCombinedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read cluster combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClusterCombinedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read cluster combined params +func (o *ReadClusterCombinedParams) WithTimeout(timeout time.Duration) *ReadClusterCombinedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read cluster combined params +func (o *ReadClusterCombinedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read cluster combined params +func (o *ReadClusterCombinedParams) WithContext(ctx context.Context) *ReadClusterCombinedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read cluster combined params +func (o *ReadClusterCombinedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read cluster combined params +func (o *ReadClusterCombinedParams) WithHTTPClient(client *http.Client) *ReadClusterCombinedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read cluster combined params +func (o *ReadClusterCombinedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read cluster combined params +func (o *ReadClusterCombinedParams) WithFilter(filter *string) *ReadClusterCombinedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read cluster combined params +func (o *ReadClusterCombinedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the read cluster combined params +func (o *ReadClusterCombinedParams) WithLimit(limit *int64) *ReadClusterCombinedParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read cluster combined params +func (o *ReadClusterCombinedParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the read cluster combined params +func (o *ReadClusterCombinedParams) WithOffset(offset *int64) *ReadClusterCombinedParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the read cluster combined params +func (o *ReadClusterCombinedParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the read cluster combined params +func (o *ReadClusterCombinedParams) WithSort(sort *string) *ReadClusterCombinedParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the read cluster combined params +func (o *ReadClusterCombinedParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadClusterCombinedParams) 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/kubernetes_protection/read_cluster_combined_responses.go b/falcon/client/kubernetes_protection/read_cluster_combined_responses.go new file mode 100644 index 00000000..7e1f7d95 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_cluster_combined_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadClusterCombinedReader is a Reader for the ReadClusterCombined structure. +type ReadClusterCombinedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadClusterCombinedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadClusterCombinedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadClusterCombinedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadClusterCombinedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadClusterCombinedInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/clusters/v1] ReadClusterCombined", response, response.Code()) + } +} + +// NewReadClusterCombinedOK creates a ReadClusterCombinedOK with default headers values +func NewReadClusterCombinedOK() *ReadClusterCombinedOK { + return &ReadClusterCombinedOK{} +} + +/* +ReadClusterCombinedOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadClusterCombinedOK 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.ModelsClusterEntityResponse +} + +// IsSuccess returns true when this read cluster combined o k response has a 2xx status code +func (o *ReadClusterCombinedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read cluster combined o k response has a 3xx status code +func (o *ReadClusterCombinedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster combined o k response has a 4xx status code +func (o *ReadClusterCombinedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read cluster combined o k response has a 5xx status code +func (o *ReadClusterCombinedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster combined o k response a status code equal to that given +func (o *ReadClusterCombinedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read cluster combined o k response +func (o *ReadClusterCombinedOK) Code() int { + return 200 +} + +func (o *ReadClusterCombinedOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadClusterCombinedOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadClusterCombinedOK) GetPayload() *models.ModelsClusterEntityResponse { + return o.Payload +} + +func (o *ReadClusterCombinedOK) 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.ModelsClusterEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadClusterCombinedForbidden creates a ReadClusterCombinedForbidden with default headers values +func NewReadClusterCombinedForbidden() *ReadClusterCombinedForbidden { + return &ReadClusterCombinedForbidden{} +} + +/* +ReadClusterCombinedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadClusterCombinedForbidden 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 cluster combined forbidden response has a 2xx status code +func (o *ReadClusterCombinedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster combined forbidden response has a 3xx status code +func (o *ReadClusterCombinedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster combined forbidden response has a 4xx status code +func (o *ReadClusterCombinedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read cluster combined forbidden response has a 5xx status code +func (o *ReadClusterCombinedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster combined forbidden response a status code equal to that given +func (o *ReadClusterCombinedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read cluster combined forbidden response +func (o *ReadClusterCombinedForbidden) Code() int { + return 403 +} + +func (o *ReadClusterCombinedForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadClusterCombinedForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadClusterCombinedForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClusterCombinedForbidden) 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 +} + +// NewReadClusterCombinedTooManyRequests creates a ReadClusterCombinedTooManyRequests with default headers values +func NewReadClusterCombinedTooManyRequests() *ReadClusterCombinedTooManyRequests { + return &ReadClusterCombinedTooManyRequests{} +} + +/* +ReadClusterCombinedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadClusterCombinedTooManyRequests 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 cluster combined too many requests response has a 2xx status code +func (o *ReadClusterCombinedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster combined too many requests response has a 3xx status code +func (o *ReadClusterCombinedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster combined too many requests response has a 4xx status code +func (o *ReadClusterCombinedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read cluster combined too many requests response has a 5xx status code +func (o *ReadClusterCombinedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster combined too many requests response a status code equal to that given +func (o *ReadClusterCombinedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read cluster combined too many requests response +func (o *ReadClusterCombinedTooManyRequests) Code() int { + return 429 +} + +func (o *ReadClusterCombinedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClusterCombinedTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClusterCombinedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClusterCombinedTooManyRequests) 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 +} + +// NewReadClusterCombinedInternalServerError creates a ReadClusterCombinedInternalServerError with default headers values +func NewReadClusterCombinedInternalServerError() *ReadClusterCombinedInternalServerError { + return &ReadClusterCombinedInternalServerError{} +} + +/* +ReadClusterCombinedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadClusterCombinedInternalServerError 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 cluster combined internal server error response has a 2xx status code +func (o *ReadClusterCombinedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster combined internal server error response has a 3xx status code +func (o *ReadClusterCombinedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster combined internal server error response has a 4xx status code +func (o *ReadClusterCombinedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read cluster combined internal server error response has a 5xx status code +func (o *ReadClusterCombinedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read cluster combined internal server error response a status code equal to that given +func (o *ReadClusterCombinedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read cluster combined internal server error response +func (o *ReadClusterCombinedInternalServerError) Code() int { + return 500 +} + +func (o *ReadClusterCombinedInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClusterCombinedInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/clusters/v1][%d] readClusterCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClusterCombinedInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadClusterCombinedInternalServerError) 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/read_cluster_count_parameters.go b/falcon/client/kubernetes_protection/read_cluster_count_parameters.go new file mode 100644 index 00000000..4fda85e4 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_cluster_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadClusterCountParams creates a new ReadClusterCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadClusterCountParams() *ReadClusterCountParams { + return &ReadClusterCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadClusterCountParamsWithTimeout creates a new ReadClusterCountParams object +// with the ability to set a timeout on a request. +func NewReadClusterCountParamsWithTimeout(timeout time.Duration) *ReadClusterCountParams { + return &ReadClusterCountParams{ + timeout: timeout, + } +} + +// NewReadClusterCountParamsWithContext creates a new ReadClusterCountParams object +// with the ability to set a context for a request. +func NewReadClusterCountParamsWithContext(ctx context.Context) *ReadClusterCountParams { + return &ReadClusterCountParams{ + Context: ctx, + } +} + +// NewReadClusterCountParamsWithHTTPClient creates a new ReadClusterCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadClusterCountParamsWithHTTPClient(client *http.Client) *ReadClusterCountParams { + return &ReadClusterCountParams{ + HTTPClient: client, + } +} + +/* +ReadClusterCountParams contains all the parameters to send to the API endpoint + + for the read cluster count operation. + + Typically these are written to a http.Request. +*/ +type ReadClusterCountParams 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 + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read cluster count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClusterCountParams) WithDefaults() *ReadClusterCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read cluster count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClusterCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read cluster count params +func (o *ReadClusterCountParams) WithTimeout(timeout time.Duration) *ReadClusterCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read cluster count params +func (o *ReadClusterCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read cluster count params +func (o *ReadClusterCountParams) WithContext(ctx context.Context) *ReadClusterCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read cluster count params +func (o *ReadClusterCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read cluster count params +func (o *ReadClusterCountParams) WithHTTPClient(client *http.Client) *ReadClusterCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read cluster count params +func (o *ReadClusterCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read cluster count params +func (o *ReadClusterCountParams) WithFilter(filter *string) *ReadClusterCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read cluster count params +func (o *ReadClusterCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadClusterCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_cluster_count_responses.go b/falcon/client/kubernetes_protection/read_cluster_count_responses.go new file mode 100644 index 00000000..e93170ab --- /dev/null +++ b/falcon/client/kubernetes_protection/read_cluster_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadClusterCountReader is a Reader for the ReadClusterCount structure. +type ReadClusterCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadClusterCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadClusterCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadClusterCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadClusterCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadClusterCountInternalServerError() + 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/clusters/count/v1] ReadClusterCount", response, response.Code()) + } +} + +// NewReadClusterCountOK creates a ReadClusterCountOK with default headers values +func NewReadClusterCountOK() *ReadClusterCountOK { + return &ReadClusterCountOK{} +} + +/* +ReadClusterCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadClusterCountOK 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.CommonCountResponse +} + +// IsSuccess returns true when this read cluster count o k response has a 2xx status code +func (o *ReadClusterCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read cluster count o k response has a 3xx status code +func (o *ReadClusterCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster count o k response has a 4xx status code +func (o *ReadClusterCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read cluster count o k response has a 5xx status code +func (o *ReadClusterCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster count o k response a status code equal to that given +func (o *ReadClusterCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read cluster count o k response +func (o *ReadClusterCountOK) Code() int { + return 200 +} + +func (o *ReadClusterCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountOK %+v", 200, o.Payload) +} + +func (o *ReadClusterCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountOK %+v", 200, o.Payload) +} + +func (o *ReadClusterCountOK) GetPayload() *models.CommonCountResponse { + return o.Payload +} + +func (o *ReadClusterCountOK) 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.CommonCountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadClusterCountForbidden creates a ReadClusterCountForbidden with default headers values +func NewReadClusterCountForbidden() *ReadClusterCountForbidden { + return &ReadClusterCountForbidden{} +} + +/* +ReadClusterCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadClusterCountForbidden 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 cluster count forbidden response has a 2xx status code +func (o *ReadClusterCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster count forbidden response has a 3xx status code +func (o *ReadClusterCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster count forbidden response has a 4xx status code +func (o *ReadClusterCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read cluster count forbidden response has a 5xx status code +func (o *ReadClusterCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster count forbidden response a status code equal to that given +func (o *ReadClusterCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read cluster count forbidden response +func (o *ReadClusterCountForbidden) Code() int { + return 403 +} + +func (o *ReadClusterCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClusterCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClusterCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClusterCountForbidden) 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 +} + +// NewReadClusterCountTooManyRequests creates a ReadClusterCountTooManyRequests with default headers values +func NewReadClusterCountTooManyRequests() *ReadClusterCountTooManyRequests { + return &ReadClusterCountTooManyRequests{} +} + +/* +ReadClusterCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadClusterCountTooManyRequests 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 cluster count too many requests response has a 2xx status code +func (o *ReadClusterCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster count too many requests response has a 3xx status code +func (o *ReadClusterCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster count too many requests response has a 4xx status code +func (o *ReadClusterCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read cluster count too many requests response has a 5xx status code +func (o *ReadClusterCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster count too many requests response a status code equal to that given +func (o *ReadClusterCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read cluster count too many requests response +func (o *ReadClusterCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadClusterCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClusterCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClusterCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClusterCountTooManyRequests) 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 +} + +// NewReadClusterCountInternalServerError creates a ReadClusterCountInternalServerError with default headers values +func NewReadClusterCountInternalServerError() *ReadClusterCountInternalServerError { + return &ReadClusterCountInternalServerError{} +} + +/* +ReadClusterCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadClusterCountInternalServerError 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 cluster count internal server error response has a 2xx status code +func (o *ReadClusterCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster count internal server error response has a 3xx status code +func (o *ReadClusterCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster count internal server error response has a 4xx status code +func (o *ReadClusterCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read cluster count internal server error response has a 5xx status code +func (o *ReadClusterCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read cluster count internal server error response a status code equal to that given +func (o *ReadClusterCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read cluster count internal server error response +func (o *ReadClusterCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadClusterCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClusterCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count/v1][%d] readClusterCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClusterCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadClusterCountInternalServerError) 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/read_cluster_enrichment_parameters.go b/falcon/client/kubernetes_protection/read_cluster_enrichment_parameters.go new file mode 100644 index 00000000..0e668920 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_cluster_enrichment_parameters.go @@ -0,0 +1,209 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadClusterEnrichmentParams creates a new ReadClusterEnrichmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadClusterEnrichmentParams() *ReadClusterEnrichmentParams { + return &ReadClusterEnrichmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadClusterEnrichmentParamsWithTimeout creates a new ReadClusterEnrichmentParams object +// with the ability to set a timeout on a request. +func NewReadClusterEnrichmentParamsWithTimeout(timeout time.Duration) *ReadClusterEnrichmentParams { + return &ReadClusterEnrichmentParams{ + timeout: timeout, + } +} + +// NewReadClusterEnrichmentParamsWithContext creates a new ReadClusterEnrichmentParams object +// with the ability to set a context for a request. +func NewReadClusterEnrichmentParamsWithContext(ctx context.Context) *ReadClusterEnrichmentParams { + return &ReadClusterEnrichmentParams{ + Context: ctx, + } +} + +// NewReadClusterEnrichmentParamsWithHTTPClient creates a new ReadClusterEnrichmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadClusterEnrichmentParamsWithHTTPClient(client *http.Client) *ReadClusterEnrichmentParams { + return &ReadClusterEnrichmentParams{ + HTTPClient: client, + } +} + +/* +ReadClusterEnrichmentParams contains all the parameters to send to the API endpoint + + for the read cluster enrichment operation. + + Typically these are written to a http.Request. +*/ +type ReadClusterEnrichmentParams struct { + + /* ClusterID. + + One or more cluster ids for which to retrieve enrichment info + */ + ClusterID []string + + /* Filter. + + Supported filters: last_seen + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read cluster enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClusterEnrichmentParams) WithDefaults() *ReadClusterEnrichmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read cluster enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClusterEnrichmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) WithTimeout(timeout time.Duration) *ReadClusterEnrichmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) WithContext(ctx context.Context) *ReadClusterEnrichmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) WithHTTPClient(client *http.Client) *ReadClusterEnrichmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) WithClusterID(clusterID []string) *ReadClusterEnrichmentParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) SetClusterID(clusterID []string) { + o.ClusterID = clusterID +} + +// WithFilter adds the filter to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) WithFilter(filter *string) *ReadClusterEnrichmentParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read cluster enrichment params +func (o *ReadClusterEnrichmentParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadClusterEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ClusterID != nil { + + // binding items for cluster_id + joinedClusterID := o.bindParamClusterID(reg) + + // query array param cluster_id + if err := r.SetQueryParam("cluster_id", joinedClusterID...); 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 +} + +// bindParamReadClusterEnrichment binds the parameter cluster_id +func (o *ReadClusterEnrichmentParams) bindParamClusterID(formats strfmt.Registry) []string { + clusterIDIR := o.ClusterID + + var clusterIDIC []string + for _, clusterIDIIR := range clusterIDIR { // explode []string + + clusterIDIIV := clusterIDIIR // string as string + clusterIDIC = append(clusterIDIC, clusterIDIIV) + } + + // items.CollectionFormat: "csv" + clusterIDIS := swag.JoinByFormat(clusterIDIC, "csv") + + return clusterIDIS +} diff --git a/falcon/client/kubernetes_protection/read_cluster_enrichment_responses.go b/falcon/client/kubernetes_protection/read_cluster_enrichment_responses.go new file mode 100644 index 00000000..e52b9beb --- /dev/null +++ b/falcon/client/kubernetes_protection/read_cluster_enrichment_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadClusterEnrichmentReader is a Reader for the ReadClusterEnrichment structure. +type ReadClusterEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadClusterEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadClusterEnrichmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadClusterEnrichmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadClusterEnrichmentTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadClusterEnrichmentInternalServerError() + 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/clusters/entities/v1] ReadClusterEnrichment", response, response.Code()) + } +} + +// NewReadClusterEnrichmentOK creates a ReadClusterEnrichmentOK with default headers values +func NewReadClusterEnrichmentOK() *ReadClusterEnrichmentOK { + return &ReadClusterEnrichmentOK{} +} + +/* +ReadClusterEnrichmentOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadClusterEnrichmentOK 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.K8sassetsClusterEnrichmentResponse +} + +// IsSuccess returns true when this read cluster enrichment o k response has a 2xx status code +func (o *ReadClusterEnrichmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read cluster enrichment o k response has a 3xx status code +func (o *ReadClusterEnrichmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster enrichment o k response has a 4xx status code +func (o *ReadClusterEnrichmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read cluster enrichment o k response has a 5xx status code +func (o *ReadClusterEnrichmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster enrichment o k response a status code equal to that given +func (o *ReadClusterEnrichmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read cluster enrichment o k response +func (o *ReadClusterEnrichmentOK) Code() int { + return 200 +} + +func (o *ReadClusterEnrichmentOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadClusterEnrichmentOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadClusterEnrichmentOK) GetPayload() *models.K8sassetsClusterEnrichmentResponse { + return o.Payload +} + +func (o *ReadClusterEnrichmentOK) 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.K8sassetsClusterEnrichmentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadClusterEnrichmentForbidden creates a ReadClusterEnrichmentForbidden with default headers values +func NewReadClusterEnrichmentForbidden() *ReadClusterEnrichmentForbidden { + return &ReadClusterEnrichmentForbidden{} +} + +/* +ReadClusterEnrichmentForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadClusterEnrichmentForbidden 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 cluster enrichment forbidden response has a 2xx status code +func (o *ReadClusterEnrichmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster enrichment forbidden response has a 3xx status code +func (o *ReadClusterEnrichmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster enrichment forbidden response has a 4xx status code +func (o *ReadClusterEnrichmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read cluster enrichment forbidden response has a 5xx status code +func (o *ReadClusterEnrichmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster enrichment forbidden response a status code equal to that given +func (o *ReadClusterEnrichmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read cluster enrichment forbidden response +func (o *ReadClusterEnrichmentForbidden) Code() int { + return 403 +} + +func (o *ReadClusterEnrichmentForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadClusterEnrichmentForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadClusterEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClusterEnrichmentForbidden) 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 +} + +// NewReadClusterEnrichmentTooManyRequests creates a ReadClusterEnrichmentTooManyRequests with default headers values +func NewReadClusterEnrichmentTooManyRequests() *ReadClusterEnrichmentTooManyRequests { + return &ReadClusterEnrichmentTooManyRequests{} +} + +/* +ReadClusterEnrichmentTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadClusterEnrichmentTooManyRequests 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 cluster enrichment too many requests response has a 2xx status code +func (o *ReadClusterEnrichmentTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster enrichment too many requests response has a 3xx status code +func (o *ReadClusterEnrichmentTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster enrichment too many requests response has a 4xx status code +func (o *ReadClusterEnrichmentTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read cluster enrichment too many requests response has a 5xx status code +func (o *ReadClusterEnrichmentTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read cluster enrichment too many requests response a status code equal to that given +func (o *ReadClusterEnrichmentTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read cluster enrichment too many requests response +func (o *ReadClusterEnrichmentTooManyRequests) Code() int { + return 429 +} + +func (o *ReadClusterEnrichmentTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClusterEnrichmentTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClusterEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClusterEnrichmentTooManyRequests) 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 +} + +// NewReadClusterEnrichmentInternalServerError creates a ReadClusterEnrichmentInternalServerError with default headers values +func NewReadClusterEnrichmentInternalServerError() *ReadClusterEnrichmentInternalServerError { + return &ReadClusterEnrichmentInternalServerError{} +} + +/* +ReadClusterEnrichmentInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadClusterEnrichmentInternalServerError 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 cluster enrichment internal server error response has a 2xx status code +func (o *ReadClusterEnrichmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read cluster enrichment internal server error response has a 3xx status code +func (o *ReadClusterEnrichmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read cluster enrichment internal server error response has a 4xx status code +func (o *ReadClusterEnrichmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read cluster enrichment internal server error response has a 5xx status code +func (o *ReadClusterEnrichmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read cluster enrichment internal server error response a status code equal to that given +func (o *ReadClusterEnrichmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read cluster enrichment internal server error response +func (o *ReadClusterEnrichmentInternalServerError) Code() int { + return 500 +} + +func (o *ReadClusterEnrichmentInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClusterEnrichmentInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/clusters/entities/v1][%d] readClusterEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClusterEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadClusterEnrichmentInternalServerError) 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/read_clusters_by_date_range_count_parameters.go b/falcon/client/kubernetes_protection/read_clusters_by_date_range_count_parameters.go new file mode 100644 index 00000000..d1f9aa56 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_clusters_by_date_range_count_parameters.go @@ -0,0 +1,128 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadClustersByDateRangeCountParams creates a new ReadClustersByDateRangeCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadClustersByDateRangeCountParams() *ReadClustersByDateRangeCountParams { + return &ReadClustersByDateRangeCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadClustersByDateRangeCountParamsWithTimeout creates a new ReadClustersByDateRangeCountParams object +// with the ability to set a timeout on a request. +func NewReadClustersByDateRangeCountParamsWithTimeout(timeout time.Duration) *ReadClustersByDateRangeCountParams { + return &ReadClustersByDateRangeCountParams{ + timeout: timeout, + } +} + +// NewReadClustersByDateRangeCountParamsWithContext creates a new ReadClustersByDateRangeCountParams object +// with the ability to set a context for a request. +func NewReadClustersByDateRangeCountParamsWithContext(ctx context.Context) *ReadClustersByDateRangeCountParams { + return &ReadClustersByDateRangeCountParams{ + Context: ctx, + } +} + +// NewReadClustersByDateRangeCountParamsWithHTTPClient creates a new ReadClustersByDateRangeCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadClustersByDateRangeCountParamsWithHTTPClient(client *http.Client) *ReadClustersByDateRangeCountParams { + return &ReadClustersByDateRangeCountParams{ + HTTPClient: client, + } +} + +/* +ReadClustersByDateRangeCountParams contains all the parameters to send to the API endpoint + + for the read clusters by date range count operation. + + Typically these are written to a http.Request. +*/ +type ReadClustersByDateRangeCountParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read clusters by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClustersByDateRangeCountParams) WithDefaults() *ReadClustersByDateRangeCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read clusters by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClustersByDateRangeCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read clusters by date range count params +func (o *ReadClustersByDateRangeCountParams) WithTimeout(timeout time.Duration) *ReadClustersByDateRangeCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read clusters by date range count params +func (o *ReadClustersByDateRangeCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read clusters by date range count params +func (o *ReadClustersByDateRangeCountParams) WithContext(ctx context.Context) *ReadClustersByDateRangeCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read clusters by date range count params +func (o *ReadClustersByDateRangeCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read clusters by date range count params +func (o *ReadClustersByDateRangeCountParams) WithHTTPClient(client *http.Client) *ReadClustersByDateRangeCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read clusters by date range count params +func (o *ReadClustersByDateRangeCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadClustersByDateRangeCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_clusters_by_date_range_count_responses.go b/falcon/client/kubernetes_protection/read_clusters_by_date_range_count_responses.go new file mode 100644 index 00000000..ba1c662f --- /dev/null +++ b/falcon/client/kubernetes_protection/read_clusters_by_date_range_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadClustersByDateRangeCountReader is a Reader for the ReadClustersByDateRangeCount structure. +type ReadClustersByDateRangeCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadClustersByDateRangeCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadClustersByDateRangeCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadClustersByDateRangeCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadClustersByDateRangeCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadClustersByDateRangeCountInternalServerError() + 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/clusters/count-by-date/v1] ReadClustersByDateRangeCount", response, response.Code()) + } +} + +// NewReadClustersByDateRangeCountOK creates a ReadClustersByDateRangeCountOK with default headers values +func NewReadClustersByDateRangeCountOK() *ReadClustersByDateRangeCountOK { + return &ReadClustersByDateRangeCountOK{} +} + +/* +ReadClustersByDateRangeCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadClustersByDateRangeCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read clusters by date range count o k response has a 2xx status code +func (o *ReadClustersByDateRangeCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read clusters by date range count o k response has a 3xx status code +func (o *ReadClustersByDateRangeCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by date range count o k response has a 4xx status code +func (o *ReadClustersByDateRangeCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read clusters by date range count o k response has a 5xx status code +func (o *ReadClustersByDateRangeCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by date range count o k response a status code equal to that given +func (o *ReadClustersByDateRangeCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read clusters by date range count o k response +func (o *ReadClustersByDateRangeCountOK) Code() int { + return 200 +} + +func (o *ReadClustersByDateRangeCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadClustersByDateRangeCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadClustersByDateRangeCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadClustersByDateRangeCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadClustersByDateRangeCountForbidden creates a ReadClustersByDateRangeCountForbidden with default headers values +func NewReadClustersByDateRangeCountForbidden() *ReadClustersByDateRangeCountForbidden { + return &ReadClustersByDateRangeCountForbidden{} +} + +/* +ReadClustersByDateRangeCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadClustersByDateRangeCountForbidden 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 clusters by date range count forbidden response has a 2xx status code +func (o *ReadClustersByDateRangeCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by date range count forbidden response has a 3xx status code +func (o *ReadClustersByDateRangeCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by date range count forbidden response has a 4xx status code +func (o *ReadClustersByDateRangeCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read clusters by date range count forbidden response has a 5xx status code +func (o *ReadClustersByDateRangeCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by date range count forbidden response a status code equal to that given +func (o *ReadClustersByDateRangeCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read clusters by date range count forbidden response +func (o *ReadClustersByDateRangeCountForbidden) Code() int { + return 403 +} + +func (o *ReadClustersByDateRangeCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClustersByDateRangeCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClustersByDateRangeCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClustersByDateRangeCountForbidden) 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 +} + +// NewReadClustersByDateRangeCountTooManyRequests creates a ReadClustersByDateRangeCountTooManyRequests with default headers values +func NewReadClustersByDateRangeCountTooManyRequests() *ReadClustersByDateRangeCountTooManyRequests { + return &ReadClustersByDateRangeCountTooManyRequests{} +} + +/* +ReadClustersByDateRangeCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadClustersByDateRangeCountTooManyRequests 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 clusters by date range count too many requests response has a 2xx status code +func (o *ReadClustersByDateRangeCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by date range count too many requests response has a 3xx status code +func (o *ReadClustersByDateRangeCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by date range count too many requests response has a 4xx status code +func (o *ReadClustersByDateRangeCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read clusters by date range count too many requests response has a 5xx status code +func (o *ReadClustersByDateRangeCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by date range count too many requests response a status code equal to that given +func (o *ReadClustersByDateRangeCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read clusters by date range count too many requests response +func (o *ReadClustersByDateRangeCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadClustersByDateRangeCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClustersByDateRangeCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClustersByDateRangeCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClustersByDateRangeCountTooManyRequests) 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 +} + +// NewReadClustersByDateRangeCountInternalServerError creates a ReadClustersByDateRangeCountInternalServerError with default headers values +func NewReadClustersByDateRangeCountInternalServerError() *ReadClustersByDateRangeCountInternalServerError { + return &ReadClustersByDateRangeCountInternalServerError{} +} + +/* +ReadClustersByDateRangeCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadClustersByDateRangeCountInternalServerError 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 clusters by date range count internal server error response has a 2xx status code +func (o *ReadClustersByDateRangeCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by date range count internal server error response has a 3xx status code +func (o *ReadClustersByDateRangeCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by date range count internal server error response has a 4xx status code +func (o *ReadClustersByDateRangeCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read clusters by date range count internal server error response has a 5xx status code +func (o *ReadClustersByDateRangeCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read clusters by date range count internal server error response a status code equal to that given +func (o *ReadClustersByDateRangeCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read clusters by date range count internal server error response +func (o *ReadClustersByDateRangeCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadClustersByDateRangeCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClustersByDateRangeCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-date/v1][%d] readClustersByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClustersByDateRangeCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadClustersByDateRangeCountInternalServerError) 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/read_clusters_by_kubernetes_version_count_parameters.go b/falcon/client/kubernetes_protection/read_clusters_by_kubernetes_version_count_parameters.go new file mode 100644 index 00000000..4d94f074 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_clusters_by_kubernetes_version_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadClustersByKubernetesVersionCountParams creates a new ReadClustersByKubernetesVersionCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadClustersByKubernetesVersionCountParams() *ReadClustersByKubernetesVersionCountParams { + return &ReadClustersByKubernetesVersionCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadClustersByKubernetesVersionCountParamsWithTimeout creates a new ReadClustersByKubernetesVersionCountParams object +// with the ability to set a timeout on a request. +func NewReadClustersByKubernetesVersionCountParamsWithTimeout(timeout time.Duration) *ReadClustersByKubernetesVersionCountParams { + return &ReadClustersByKubernetesVersionCountParams{ + timeout: timeout, + } +} + +// NewReadClustersByKubernetesVersionCountParamsWithContext creates a new ReadClustersByKubernetesVersionCountParams object +// with the ability to set a context for a request. +func NewReadClustersByKubernetesVersionCountParamsWithContext(ctx context.Context) *ReadClustersByKubernetesVersionCountParams { + return &ReadClustersByKubernetesVersionCountParams{ + Context: ctx, + } +} + +// NewReadClustersByKubernetesVersionCountParamsWithHTTPClient creates a new ReadClustersByKubernetesVersionCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadClustersByKubernetesVersionCountParamsWithHTTPClient(client *http.Client) *ReadClustersByKubernetesVersionCountParams { + return &ReadClustersByKubernetesVersionCountParams{ + HTTPClient: client, + } +} + +/* +ReadClustersByKubernetesVersionCountParams contains all the parameters to send to the API endpoint + + for the read clusters by kubernetes version count operation. + + Typically these are written to a http.Request. +*/ +type ReadClustersByKubernetesVersionCountParams 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 + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read clusters by kubernetes version count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClustersByKubernetesVersionCountParams) WithDefaults() *ReadClustersByKubernetesVersionCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read clusters by kubernetes version count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClustersByKubernetesVersionCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) WithTimeout(timeout time.Duration) *ReadClustersByKubernetesVersionCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) WithContext(ctx context.Context) *ReadClustersByKubernetesVersionCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) WithHTTPClient(client *http.Client) *ReadClustersByKubernetesVersionCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) WithFilter(filter *string) *ReadClustersByKubernetesVersionCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read clusters by kubernetes version count params +func (o *ReadClustersByKubernetesVersionCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadClustersByKubernetesVersionCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_clusters_by_kubernetes_version_count_responses.go b/falcon/client/kubernetes_protection/read_clusters_by_kubernetes_version_count_responses.go new file mode 100644 index 00000000..7cf29696 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_clusters_by_kubernetes_version_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadClustersByKubernetesVersionCountReader is a Reader for the ReadClustersByKubernetesVersionCount structure. +type ReadClustersByKubernetesVersionCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadClustersByKubernetesVersionCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadClustersByKubernetesVersionCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadClustersByKubernetesVersionCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadClustersByKubernetesVersionCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadClustersByKubernetesVersionCountInternalServerError() + 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/clusters/count-by-kubernetes-version/v1] ReadClustersByKubernetesVersionCount", response, response.Code()) + } +} + +// NewReadClustersByKubernetesVersionCountOK creates a ReadClustersByKubernetesVersionCountOK with default headers values +func NewReadClustersByKubernetesVersionCountOK() *ReadClustersByKubernetesVersionCountOK { + return &ReadClustersByKubernetesVersionCountOK{} +} + +/* +ReadClustersByKubernetesVersionCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadClustersByKubernetesVersionCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read clusters by kubernetes version count o k response has a 2xx status code +func (o *ReadClustersByKubernetesVersionCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read clusters by kubernetes version count o k response has a 3xx status code +func (o *ReadClustersByKubernetesVersionCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by kubernetes version count o k response has a 4xx status code +func (o *ReadClustersByKubernetesVersionCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read clusters by kubernetes version count o k response has a 5xx status code +func (o *ReadClustersByKubernetesVersionCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by kubernetes version count o k response a status code equal to that given +func (o *ReadClustersByKubernetesVersionCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read clusters by kubernetes version count o k response +func (o *ReadClustersByKubernetesVersionCountOK) Code() int { + return 200 +} + +func (o *ReadClustersByKubernetesVersionCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountOK %+v", 200, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountOK %+v", 200, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadClustersByKubernetesVersionCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadClustersByKubernetesVersionCountForbidden creates a ReadClustersByKubernetesVersionCountForbidden with default headers values +func NewReadClustersByKubernetesVersionCountForbidden() *ReadClustersByKubernetesVersionCountForbidden { + return &ReadClustersByKubernetesVersionCountForbidden{} +} + +/* +ReadClustersByKubernetesVersionCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadClustersByKubernetesVersionCountForbidden 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 clusters by kubernetes version count forbidden response has a 2xx status code +func (o *ReadClustersByKubernetesVersionCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by kubernetes version count forbidden response has a 3xx status code +func (o *ReadClustersByKubernetesVersionCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by kubernetes version count forbidden response has a 4xx status code +func (o *ReadClustersByKubernetesVersionCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read clusters by kubernetes version count forbidden response has a 5xx status code +func (o *ReadClustersByKubernetesVersionCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by kubernetes version count forbidden response a status code equal to that given +func (o *ReadClustersByKubernetesVersionCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read clusters by kubernetes version count forbidden response +func (o *ReadClustersByKubernetesVersionCountForbidden) Code() int { + return 403 +} + +func (o *ReadClustersByKubernetesVersionCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClustersByKubernetesVersionCountForbidden) 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 +} + +// NewReadClustersByKubernetesVersionCountTooManyRequests creates a ReadClustersByKubernetesVersionCountTooManyRequests with default headers values +func NewReadClustersByKubernetesVersionCountTooManyRequests() *ReadClustersByKubernetesVersionCountTooManyRequests { + return &ReadClustersByKubernetesVersionCountTooManyRequests{} +} + +/* +ReadClustersByKubernetesVersionCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadClustersByKubernetesVersionCountTooManyRequests 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 clusters by kubernetes version count too many requests response has a 2xx status code +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by kubernetes version count too many requests response has a 3xx status code +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by kubernetes version count too many requests response has a 4xx status code +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read clusters by kubernetes version count too many requests response has a 5xx status code +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by kubernetes version count too many requests response a status code equal to that given +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read clusters by kubernetes version count too many requests response +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClustersByKubernetesVersionCountTooManyRequests) 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 +} + +// NewReadClustersByKubernetesVersionCountInternalServerError creates a ReadClustersByKubernetesVersionCountInternalServerError with default headers values +func NewReadClustersByKubernetesVersionCountInternalServerError() *ReadClustersByKubernetesVersionCountInternalServerError { + return &ReadClustersByKubernetesVersionCountInternalServerError{} +} + +/* +ReadClustersByKubernetesVersionCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadClustersByKubernetesVersionCountInternalServerError 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 clusters by kubernetes version count internal server error response has a 2xx status code +func (o *ReadClustersByKubernetesVersionCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by kubernetes version count internal server error response has a 3xx status code +func (o *ReadClustersByKubernetesVersionCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by kubernetes version count internal server error response has a 4xx status code +func (o *ReadClustersByKubernetesVersionCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read clusters by kubernetes version count internal server error response has a 5xx status code +func (o *ReadClustersByKubernetesVersionCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read clusters by kubernetes version count internal server error response a status code equal to that given +func (o *ReadClustersByKubernetesVersionCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read clusters by kubernetes version count internal server error response +func (o *ReadClustersByKubernetesVersionCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadClustersByKubernetesVersionCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-kubernetes-version/v1][%d] readClustersByKubernetesVersionCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClustersByKubernetesVersionCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadClustersByKubernetesVersionCountInternalServerError) 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/read_clusters_by_status_count_parameters.go b/falcon/client/kubernetes_protection/read_clusters_by_status_count_parameters.go new file mode 100644 index 00000000..1be80b08 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_clusters_by_status_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadClustersByStatusCountParams creates a new ReadClustersByStatusCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadClustersByStatusCountParams() *ReadClustersByStatusCountParams { + return &ReadClustersByStatusCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadClustersByStatusCountParamsWithTimeout creates a new ReadClustersByStatusCountParams object +// with the ability to set a timeout on a request. +func NewReadClustersByStatusCountParamsWithTimeout(timeout time.Duration) *ReadClustersByStatusCountParams { + return &ReadClustersByStatusCountParams{ + timeout: timeout, + } +} + +// NewReadClustersByStatusCountParamsWithContext creates a new ReadClustersByStatusCountParams object +// with the ability to set a context for a request. +func NewReadClustersByStatusCountParamsWithContext(ctx context.Context) *ReadClustersByStatusCountParams { + return &ReadClustersByStatusCountParams{ + Context: ctx, + } +} + +// NewReadClustersByStatusCountParamsWithHTTPClient creates a new ReadClustersByStatusCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadClustersByStatusCountParamsWithHTTPClient(client *http.Client) *ReadClustersByStatusCountParams { + return &ReadClustersByStatusCountParams{ + HTTPClient: client, + } +} + +/* +ReadClustersByStatusCountParams contains all the parameters to send to the API endpoint + + for the read clusters by status count operation. + + Typically these are written to a http.Request. +*/ +type ReadClustersByStatusCountParams 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 + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read clusters by status count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClustersByStatusCountParams) WithDefaults() *ReadClustersByStatusCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read clusters by status count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadClustersByStatusCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) WithTimeout(timeout time.Duration) *ReadClustersByStatusCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) WithContext(ctx context.Context) *ReadClustersByStatusCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) WithHTTPClient(client *http.Client) *ReadClustersByStatusCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) WithFilter(filter *string) *ReadClustersByStatusCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read clusters by status count params +func (o *ReadClustersByStatusCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadClustersByStatusCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_clusters_by_status_count_responses.go b/falcon/client/kubernetes_protection/read_clusters_by_status_count_responses.go new file mode 100644 index 00000000..2f5a3669 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_clusters_by_status_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadClustersByStatusCountReader is a Reader for the ReadClustersByStatusCount structure. +type ReadClustersByStatusCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadClustersByStatusCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadClustersByStatusCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadClustersByStatusCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadClustersByStatusCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadClustersByStatusCountInternalServerError() + 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/clusters/count-by-status/v1] ReadClustersByStatusCount", response, response.Code()) + } +} + +// NewReadClustersByStatusCountOK creates a ReadClustersByStatusCountOK with default headers values +func NewReadClustersByStatusCountOK() *ReadClustersByStatusCountOK { + return &ReadClustersByStatusCountOK{} +} + +/* +ReadClustersByStatusCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadClustersByStatusCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read clusters by status count o k response has a 2xx status code +func (o *ReadClustersByStatusCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read clusters by status count o k response has a 3xx status code +func (o *ReadClustersByStatusCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by status count o k response has a 4xx status code +func (o *ReadClustersByStatusCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read clusters by status count o k response has a 5xx status code +func (o *ReadClustersByStatusCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by status count o k response a status code equal to that given +func (o *ReadClustersByStatusCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read clusters by status count o k response +func (o *ReadClustersByStatusCountOK) Code() int { + return 200 +} + +func (o *ReadClustersByStatusCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountOK %+v", 200, o.Payload) +} + +func (o *ReadClustersByStatusCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountOK %+v", 200, o.Payload) +} + +func (o *ReadClustersByStatusCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadClustersByStatusCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadClustersByStatusCountForbidden creates a ReadClustersByStatusCountForbidden with default headers values +func NewReadClustersByStatusCountForbidden() *ReadClustersByStatusCountForbidden { + return &ReadClustersByStatusCountForbidden{} +} + +/* +ReadClustersByStatusCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadClustersByStatusCountForbidden 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 clusters by status count forbidden response has a 2xx status code +func (o *ReadClustersByStatusCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by status count forbidden response has a 3xx status code +func (o *ReadClustersByStatusCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by status count forbidden response has a 4xx status code +func (o *ReadClustersByStatusCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read clusters by status count forbidden response has a 5xx status code +func (o *ReadClustersByStatusCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by status count forbidden response a status code equal to that given +func (o *ReadClustersByStatusCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read clusters by status count forbidden response +func (o *ReadClustersByStatusCountForbidden) Code() int { + return 403 +} + +func (o *ReadClustersByStatusCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClustersByStatusCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadClustersByStatusCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClustersByStatusCountForbidden) 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 +} + +// NewReadClustersByStatusCountTooManyRequests creates a ReadClustersByStatusCountTooManyRequests with default headers values +func NewReadClustersByStatusCountTooManyRequests() *ReadClustersByStatusCountTooManyRequests { + return &ReadClustersByStatusCountTooManyRequests{} +} + +/* +ReadClustersByStatusCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadClustersByStatusCountTooManyRequests 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 clusters by status count too many requests response has a 2xx status code +func (o *ReadClustersByStatusCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by status count too many requests response has a 3xx status code +func (o *ReadClustersByStatusCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by status count too many requests response has a 4xx status code +func (o *ReadClustersByStatusCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read clusters by status count too many requests response has a 5xx status code +func (o *ReadClustersByStatusCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read clusters by status count too many requests response a status code equal to that given +func (o *ReadClustersByStatusCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read clusters by status count too many requests response +func (o *ReadClustersByStatusCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadClustersByStatusCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClustersByStatusCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadClustersByStatusCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadClustersByStatusCountTooManyRequests) 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 +} + +// NewReadClustersByStatusCountInternalServerError creates a ReadClustersByStatusCountInternalServerError with default headers values +func NewReadClustersByStatusCountInternalServerError() *ReadClustersByStatusCountInternalServerError { + return &ReadClustersByStatusCountInternalServerError{} +} + +/* +ReadClustersByStatusCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadClustersByStatusCountInternalServerError 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 clusters by status count internal server error response has a 2xx status code +func (o *ReadClustersByStatusCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read clusters by status count internal server error response has a 3xx status code +func (o *ReadClustersByStatusCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read clusters by status count internal server error response has a 4xx status code +func (o *ReadClustersByStatusCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read clusters by status count internal server error response has a 5xx status code +func (o *ReadClustersByStatusCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read clusters by status count internal server error response a status code equal to that given +func (o *ReadClustersByStatusCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read clusters by status count internal server error response +func (o *ReadClustersByStatusCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadClustersByStatusCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClustersByStatusCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/clusters/count-by-status/v1][%d] readClustersByStatusCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadClustersByStatusCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadClustersByStatusCountInternalServerError) 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/read_container_combined_parameters.go b/falcon/client/kubernetes_protection/read_container_combined_parameters.go new file mode 100644 index 00000000..ff52b0b7 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_combined_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadContainerCombinedParams creates a new ReadContainerCombinedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerCombinedParams() *ReadContainerCombinedParams { + return &ReadContainerCombinedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerCombinedParamsWithTimeout creates a new ReadContainerCombinedParams object +// with the ability to set a timeout on a request. +func NewReadContainerCombinedParamsWithTimeout(timeout time.Duration) *ReadContainerCombinedParams { + return &ReadContainerCombinedParams{ + timeout: timeout, + } +} + +// NewReadContainerCombinedParamsWithContext creates a new ReadContainerCombinedParams object +// with the ability to set a context for a request. +func NewReadContainerCombinedParamsWithContext(ctx context.Context) *ReadContainerCombinedParams { + return &ReadContainerCombinedParams{ + Context: ctx, + } +} + +// NewReadContainerCombinedParamsWithHTTPClient creates a new ReadContainerCombinedParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerCombinedParamsWithHTTPClient(client *http.Client) *ReadContainerCombinedParams { + return &ReadContainerCombinedParams{ + HTTPClient: client, + } +} + +/* +ReadContainerCombinedParams contains all the parameters to send to the API endpoint + + for the read container combined operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerCombinedParams struct { + + /* Filter. + + Search Kubernetes containers using a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_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. + + Field to sort results by + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read container combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerCombinedParams) WithDefaults() *ReadContainerCombinedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerCombinedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container combined params +func (o *ReadContainerCombinedParams) WithTimeout(timeout time.Duration) *ReadContainerCombinedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container combined params +func (o *ReadContainerCombinedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container combined params +func (o *ReadContainerCombinedParams) WithContext(ctx context.Context) *ReadContainerCombinedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container combined params +func (o *ReadContainerCombinedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container combined params +func (o *ReadContainerCombinedParams) WithHTTPClient(client *http.Client) *ReadContainerCombinedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container combined params +func (o *ReadContainerCombinedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read container combined params +func (o *ReadContainerCombinedParams) WithFilter(filter *string) *ReadContainerCombinedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read container combined params +func (o *ReadContainerCombinedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the read container combined params +func (o *ReadContainerCombinedParams) WithLimit(limit *int64) *ReadContainerCombinedParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read container combined params +func (o *ReadContainerCombinedParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the read container combined params +func (o *ReadContainerCombinedParams) WithOffset(offset *int64) *ReadContainerCombinedParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the read container combined params +func (o *ReadContainerCombinedParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the read container combined params +func (o *ReadContainerCombinedParams) WithSort(sort *string) *ReadContainerCombinedParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the read container combined params +func (o *ReadContainerCombinedParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerCombinedParams) 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/kubernetes_protection/read_container_combined_responses.go b/falcon/client/kubernetes_protection/read_container_combined_responses.go new file mode 100644 index 00000000..a00ef831 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_combined_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerCombinedReader is a Reader for the ReadContainerCombined structure. +type ReadContainerCombinedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerCombinedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerCombinedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerCombinedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerCombinedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerCombinedInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/containers/v1] ReadContainerCombined", response, response.Code()) + } +} + +// NewReadContainerCombinedOK creates a ReadContainerCombinedOK with default headers values +func NewReadContainerCombinedOK() *ReadContainerCombinedOK { + return &ReadContainerCombinedOK{} +} + +/* +ReadContainerCombinedOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerCombinedOK 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.ModelsContainerEntityResponse +} + +// IsSuccess returns true when this read container combined o k response has a 2xx status code +func (o *ReadContainerCombinedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container combined o k response has a 3xx status code +func (o *ReadContainerCombinedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container combined o k response has a 4xx status code +func (o *ReadContainerCombinedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container combined o k response has a 5xx status code +func (o *ReadContainerCombinedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container combined o k response a status code equal to that given +func (o *ReadContainerCombinedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container combined o k response +func (o *ReadContainerCombinedOK) Code() int { + return 200 +} + +func (o *ReadContainerCombinedOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadContainerCombinedOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadContainerCombinedOK) GetPayload() *models.ModelsContainerEntityResponse { + return o.Payload +} + +func (o *ReadContainerCombinedOK) 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.ModelsContainerEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainerCombinedForbidden creates a ReadContainerCombinedForbidden with default headers values +func NewReadContainerCombinedForbidden() *ReadContainerCombinedForbidden { + return &ReadContainerCombinedForbidden{} +} + +/* +ReadContainerCombinedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerCombinedForbidden 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 container combined forbidden response has a 2xx status code +func (o *ReadContainerCombinedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container combined forbidden response has a 3xx status code +func (o *ReadContainerCombinedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container combined forbidden response has a 4xx status code +func (o *ReadContainerCombinedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container combined forbidden response has a 5xx status code +func (o *ReadContainerCombinedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container combined forbidden response a status code equal to that given +func (o *ReadContainerCombinedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container combined forbidden response +func (o *ReadContainerCombinedForbidden) Code() int { + return 403 +} + +func (o *ReadContainerCombinedForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerCombinedForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerCombinedForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerCombinedForbidden) 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 +} + +// NewReadContainerCombinedTooManyRequests creates a ReadContainerCombinedTooManyRequests with default headers values +func NewReadContainerCombinedTooManyRequests() *ReadContainerCombinedTooManyRequests { + return &ReadContainerCombinedTooManyRequests{} +} + +/* +ReadContainerCombinedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerCombinedTooManyRequests 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 container combined too many requests response has a 2xx status code +func (o *ReadContainerCombinedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container combined too many requests response has a 3xx status code +func (o *ReadContainerCombinedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container combined too many requests response has a 4xx status code +func (o *ReadContainerCombinedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container combined too many requests response has a 5xx status code +func (o *ReadContainerCombinedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container combined too many requests response a status code equal to that given +func (o *ReadContainerCombinedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container combined too many requests response +func (o *ReadContainerCombinedTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerCombinedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerCombinedTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerCombinedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerCombinedTooManyRequests) 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 +} + +// NewReadContainerCombinedInternalServerError creates a ReadContainerCombinedInternalServerError with default headers values +func NewReadContainerCombinedInternalServerError() *ReadContainerCombinedInternalServerError { + return &ReadContainerCombinedInternalServerError{} +} + +/* +ReadContainerCombinedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerCombinedInternalServerError 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 container combined internal server error response has a 2xx status code +func (o *ReadContainerCombinedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container combined internal server error response has a 3xx status code +func (o *ReadContainerCombinedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container combined internal server error response has a 4xx status code +func (o *ReadContainerCombinedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container combined internal server error response has a 5xx status code +func (o *ReadContainerCombinedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container combined internal server error response a status code equal to that given +func (o *ReadContainerCombinedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container combined internal server error response +func (o *ReadContainerCombinedInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerCombinedInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerCombinedInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/containers/v1][%d] readContainerCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerCombinedInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerCombinedInternalServerError) 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/read_container_count_by_registry_parameters.go b/falcon/client/kubernetes_protection/read_container_count_by_registry_parameters.go new file mode 100644 index 00000000..20a1a5b3 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_count_by_registry_parameters.go @@ -0,0 +1,198 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadContainerCountByRegistryParams creates a new ReadContainerCountByRegistryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerCountByRegistryParams() *ReadContainerCountByRegistryParams { + return &ReadContainerCountByRegistryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerCountByRegistryParamsWithTimeout creates a new ReadContainerCountByRegistryParams object +// with the ability to set a timeout on a request. +func NewReadContainerCountByRegistryParamsWithTimeout(timeout time.Duration) *ReadContainerCountByRegistryParams { + return &ReadContainerCountByRegistryParams{ + timeout: timeout, + } +} + +// NewReadContainerCountByRegistryParamsWithContext creates a new ReadContainerCountByRegistryParams object +// with the ability to set a context for a request. +func NewReadContainerCountByRegistryParamsWithContext(ctx context.Context) *ReadContainerCountByRegistryParams { + return &ReadContainerCountByRegistryParams{ + Context: ctx, + } +} + +// NewReadContainerCountByRegistryParamsWithHTTPClient creates a new ReadContainerCountByRegistryParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerCountByRegistryParamsWithHTTPClient(client *http.Client) *ReadContainerCountByRegistryParams { + return &ReadContainerCountByRegistryParams{ + HTTPClient: client, + } +} + +/* +ReadContainerCountByRegistryParams contains all the parameters to send to the API endpoint + + for the read container count by registry operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerCountByRegistryParams struct { + + /* Limit. + + The upper-bound on the number of records to retrieve. + */ + Limit *int64 + + /* UnderAssessment. + + (true/false) whether to return registries under assessment or not under assessment. If not provided all registries are considered + */ + UnderAssessment *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read container count by registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerCountByRegistryParams) WithDefaults() *ReadContainerCountByRegistryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container count by registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerCountByRegistryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) WithTimeout(timeout time.Duration) *ReadContainerCountByRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) WithContext(ctx context.Context) *ReadContainerCountByRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) WithHTTPClient(client *http.Client) *ReadContainerCountByRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) WithLimit(limit *int64) *ReadContainerCountByRegistryParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithUnderAssessment adds the underAssessment to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) WithUnderAssessment(underAssessment *bool) *ReadContainerCountByRegistryParams { + o.SetUnderAssessment(underAssessment) + return o +} + +// SetUnderAssessment adds the underAssessment to the read container count by registry params +func (o *ReadContainerCountByRegistryParams) SetUnderAssessment(underAssessment *bool) { + o.UnderAssessment = underAssessment +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerCountByRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + 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.UnderAssessment != nil { + + // query param under_assessment + var qrUnderAssessment bool + + if o.UnderAssessment != nil { + qrUnderAssessment = *o.UnderAssessment + } + qUnderAssessment := swag.FormatBool(qrUnderAssessment) + if qUnderAssessment != "" { + + if err := r.SetQueryParam("under_assessment", qUnderAssessment); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_container_count_by_registry_responses.go b/falcon/client/kubernetes_protection/read_container_count_by_registry_responses.go new file mode 100644 index 00000000..6e965c2b --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_count_by_registry_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerCountByRegistryReader is a Reader for the ReadContainerCountByRegistry structure. +type ReadContainerCountByRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerCountByRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerCountByRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerCountByRegistryForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerCountByRegistryTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerCountByRegistryInternalServerError() + 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/containers/count-by-registry/v1] ReadContainerCountByRegistry", response, response.Code()) + } +} + +// NewReadContainerCountByRegistryOK creates a ReadContainerCountByRegistryOK with default headers values +func NewReadContainerCountByRegistryOK() *ReadContainerCountByRegistryOK { + return &ReadContainerCountByRegistryOK{} +} + +/* +ReadContainerCountByRegistryOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerCountByRegistryOK 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.ModelsAPIFilterResponse +} + +// IsSuccess returns true when this read container count by registry o k response has a 2xx status code +func (o *ReadContainerCountByRegistryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container count by registry o k response has a 3xx status code +func (o *ReadContainerCountByRegistryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count by registry o k response has a 4xx status code +func (o *ReadContainerCountByRegistryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container count by registry o k response has a 5xx status code +func (o *ReadContainerCountByRegistryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container count by registry o k response a status code equal to that given +func (o *ReadContainerCountByRegistryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container count by registry o k response +func (o *ReadContainerCountByRegistryOK) Code() int { + return 200 +} + +func (o *ReadContainerCountByRegistryOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryOK %+v", 200, o.Payload) +} + +func (o *ReadContainerCountByRegistryOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryOK %+v", 200, o.Payload) +} + +func (o *ReadContainerCountByRegistryOK) GetPayload() *models.ModelsAPIFilterResponse { + return o.Payload +} + +func (o *ReadContainerCountByRegistryOK) 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.ModelsAPIFilterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainerCountByRegistryForbidden creates a ReadContainerCountByRegistryForbidden with default headers values +func NewReadContainerCountByRegistryForbidden() *ReadContainerCountByRegistryForbidden { + return &ReadContainerCountByRegistryForbidden{} +} + +/* +ReadContainerCountByRegistryForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerCountByRegistryForbidden 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 container count by registry forbidden response has a 2xx status code +func (o *ReadContainerCountByRegistryForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container count by registry forbidden response has a 3xx status code +func (o *ReadContainerCountByRegistryForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count by registry forbidden response has a 4xx status code +func (o *ReadContainerCountByRegistryForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container count by registry forbidden response has a 5xx status code +func (o *ReadContainerCountByRegistryForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container count by registry forbidden response a status code equal to that given +func (o *ReadContainerCountByRegistryForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container count by registry forbidden response +func (o *ReadContainerCountByRegistryForbidden) Code() int { + return 403 +} + +func (o *ReadContainerCountByRegistryForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerCountByRegistryForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerCountByRegistryForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerCountByRegistryForbidden) 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 +} + +// NewReadContainerCountByRegistryTooManyRequests creates a ReadContainerCountByRegistryTooManyRequests with default headers values +func NewReadContainerCountByRegistryTooManyRequests() *ReadContainerCountByRegistryTooManyRequests { + return &ReadContainerCountByRegistryTooManyRequests{} +} + +/* +ReadContainerCountByRegistryTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerCountByRegistryTooManyRequests 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 container count by registry too many requests response has a 2xx status code +func (o *ReadContainerCountByRegistryTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container count by registry too many requests response has a 3xx status code +func (o *ReadContainerCountByRegistryTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count by registry too many requests response has a 4xx status code +func (o *ReadContainerCountByRegistryTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container count by registry too many requests response has a 5xx status code +func (o *ReadContainerCountByRegistryTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container count by registry too many requests response a status code equal to that given +func (o *ReadContainerCountByRegistryTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container count by registry too many requests response +func (o *ReadContainerCountByRegistryTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerCountByRegistryTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerCountByRegistryTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerCountByRegistryTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerCountByRegistryTooManyRequests) 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 +} + +// NewReadContainerCountByRegistryInternalServerError creates a ReadContainerCountByRegistryInternalServerError with default headers values +func NewReadContainerCountByRegistryInternalServerError() *ReadContainerCountByRegistryInternalServerError { + return &ReadContainerCountByRegistryInternalServerError{} +} + +/* +ReadContainerCountByRegistryInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerCountByRegistryInternalServerError 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 container count by registry internal server error response has a 2xx status code +func (o *ReadContainerCountByRegistryInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container count by registry internal server error response has a 3xx status code +func (o *ReadContainerCountByRegistryInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count by registry internal server error response has a 4xx status code +func (o *ReadContainerCountByRegistryInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container count by registry internal server error response has a 5xx status code +func (o *ReadContainerCountByRegistryInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container count by registry internal server error response a status code equal to that given +func (o *ReadContainerCountByRegistryInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container count by registry internal server error response +func (o *ReadContainerCountByRegistryInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerCountByRegistryInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerCountByRegistryInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-registry/v1][%d] readContainerCountByRegistryInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerCountByRegistryInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerCountByRegistryInternalServerError) 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/read_container_count_parameters.go b/falcon/client/kubernetes_protection/read_container_count_parameters.go new file mode 100644 index 00000000..b43559f7 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadContainerCountParams creates a new ReadContainerCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerCountParams() *ReadContainerCountParams { + return &ReadContainerCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerCountParamsWithTimeout creates a new ReadContainerCountParams object +// with the ability to set a timeout on a request. +func NewReadContainerCountParamsWithTimeout(timeout time.Duration) *ReadContainerCountParams { + return &ReadContainerCountParams{ + timeout: timeout, + } +} + +// NewReadContainerCountParamsWithContext creates a new ReadContainerCountParams object +// with the ability to set a context for a request. +func NewReadContainerCountParamsWithContext(ctx context.Context) *ReadContainerCountParams { + return &ReadContainerCountParams{ + Context: ctx, + } +} + +// NewReadContainerCountParamsWithHTTPClient creates a new ReadContainerCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerCountParamsWithHTTPClient(client *http.Client) *ReadContainerCountParams { + return &ReadContainerCountParams{ + HTTPClient: client, + } +} + +/* +ReadContainerCountParams contains all the parameters to send to the API endpoint + + for the read container count operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerCountParams struct { + + /* Filter. + + Retrieve count of Kubernetes containers that match a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read container count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerCountParams) WithDefaults() *ReadContainerCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container count params +func (o *ReadContainerCountParams) WithTimeout(timeout time.Duration) *ReadContainerCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container count params +func (o *ReadContainerCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container count params +func (o *ReadContainerCountParams) WithContext(ctx context.Context) *ReadContainerCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container count params +func (o *ReadContainerCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container count params +func (o *ReadContainerCountParams) WithHTTPClient(client *http.Client) *ReadContainerCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container count params +func (o *ReadContainerCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read container count params +func (o *ReadContainerCountParams) WithFilter(filter *string) *ReadContainerCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read container count params +func (o *ReadContainerCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_container_count_responses.go b/falcon/client/kubernetes_protection/read_container_count_responses.go new file mode 100644 index 00000000..3b8b46b2 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerCountReader is a Reader for the ReadContainerCount structure. +type ReadContainerCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerCountInternalServerError() + 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/containers/count/v1] ReadContainerCount", response, response.Code()) + } +} + +// NewReadContainerCountOK creates a ReadContainerCountOK with default headers values +func NewReadContainerCountOK() *ReadContainerCountOK { + return &ReadContainerCountOK{} +} + +/* +ReadContainerCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerCountOK 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.CommonCountResponse +} + +// IsSuccess returns true when this read container count o k response has a 2xx status code +func (o *ReadContainerCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container count o k response has a 3xx status code +func (o *ReadContainerCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count o k response has a 4xx status code +func (o *ReadContainerCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container count o k response has a 5xx status code +func (o *ReadContainerCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container count o k response a status code equal to that given +func (o *ReadContainerCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container count o k response +func (o *ReadContainerCountOK) Code() int { + return 200 +} + +func (o *ReadContainerCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountOK %+v", 200, o.Payload) +} + +func (o *ReadContainerCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountOK %+v", 200, o.Payload) +} + +func (o *ReadContainerCountOK) GetPayload() *models.CommonCountResponse { + return o.Payload +} + +func (o *ReadContainerCountOK) 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.CommonCountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainerCountForbidden creates a ReadContainerCountForbidden with default headers values +func NewReadContainerCountForbidden() *ReadContainerCountForbidden { + return &ReadContainerCountForbidden{} +} + +/* +ReadContainerCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerCountForbidden 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 container count forbidden response has a 2xx status code +func (o *ReadContainerCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container count forbidden response has a 3xx status code +func (o *ReadContainerCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count forbidden response has a 4xx status code +func (o *ReadContainerCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container count forbidden response has a 5xx status code +func (o *ReadContainerCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container count forbidden response a status code equal to that given +func (o *ReadContainerCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container count forbidden response +func (o *ReadContainerCountForbidden) Code() int { + return 403 +} + +func (o *ReadContainerCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerCountForbidden) 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 +} + +// NewReadContainerCountTooManyRequests creates a ReadContainerCountTooManyRequests with default headers values +func NewReadContainerCountTooManyRequests() *ReadContainerCountTooManyRequests { + return &ReadContainerCountTooManyRequests{} +} + +/* +ReadContainerCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerCountTooManyRequests 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 container count too many requests response has a 2xx status code +func (o *ReadContainerCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container count too many requests response has a 3xx status code +func (o *ReadContainerCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count too many requests response has a 4xx status code +func (o *ReadContainerCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container count too many requests response has a 5xx status code +func (o *ReadContainerCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container count too many requests response a status code equal to that given +func (o *ReadContainerCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container count too many requests response +func (o *ReadContainerCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerCountTooManyRequests) 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 +} + +// NewReadContainerCountInternalServerError creates a ReadContainerCountInternalServerError with default headers values +func NewReadContainerCountInternalServerError() *ReadContainerCountInternalServerError { + return &ReadContainerCountInternalServerError{} +} + +/* +ReadContainerCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerCountInternalServerError 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 container count internal server error response has a 2xx status code +func (o *ReadContainerCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container count internal server error response has a 3xx status code +func (o *ReadContainerCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container count internal server error response has a 4xx status code +func (o *ReadContainerCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container count internal server error response has a 5xx status code +func (o *ReadContainerCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container count internal server error response a status code equal to that given +func (o *ReadContainerCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container count internal server error response +func (o *ReadContainerCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count/v1][%d] readContainerCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerCountInternalServerError) 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/read_container_enrichment_parameters.go b/falcon/client/kubernetes_protection/read_container_enrichment_parameters.go new file mode 100644 index 00000000..8487e3e1 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_enrichment_parameters.go @@ -0,0 +1,209 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadContainerEnrichmentParams creates a new ReadContainerEnrichmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerEnrichmentParams() *ReadContainerEnrichmentParams { + return &ReadContainerEnrichmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerEnrichmentParamsWithTimeout creates a new ReadContainerEnrichmentParams object +// with the ability to set a timeout on a request. +func NewReadContainerEnrichmentParamsWithTimeout(timeout time.Duration) *ReadContainerEnrichmentParams { + return &ReadContainerEnrichmentParams{ + timeout: timeout, + } +} + +// NewReadContainerEnrichmentParamsWithContext creates a new ReadContainerEnrichmentParams object +// with the ability to set a context for a request. +func NewReadContainerEnrichmentParamsWithContext(ctx context.Context) *ReadContainerEnrichmentParams { + return &ReadContainerEnrichmentParams{ + Context: ctx, + } +} + +// NewReadContainerEnrichmentParamsWithHTTPClient creates a new ReadContainerEnrichmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerEnrichmentParamsWithHTTPClient(client *http.Client) *ReadContainerEnrichmentParams { + return &ReadContainerEnrichmentParams{ + HTTPClient: client, + } +} + +/* +ReadContainerEnrichmentParams contains all the parameters to send to the API endpoint + + for the read container enrichment operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerEnrichmentParams 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 +} + +// WithDefaults hydrates default values in the read container enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerEnrichmentParams) WithDefaults() *ReadContainerEnrichmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerEnrichmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container enrichment params +func (o *ReadContainerEnrichmentParams) WithTimeout(timeout time.Duration) *ReadContainerEnrichmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container enrichment params +func (o *ReadContainerEnrichmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container enrichment params +func (o *ReadContainerEnrichmentParams) WithContext(ctx context.Context) *ReadContainerEnrichmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container enrichment params +func (o *ReadContainerEnrichmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container enrichment params +func (o *ReadContainerEnrichmentParams) WithHTTPClient(client *http.Client) *ReadContainerEnrichmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container enrichment params +func (o *ReadContainerEnrichmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContainerID adds the containerID to the read container enrichment params +func (o *ReadContainerEnrichmentParams) WithContainerID(containerID []string) *ReadContainerEnrichmentParams { + o.SetContainerID(containerID) + return o +} + +// SetContainerID adds the containerId to the read container enrichment params +func (o *ReadContainerEnrichmentParams) SetContainerID(containerID []string) { + o.ContainerID = containerID +} + +// WithFilter adds the filter to the read container enrichment params +func (o *ReadContainerEnrichmentParams) WithFilter(filter *string) *ReadContainerEnrichmentParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read container enrichment params +func (o *ReadContainerEnrichmentParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + 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 +} + +// bindParamReadContainerEnrichment binds the parameter container_id +func (o *ReadContainerEnrichmentParams) 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/kubernetes_protection/read_container_enrichment_responses.go b/falcon/client/kubernetes_protection/read_container_enrichment_responses.go new file mode 100644 index 00000000..7850fbff --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_enrichment_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerEnrichmentReader is a Reader for the ReadContainerEnrichment structure. +type ReadContainerEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerEnrichmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerEnrichmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerEnrichmentTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerEnrichmentInternalServerError() + 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] ReadContainerEnrichment", response, response.Code()) + } +} + +// NewReadContainerEnrichmentOK creates a ReadContainerEnrichmentOK with default headers values +func NewReadContainerEnrichmentOK() *ReadContainerEnrichmentOK { + return &ReadContainerEnrichmentOK{} +} + +/* +ReadContainerEnrichmentOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerEnrichmentOK 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 read container enrichment o k response has a 2xx status code +func (o *ReadContainerEnrichmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container enrichment o k response has a 3xx status code +func (o *ReadContainerEnrichmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container enrichment o k response has a 4xx status code +func (o *ReadContainerEnrichmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container enrichment o k response has a 5xx status code +func (o *ReadContainerEnrichmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container enrichment o k response a status code equal to that given +func (o *ReadContainerEnrichmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container enrichment o k response +func (o *ReadContainerEnrichmentOK) Code() int { + return 200 +} + +func (o *ReadContainerEnrichmentOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadContainerEnrichmentOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadContainerEnrichmentOK) GetPayload() *models.K8sassetsContainerEnrichmentResponse { + return o.Payload +} + +func (o *ReadContainerEnrichmentOK) 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 +} + +// NewReadContainerEnrichmentForbidden creates a ReadContainerEnrichmentForbidden with default headers values +func NewReadContainerEnrichmentForbidden() *ReadContainerEnrichmentForbidden { + return &ReadContainerEnrichmentForbidden{} +} + +/* +ReadContainerEnrichmentForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerEnrichmentForbidden 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 container enrichment forbidden response has a 2xx status code +func (o *ReadContainerEnrichmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container enrichment forbidden response has a 3xx status code +func (o *ReadContainerEnrichmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container enrichment forbidden response has a 4xx status code +func (o *ReadContainerEnrichmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container enrichment forbidden response has a 5xx status code +func (o *ReadContainerEnrichmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container enrichment forbidden response a status code equal to that given +func (o *ReadContainerEnrichmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container enrichment forbidden response +func (o *ReadContainerEnrichmentForbidden) Code() int { + return 403 +} + +func (o *ReadContainerEnrichmentForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerEnrichmentForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerEnrichmentForbidden) 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 +} + +// NewReadContainerEnrichmentTooManyRequests creates a ReadContainerEnrichmentTooManyRequests with default headers values +func NewReadContainerEnrichmentTooManyRequests() *ReadContainerEnrichmentTooManyRequests { + return &ReadContainerEnrichmentTooManyRequests{} +} + +/* +ReadContainerEnrichmentTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerEnrichmentTooManyRequests 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 container enrichment too many requests response has a 2xx status code +func (o *ReadContainerEnrichmentTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container enrichment too many requests response has a 3xx status code +func (o *ReadContainerEnrichmentTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container enrichment too many requests response has a 4xx status code +func (o *ReadContainerEnrichmentTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container enrichment too many requests response has a 5xx status code +func (o *ReadContainerEnrichmentTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container enrichment too many requests response a status code equal to that given +func (o *ReadContainerEnrichmentTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container enrichment too many requests response +func (o *ReadContainerEnrichmentTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerEnrichmentTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerEnrichmentTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerEnrichmentTooManyRequests) 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 +} + +// NewReadContainerEnrichmentInternalServerError creates a ReadContainerEnrichmentInternalServerError with default headers values +func NewReadContainerEnrichmentInternalServerError() *ReadContainerEnrichmentInternalServerError { + return &ReadContainerEnrichmentInternalServerError{} +} + +/* +ReadContainerEnrichmentInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerEnrichmentInternalServerError 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 container enrichment internal server error response has a 2xx status code +func (o *ReadContainerEnrichmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container enrichment internal server error response has a 3xx status code +func (o *ReadContainerEnrichmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container enrichment internal server error response has a 4xx status code +func (o *ReadContainerEnrichmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container enrichment internal server error response has a 5xx status code +func (o *ReadContainerEnrichmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container enrichment internal server error response a status code equal to that given +func (o *ReadContainerEnrichmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container enrichment internal server error response +func (o *ReadContainerEnrichmentInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerEnrichmentInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerEnrichmentInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/containers/entities/v1][%d] readContainerEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerEnrichmentInternalServerError) 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/read_container_image_detections_count_by_date_parameters.go b/falcon/client/kubernetes_protection/read_container_image_detections_count_by_date_parameters.go new file mode 100644 index 00000000..d1825cb3 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_image_detections_count_by_date_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadContainerImageDetectionsCountByDateParams creates a new ReadContainerImageDetectionsCountByDateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerImageDetectionsCountByDateParams() *ReadContainerImageDetectionsCountByDateParams { + return &ReadContainerImageDetectionsCountByDateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerImageDetectionsCountByDateParamsWithTimeout creates a new ReadContainerImageDetectionsCountByDateParams object +// with the ability to set a timeout on a request. +func NewReadContainerImageDetectionsCountByDateParamsWithTimeout(timeout time.Duration) *ReadContainerImageDetectionsCountByDateParams { + return &ReadContainerImageDetectionsCountByDateParams{ + timeout: timeout, + } +} + +// NewReadContainerImageDetectionsCountByDateParamsWithContext creates a new ReadContainerImageDetectionsCountByDateParams object +// with the ability to set a context for a request. +func NewReadContainerImageDetectionsCountByDateParamsWithContext(ctx context.Context) *ReadContainerImageDetectionsCountByDateParams { + return &ReadContainerImageDetectionsCountByDateParams{ + Context: ctx, + } +} + +// NewReadContainerImageDetectionsCountByDateParamsWithHTTPClient creates a new ReadContainerImageDetectionsCountByDateParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerImageDetectionsCountByDateParamsWithHTTPClient(client *http.Client) *ReadContainerImageDetectionsCountByDateParams { + return &ReadContainerImageDetectionsCountByDateParams{ + HTTPClient: client, + } +} + +/* +ReadContainerImageDetectionsCountByDateParams contains all the parameters to send to the API endpoint + + for the read container image detections count by date operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerImageDetectionsCountByDateParams struct { + + /* Filter. + + Retrieve count of Kubernetes containers that match a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read container image detections count by date params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerImageDetectionsCountByDateParams) WithDefaults() *ReadContainerImageDetectionsCountByDateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container image detections count by date params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerImageDetectionsCountByDateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) WithTimeout(timeout time.Duration) *ReadContainerImageDetectionsCountByDateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) WithContext(ctx context.Context) *ReadContainerImageDetectionsCountByDateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) WithHTTPClient(client *http.Client) *ReadContainerImageDetectionsCountByDateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) WithFilter(filter *string) *ReadContainerImageDetectionsCountByDateParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read container image detections count by date params +func (o *ReadContainerImageDetectionsCountByDateParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerImageDetectionsCountByDateParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_container_image_detections_count_by_date_responses.go b/falcon/client/kubernetes_protection/read_container_image_detections_count_by_date_responses.go new file mode 100644 index 00000000..0a21c93a --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_image_detections_count_by_date_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerImageDetectionsCountByDateReader is a Reader for the ReadContainerImageDetectionsCountByDate structure. +type ReadContainerImageDetectionsCountByDateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerImageDetectionsCountByDateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerImageDetectionsCountByDateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerImageDetectionsCountByDateForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerImageDetectionsCountByDateTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerImageDetectionsCountByDateInternalServerError() + 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/containers/image-detections-count-by-date/v1] ReadContainerImageDetectionsCountByDate", response, response.Code()) + } +} + +// NewReadContainerImageDetectionsCountByDateOK creates a ReadContainerImageDetectionsCountByDateOK with default headers values +func NewReadContainerImageDetectionsCountByDateOK() *ReadContainerImageDetectionsCountByDateOK { + return &ReadContainerImageDetectionsCountByDateOK{} +} + +/* +ReadContainerImageDetectionsCountByDateOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerImageDetectionsCountByDateOK 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.ModelsAPIFilterResponse +} + +// IsSuccess returns true when this read container image detections count by date o k response has a 2xx status code +func (o *ReadContainerImageDetectionsCountByDateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container image detections count by date o k response has a 3xx status code +func (o *ReadContainerImageDetectionsCountByDateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container image detections count by date o k response has a 4xx status code +func (o *ReadContainerImageDetectionsCountByDateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container image detections count by date o k response has a 5xx status code +func (o *ReadContainerImageDetectionsCountByDateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container image detections count by date o k response a status code equal to that given +func (o *ReadContainerImageDetectionsCountByDateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container image detections count by date o k response +func (o *ReadContainerImageDetectionsCountByDateOK) Code() int { + return 200 +} + +func (o *ReadContainerImageDetectionsCountByDateOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateOK %+v", 200, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateOK %+v", 200, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateOK) GetPayload() *models.ModelsAPIFilterResponse { + return o.Payload +} + +func (o *ReadContainerImageDetectionsCountByDateOK) 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.ModelsAPIFilterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainerImageDetectionsCountByDateForbidden creates a ReadContainerImageDetectionsCountByDateForbidden with default headers values +func NewReadContainerImageDetectionsCountByDateForbidden() *ReadContainerImageDetectionsCountByDateForbidden { + return &ReadContainerImageDetectionsCountByDateForbidden{} +} + +/* +ReadContainerImageDetectionsCountByDateForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerImageDetectionsCountByDateForbidden 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 container image detections count by date forbidden response has a 2xx status code +func (o *ReadContainerImageDetectionsCountByDateForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container image detections count by date forbidden response has a 3xx status code +func (o *ReadContainerImageDetectionsCountByDateForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container image detections count by date forbidden response has a 4xx status code +func (o *ReadContainerImageDetectionsCountByDateForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container image detections count by date forbidden response has a 5xx status code +func (o *ReadContainerImageDetectionsCountByDateForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container image detections count by date forbidden response a status code equal to that given +func (o *ReadContainerImageDetectionsCountByDateForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container image detections count by date forbidden response +func (o *ReadContainerImageDetectionsCountByDateForbidden) Code() int { + return 403 +} + +func (o *ReadContainerImageDetectionsCountByDateForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerImageDetectionsCountByDateForbidden) 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 +} + +// NewReadContainerImageDetectionsCountByDateTooManyRequests creates a ReadContainerImageDetectionsCountByDateTooManyRequests with default headers values +func NewReadContainerImageDetectionsCountByDateTooManyRequests() *ReadContainerImageDetectionsCountByDateTooManyRequests { + return &ReadContainerImageDetectionsCountByDateTooManyRequests{} +} + +/* +ReadContainerImageDetectionsCountByDateTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerImageDetectionsCountByDateTooManyRequests 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 container image detections count by date too many requests response has a 2xx status code +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container image detections count by date too many requests response has a 3xx status code +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container image detections count by date too many requests response has a 4xx status code +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container image detections count by date too many requests response has a 5xx status code +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container image detections count by date too many requests response a status code equal to that given +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container image detections count by date too many requests response +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerImageDetectionsCountByDateTooManyRequests) 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 +} + +// NewReadContainerImageDetectionsCountByDateInternalServerError creates a ReadContainerImageDetectionsCountByDateInternalServerError with default headers values +func NewReadContainerImageDetectionsCountByDateInternalServerError() *ReadContainerImageDetectionsCountByDateInternalServerError { + return &ReadContainerImageDetectionsCountByDateInternalServerError{} +} + +/* +ReadContainerImageDetectionsCountByDateInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerImageDetectionsCountByDateInternalServerError 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 container image detections count by date internal server error response has a 2xx status code +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container image detections count by date internal server error response has a 3xx status code +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container image detections count by date internal server error response has a 4xx status code +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container image detections count by date internal server error response has a 5xx status code +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container image detections count by date internal server error response a status code equal to that given +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container image detections count by date internal server error response +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/image-detections-count-by-date/v1][%d] readContainerImageDetectionsCountByDateInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerImageDetectionsCountByDateInternalServerError) 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/read_container_images_by_most_used_parameters.go b/falcon/client/kubernetes_protection/read_container_images_by_most_used_parameters.go new file mode 100644 index 00000000..20a11b0f --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_images_by_most_used_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadContainerImagesByMostUsedParams creates a new ReadContainerImagesByMostUsedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerImagesByMostUsedParams() *ReadContainerImagesByMostUsedParams { + return &ReadContainerImagesByMostUsedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerImagesByMostUsedParamsWithTimeout creates a new ReadContainerImagesByMostUsedParams object +// with the ability to set a timeout on a request. +func NewReadContainerImagesByMostUsedParamsWithTimeout(timeout time.Duration) *ReadContainerImagesByMostUsedParams { + return &ReadContainerImagesByMostUsedParams{ + timeout: timeout, + } +} + +// NewReadContainerImagesByMostUsedParamsWithContext creates a new ReadContainerImagesByMostUsedParams object +// with the ability to set a context for a request. +func NewReadContainerImagesByMostUsedParamsWithContext(ctx context.Context) *ReadContainerImagesByMostUsedParams { + return &ReadContainerImagesByMostUsedParams{ + Context: ctx, + } +} + +// NewReadContainerImagesByMostUsedParamsWithHTTPClient creates a new ReadContainerImagesByMostUsedParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerImagesByMostUsedParamsWithHTTPClient(client *http.Client) *ReadContainerImagesByMostUsedParams { + return &ReadContainerImagesByMostUsedParams{ + HTTPClient: client, + } +} + +/* +ReadContainerImagesByMostUsedParams contains all the parameters to send to the API endpoint + + for the read container images by most used operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerImagesByMostUsedParams struct { + + /* Filter. + + Retrieve count of Kubernetes containers that match a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read container images by most used params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerImagesByMostUsedParams) WithDefaults() *ReadContainerImagesByMostUsedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container images by most used params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerImagesByMostUsedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) WithTimeout(timeout time.Duration) *ReadContainerImagesByMostUsedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) WithContext(ctx context.Context) *ReadContainerImagesByMostUsedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) WithHTTPClient(client *http.Client) *ReadContainerImagesByMostUsedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) WithFilter(filter *string) *ReadContainerImagesByMostUsedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read container images by most used params +func (o *ReadContainerImagesByMostUsedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerImagesByMostUsedParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_container_images_by_most_used_responses.go b/falcon/client/kubernetes_protection/read_container_images_by_most_used_responses.go new file mode 100644 index 00000000..fa943a32 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_images_by_most_used_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerImagesByMostUsedReader is a Reader for the ReadContainerImagesByMostUsed structure. +type ReadContainerImagesByMostUsedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerImagesByMostUsedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerImagesByMostUsedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerImagesByMostUsedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerImagesByMostUsedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerImagesByMostUsedInternalServerError() + 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/images/most-used/v1] ReadContainerImagesByMostUsed", response, response.Code()) + } +} + +// NewReadContainerImagesByMostUsedOK creates a ReadContainerImagesByMostUsedOK with default headers values +func NewReadContainerImagesByMostUsedOK() *ReadContainerImagesByMostUsedOK { + return &ReadContainerImagesByMostUsedOK{} +} + +/* +ReadContainerImagesByMostUsedOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerImagesByMostUsedOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read container images by most used o k response has a 2xx status code +func (o *ReadContainerImagesByMostUsedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container images by most used o k response has a 3xx status code +func (o *ReadContainerImagesByMostUsedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by most used o k response has a 4xx status code +func (o *ReadContainerImagesByMostUsedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container images by most used o k response has a 5xx status code +func (o *ReadContainerImagesByMostUsedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container images by most used o k response a status code equal to that given +func (o *ReadContainerImagesByMostUsedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container images by most used o k response +func (o *ReadContainerImagesByMostUsedOK) Code() int { + return 200 +} + +func (o *ReadContainerImagesByMostUsedOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedOK %+v", 200, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedOK %+v", 200, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadContainerImagesByMostUsedOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainerImagesByMostUsedForbidden creates a ReadContainerImagesByMostUsedForbidden with default headers values +func NewReadContainerImagesByMostUsedForbidden() *ReadContainerImagesByMostUsedForbidden { + return &ReadContainerImagesByMostUsedForbidden{} +} + +/* +ReadContainerImagesByMostUsedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerImagesByMostUsedForbidden 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 container images by most used forbidden response has a 2xx status code +func (o *ReadContainerImagesByMostUsedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container images by most used forbidden response has a 3xx status code +func (o *ReadContainerImagesByMostUsedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by most used forbidden response has a 4xx status code +func (o *ReadContainerImagesByMostUsedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container images by most used forbidden response has a 5xx status code +func (o *ReadContainerImagesByMostUsedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container images by most used forbidden response a status code equal to that given +func (o *ReadContainerImagesByMostUsedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container images by most used forbidden response +func (o *ReadContainerImagesByMostUsedForbidden) Code() int { + return 403 +} + +func (o *ReadContainerImagesByMostUsedForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerImagesByMostUsedForbidden) 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 +} + +// NewReadContainerImagesByMostUsedTooManyRequests creates a ReadContainerImagesByMostUsedTooManyRequests with default headers values +func NewReadContainerImagesByMostUsedTooManyRequests() *ReadContainerImagesByMostUsedTooManyRequests { + return &ReadContainerImagesByMostUsedTooManyRequests{} +} + +/* +ReadContainerImagesByMostUsedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerImagesByMostUsedTooManyRequests 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 container images by most used too many requests response has a 2xx status code +func (o *ReadContainerImagesByMostUsedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container images by most used too many requests response has a 3xx status code +func (o *ReadContainerImagesByMostUsedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by most used too many requests response has a 4xx status code +func (o *ReadContainerImagesByMostUsedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container images by most used too many requests response has a 5xx status code +func (o *ReadContainerImagesByMostUsedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container images by most used too many requests response a status code equal to that given +func (o *ReadContainerImagesByMostUsedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container images by most used too many requests response +func (o *ReadContainerImagesByMostUsedTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerImagesByMostUsedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerImagesByMostUsedTooManyRequests) 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 +} + +// NewReadContainerImagesByMostUsedInternalServerError creates a ReadContainerImagesByMostUsedInternalServerError with default headers values +func NewReadContainerImagesByMostUsedInternalServerError() *ReadContainerImagesByMostUsedInternalServerError { + return &ReadContainerImagesByMostUsedInternalServerError{} +} + +/* +ReadContainerImagesByMostUsedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerImagesByMostUsedInternalServerError 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 container images by most used internal server error response has a 2xx status code +func (o *ReadContainerImagesByMostUsedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container images by most used internal server error response has a 3xx status code +func (o *ReadContainerImagesByMostUsedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by most used internal server error response has a 4xx status code +func (o *ReadContainerImagesByMostUsedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container images by most used internal server error response has a 5xx status code +func (o *ReadContainerImagesByMostUsedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container images by most used internal server error response a status code equal to that given +func (o *ReadContainerImagesByMostUsedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container images by most used internal server error response +func (o *ReadContainerImagesByMostUsedInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerImagesByMostUsedInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/most-used/v1][%d] readContainerImagesByMostUsedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerImagesByMostUsedInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerImagesByMostUsedInternalServerError) 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/read_container_images_by_state_parameters.go b/falcon/client/kubernetes_protection/read_container_images_by_state_parameters.go new file mode 100644 index 00000000..3cb8d113 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_images_by_state_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadContainerImagesByStateParams creates a new ReadContainerImagesByStateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerImagesByStateParams() *ReadContainerImagesByStateParams { + return &ReadContainerImagesByStateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerImagesByStateParamsWithTimeout creates a new ReadContainerImagesByStateParams object +// with the ability to set a timeout on a request. +func NewReadContainerImagesByStateParamsWithTimeout(timeout time.Duration) *ReadContainerImagesByStateParams { + return &ReadContainerImagesByStateParams{ + timeout: timeout, + } +} + +// NewReadContainerImagesByStateParamsWithContext creates a new ReadContainerImagesByStateParams object +// with the ability to set a context for a request. +func NewReadContainerImagesByStateParamsWithContext(ctx context.Context) *ReadContainerImagesByStateParams { + return &ReadContainerImagesByStateParams{ + Context: ctx, + } +} + +// NewReadContainerImagesByStateParamsWithHTTPClient creates a new ReadContainerImagesByStateParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerImagesByStateParamsWithHTTPClient(client *http.Client) *ReadContainerImagesByStateParams { + return &ReadContainerImagesByStateParams{ + HTTPClient: client, + } +} + +/* +ReadContainerImagesByStateParams contains all the parameters to send to the API endpoint + + for the read container images by state operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerImagesByStateParams struct { + + /* Filter. + + Filter using a query in Falcon Query Language (FQL). Supported filters: cid + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read container images by state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerImagesByStateParams) WithDefaults() *ReadContainerImagesByStateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container images by state params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerImagesByStateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container images by state params +func (o *ReadContainerImagesByStateParams) WithTimeout(timeout time.Duration) *ReadContainerImagesByStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container images by state params +func (o *ReadContainerImagesByStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container images by state params +func (o *ReadContainerImagesByStateParams) WithContext(ctx context.Context) *ReadContainerImagesByStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container images by state params +func (o *ReadContainerImagesByStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container images by state params +func (o *ReadContainerImagesByStateParams) WithHTTPClient(client *http.Client) *ReadContainerImagesByStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container images by state params +func (o *ReadContainerImagesByStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read container images by state params +func (o *ReadContainerImagesByStateParams) WithFilter(filter *string) *ReadContainerImagesByStateParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read container images by state params +func (o *ReadContainerImagesByStateParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerImagesByStateParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_container_images_by_state_responses.go b/falcon/client/kubernetes_protection/read_container_images_by_state_responses.go new file mode 100644 index 00000000..40a4d92c --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_images_by_state_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerImagesByStateReader is a Reader for the ReadContainerImagesByState structure. +type ReadContainerImagesByStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerImagesByStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerImagesByStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerImagesByStateForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerImagesByStateTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerImagesByStateInternalServerError() + 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/containers/images-by-state/v1] ReadContainerImagesByState", response, response.Code()) + } +} + +// NewReadContainerImagesByStateOK creates a ReadContainerImagesByStateOK with default headers values +func NewReadContainerImagesByStateOK() *ReadContainerImagesByStateOK { + return &ReadContainerImagesByStateOK{} +} + +/* +ReadContainerImagesByStateOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerImagesByStateOK 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.ModelsAPIFilterResponse +} + +// IsSuccess returns true when this read container images by state o k response has a 2xx status code +func (o *ReadContainerImagesByStateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container images by state o k response has a 3xx status code +func (o *ReadContainerImagesByStateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by state o k response has a 4xx status code +func (o *ReadContainerImagesByStateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container images by state o k response has a 5xx status code +func (o *ReadContainerImagesByStateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container images by state o k response a status code equal to that given +func (o *ReadContainerImagesByStateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container images by state o k response +func (o *ReadContainerImagesByStateOK) Code() int { + return 200 +} + +func (o *ReadContainerImagesByStateOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateOK %+v", 200, o.Payload) +} + +func (o *ReadContainerImagesByStateOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateOK %+v", 200, o.Payload) +} + +func (o *ReadContainerImagesByStateOK) GetPayload() *models.ModelsAPIFilterResponse { + return o.Payload +} + +func (o *ReadContainerImagesByStateOK) 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.ModelsAPIFilterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainerImagesByStateForbidden creates a ReadContainerImagesByStateForbidden with default headers values +func NewReadContainerImagesByStateForbidden() *ReadContainerImagesByStateForbidden { + return &ReadContainerImagesByStateForbidden{} +} + +/* +ReadContainerImagesByStateForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerImagesByStateForbidden 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 container images by state forbidden response has a 2xx status code +func (o *ReadContainerImagesByStateForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container images by state forbidden response has a 3xx status code +func (o *ReadContainerImagesByStateForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by state forbidden response has a 4xx status code +func (o *ReadContainerImagesByStateForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container images by state forbidden response has a 5xx status code +func (o *ReadContainerImagesByStateForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container images by state forbidden response a status code equal to that given +func (o *ReadContainerImagesByStateForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container images by state forbidden response +func (o *ReadContainerImagesByStateForbidden) Code() int { + return 403 +} + +func (o *ReadContainerImagesByStateForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerImagesByStateForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerImagesByStateForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerImagesByStateForbidden) 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 +} + +// NewReadContainerImagesByStateTooManyRequests creates a ReadContainerImagesByStateTooManyRequests with default headers values +func NewReadContainerImagesByStateTooManyRequests() *ReadContainerImagesByStateTooManyRequests { + return &ReadContainerImagesByStateTooManyRequests{} +} + +/* +ReadContainerImagesByStateTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerImagesByStateTooManyRequests 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 container images by state too many requests response has a 2xx status code +func (o *ReadContainerImagesByStateTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container images by state too many requests response has a 3xx status code +func (o *ReadContainerImagesByStateTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by state too many requests response has a 4xx status code +func (o *ReadContainerImagesByStateTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container images by state too many requests response has a 5xx status code +func (o *ReadContainerImagesByStateTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container images by state too many requests response a status code equal to that given +func (o *ReadContainerImagesByStateTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container images by state too many requests response +func (o *ReadContainerImagesByStateTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerImagesByStateTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerImagesByStateTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerImagesByStateTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerImagesByStateTooManyRequests) 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 +} + +// NewReadContainerImagesByStateInternalServerError creates a ReadContainerImagesByStateInternalServerError with default headers values +func NewReadContainerImagesByStateInternalServerError() *ReadContainerImagesByStateInternalServerError { + return &ReadContainerImagesByStateInternalServerError{} +} + +/* +ReadContainerImagesByStateInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerImagesByStateInternalServerError 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 container images by state internal server error response has a 2xx status code +func (o *ReadContainerImagesByStateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container images by state internal server error response has a 3xx status code +func (o *ReadContainerImagesByStateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container images by state internal server error response has a 4xx status code +func (o *ReadContainerImagesByStateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container images by state internal server error response has a 5xx status code +func (o *ReadContainerImagesByStateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container images by state internal server error response a status code equal to that given +func (o *ReadContainerImagesByStateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container images by state internal server error response +func (o *ReadContainerImagesByStateInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerImagesByStateInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerImagesByStateInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/images-by-state/v1][%d] readContainerImagesByStateInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerImagesByStateInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerImagesByStateInternalServerError) 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/read_container_vulnerabilities_by_severity_count_parameters.go b/falcon/client/kubernetes_protection/read_container_vulnerabilities_by_severity_count_parameters.go new file mode 100644 index 00000000..c9ba22bc --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_vulnerabilities_by_severity_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadContainerVulnerabilitiesBySeverityCountParams creates a new ReadContainerVulnerabilitiesBySeverityCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainerVulnerabilitiesBySeverityCountParams() *ReadContainerVulnerabilitiesBySeverityCountParams { + return &ReadContainerVulnerabilitiesBySeverityCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainerVulnerabilitiesBySeverityCountParamsWithTimeout creates a new ReadContainerVulnerabilitiesBySeverityCountParams object +// with the ability to set a timeout on a request. +func NewReadContainerVulnerabilitiesBySeverityCountParamsWithTimeout(timeout time.Duration) *ReadContainerVulnerabilitiesBySeverityCountParams { + return &ReadContainerVulnerabilitiesBySeverityCountParams{ + timeout: timeout, + } +} + +// NewReadContainerVulnerabilitiesBySeverityCountParamsWithContext creates a new ReadContainerVulnerabilitiesBySeverityCountParams object +// with the ability to set a context for a request. +func NewReadContainerVulnerabilitiesBySeverityCountParamsWithContext(ctx context.Context) *ReadContainerVulnerabilitiesBySeverityCountParams { + return &ReadContainerVulnerabilitiesBySeverityCountParams{ + Context: ctx, + } +} + +// NewReadContainerVulnerabilitiesBySeverityCountParamsWithHTTPClient creates a new ReadContainerVulnerabilitiesBySeverityCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainerVulnerabilitiesBySeverityCountParamsWithHTTPClient(client *http.Client) *ReadContainerVulnerabilitiesBySeverityCountParams { + return &ReadContainerVulnerabilitiesBySeverityCountParams{ + HTTPClient: client, + } +} + +/* +ReadContainerVulnerabilitiesBySeverityCountParams contains all the parameters to send to the API endpoint + + for the read container vulnerabilities by severity count operation. + + Typically these are written to a http.Request. +*/ +type ReadContainerVulnerabilitiesBySeverityCountParams struct { + + /* Filter. + + Get vulnerabilities count by severity for container using a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read container vulnerabilities by severity count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) WithDefaults() *ReadContainerVulnerabilitiesBySeverityCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read container vulnerabilities by severity count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) WithTimeout(timeout time.Duration) *ReadContainerVulnerabilitiesBySeverityCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) WithContext(ctx context.Context) *ReadContainerVulnerabilitiesBySeverityCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) WithHTTPClient(client *http.Client) *ReadContainerVulnerabilitiesBySeverityCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) WithFilter(filter *string) *ReadContainerVulnerabilitiesBySeverityCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read container vulnerabilities by severity count params +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainerVulnerabilitiesBySeverityCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_container_vulnerabilities_by_severity_count_responses.go b/falcon/client/kubernetes_protection/read_container_vulnerabilities_by_severity_count_responses.go new file mode 100644 index 00000000..8a0b3783 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_container_vulnerabilities_by_severity_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainerVulnerabilitiesBySeverityCountReader is a Reader for the ReadContainerVulnerabilitiesBySeverityCount structure. +type ReadContainerVulnerabilitiesBySeverityCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainerVulnerabilitiesBySeverityCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainerVulnerabilitiesBySeverityCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainerVulnerabilitiesBySeverityCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainerVulnerabilitiesBySeverityCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainerVulnerabilitiesBySeverityCountInternalServerError() + 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/containers/vulnerability-count-by-severity/v1] ReadContainerVulnerabilitiesBySeverityCount", response, response.Code()) + } +} + +// NewReadContainerVulnerabilitiesBySeverityCountOK creates a ReadContainerVulnerabilitiesBySeverityCountOK with default headers values +func NewReadContainerVulnerabilitiesBySeverityCountOK() *ReadContainerVulnerabilitiesBySeverityCountOK { + return &ReadContainerVulnerabilitiesBySeverityCountOK{} +} + +/* +ReadContainerVulnerabilitiesBySeverityCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainerVulnerabilitiesBySeverityCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read container vulnerabilities by severity count o k response has a 2xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read container vulnerabilities by severity count o k response has a 3xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container vulnerabilities by severity count o k response has a 4xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container vulnerabilities by severity count o k response has a 5xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read container vulnerabilities by severity count o k response a status code equal to that given +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read container vulnerabilities by severity count o k response +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) Code() int { + return 200 +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountOK %+v", 200, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountOK %+v", 200, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainerVulnerabilitiesBySeverityCountForbidden creates a ReadContainerVulnerabilitiesBySeverityCountForbidden with default headers values +func NewReadContainerVulnerabilitiesBySeverityCountForbidden() *ReadContainerVulnerabilitiesBySeverityCountForbidden { + return &ReadContainerVulnerabilitiesBySeverityCountForbidden{} +} + +/* +ReadContainerVulnerabilitiesBySeverityCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainerVulnerabilitiesBySeverityCountForbidden 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 container vulnerabilities by severity count forbidden response has a 2xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container vulnerabilities by severity count forbidden response has a 3xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container vulnerabilities by severity count forbidden response has a 4xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container vulnerabilities by severity count forbidden response has a 5xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read container vulnerabilities by severity count forbidden response a status code equal to that given +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read container vulnerabilities by severity count forbidden response +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) Code() int { + return 403 +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountForbidden) 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 +} + +// NewReadContainerVulnerabilitiesBySeverityCountTooManyRequests creates a ReadContainerVulnerabilitiesBySeverityCountTooManyRequests with default headers values +func NewReadContainerVulnerabilitiesBySeverityCountTooManyRequests() *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests { + return &ReadContainerVulnerabilitiesBySeverityCountTooManyRequests{} +} + +/* +ReadContainerVulnerabilitiesBySeverityCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainerVulnerabilitiesBySeverityCountTooManyRequests 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 container vulnerabilities by severity count too many requests response has a 2xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container vulnerabilities by severity count too many requests response has a 3xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container vulnerabilities by severity count too many requests response has a 4xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read container vulnerabilities by severity count too many requests response has a 5xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read container vulnerabilities by severity count too many requests response a status code equal to that given +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read container vulnerabilities by severity count too many requests response +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountTooManyRequests) 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 +} + +// NewReadContainerVulnerabilitiesBySeverityCountInternalServerError creates a ReadContainerVulnerabilitiesBySeverityCountInternalServerError with default headers values +func NewReadContainerVulnerabilitiesBySeverityCountInternalServerError() *ReadContainerVulnerabilitiesBySeverityCountInternalServerError { + return &ReadContainerVulnerabilitiesBySeverityCountInternalServerError{} +} + +/* +ReadContainerVulnerabilitiesBySeverityCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainerVulnerabilitiesBySeverityCountInternalServerError 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 container vulnerabilities by severity count internal server error response has a 2xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read container vulnerabilities by severity count internal server error response has a 3xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read container vulnerabilities by severity count internal server error response has a 4xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read container vulnerabilities by severity count internal server error response has a 5xx status code +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read container vulnerabilities by severity count internal server error response a status code equal to that given +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read container vulnerabilities by severity count internal server error response +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/vulnerability-count-by-severity/v1][%d] readContainerVulnerabilitiesBySeverityCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainerVulnerabilitiesBySeverityCountInternalServerError) 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/read_containers_by_date_range_count_parameters.go b/falcon/client/kubernetes_protection/read_containers_by_date_range_count_parameters.go new file mode 100644 index 00000000..fd9957a7 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_containers_by_date_range_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadContainersByDateRangeCountParams creates a new ReadContainersByDateRangeCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainersByDateRangeCountParams() *ReadContainersByDateRangeCountParams { + return &ReadContainersByDateRangeCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainersByDateRangeCountParamsWithTimeout creates a new ReadContainersByDateRangeCountParams object +// with the ability to set a timeout on a request. +func NewReadContainersByDateRangeCountParamsWithTimeout(timeout time.Duration) *ReadContainersByDateRangeCountParams { + return &ReadContainersByDateRangeCountParams{ + timeout: timeout, + } +} + +// NewReadContainersByDateRangeCountParamsWithContext creates a new ReadContainersByDateRangeCountParams object +// with the ability to set a context for a request. +func NewReadContainersByDateRangeCountParamsWithContext(ctx context.Context) *ReadContainersByDateRangeCountParams { + return &ReadContainersByDateRangeCountParams{ + Context: ctx, + } +} + +// NewReadContainersByDateRangeCountParamsWithHTTPClient creates a new ReadContainersByDateRangeCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainersByDateRangeCountParamsWithHTTPClient(client *http.Client) *ReadContainersByDateRangeCountParams { + return &ReadContainersByDateRangeCountParams{ + HTTPClient: client, + } +} + +/* +ReadContainersByDateRangeCountParams contains all the parameters to send to the API endpoint + + for the read containers by date range count operation. + + Typically these are written to a http.Request. +*/ +type ReadContainersByDateRangeCountParams struct { + + /* Filter. + + Get container counts using a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read containers by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainersByDateRangeCountParams) WithDefaults() *ReadContainersByDateRangeCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read containers by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainersByDateRangeCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) WithTimeout(timeout time.Duration) *ReadContainersByDateRangeCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) WithContext(ctx context.Context) *ReadContainersByDateRangeCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) WithHTTPClient(client *http.Client) *ReadContainersByDateRangeCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) WithFilter(filter *string) *ReadContainersByDateRangeCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read containers by date range count params +func (o *ReadContainersByDateRangeCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainersByDateRangeCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_containers_by_date_range_count_responses.go b/falcon/client/kubernetes_protection/read_containers_by_date_range_count_responses.go new file mode 100644 index 00000000..c5bc8c99 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_containers_by_date_range_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainersByDateRangeCountReader is a Reader for the ReadContainersByDateRangeCount structure. +type ReadContainersByDateRangeCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainersByDateRangeCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainersByDateRangeCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainersByDateRangeCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainersByDateRangeCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainersByDateRangeCountInternalServerError() + 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/containers/count-by-date/v1] ReadContainersByDateRangeCount", response, response.Code()) + } +} + +// NewReadContainersByDateRangeCountOK creates a ReadContainersByDateRangeCountOK with default headers values +func NewReadContainersByDateRangeCountOK() *ReadContainersByDateRangeCountOK { + return &ReadContainersByDateRangeCountOK{} +} + +/* +ReadContainersByDateRangeCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainersByDateRangeCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read containers by date range count o k response has a 2xx status code +func (o *ReadContainersByDateRangeCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read containers by date range count o k response has a 3xx status code +func (o *ReadContainersByDateRangeCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers by date range count o k response has a 4xx status code +func (o *ReadContainersByDateRangeCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read containers by date range count o k response has a 5xx status code +func (o *ReadContainersByDateRangeCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read containers by date range count o k response a status code equal to that given +func (o *ReadContainersByDateRangeCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read containers by date range count o k response +func (o *ReadContainersByDateRangeCountOK) Code() int { + return 200 +} + +func (o *ReadContainersByDateRangeCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadContainersByDateRangeCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadContainersByDateRangeCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadContainersByDateRangeCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainersByDateRangeCountForbidden creates a ReadContainersByDateRangeCountForbidden with default headers values +func NewReadContainersByDateRangeCountForbidden() *ReadContainersByDateRangeCountForbidden { + return &ReadContainersByDateRangeCountForbidden{} +} + +/* +ReadContainersByDateRangeCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainersByDateRangeCountForbidden 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 containers by date range count forbidden response has a 2xx status code +func (o *ReadContainersByDateRangeCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read containers by date range count forbidden response has a 3xx status code +func (o *ReadContainersByDateRangeCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers by date range count forbidden response has a 4xx status code +func (o *ReadContainersByDateRangeCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read containers by date range count forbidden response has a 5xx status code +func (o *ReadContainersByDateRangeCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read containers by date range count forbidden response a status code equal to that given +func (o *ReadContainersByDateRangeCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read containers by date range count forbidden response +func (o *ReadContainersByDateRangeCountForbidden) Code() int { + return 403 +} + +func (o *ReadContainersByDateRangeCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainersByDateRangeCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainersByDateRangeCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainersByDateRangeCountForbidden) 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 +} + +// NewReadContainersByDateRangeCountTooManyRequests creates a ReadContainersByDateRangeCountTooManyRequests with default headers values +func NewReadContainersByDateRangeCountTooManyRequests() *ReadContainersByDateRangeCountTooManyRequests { + return &ReadContainersByDateRangeCountTooManyRequests{} +} + +/* +ReadContainersByDateRangeCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainersByDateRangeCountTooManyRequests 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 containers by date range count too many requests response has a 2xx status code +func (o *ReadContainersByDateRangeCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read containers by date range count too many requests response has a 3xx status code +func (o *ReadContainersByDateRangeCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers by date range count too many requests response has a 4xx status code +func (o *ReadContainersByDateRangeCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read containers by date range count too many requests response has a 5xx status code +func (o *ReadContainersByDateRangeCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read containers by date range count too many requests response a status code equal to that given +func (o *ReadContainersByDateRangeCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read containers by date range count too many requests response +func (o *ReadContainersByDateRangeCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainersByDateRangeCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainersByDateRangeCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainersByDateRangeCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainersByDateRangeCountTooManyRequests) 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 +} + +// NewReadContainersByDateRangeCountInternalServerError creates a ReadContainersByDateRangeCountInternalServerError with default headers values +func NewReadContainersByDateRangeCountInternalServerError() *ReadContainersByDateRangeCountInternalServerError { + return &ReadContainersByDateRangeCountInternalServerError{} +} + +/* +ReadContainersByDateRangeCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainersByDateRangeCountInternalServerError 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 containers by date range count internal server error response has a 2xx status code +func (o *ReadContainersByDateRangeCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read containers by date range count internal server error response has a 3xx status code +func (o *ReadContainersByDateRangeCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers by date range count internal server error response has a 4xx status code +func (o *ReadContainersByDateRangeCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read containers by date range count internal server error response has a 5xx status code +func (o *ReadContainersByDateRangeCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read containers by date range count internal server error response a status code equal to that given +func (o *ReadContainersByDateRangeCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read containers by date range count internal server error response +func (o *ReadContainersByDateRangeCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainersByDateRangeCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainersByDateRangeCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-by-date/v1][%d] readContainersByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainersByDateRangeCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainersByDateRangeCountInternalServerError) 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/read_containers_sensor_coverage_parameters.go b/falcon/client/kubernetes_protection/read_containers_sensor_coverage_parameters.go new file mode 100644 index 00000000..885e8fcc --- /dev/null +++ b/falcon/client/kubernetes_protection/read_containers_sensor_coverage_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadContainersSensorCoverageParams creates a new ReadContainersSensorCoverageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadContainersSensorCoverageParams() *ReadContainersSensorCoverageParams { + return &ReadContainersSensorCoverageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadContainersSensorCoverageParamsWithTimeout creates a new ReadContainersSensorCoverageParams object +// with the ability to set a timeout on a request. +func NewReadContainersSensorCoverageParamsWithTimeout(timeout time.Duration) *ReadContainersSensorCoverageParams { + return &ReadContainersSensorCoverageParams{ + timeout: timeout, + } +} + +// NewReadContainersSensorCoverageParamsWithContext creates a new ReadContainersSensorCoverageParams object +// with the ability to set a context for a request. +func NewReadContainersSensorCoverageParamsWithContext(ctx context.Context) *ReadContainersSensorCoverageParams { + return &ReadContainersSensorCoverageParams{ + Context: ctx, + } +} + +// NewReadContainersSensorCoverageParamsWithHTTPClient creates a new ReadContainersSensorCoverageParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadContainersSensorCoverageParamsWithHTTPClient(client *http.Client) *ReadContainersSensorCoverageParams { + return &ReadContainersSensorCoverageParams{ + HTTPClient: client, + } +} + +/* +ReadContainersSensorCoverageParams contains all the parameters to send to the API endpoint + + for the read containers sensor coverage operation. + + Typically these are written to a http.Request. +*/ +type ReadContainersSensorCoverageParams struct { + + /* Filter. + + Retrieve count of Kubernetes containers that match a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read containers sensor coverage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainersSensorCoverageParams) WithDefaults() *ReadContainersSensorCoverageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read containers sensor coverage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadContainersSensorCoverageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) WithTimeout(timeout time.Duration) *ReadContainersSensorCoverageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) WithContext(ctx context.Context) *ReadContainersSensorCoverageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) WithHTTPClient(client *http.Client) *ReadContainersSensorCoverageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) WithFilter(filter *string) *ReadContainersSensorCoverageParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read containers sensor coverage params +func (o *ReadContainersSensorCoverageParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadContainersSensorCoverageParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_containers_sensor_coverage_responses.go b/falcon/client/kubernetes_protection/read_containers_sensor_coverage_responses.go new file mode 100644 index 00000000..d25feb9b --- /dev/null +++ b/falcon/client/kubernetes_protection/read_containers_sensor_coverage_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadContainersSensorCoverageReader is a Reader for the ReadContainersSensorCoverage structure. +type ReadContainersSensorCoverageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadContainersSensorCoverageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadContainersSensorCoverageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadContainersSensorCoverageForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadContainersSensorCoverageTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadContainersSensorCoverageInternalServerError() + 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/containers/sensor-coverage/v1] ReadContainersSensorCoverage", response, response.Code()) + } +} + +// NewReadContainersSensorCoverageOK creates a ReadContainersSensorCoverageOK with default headers values +func NewReadContainersSensorCoverageOK() *ReadContainersSensorCoverageOK { + return &ReadContainersSensorCoverageOK{} +} + +/* +ReadContainersSensorCoverageOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadContainersSensorCoverageOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read containers sensor coverage o k response has a 2xx status code +func (o *ReadContainersSensorCoverageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read containers sensor coverage o k response has a 3xx status code +func (o *ReadContainersSensorCoverageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers sensor coverage o k response has a 4xx status code +func (o *ReadContainersSensorCoverageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read containers sensor coverage o k response has a 5xx status code +func (o *ReadContainersSensorCoverageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read containers sensor coverage o k response a status code equal to that given +func (o *ReadContainersSensorCoverageOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read containers sensor coverage o k response +func (o *ReadContainersSensorCoverageOK) Code() int { + return 200 +} + +func (o *ReadContainersSensorCoverageOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageOK %+v", 200, o.Payload) +} + +func (o *ReadContainersSensorCoverageOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageOK %+v", 200, o.Payload) +} + +func (o *ReadContainersSensorCoverageOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadContainersSensorCoverageOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadContainersSensorCoverageForbidden creates a ReadContainersSensorCoverageForbidden with default headers values +func NewReadContainersSensorCoverageForbidden() *ReadContainersSensorCoverageForbidden { + return &ReadContainersSensorCoverageForbidden{} +} + +/* +ReadContainersSensorCoverageForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadContainersSensorCoverageForbidden 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 containers sensor coverage forbidden response has a 2xx status code +func (o *ReadContainersSensorCoverageForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read containers sensor coverage forbidden response has a 3xx status code +func (o *ReadContainersSensorCoverageForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers sensor coverage forbidden response has a 4xx status code +func (o *ReadContainersSensorCoverageForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read containers sensor coverage forbidden response has a 5xx status code +func (o *ReadContainersSensorCoverageForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read containers sensor coverage forbidden response a status code equal to that given +func (o *ReadContainersSensorCoverageForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read containers sensor coverage forbidden response +func (o *ReadContainersSensorCoverageForbidden) Code() int { + return 403 +} + +func (o *ReadContainersSensorCoverageForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainersSensorCoverageForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageForbidden %+v", 403, o.Payload) +} + +func (o *ReadContainersSensorCoverageForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainersSensorCoverageForbidden) 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 +} + +// NewReadContainersSensorCoverageTooManyRequests creates a ReadContainersSensorCoverageTooManyRequests with default headers values +func NewReadContainersSensorCoverageTooManyRequests() *ReadContainersSensorCoverageTooManyRequests { + return &ReadContainersSensorCoverageTooManyRequests{} +} + +/* +ReadContainersSensorCoverageTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadContainersSensorCoverageTooManyRequests 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 containers sensor coverage too many requests response has a 2xx status code +func (o *ReadContainersSensorCoverageTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read containers sensor coverage too many requests response has a 3xx status code +func (o *ReadContainersSensorCoverageTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers sensor coverage too many requests response has a 4xx status code +func (o *ReadContainersSensorCoverageTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read containers sensor coverage too many requests response has a 5xx status code +func (o *ReadContainersSensorCoverageTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read containers sensor coverage too many requests response a status code equal to that given +func (o *ReadContainersSensorCoverageTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read containers sensor coverage too many requests response +func (o *ReadContainersSensorCoverageTooManyRequests) Code() int { + return 429 +} + +func (o *ReadContainersSensorCoverageTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainersSensorCoverageTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadContainersSensorCoverageTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadContainersSensorCoverageTooManyRequests) 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 +} + +// NewReadContainersSensorCoverageInternalServerError creates a ReadContainersSensorCoverageInternalServerError with default headers values +func NewReadContainersSensorCoverageInternalServerError() *ReadContainersSensorCoverageInternalServerError { + return &ReadContainersSensorCoverageInternalServerError{} +} + +/* +ReadContainersSensorCoverageInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadContainersSensorCoverageInternalServerError 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 containers sensor coverage internal server error response has a 2xx status code +func (o *ReadContainersSensorCoverageInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read containers sensor coverage internal server error response has a 3xx status code +func (o *ReadContainersSensorCoverageInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read containers sensor coverage internal server error response has a 4xx status code +func (o *ReadContainersSensorCoverageInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read containers sensor coverage internal server error response has a 5xx status code +func (o *ReadContainersSensorCoverageInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read containers sensor coverage internal server error response a status code equal to that given +func (o *ReadContainersSensorCoverageInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read containers sensor coverage internal server error response +func (o *ReadContainersSensorCoverageInternalServerError) Code() int { + return 500 +} + +func (o *ReadContainersSensorCoverageInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainersSensorCoverageInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/sensor-coverage/v1][%d] readContainersSensorCoverageInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadContainersSensorCoverageInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadContainersSensorCoverageInternalServerError) 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/read_deployment_combined_parameters.go b/falcon/client/kubernetes_protection/read_deployment_combined_parameters.go new file mode 100644 index 00000000..6063439b --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployment_combined_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadDeploymentCombinedParams creates a new ReadDeploymentCombinedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadDeploymentCombinedParams() *ReadDeploymentCombinedParams { + return &ReadDeploymentCombinedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadDeploymentCombinedParamsWithTimeout creates a new ReadDeploymentCombinedParams object +// with the ability to set a timeout on a request. +func NewReadDeploymentCombinedParamsWithTimeout(timeout time.Duration) *ReadDeploymentCombinedParams { + return &ReadDeploymentCombinedParams{ + timeout: timeout, + } +} + +// NewReadDeploymentCombinedParamsWithContext creates a new ReadDeploymentCombinedParams object +// with the ability to set a context for a request. +func NewReadDeploymentCombinedParamsWithContext(ctx context.Context) *ReadDeploymentCombinedParams { + return &ReadDeploymentCombinedParams{ + Context: ctx, + } +} + +// NewReadDeploymentCombinedParamsWithHTTPClient creates a new ReadDeploymentCombinedParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadDeploymentCombinedParamsWithHTTPClient(client *http.Client) *ReadDeploymentCombinedParams { + return &ReadDeploymentCombinedParams{ + HTTPClient: client, + } +} + +/* +ReadDeploymentCombinedParams contains all the parameters to send to the API endpoint + + for the read deployment combined operation. + + Typically these are written to a http.Request. +*/ +type ReadDeploymentCombinedParams struct { + + /* Filter. + + Search Kubernetes deployments using a query in Falcon Query Language (FQL). Supported filters: annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,deployment_id,deployment_name,first_seen,last_seen,namespace,pod_count + */ + 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. + + Field to sort results by + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read deployment combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentCombinedParams) WithDefaults() *ReadDeploymentCombinedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read deployment combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentCombinedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read deployment combined params +func (o *ReadDeploymentCombinedParams) WithTimeout(timeout time.Duration) *ReadDeploymentCombinedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read deployment combined params +func (o *ReadDeploymentCombinedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read deployment combined params +func (o *ReadDeploymentCombinedParams) WithContext(ctx context.Context) *ReadDeploymentCombinedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read deployment combined params +func (o *ReadDeploymentCombinedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read deployment combined params +func (o *ReadDeploymentCombinedParams) WithHTTPClient(client *http.Client) *ReadDeploymentCombinedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read deployment combined params +func (o *ReadDeploymentCombinedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read deployment combined params +func (o *ReadDeploymentCombinedParams) WithFilter(filter *string) *ReadDeploymentCombinedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read deployment combined params +func (o *ReadDeploymentCombinedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the read deployment combined params +func (o *ReadDeploymentCombinedParams) WithLimit(limit *int64) *ReadDeploymentCombinedParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read deployment combined params +func (o *ReadDeploymentCombinedParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the read deployment combined params +func (o *ReadDeploymentCombinedParams) WithOffset(offset *int64) *ReadDeploymentCombinedParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the read deployment combined params +func (o *ReadDeploymentCombinedParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the read deployment combined params +func (o *ReadDeploymentCombinedParams) WithSort(sort *string) *ReadDeploymentCombinedParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the read deployment combined params +func (o *ReadDeploymentCombinedParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadDeploymentCombinedParams) 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/kubernetes_protection/read_deployment_combined_responses.go b/falcon/client/kubernetes_protection/read_deployment_combined_responses.go new file mode 100644 index 00000000..c45b1b18 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployment_combined_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadDeploymentCombinedReader is a Reader for the ReadDeploymentCombined structure. +type ReadDeploymentCombinedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadDeploymentCombinedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadDeploymentCombinedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadDeploymentCombinedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadDeploymentCombinedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadDeploymentCombinedInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/deployments/v1] ReadDeploymentCombined", response, response.Code()) + } +} + +// NewReadDeploymentCombinedOK creates a ReadDeploymentCombinedOK with default headers values +func NewReadDeploymentCombinedOK() *ReadDeploymentCombinedOK { + return &ReadDeploymentCombinedOK{} +} + +/* +ReadDeploymentCombinedOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadDeploymentCombinedOK 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.ModelsDeploymentEntityResponse +} + +// IsSuccess returns true when this read deployment combined o k response has a 2xx status code +func (o *ReadDeploymentCombinedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read deployment combined o k response has a 3xx status code +func (o *ReadDeploymentCombinedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment combined o k response has a 4xx status code +func (o *ReadDeploymentCombinedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployment combined o k response has a 5xx status code +func (o *ReadDeploymentCombinedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment combined o k response a status code equal to that given +func (o *ReadDeploymentCombinedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read deployment combined o k response +func (o *ReadDeploymentCombinedOK) Code() int { + return 200 +} + +func (o *ReadDeploymentCombinedOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentCombinedOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentCombinedOK) GetPayload() *models.ModelsDeploymentEntityResponse { + return o.Payload +} + +func (o *ReadDeploymentCombinedOK) 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.ModelsDeploymentEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentCombinedForbidden creates a ReadDeploymentCombinedForbidden with default headers values +func NewReadDeploymentCombinedForbidden() *ReadDeploymentCombinedForbidden { + return &ReadDeploymentCombinedForbidden{} +} + +/* +ReadDeploymentCombinedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadDeploymentCombinedForbidden 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 deployment combined forbidden response has a 2xx status code +func (o *ReadDeploymentCombinedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment combined forbidden response has a 3xx status code +func (o *ReadDeploymentCombinedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment combined forbidden response has a 4xx status code +func (o *ReadDeploymentCombinedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployment combined forbidden response has a 5xx status code +func (o *ReadDeploymentCombinedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment combined forbidden response a status code equal to that given +func (o *ReadDeploymentCombinedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read deployment combined forbidden response +func (o *ReadDeploymentCombinedForbidden) Code() int { + return 403 +} + +func (o *ReadDeploymentCombinedForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentCombinedForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentCombinedForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentCombinedForbidden) 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 +} + +// NewReadDeploymentCombinedTooManyRequests creates a ReadDeploymentCombinedTooManyRequests with default headers values +func NewReadDeploymentCombinedTooManyRequests() *ReadDeploymentCombinedTooManyRequests { + return &ReadDeploymentCombinedTooManyRequests{} +} + +/* +ReadDeploymentCombinedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadDeploymentCombinedTooManyRequests 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 deployment combined too many requests response has a 2xx status code +func (o *ReadDeploymentCombinedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment combined too many requests response has a 3xx status code +func (o *ReadDeploymentCombinedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment combined too many requests response has a 4xx status code +func (o *ReadDeploymentCombinedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployment combined too many requests response has a 5xx status code +func (o *ReadDeploymentCombinedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment combined too many requests response a status code equal to that given +func (o *ReadDeploymentCombinedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read deployment combined too many requests response +func (o *ReadDeploymentCombinedTooManyRequests) Code() int { + return 429 +} + +func (o *ReadDeploymentCombinedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentCombinedTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentCombinedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentCombinedTooManyRequests) 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 +} + +// NewReadDeploymentCombinedInternalServerError creates a ReadDeploymentCombinedInternalServerError with default headers values +func NewReadDeploymentCombinedInternalServerError() *ReadDeploymentCombinedInternalServerError { + return &ReadDeploymentCombinedInternalServerError{} +} + +/* +ReadDeploymentCombinedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadDeploymentCombinedInternalServerError 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 deployment combined internal server error response has a 2xx status code +func (o *ReadDeploymentCombinedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment combined internal server error response has a 3xx status code +func (o *ReadDeploymentCombinedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment combined internal server error response has a 4xx status code +func (o *ReadDeploymentCombinedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployment combined internal server error response has a 5xx status code +func (o *ReadDeploymentCombinedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read deployment combined internal server error response a status code equal to that given +func (o *ReadDeploymentCombinedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read deployment combined internal server error response +func (o *ReadDeploymentCombinedInternalServerError) Code() int { + return 500 +} + +func (o *ReadDeploymentCombinedInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentCombinedInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/deployments/v1][%d] readDeploymentCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentCombinedInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadDeploymentCombinedInternalServerError) 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/read_deployment_count_parameters.go b/falcon/client/kubernetes_protection/read_deployment_count_parameters.go new file mode 100644 index 00000000..9d4d4199 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployment_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadDeploymentCountParams creates a new ReadDeploymentCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadDeploymentCountParams() *ReadDeploymentCountParams { + return &ReadDeploymentCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadDeploymentCountParamsWithTimeout creates a new ReadDeploymentCountParams object +// with the ability to set a timeout on a request. +func NewReadDeploymentCountParamsWithTimeout(timeout time.Duration) *ReadDeploymentCountParams { + return &ReadDeploymentCountParams{ + timeout: timeout, + } +} + +// NewReadDeploymentCountParamsWithContext creates a new ReadDeploymentCountParams object +// with the ability to set a context for a request. +func NewReadDeploymentCountParamsWithContext(ctx context.Context) *ReadDeploymentCountParams { + return &ReadDeploymentCountParams{ + Context: ctx, + } +} + +// NewReadDeploymentCountParamsWithHTTPClient creates a new ReadDeploymentCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadDeploymentCountParamsWithHTTPClient(client *http.Client) *ReadDeploymentCountParams { + return &ReadDeploymentCountParams{ + HTTPClient: client, + } +} + +/* +ReadDeploymentCountParams contains all the parameters to send to the API endpoint + + for the read deployment count operation. + + Typically these are written to a http.Request. +*/ +type ReadDeploymentCountParams struct { + + /* Filter. + + Retrieve count of Kubernetes deployments that match a query in Falcon Query Language (FQL). Supported filters: annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,deployment_id,deployment_name,first_seen,last_seen,namespace,pod_count + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read deployment count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentCountParams) WithDefaults() *ReadDeploymentCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read deployment count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read deployment count params +func (o *ReadDeploymentCountParams) WithTimeout(timeout time.Duration) *ReadDeploymentCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read deployment count params +func (o *ReadDeploymentCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read deployment count params +func (o *ReadDeploymentCountParams) WithContext(ctx context.Context) *ReadDeploymentCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read deployment count params +func (o *ReadDeploymentCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read deployment count params +func (o *ReadDeploymentCountParams) WithHTTPClient(client *http.Client) *ReadDeploymentCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read deployment count params +func (o *ReadDeploymentCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read deployment count params +func (o *ReadDeploymentCountParams) WithFilter(filter *string) *ReadDeploymentCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read deployment count params +func (o *ReadDeploymentCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadDeploymentCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_deployment_count_responses.go b/falcon/client/kubernetes_protection/read_deployment_count_responses.go new file mode 100644 index 00000000..34796c61 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployment_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadDeploymentCountReader is a Reader for the ReadDeploymentCount structure. +type ReadDeploymentCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadDeploymentCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadDeploymentCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadDeploymentCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadDeploymentCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadDeploymentCountInternalServerError() + 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/deployments/count/v1] ReadDeploymentCount", response, response.Code()) + } +} + +// NewReadDeploymentCountOK creates a ReadDeploymentCountOK with default headers values +func NewReadDeploymentCountOK() *ReadDeploymentCountOK { + return &ReadDeploymentCountOK{} +} + +/* +ReadDeploymentCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadDeploymentCountOK 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.CommonCountResponse +} + +// IsSuccess returns true when this read deployment count o k response has a 2xx status code +func (o *ReadDeploymentCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read deployment count o k response has a 3xx status code +func (o *ReadDeploymentCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment count o k response has a 4xx status code +func (o *ReadDeploymentCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployment count o k response has a 5xx status code +func (o *ReadDeploymentCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment count o k response a status code equal to that given +func (o *ReadDeploymentCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read deployment count o k response +func (o *ReadDeploymentCountOK) Code() int { + return 200 +} + +func (o *ReadDeploymentCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentCountOK) GetPayload() *models.CommonCountResponse { + return o.Payload +} + +func (o *ReadDeploymentCountOK) 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.CommonCountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentCountForbidden creates a ReadDeploymentCountForbidden with default headers values +func NewReadDeploymentCountForbidden() *ReadDeploymentCountForbidden { + return &ReadDeploymentCountForbidden{} +} + +/* +ReadDeploymentCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadDeploymentCountForbidden 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 deployment count forbidden response has a 2xx status code +func (o *ReadDeploymentCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment count forbidden response has a 3xx status code +func (o *ReadDeploymentCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment count forbidden response has a 4xx status code +func (o *ReadDeploymentCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployment count forbidden response has a 5xx status code +func (o *ReadDeploymentCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment count forbidden response a status code equal to that given +func (o *ReadDeploymentCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read deployment count forbidden response +func (o *ReadDeploymentCountForbidden) Code() int { + return 403 +} + +func (o *ReadDeploymentCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentCountForbidden) 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 +} + +// NewReadDeploymentCountTooManyRequests creates a ReadDeploymentCountTooManyRequests with default headers values +func NewReadDeploymentCountTooManyRequests() *ReadDeploymentCountTooManyRequests { + return &ReadDeploymentCountTooManyRequests{} +} + +/* +ReadDeploymentCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadDeploymentCountTooManyRequests 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 deployment count too many requests response has a 2xx status code +func (o *ReadDeploymentCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment count too many requests response has a 3xx status code +func (o *ReadDeploymentCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment count too many requests response has a 4xx status code +func (o *ReadDeploymentCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployment count too many requests response has a 5xx status code +func (o *ReadDeploymentCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment count too many requests response a status code equal to that given +func (o *ReadDeploymentCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read deployment count too many requests response +func (o *ReadDeploymentCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadDeploymentCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentCountTooManyRequests) 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 +} + +// NewReadDeploymentCountInternalServerError creates a ReadDeploymentCountInternalServerError with default headers values +func NewReadDeploymentCountInternalServerError() *ReadDeploymentCountInternalServerError { + return &ReadDeploymentCountInternalServerError{} +} + +/* +ReadDeploymentCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadDeploymentCountInternalServerError 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 deployment count internal server error response has a 2xx status code +func (o *ReadDeploymentCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment count internal server error response has a 3xx status code +func (o *ReadDeploymentCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment count internal server error response has a 4xx status code +func (o *ReadDeploymentCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployment count internal server error response has a 5xx status code +func (o *ReadDeploymentCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read deployment count internal server error response a status code equal to that given +func (o *ReadDeploymentCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read deployment count internal server error response +func (o *ReadDeploymentCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadDeploymentCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count/v1][%d] readDeploymentCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadDeploymentCountInternalServerError) 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/read_deployment_enrichment_parameters.go b/falcon/client/kubernetes_protection/read_deployment_enrichment_parameters.go new file mode 100644 index 00000000..8f255787 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployment_enrichment_parameters.go @@ -0,0 +1,209 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadDeploymentEnrichmentParams creates a new ReadDeploymentEnrichmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadDeploymentEnrichmentParams() *ReadDeploymentEnrichmentParams { + return &ReadDeploymentEnrichmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadDeploymentEnrichmentParamsWithTimeout creates a new ReadDeploymentEnrichmentParams object +// with the ability to set a timeout on a request. +func NewReadDeploymentEnrichmentParamsWithTimeout(timeout time.Duration) *ReadDeploymentEnrichmentParams { + return &ReadDeploymentEnrichmentParams{ + timeout: timeout, + } +} + +// NewReadDeploymentEnrichmentParamsWithContext creates a new ReadDeploymentEnrichmentParams object +// with the ability to set a context for a request. +func NewReadDeploymentEnrichmentParamsWithContext(ctx context.Context) *ReadDeploymentEnrichmentParams { + return &ReadDeploymentEnrichmentParams{ + Context: ctx, + } +} + +// NewReadDeploymentEnrichmentParamsWithHTTPClient creates a new ReadDeploymentEnrichmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadDeploymentEnrichmentParamsWithHTTPClient(client *http.Client) *ReadDeploymentEnrichmentParams { + return &ReadDeploymentEnrichmentParams{ + HTTPClient: client, + } +} + +/* +ReadDeploymentEnrichmentParams contains all the parameters to send to the API endpoint + + for the read deployment enrichment operation. + + Typically these are written to a http.Request. +*/ +type ReadDeploymentEnrichmentParams 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 +} + +// WithDefaults hydrates default values in the read deployment enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentEnrichmentParams) WithDefaults() *ReadDeploymentEnrichmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read deployment enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentEnrichmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) WithTimeout(timeout time.Duration) *ReadDeploymentEnrichmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) WithContext(ctx context.Context) *ReadDeploymentEnrichmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) WithHTTPClient(client *http.Client) *ReadDeploymentEnrichmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDeploymentID adds the deploymentID to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) WithDeploymentID(deploymentID []string) *ReadDeploymentEnrichmentParams { + o.SetDeploymentID(deploymentID) + return o +} + +// SetDeploymentID adds the deploymentId to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) SetDeploymentID(deploymentID []string) { + o.DeploymentID = deploymentID +} + +// WithFilter adds the filter to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) WithFilter(filter *string) *ReadDeploymentEnrichmentParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read deployment enrichment params +func (o *ReadDeploymentEnrichmentParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadDeploymentEnrichmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + 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 +} + +// bindParamReadDeploymentEnrichment binds the parameter deployment_id +func (o *ReadDeploymentEnrichmentParams) 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/kubernetes_protection/read_deployment_enrichment_responses.go b/falcon/client/kubernetes_protection/read_deployment_enrichment_responses.go new file mode 100644 index 00000000..34b60f47 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployment_enrichment_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadDeploymentEnrichmentReader is a Reader for the ReadDeploymentEnrichment structure. +type ReadDeploymentEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadDeploymentEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadDeploymentEnrichmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadDeploymentEnrichmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadDeploymentEnrichmentTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadDeploymentEnrichmentInternalServerError() + 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] ReadDeploymentEnrichment", response, response.Code()) + } +} + +// NewReadDeploymentEnrichmentOK creates a ReadDeploymentEnrichmentOK with default headers values +func NewReadDeploymentEnrichmentOK() *ReadDeploymentEnrichmentOK { + return &ReadDeploymentEnrichmentOK{} +} + +/* +ReadDeploymentEnrichmentOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadDeploymentEnrichmentOK 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 read deployment enrichment o k response has a 2xx status code +func (o *ReadDeploymentEnrichmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read deployment enrichment o k response has a 3xx status code +func (o *ReadDeploymentEnrichmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment enrichment o k response has a 4xx status code +func (o *ReadDeploymentEnrichmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployment enrichment o k response has a 5xx status code +func (o *ReadDeploymentEnrichmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment enrichment o k response a status code equal to that given +func (o *ReadDeploymentEnrichmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read deployment enrichment o k response +func (o *ReadDeploymentEnrichmentOK) Code() int { + return 200 +} + +func (o *ReadDeploymentEnrichmentOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentEnrichmentOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentEnrichmentOK) GetPayload() *models.K8sassetsDeploymentEnrichmentResponse { + return o.Payload +} + +func (o *ReadDeploymentEnrichmentOK) 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 +} + +// NewReadDeploymentEnrichmentForbidden creates a ReadDeploymentEnrichmentForbidden with default headers values +func NewReadDeploymentEnrichmentForbidden() *ReadDeploymentEnrichmentForbidden { + return &ReadDeploymentEnrichmentForbidden{} +} + +/* +ReadDeploymentEnrichmentForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadDeploymentEnrichmentForbidden 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 deployment enrichment forbidden response has a 2xx status code +func (o *ReadDeploymentEnrichmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment enrichment forbidden response has a 3xx status code +func (o *ReadDeploymentEnrichmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment enrichment forbidden response has a 4xx status code +func (o *ReadDeploymentEnrichmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployment enrichment forbidden response has a 5xx status code +func (o *ReadDeploymentEnrichmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment enrichment forbidden response a status code equal to that given +func (o *ReadDeploymentEnrichmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read deployment enrichment forbidden response +func (o *ReadDeploymentEnrichmentForbidden) Code() int { + return 403 +} + +func (o *ReadDeploymentEnrichmentForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentEnrichmentForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentEnrichmentForbidden) 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 +} + +// NewReadDeploymentEnrichmentTooManyRequests creates a ReadDeploymentEnrichmentTooManyRequests with default headers values +func NewReadDeploymentEnrichmentTooManyRequests() *ReadDeploymentEnrichmentTooManyRequests { + return &ReadDeploymentEnrichmentTooManyRequests{} +} + +/* +ReadDeploymentEnrichmentTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadDeploymentEnrichmentTooManyRequests 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 deployment enrichment too many requests response has a 2xx status code +func (o *ReadDeploymentEnrichmentTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment enrichment too many requests response has a 3xx status code +func (o *ReadDeploymentEnrichmentTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment enrichment too many requests response has a 4xx status code +func (o *ReadDeploymentEnrichmentTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployment enrichment too many requests response has a 5xx status code +func (o *ReadDeploymentEnrichmentTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployment enrichment too many requests response a status code equal to that given +func (o *ReadDeploymentEnrichmentTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read deployment enrichment too many requests response +func (o *ReadDeploymentEnrichmentTooManyRequests) Code() int { + return 429 +} + +func (o *ReadDeploymentEnrichmentTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentEnrichmentTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentEnrichmentTooManyRequests) 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 +} + +// NewReadDeploymentEnrichmentInternalServerError creates a ReadDeploymentEnrichmentInternalServerError with default headers values +func NewReadDeploymentEnrichmentInternalServerError() *ReadDeploymentEnrichmentInternalServerError { + return &ReadDeploymentEnrichmentInternalServerError{} +} + +/* +ReadDeploymentEnrichmentInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadDeploymentEnrichmentInternalServerError 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 deployment enrichment internal server error response has a 2xx status code +func (o *ReadDeploymentEnrichmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployment enrichment internal server error response has a 3xx status code +func (o *ReadDeploymentEnrichmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployment enrichment internal server error response has a 4xx status code +func (o *ReadDeploymentEnrichmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployment enrichment internal server error response has a 5xx status code +func (o *ReadDeploymentEnrichmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read deployment enrichment internal server error response a status code equal to that given +func (o *ReadDeploymentEnrichmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read deployment enrichment internal server error response +func (o *ReadDeploymentEnrichmentInternalServerError) Code() int { + return 500 +} + +func (o *ReadDeploymentEnrichmentInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentEnrichmentInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/deployments/entities/v1][%d] readDeploymentEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadDeploymentEnrichmentInternalServerError) 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/read_deployments_by_date_range_count_parameters.go b/falcon/client/kubernetes_protection/read_deployments_by_date_range_count_parameters.go new file mode 100644 index 00000000..c019e96f --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployments_by_date_range_count_parameters.go @@ -0,0 +1,128 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadDeploymentsByDateRangeCountParams creates a new ReadDeploymentsByDateRangeCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadDeploymentsByDateRangeCountParams() *ReadDeploymentsByDateRangeCountParams { + return &ReadDeploymentsByDateRangeCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadDeploymentsByDateRangeCountParamsWithTimeout creates a new ReadDeploymentsByDateRangeCountParams object +// with the ability to set a timeout on a request. +func NewReadDeploymentsByDateRangeCountParamsWithTimeout(timeout time.Duration) *ReadDeploymentsByDateRangeCountParams { + return &ReadDeploymentsByDateRangeCountParams{ + timeout: timeout, + } +} + +// NewReadDeploymentsByDateRangeCountParamsWithContext creates a new ReadDeploymentsByDateRangeCountParams object +// with the ability to set a context for a request. +func NewReadDeploymentsByDateRangeCountParamsWithContext(ctx context.Context) *ReadDeploymentsByDateRangeCountParams { + return &ReadDeploymentsByDateRangeCountParams{ + Context: ctx, + } +} + +// NewReadDeploymentsByDateRangeCountParamsWithHTTPClient creates a new ReadDeploymentsByDateRangeCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadDeploymentsByDateRangeCountParamsWithHTTPClient(client *http.Client) *ReadDeploymentsByDateRangeCountParams { + return &ReadDeploymentsByDateRangeCountParams{ + HTTPClient: client, + } +} + +/* +ReadDeploymentsByDateRangeCountParams contains all the parameters to send to the API endpoint + + for the read deployments by date range count operation. + + Typically these are written to a http.Request. +*/ +type ReadDeploymentsByDateRangeCountParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read deployments by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentsByDateRangeCountParams) WithDefaults() *ReadDeploymentsByDateRangeCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read deployments by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDeploymentsByDateRangeCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read deployments by date range count params +func (o *ReadDeploymentsByDateRangeCountParams) WithTimeout(timeout time.Duration) *ReadDeploymentsByDateRangeCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read deployments by date range count params +func (o *ReadDeploymentsByDateRangeCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read deployments by date range count params +func (o *ReadDeploymentsByDateRangeCountParams) WithContext(ctx context.Context) *ReadDeploymentsByDateRangeCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read deployments by date range count params +func (o *ReadDeploymentsByDateRangeCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read deployments by date range count params +func (o *ReadDeploymentsByDateRangeCountParams) WithHTTPClient(client *http.Client) *ReadDeploymentsByDateRangeCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read deployments by date range count params +func (o *ReadDeploymentsByDateRangeCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadDeploymentsByDateRangeCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_deployments_by_date_range_count_responses.go b/falcon/client/kubernetes_protection/read_deployments_by_date_range_count_responses.go new file mode 100644 index 00000000..c94d4ac1 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_deployments_by_date_range_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadDeploymentsByDateRangeCountReader is a Reader for the ReadDeploymentsByDateRangeCount structure. +type ReadDeploymentsByDateRangeCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadDeploymentsByDateRangeCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadDeploymentsByDateRangeCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadDeploymentsByDateRangeCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadDeploymentsByDateRangeCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadDeploymentsByDateRangeCountInternalServerError() + 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/deployments/count-by-date/v1] ReadDeploymentsByDateRangeCount", response, response.Code()) + } +} + +// NewReadDeploymentsByDateRangeCountOK creates a ReadDeploymentsByDateRangeCountOK with default headers values +func NewReadDeploymentsByDateRangeCountOK() *ReadDeploymentsByDateRangeCountOK { + return &ReadDeploymentsByDateRangeCountOK{} +} + +/* +ReadDeploymentsByDateRangeCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadDeploymentsByDateRangeCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read deployments by date range count o k response has a 2xx status code +func (o *ReadDeploymentsByDateRangeCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read deployments by date range count o k response has a 3xx status code +func (o *ReadDeploymentsByDateRangeCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments by date range count o k response has a 4xx status code +func (o *ReadDeploymentsByDateRangeCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployments by date range count o k response has a 5xx status code +func (o *ReadDeploymentsByDateRangeCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments by date range count o k response a status code equal to that given +func (o *ReadDeploymentsByDateRangeCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read deployments by date range count o k response +func (o *ReadDeploymentsByDateRangeCountOK) Code() int { + return 200 +} + +func (o *ReadDeploymentsByDateRangeCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadDeploymentsByDateRangeCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDeploymentsByDateRangeCountForbidden creates a ReadDeploymentsByDateRangeCountForbidden with default headers values +func NewReadDeploymentsByDateRangeCountForbidden() *ReadDeploymentsByDateRangeCountForbidden { + return &ReadDeploymentsByDateRangeCountForbidden{} +} + +/* +ReadDeploymentsByDateRangeCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadDeploymentsByDateRangeCountForbidden 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 deployments by date range count forbidden response has a 2xx status code +func (o *ReadDeploymentsByDateRangeCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments by date range count forbidden response has a 3xx status code +func (o *ReadDeploymentsByDateRangeCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments by date range count forbidden response has a 4xx status code +func (o *ReadDeploymentsByDateRangeCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments by date range count forbidden response has a 5xx status code +func (o *ReadDeploymentsByDateRangeCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments by date range count forbidden response a status code equal to that given +func (o *ReadDeploymentsByDateRangeCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read deployments by date range count forbidden response +func (o *ReadDeploymentsByDateRangeCountForbidden) Code() int { + return 403 +} + +func (o *ReadDeploymentsByDateRangeCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentsByDateRangeCountForbidden) 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 +} + +// NewReadDeploymentsByDateRangeCountTooManyRequests creates a ReadDeploymentsByDateRangeCountTooManyRequests with default headers values +func NewReadDeploymentsByDateRangeCountTooManyRequests() *ReadDeploymentsByDateRangeCountTooManyRequests { + return &ReadDeploymentsByDateRangeCountTooManyRequests{} +} + +/* +ReadDeploymentsByDateRangeCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadDeploymentsByDateRangeCountTooManyRequests 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 by date range count too many requests response has a 2xx status code +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments by date range count too many requests response has a 3xx status code +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments by date range count too many requests response has a 4xx status code +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read deployments by date range count too many requests response has a 5xx status code +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read deployments by date range count too many requests response a status code equal to that given +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read deployments by date range count too many requests response +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDeploymentsByDateRangeCountTooManyRequests) 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 +} + +// NewReadDeploymentsByDateRangeCountInternalServerError creates a ReadDeploymentsByDateRangeCountInternalServerError with default headers values +func NewReadDeploymentsByDateRangeCountInternalServerError() *ReadDeploymentsByDateRangeCountInternalServerError { + return &ReadDeploymentsByDateRangeCountInternalServerError{} +} + +/* +ReadDeploymentsByDateRangeCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadDeploymentsByDateRangeCountInternalServerError 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 deployments by date range count internal server error response has a 2xx status code +func (o *ReadDeploymentsByDateRangeCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read deployments by date range count internal server error response has a 3xx status code +func (o *ReadDeploymentsByDateRangeCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read deployments by date range count internal server error response has a 4xx status code +func (o *ReadDeploymentsByDateRangeCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read deployments by date range count internal server error response has a 5xx status code +func (o *ReadDeploymentsByDateRangeCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read deployments by date range count internal server error response a status code equal to that given +func (o *ReadDeploymentsByDateRangeCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read deployments by date range count internal server error response +func (o *ReadDeploymentsByDateRangeCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadDeploymentsByDateRangeCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/deployments/count-by-date/v1][%d] readDeploymentsByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDeploymentsByDateRangeCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadDeploymentsByDateRangeCountInternalServerError) 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/read_distinct_container_image_count_parameters.go b/falcon/client/kubernetes_protection/read_distinct_container_image_count_parameters.go new file mode 100644 index 00000000..0961f11e --- /dev/null +++ b/falcon/client/kubernetes_protection/read_distinct_container_image_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadDistinctContainerImageCountParams creates a new ReadDistinctContainerImageCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadDistinctContainerImageCountParams() *ReadDistinctContainerImageCountParams { + return &ReadDistinctContainerImageCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadDistinctContainerImageCountParamsWithTimeout creates a new ReadDistinctContainerImageCountParams object +// with the ability to set a timeout on a request. +func NewReadDistinctContainerImageCountParamsWithTimeout(timeout time.Duration) *ReadDistinctContainerImageCountParams { + return &ReadDistinctContainerImageCountParams{ + timeout: timeout, + } +} + +// NewReadDistinctContainerImageCountParamsWithContext creates a new ReadDistinctContainerImageCountParams object +// with the ability to set a context for a request. +func NewReadDistinctContainerImageCountParamsWithContext(ctx context.Context) *ReadDistinctContainerImageCountParams { + return &ReadDistinctContainerImageCountParams{ + Context: ctx, + } +} + +// NewReadDistinctContainerImageCountParamsWithHTTPClient creates a new ReadDistinctContainerImageCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadDistinctContainerImageCountParamsWithHTTPClient(client *http.Client) *ReadDistinctContainerImageCountParams { + return &ReadDistinctContainerImageCountParams{ + HTTPClient: client, + } +} + +/* +ReadDistinctContainerImageCountParams contains all the parameters to send to the API endpoint + + for the read distinct container image count operation. + + Typically these are written to a http.Request. +*/ +type ReadDistinctContainerImageCountParams struct { + + /* Filter. + + Search Kubernetes containers using a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read distinct container image count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDistinctContainerImageCountParams) WithDefaults() *ReadDistinctContainerImageCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read distinct container image count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadDistinctContainerImageCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) WithTimeout(timeout time.Duration) *ReadDistinctContainerImageCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) WithContext(ctx context.Context) *ReadDistinctContainerImageCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) WithHTTPClient(client *http.Client) *ReadDistinctContainerImageCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) WithFilter(filter *string) *ReadDistinctContainerImageCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read distinct container image count params +func (o *ReadDistinctContainerImageCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadDistinctContainerImageCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_distinct_container_image_count_responses.go b/falcon/client/kubernetes_protection/read_distinct_container_image_count_responses.go new file mode 100644 index 00000000..cf530bf7 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_distinct_container_image_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadDistinctContainerImageCountReader is a Reader for the ReadDistinctContainerImageCount structure. +type ReadDistinctContainerImageCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadDistinctContainerImageCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadDistinctContainerImageCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadDistinctContainerImageCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadDistinctContainerImageCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadDistinctContainerImageCountInternalServerError() + 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/images/count-by-distinct/v1] ReadDistinctContainerImageCount", response, response.Code()) + } +} + +// NewReadDistinctContainerImageCountOK creates a ReadDistinctContainerImageCountOK with default headers values +func NewReadDistinctContainerImageCountOK() *ReadDistinctContainerImageCountOK { + return &ReadDistinctContainerImageCountOK{} +} + +/* +ReadDistinctContainerImageCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadDistinctContainerImageCountOK 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.ModelsAPIFilterResponse +} + +// IsSuccess returns true when this read distinct container image count o k response has a 2xx status code +func (o *ReadDistinctContainerImageCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read distinct container image count o k response has a 3xx status code +func (o *ReadDistinctContainerImageCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read distinct container image count o k response has a 4xx status code +func (o *ReadDistinctContainerImageCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read distinct container image count o k response has a 5xx status code +func (o *ReadDistinctContainerImageCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read distinct container image count o k response a status code equal to that given +func (o *ReadDistinctContainerImageCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read distinct container image count o k response +func (o *ReadDistinctContainerImageCountOK) Code() int { + return 200 +} + +func (o *ReadDistinctContainerImageCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountOK %+v", 200, o.Payload) +} + +func (o *ReadDistinctContainerImageCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountOK %+v", 200, o.Payload) +} + +func (o *ReadDistinctContainerImageCountOK) GetPayload() *models.ModelsAPIFilterResponse { + return o.Payload +} + +func (o *ReadDistinctContainerImageCountOK) 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.ModelsAPIFilterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadDistinctContainerImageCountForbidden creates a ReadDistinctContainerImageCountForbidden with default headers values +func NewReadDistinctContainerImageCountForbidden() *ReadDistinctContainerImageCountForbidden { + return &ReadDistinctContainerImageCountForbidden{} +} + +/* +ReadDistinctContainerImageCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadDistinctContainerImageCountForbidden 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 distinct container image count forbidden response has a 2xx status code +func (o *ReadDistinctContainerImageCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read distinct container image count forbidden response has a 3xx status code +func (o *ReadDistinctContainerImageCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read distinct container image count forbidden response has a 4xx status code +func (o *ReadDistinctContainerImageCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read distinct container image count forbidden response has a 5xx status code +func (o *ReadDistinctContainerImageCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read distinct container image count forbidden response a status code equal to that given +func (o *ReadDistinctContainerImageCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read distinct container image count forbidden response +func (o *ReadDistinctContainerImageCountForbidden) Code() int { + return 403 +} + +func (o *ReadDistinctContainerImageCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadDistinctContainerImageCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadDistinctContainerImageCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDistinctContainerImageCountForbidden) 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 +} + +// NewReadDistinctContainerImageCountTooManyRequests creates a ReadDistinctContainerImageCountTooManyRequests with default headers values +func NewReadDistinctContainerImageCountTooManyRequests() *ReadDistinctContainerImageCountTooManyRequests { + return &ReadDistinctContainerImageCountTooManyRequests{} +} + +/* +ReadDistinctContainerImageCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadDistinctContainerImageCountTooManyRequests 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 distinct container image count too many requests response has a 2xx status code +func (o *ReadDistinctContainerImageCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read distinct container image count too many requests response has a 3xx status code +func (o *ReadDistinctContainerImageCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read distinct container image count too many requests response has a 4xx status code +func (o *ReadDistinctContainerImageCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read distinct container image count too many requests response has a 5xx status code +func (o *ReadDistinctContainerImageCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read distinct container image count too many requests response a status code equal to that given +func (o *ReadDistinctContainerImageCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read distinct container image count too many requests response +func (o *ReadDistinctContainerImageCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadDistinctContainerImageCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDistinctContainerImageCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadDistinctContainerImageCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadDistinctContainerImageCountTooManyRequests) 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 +} + +// NewReadDistinctContainerImageCountInternalServerError creates a ReadDistinctContainerImageCountInternalServerError with default headers values +func NewReadDistinctContainerImageCountInternalServerError() *ReadDistinctContainerImageCountInternalServerError { + return &ReadDistinctContainerImageCountInternalServerError{} +} + +/* +ReadDistinctContainerImageCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadDistinctContainerImageCountInternalServerError 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 distinct container image count internal server error response has a 2xx status code +func (o *ReadDistinctContainerImageCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read distinct container image count internal server error response has a 3xx status code +func (o *ReadDistinctContainerImageCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read distinct container image count internal server error response has a 4xx status code +func (o *ReadDistinctContainerImageCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read distinct container image count internal server error response has a 5xx status code +func (o *ReadDistinctContainerImageCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read distinct container image count internal server error response a status code equal to that given +func (o *ReadDistinctContainerImageCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read distinct container image count internal server error response +func (o *ReadDistinctContainerImageCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadDistinctContainerImageCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDistinctContainerImageCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/images/count-by-distinct/v1][%d] readDistinctContainerImageCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadDistinctContainerImageCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadDistinctContainerImageCountInternalServerError) 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/read_kubernetes_iom_by_date_range_parameters.go b/falcon/client/kubernetes_protection/read_kubernetes_iom_by_date_range_parameters.go new file mode 100644 index 00000000..75fbd013 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_kubernetes_iom_by_date_range_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadKubernetesIomByDateRangeParams creates a new ReadKubernetesIomByDateRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadKubernetesIomByDateRangeParams() *ReadKubernetesIomByDateRangeParams { + return &ReadKubernetesIomByDateRangeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadKubernetesIomByDateRangeParamsWithTimeout creates a new ReadKubernetesIomByDateRangeParams object +// with the ability to set a timeout on a request. +func NewReadKubernetesIomByDateRangeParamsWithTimeout(timeout time.Duration) *ReadKubernetesIomByDateRangeParams { + return &ReadKubernetesIomByDateRangeParams{ + timeout: timeout, + } +} + +// NewReadKubernetesIomByDateRangeParamsWithContext creates a new ReadKubernetesIomByDateRangeParams object +// with the ability to set a context for a request. +func NewReadKubernetesIomByDateRangeParamsWithContext(ctx context.Context) *ReadKubernetesIomByDateRangeParams { + return &ReadKubernetesIomByDateRangeParams{ + Context: ctx, + } +} + +// NewReadKubernetesIomByDateRangeParamsWithHTTPClient creates a new ReadKubernetesIomByDateRangeParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadKubernetesIomByDateRangeParamsWithHTTPClient(client *http.Client) *ReadKubernetesIomByDateRangeParams { + return &ReadKubernetesIomByDateRangeParams{ + HTTPClient: client, + } +} + +/* +ReadKubernetesIomByDateRangeParams contains all the parameters to send to the API endpoint + + for the read kubernetes iom by date range operation. + + Typically these are written to a http.Request. +*/ +type ReadKubernetesIomByDateRangeParams struct { + + /* Filter. + + Filter images using a query in Falcon Query Language (FQL). Supported filters: cid,created_timestamp,detect_timestamp,severity + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read kubernetes iom by date range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadKubernetesIomByDateRangeParams) WithDefaults() *ReadKubernetesIomByDateRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read kubernetes iom by date range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadKubernetesIomByDateRangeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) WithTimeout(timeout time.Duration) *ReadKubernetesIomByDateRangeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) WithContext(ctx context.Context) *ReadKubernetesIomByDateRangeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) WithHTTPClient(client *http.Client) *ReadKubernetesIomByDateRangeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) WithFilter(filter *string) *ReadKubernetesIomByDateRangeParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read kubernetes iom by date range params +func (o *ReadKubernetesIomByDateRangeParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadKubernetesIomByDateRangeParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_kubernetes_iom_by_date_range_responses.go b/falcon/client/kubernetes_protection/read_kubernetes_iom_by_date_range_responses.go new file mode 100644 index 00000000..01d8267c --- /dev/null +++ b/falcon/client/kubernetes_protection/read_kubernetes_iom_by_date_range_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadKubernetesIomByDateRangeReader is a Reader for the ReadKubernetesIomByDateRange structure. +type ReadKubernetesIomByDateRangeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadKubernetesIomByDateRangeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadKubernetesIomByDateRangeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadKubernetesIomByDateRangeForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadKubernetesIomByDateRangeTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadKubernetesIomByDateRangeInternalServerError() + 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/kubernetes-ioms/count-by-date/v1] ReadKubernetesIomByDateRange", response, response.Code()) + } +} + +// NewReadKubernetesIomByDateRangeOK creates a ReadKubernetesIomByDateRangeOK with default headers values +func NewReadKubernetesIomByDateRangeOK() *ReadKubernetesIomByDateRangeOK { + return &ReadKubernetesIomByDateRangeOK{} +} + +/* +ReadKubernetesIomByDateRangeOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadKubernetesIomByDateRangeOK 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.K8siomsKubernetesIOMFieldValue +} + +// IsSuccess returns true when this read kubernetes iom by date range o k response has a 2xx status code +func (o *ReadKubernetesIomByDateRangeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read kubernetes iom by date range o k response has a 3xx status code +func (o *ReadKubernetesIomByDateRangeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom by date range o k response has a 4xx status code +func (o *ReadKubernetesIomByDateRangeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read kubernetes iom by date range o k response has a 5xx status code +func (o *ReadKubernetesIomByDateRangeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom by date range o k response a status code equal to that given +func (o *ReadKubernetesIomByDateRangeOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read kubernetes iom by date range o k response +func (o *ReadKubernetesIomByDateRangeOK) Code() int { + return 200 +} + +func (o *ReadKubernetesIomByDateRangeOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeOK %+v", 200, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeOK %+v", 200, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeOK) GetPayload() *models.K8siomsKubernetesIOMFieldValue { + return o.Payload +} + +func (o *ReadKubernetesIomByDateRangeOK) 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.K8siomsKubernetesIOMFieldValue) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadKubernetesIomByDateRangeForbidden creates a ReadKubernetesIomByDateRangeForbidden with default headers values +func NewReadKubernetesIomByDateRangeForbidden() *ReadKubernetesIomByDateRangeForbidden { + return &ReadKubernetesIomByDateRangeForbidden{} +} + +/* +ReadKubernetesIomByDateRangeForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadKubernetesIomByDateRangeForbidden 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 kubernetes iom by date range forbidden response has a 2xx status code +func (o *ReadKubernetesIomByDateRangeForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom by date range forbidden response has a 3xx status code +func (o *ReadKubernetesIomByDateRangeForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom by date range forbidden response has a 4xx status code +func (o *ReadKubernetesIomByDateRangeForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read kubernetes iom by date range forbidden response has a 5xx status code +func (o *ReadKubernetesIomByDateRangeForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom by date range forbidden response a status code equal to that given +func (o *ReadKubernetesIomByDateRangeForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read kubernetes iom by date range forbidden response +func (o *ReadKubernetesIomByDateRangeForbidden) Code() int { + return 403 +} + +func (o *ReadKubernetesIomByDateRangeForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeForbidden %+v", 403, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeForbidden %+v", 403, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadKubernetesIomByDateRangeForbidden) 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 +} + +// NewReadKubernetesIomByDateRangeTooManyRequests creates a ReadKubernetesIomByDateRangeTooManyRequests with default headers values +func NewReadKubernetesIomByDateRangeTooManyRequests() *ReadKubernetesIomByDateRangeTooManyRequests { + return &ReadKubernetesIomByDateRangeTooManyRequests{} +} + +/* +ReadKubernetesIomByDateRangeTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadKubernetesIomByDateRangeTooManyRequests 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 kubernetes iom by date range too many requests response has a 2xx status code +func (o *ReadKubernetesIomByDateRangeTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom by date range too many requests response has a 3xx status code +func (o *ReadKubernetesIomByDateRangeTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom by date range too many requests response has a 4xx status code +func (o *ReadKubernetesIomByDateRangeTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read kubernetes iom by date range too many requests response has a 5xx status code +func (o *ReadKubernetesIomByDateRangeTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom by date range too many requests response a status code equal to that given +func (o *ReadKubernetesIomByDateRangeTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read kubernetes iom by date range too many requests response +func (o *ReadKubernetesIomByDateRangeTooManyRequests) Code() int { + return 429 +} + +func (o *ReadKubernetesIomByDateRangeTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadKubernetesIomByDateRangeTooManyRequests) 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 +} + +// NewReadKubernetesIomByDateRangeInternalServerError creates a ReadKubernetesIomByDateRangeInternalServerError with default headers values +func NewReadKubernetesIomByDateRangeInternalServerError() *ReadKubernetesIomByDateRangeInternalServerError { + return &ReadKubernetesIomByDateRangeInternalServerError{} +} + +/* +ReadKubernetesIomByDateRangeInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadKubernetesIomByDateRangeInternalServerError 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 kubernetes iom by date range internal server error response has a 2xx status code +func (o *ReadKubernetesIomByDateRangeInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom by date range internal server error response has a 3xx status code +func (o *ReadKubernetesIomByDateRangeInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom by date range internal server error response has a 4xx status code +func (o *ReadKubernetesIomByDateRangeInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read kubernetes iom by date range internal server error response has a 5xx status code +func (o *ReadKubernetesIomByDateRangeInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read kubernetes iom by date range internal server error response a status code equal to that given +func (o *ReadKubernetesIomByDateRangeInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read kubernetes iom by date range internal server error response +func (o *ReadKubernetesIomByDateRangeInternalServerError) Code() int { + return 500 +} + +func (o *ReadKubernetesIomByDateRangeInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count-by-date/v1][%d] readKubernetesIomByDateRangeInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadKubernetesIomByDateRangeInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadKubernetesIomByDateRangeInternalServerError) 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/read_kubernetes_iom_count_parameters.go b/falcon/client/kubernetes_protection/read_kubernetes_iom_count_parameters.go new file mode 100644 index 00000000..33b6ec7a --- /dev/null +++ b/falcon/client/kubernetes_protection/read_kubernetes_iom_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadKubernetesIomCountParams creates a new ReadKubernetesIomCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadKubernetesIomCountParams() *ReadKubernetesIomCountParams { + return &ReadKubernetesIomCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadKubernetesIomCountParamsWithTimeout creates a new ReadKubernetesIomCountParams object +// with the ability to set a timeout on a request. +func NewReadKubernetesIomCountParamsWithTimeout(timeout time.Duration) *ReadKubernetesIomCountParams { + return &ReadKubernetesIomCountParams{ + timeout: timeout, + } +} + +// NewReadKubernetesIomCountParamsWithContext creates a new ReadKubernetesIomCountParams object +// with the ability to set a context for a request. +func NewReadKubernetesIomCountParamsWithContext(ctx context.Context) *ReadKubernetesIomCountParams { + return &ReadKubernetesIomCountParams{ + Context: ctx, + } +} + +// NewReadKubernetesIomCountParamsWithHTTPClient creates a new ReadKubernetesIomCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadKubernetesIomCountParamsWithHTTPClient(client *http.Client) *ReadKubernetesIomCountParams { + return &ReadKubernetesIomCountParams{ + HTTPClient: client, + } +} + +/* +ReadKubernetesIomCountParams contains all the parameters to send to the API endpoint + + for the read kubernetes iom count operation. + + Typically these are written to a http.Request. +*/ +type ReadKubernetesIomCountParams struct { + + /* Filter. + + Filter images using a query in Falcon Query Language (FQL). Supported filters: cid,created_timestamp,detect_timestamp,severity + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read kubernetes iom count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadKubernetesIomCountParams) WithDefaults() *ReadKubernetesIomCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read kubernetes iom count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadKubernetesIomCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) WithTimeout(timeout time.Duration) *ReadKubernetesIomCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) WithContext(ctx context.Context) *ReadKubernetesIomCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) WithHTTPClient(client *http.Client) *ReadKubernetesIomCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) WithFilter(filter *string) *ReadKubernetesIomCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read kubernetes iom count params +func (o *ReadKubernetesIomCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadKubernetesIomCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_kubernetes_iom_count_responses.go b/falcon/client/kubernetes_protection/read_kubernetes_iom_count_responses.go new file mode 100644 index 00000000..0bbbaf86 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_kubernetes_iom_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadKubernetesIomCountReader is a Reader for the ReadKubernetesIomCount structure. +type ReadKubernetesIomCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadKubernetesIomCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadKubernetesIomCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadKubernetesIomCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadKubernetesIomCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadKubernetesIomCountInternalServerError() + 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/kubernetes-ioms/count/v1] ReadKubernetesIomCount", response, response.Code()) + } +} + +// NewReadKubernetesIomCountOK creates a ReadKubernetesIomCountOK with default headers values +func NewReadKubernetesIomCountOK() *ReadKubernetesIomCountOK { + return &ReadKubernetesIomCountOK{} +} + +/* +ReadKubernetesIomCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadKubernetesIomCountOK 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.K8siomsKubernetesIOMCountValue +} + +// IsSuccess returns true when this read kubernetes iom count o k response has a 2xx status code +func (o *ReadKubernetesIomCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read kubernetes iom count o k response has a 3xx status code +func (o *ReadKubernetesIomCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom count o k response has a 4xx status code +func (o *ReadKubernetesIomCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read kubernetes iom count o k response has a 5xx status code +func (o *ReadKubernetesIomCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom count o k response a status code equal to that given +func (o *ReadKubernetesIomCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read kubernetes iom count o k response +func (o *ReadKubernetesIomCountOK) Code() int { + return 200 +} + +func (o *ReadKubernetesIomCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountOK %+v", 200, o.Payload) +} + +func (o *ReadKubernetesIomCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountOK %+v", 200, o.Payload) +} + +func (o *ReadKubernetesIomCountOK) GetPayload() *models.K8siomsKubernetesIOMCountValue { + return o.Payload +} + +func (o *ReadKubernetesIomCountOK) 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.K8siomsKubernetesIOMCountValue) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadKubernetesIomCountForbidden creates a ReadKubernetesIomCountForbidden with default headers values +func NewReadKubernetesIomCountForbidden() *ReadKubernetesIomCountForbidden { + return &ReadKubernetesIomCountForbidden{} +} + +/* +ReadKubernetesIomCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadKubernetesIomCountForbidden 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 kubernetes iom count forbidden response has a 2xx status code +func (o *ReadKubernetesIomCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom count forbidden response has a 3xx status code +func (o *ReadKubernetesIomCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom count forbidden response has a 4xx status code +func (o *ReadKubernetesIomCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read kubernetes iom count forbidden response has a 5xx status code +func (o *ReadKubernetesIomCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom count forbidden response a status code equal to that given +func (o *ReadKubernetesIomCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read kubernetes iom count forbidden response +func (o *ReadKubernetesIomCountForbidden) Code() int { + return 403 +} + +func (o *ReadKubernetesIomCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadKubernetesIomCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadKubernetesIomCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadKubernetesIomCountForbidden) 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 +} + +// NewReadKubernetesIomCountTooManyRequests creates a ReadKubernetesIomCountTooManyRequests with default headers values +func NewReadKubernetesIomCountTooManyRequests() *ReadKubernetesIomCountTooManyRequests { + return &ReadKubernetesIomCountTooManyRequests{} +} + +/* +ReadKubernetesIomCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadKubernetesIomCountTooManyRequests 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 kubernetes iom count too many requests response has a 2xx status code +func (o *ReadKubernetesIomCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom count too many requests response has a 3xx status code +func (o *ReadKubernetesIomCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom count too many requests response has a 4xx status code +func (o *ReadKubernetesIomCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read kubernetes iom count too many requests response has a 5xx status code +func (o *ReadKubernetesIomCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom count too many requests response a status code equal to that given +func (o *ReadKubernetesIomCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read kubernetes iom count too many requests response +func (o *ReadKubernetesIomCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadKubernetesIomCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadKubernetesIomCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadKubernetesIomCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadKubernetesIomCountTooManyRequests) 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 +} + +// NewReadKubernetesIomCountInternalServerError creates a ReadKubernetesIomCountInternalServerError with default headers values +func NewReadKubernetesIomCountInternalServerError() *ReadKubernetesIomCountInternalServerError { + return &ReadKubernetesIomCountInternalServerError{} +} + +/* +ReadKubernetesIomCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadKubernetesIomCountInternalServerError 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 kubernetes iom count internal server error response has a 2xx status code +func (o *ReadKubernetesIomCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom count internal server error response has a 3xx status code +func (o *ReadKubernetesIomCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom count internal server error response has a 4xx status code +func (o *ReadKubernetesIomCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read kubernetes iom count internal server error response has a 5xx status code +func (o *ReadKubernetesIomCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read kubernetes iom count internal server error response a status code equal to that given +func (o *ReadKubernetesIomCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read kubernetes iom count internal server error response +func (o *ReadKubernetesIomCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadKubernetesIomCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadKubernetesIomCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/kubernetes-ioms/count/v1][%d] readKubernetesIomCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadKubernetesIomCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadKubernetesIomCountInternalServerError) 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/read_kubernetes_iom_entities_parameters.go b/falcon/client/kubernetes_protection/read_kubernetes_iom_entities_parameters.go new file mode 100644 index 00000000..0685acc1 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_kubernetes_iom_entities_parameters.go @@ -0,0 +1,175 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadKubernetesIomEntitiesParams creates a new ReadKubernetesIomEntitiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadKubernetesIomEntitiesParams() *ReadKubernetesIomEntitiesParams { + return &ReadKubernetesIomEntitiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadKubernetesIomEntitiesParamsWithTimeout creates a new ReadKubernetesIomEntitiesParams object +// with the ability to set a timeout on a request. +func NewReadKubernetesIomEntitiesParamsWithTimeout(timeout time.Duration) *ReadKubernetesIomEntitiesParams { + return &ReadKubernetesIomEntitiesParams{ + timeout: timeout, + } +} + +// NewReadKubernetesIomEntitiesParamsWithContext creates a new ReadKubernetesIomEntitiesParams object +// with the ability to set a context for a request. +func NewReadKubernetesIomEntitiesParamsWithContext(ctx context.Context) *ReadKubernetesIomEntitiesParams { + return &ReadKubernetesIomEntitiesParams{ + Context: ctx, + } +} + +// NewReadKubernetesIomEntitiesParamsWithHTTPClient creates a new ReadKubernetesIomEntitiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadKubernetesIomEntitiesParamsWithHTTPClient(client *http.Client) *ReadKubernetesIomEntitiesParams { + return &ReadKubernetesIomEntitiesParams{ + HTTPClient: client, + } +} + +/* +ReadKubernetesIomEntitiesParams contains all the parameters to send to the API endpoint + + for the read kubernetes iom entities operation. + + Typically these are written to a http.Request. +*/ +type ReadKubernetesIomEntitiesParams struct { + + /* Ids. + + Search Kubernetes IOMs 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 kubernetes iom entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadKubernetesIomEntitiesParams) WithDefaults() *ReadKubernetesIomEntitiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read kubernetes iom entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadKubernetesIomEntitiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) WithTimeout(timeout time.Duration) *ReadKubernetesIomEntitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) WithContext(ctx context.Context) *ReadKubernetesIomEntitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) WithHTTPClient(client *http.Client) *ReadKubernetesIomEntitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) WithIds(ids []string) *ReadKubernetesIomEntitiesParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the read kubernetes iom entities params +func (o *ReadKubernetesIomEntitiesParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadKubernetesIomEntitiesParams) 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 +} + +// bindParamReadKubernetesIomEntities binds the parameter ids +func (o *ReadKubernetesIomEntitiesParams) 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/kubernetes_protection/read_kubernetes_iom_entities_responses.go b/falcon/client/kubernetes_protection/read_kubernetes_iom_entities_responses.go new file mode 100644 index 00000000..810b2f83 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_kubernetes_iom_entities_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadKubernetesIomEntitiesReader is a Reader for the ReadKubernetesIomEntities structure. +type ReadKubernetesIomEntitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadKubernetesIomEntitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadKubernetesIomEntitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadKubernetesIomEntitiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadKubernetesIomEntitiesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadKubernetesIomEntitiesInternalServerError() + 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/kubernetes-ioms/v1] ReadKubernetesIomEntities", response, response.Code()) + } +} + +// NewReadKubernetesIomEntitiesOK creates a ReadKubernetesIomEntitiesOK with default headers values +func NewReadKubernetesIomEntitiesOK() *ReadKubernetesIomEntitiesOK { + return &ReadKubernetesIomEntitiesOK{} +} + +/* +ReadKubernetesIomEntitiesOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadKubernetesIomEntitiesOK 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.K8siomsKubernetesIOMEntityResponse +} + +// IsSuccess returns true when this read kubernetes iom entities o k response has a 2xx status code +func (o *ReadKubernetesIomEntitiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read kubernetes iom entities o k response has a 3xx status code +func (o *ReadKubernetesIomEntitiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom entities o k response has a 4xx status code +func (o *ReadKubernetesIomEntitiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read kubernetes iom entities o k response has a 5xx status code +func (o *ReadKubernetesIomEntitiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom entities o k response a status code equal to that given +func (o *ReadKubernetesIomEntitiesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read kubernetes iom entities o k response +func (o *ReadKubernetesIomEntitiesOK) Code() int { + return 200 +} + +func (o *ReadKubernetesIomEntitiesOK) Error() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesOK %+v", 200, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesOK) String() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesOK %+v", 200, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesOK) GetPayload() *models.K8siomsKubernetesIOMEntityResponse { + return o.Payload +} + +func (o *ReadKubernetesIomEntitiesOK) 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.K8siomsKubernetesIOMEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadKubernetesIomEntitiesForbidden creates a ReadKubernetesIomEntitiesForbidden with default headers values +func NewReadKubernetesIomEntitiesForbidden() *ReadKubernetesIomEntitiesForbidden { + return &ReadKubernetesIomEntitiesForbidden{} +} + +/* +ReadKubernetesIomEntitiesForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadKubernetesIomEntitiesForbidden 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 kubernetes iom entities forbidden response has a 2xx status code +func (o *ReadKubernetesIomEntitiesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom entities forbidden response has a 3xx status code +func (o *ReadKubernetesIomEntitiesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom entities forbidden response has a 4xx status code +func (o *ReadKubernetesIomEntitiesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read kubernetes iom entities forbidden response has a 5xx status code +func (o *ReadKubernetesIomEntitiesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom entities forbidden response a status code equal to that given +func (o *ReadKubernetesIomEntitiesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read kubernetes iom entities forbidden response +func (o *ReadKubernetesIomEntitiesForbidden) Code() int { + return 403 +} + +func (o *ReadKubernetesIomEntitiesForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesForbidden) String() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadKubernetesIomEntitiesForbidden) 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 +} + +// NewReadKubernetesIomEntitiesTooManyRequests creates a ReadKubernetesIomEntitiesTooManyRequests with default headers values +func NewReadKubernetesIomEntitiesTooManyRequests() *ReadKubernetesIomEntitiesTooManyRequests { + return &ReadKubernetesIomEntitiesTooManyRequests{} +} + +/* +ReadKubernetesIomEntitiesTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadKubernetesIomEntitiesTooManyRequests 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 kubernetes iom entities too many requests response has a 2xx status code +func (o *ReadKubernetesIomEntitiesTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom entities too many requests response has a 3xx status code +func (o *ReadKubernetesIomEntitiesTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom entities too many requests response has a 4xx status code +func (o *ReadKubernetesIomEntitiesTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read kubernetes iom entities too many requests response has a 5xx status code +func (o *ReadKubernetesIomEntitiesTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read kubernetes iom entities too many requests response a status code equal to that given +func (o *ReadKubernetesIomEntitiesTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read kubernetes iom entities too many requests response +func (o *ReadKubernetesIomEntitiesTooManyRequests) Code() int { + return 429 +} + +func (o *ReadKubernetesIomEntitiesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadKubernetesIomEntitiesTooManyRequests) 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 +} + +// NewReadKubernetesIomEntitiesInternalServerError creates a ReadKubernetesIomEntitiesInternalServerError with default headers values +func NewReadKubernetesIomEntitiesInternalServerError() *ReadKubernetesIomEntitiesInternalServerError { + return &ReadKubernetesIomEntitiesInternalServerError{} +} + +/* +ReadKubernetesIomEntitiesInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadKubernetesIomEntitiesInternalServerError 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 kubernetes iom entities internal server error response has a 2xx status code +func (o *ReadKubernetesIomEntitiesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read kubernetes iom entities internal server error response has a 3xx status code +func (o *ReadKubernetesIomEntitiesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read kubernetes iom entities internal server error response has a 4xx status code +func (o *ReadKubernetesIomEntitiesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read kubernetes iom entities internal server error response has a 5xx status code +func (o *ReadKubernetesIomEntitiesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read kubernetes iom entities internal server error response a status code equal to that given +func (o *ReadKubernetesIomEntitiesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read kubernetes iom entities internal server error response +func (o *ReadKubernetesIomEntitiesInternalServerError) Code() int { + return 500 +} + +func (o *ReadKubernetesIomEntitiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/entities/kubernetes-ioms/v1][%d] readKubernetesIomEntitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadKubernetesIomEntitiesInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadKubernetesIomEntitiesInternalServerError) 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/read_node_combined_parameters.go b/falcon/client/kubernetes_protection/read_node_combined_parameters.go new file mode 100644 index 00000000..9c1b14c2 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_node_combined_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadNodeCombinedParams creates a new ReadNodeCombinedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadNodeCombinedParams() *ReadNodeCombinedParams { + return &ReadNodeCombinedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadNodeCombinedParamsWithTimeout creates a new ReadNodeCombinedParams object +// with the ability to set a timeout on a request. +func NewReadNodeCombinedParamsWithTimeout(timeout time.Duration) *ReadNodeCombinedParams { + return &ReadNodeCombinedParams{ + timeout: timeout, + } +} + +// NewReadNodeCombinedParamsWithContext creates a new ReadNodeCombinedParams object +// with the ability to set a context for a request. +func NewReadNodeCombinedParamsWithContext(ctx context.Context) *ReadNodeCombinedParams { + return &ReadNodeCombinedParams{ + Context: ctx, + } +} + +// NewReadNodeCombinedParamsWithHTTPClient creates a new ReadNodeCombinedParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadNodeCombinedParamsWithHTTPClient(client *http.Client) *ReadNodeCombinedParams { + return &ReadNodeCombinedParams{ + HTTPClient: client, + } +} + +/* +ReadNodeCombinedParams contains all the parameters to send to the API endpoint + + for the read node combined operation. + + Typically these are written to a http.Request. +*/ +type ReadNodeCombinedParams struct { + + /* Filter. + + Search Kubernetes nodes using a query in Falcon Query Language (FQL). Supported filters: aid,annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_count,container_runtime_version,first_seen,image_digest,ipv4,last_seen,node_name,pod_count + */ + 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. + + Field to sort results by + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read node combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodeCombinedParams) WithDefaults() *ReadNodeCombinedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read node combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodeCombinedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read node combined params +func (o *ReadNodeCombinedParams) WithTimeout(timeout time.Duration) *ReadNodeCombinedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read node combined params +func (o *ReadNodeCombinedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read node combined params +func (o *ReadNodeCombinedParams) WithContext(ctx context.Context) *ReadNodeCombinedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read node combined params +func (o *ReadNodeCombinedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read node combined params +func (o *ReadNodeCombinedParams) WithHTTPClient(client *http.Client) *ReadNodeCombinedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read node combined params +func (o *ReadNodeCombinedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read node combined params +func (o *ReadNodeCombinedParams) WithFilter(filter *string) *ReadNodeCombinedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read node combined params +func (o *ReadNodeCombinedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the read node combined params +func (o *ReadNodeCombinedParams) WithLimit(limit *int64) *ReadNodeCombinedParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read node combined params +func (o *ReadNodeCombinedParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the read node combined params +func (o *ReadNodeCombinedParams) WithOffset(offset *int64) *ReadNodeCombinedParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the read node combined params +func (o *ReadNodeCombinedParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the read node combined params +func (o *ReadNodeCombinedParams) WithSort(sort *string) *ReadNodeCombinedParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the read node combined params +func (o *ReadNodeCombinedParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadNodeCombinedParams) 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/kubernetes_protection/read_node_combined_responses.go b/falcon/client/kubernetes_protection/read_node_combined_responses.go new file mode 100644 index 00000000..13bbb6b5 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_node_combined_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadNodeCombinedReader is a Reader for the ReadNodeCombined structure. +type ReadNodeCombinedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadNodeCombinedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadNodeCombinedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadNodeCombinedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadNodeCombinedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadNodeCombinedInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/nodes/v1] ReadNodeCombined", response, response.Code()) + } +} + +// NewReadNodeCombinedOK creates a ReadNodeCombinedOK with default headers values +func NewReadNodeCombinedOK() *ReadNodeCombinedOK { + return &ReadNodeCombinedOK{} +} + +/* +ReadNodeCombinedOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadNodeCombinedOK 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.ModelsNodeEntityResponse +} + +// IsSuccess returns true when this read node combined o k response has a 2xx status code +func (o *ReadNodeCombinedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read node combined o k response has a 3xx status code +func (o *ReadNodeCombinedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node combined o k response has a 4xx status code +func (o *ReadNodeCombinedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read node combined o k response has a 5xx status code +func (o *ReadNodeCombinedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read node combined o k response a status code equal to that given +func (o *ReadNodeCombinedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read node combined o k response +func (o *ReadNodeCombinedOK) Code() int { + return 200 +} + +func (o *ReadNodeCombinedOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadNodeCombinedOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadNodeCombinedOK) GetPayload() *models.ModelsNodeEntityResponse { + return o.Payload +} + +func (o *ReadNodeCombinedOK) 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.ModelsNodeEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadNodeCombinedForbidden creates a ReadNodeCombinedForbidden with default headers values +func NewReadNodeCombinedForbidden() *ReadNodeCombinedForbidden { + return &ReadNodeCombinedForbidden{} +} + +/* +ReadNodeCombinedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadNodeCombinedForbidden 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 node combined forbidden response has a 2xx status code +func (o *ReadNodeCombinedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node combined forbidden response has a 3xx status code +func (o *ReadNodeCombinedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node combined forbidden response has a 4xx status code +func (o *ReadNodeCombinedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read node combined forbidden response has a 5xx status code +func (o *ReadNodeCombinedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read node combined forbidden response a status code equal to that given +func (o *ReadNodeCombinedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read node combined forbidden response +func (o *ReadNodeCombinedForbidden) Code() int { + return 403 +} + +func (o *ReadNodeCombinedForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodeCombinedForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodeCombinedForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodeCombinedForbidden) 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 +} + +// NewReadNodeCombinedTooManyRequests creates a ReadNodeCombinedTooManyRequests with default headers values +func NewReadNodeCombinedTooManyRequests() *ReadNodeCombinedTooManyRequests { + return &ReadNodeCombinedTooManyRequests{} +} + +/* +ReadNodeCombinedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadNodeCombinedTooManyRequests 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 node combined too many requests response has a 2xx status code +func (o *ReadNodeCombinedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node combined too many requests response has a 3xx status code +func (o *ReadNodeCombinedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node combined too many requests response has a 4xx status code +func (o *ReadNodeCombinedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read node combined too many requests response has a 5xx status code +func (o *ReadNodeCombinedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read node combined too many requests response a status code equal to that given +func (o *ReadNodeCombinedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read node combined too many requests response +func (o *ReadNodeCombinedTooManyRequests) Code() int { + return 429 +} + +func (o *ReadNodeCombinedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodeCombinedTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodeCombinedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodeCombinedTooManyRequests) 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 +} + +// NewReadNodeCombinedInternalServerError creates a ReadNodeCombinedInternalServerError with default headers values +func NewReadNodeCombinedInternalServerError() *ReadNodeCombinedInternalServerError { + return &ReadNodeCombinedInternalServerError{} +} + +/* +ReadNodeCombinedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadNodeCombinedInternalServerError 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 node combined internal server error response has a 2xx status code +func (o *ReadNodeCombinedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node combined internal server error response has a 3xx status code +func (o *ReadNodeCombinedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node combined internal server error response has a 4xx status code +func (o *ReadNodeCombinedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read node combined internal server error response has a 5xx status code +func (o *ReadNodeCombinedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read node combined internal server error response a status code equal to that given +func (o *ReadNodeCombinedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read node combined internal server error response +func (o *ReadNodeCombinedInternalServerError) Code() int { + return 500 +} + +func (o *ReadNodeCombinedInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodeCombinedInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/nodes/v1][%d] readNodeCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodeCombinedInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadNodeCombinedInternalServerError) 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/read_node_count_parameters.go b/falcon/client/kubernetes_protection/read_node_count_parameters.go new file mode 100644 index 00000000..f7493edb --- /dev/null +++ b/falcon/client/kubernetes_protection/read_node_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadNodeCountParams creates a new ReadNodeCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadNodeCountParams() *ReadNodeCountParams { + return &ReadNodeCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadNodeCountParamsWithTimeout creates a new ReadNodeCountParams object +// with the ability to set a timeout on a request. +func NewReadNodeCountParamsWithTimeout(timeout time.Duration) *ReadNodeCountParams { + return &ReadNodeCountParams{ + timeout: timeout, + } +} + +// NewReadNodeCountParamsWithContext creates a new ReadNodeCountParams object +// with the ability to set a context for a request. +func NewReadNodeCountParamsWithContext(ctx context.Context) *ReadNodeCountParams { + return &ReadNodeCountParams{ + Context: ctx, + } +} + +// NewReadNodeCountParamsWithHTTPClient creates a new ReadNodeCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadNodeCountParamsWithHTTPClient(client *http.Client) *ReadNodeCountParams { + return &ReadNodeCountParams{ + HTTPClient: client, + } +} + +/* +ReadNodeCountParams contains all the parameters to send to the API endpoint + + for the read node count operation. + + Typically these are written to a http.Request. +*/ +type ReadNodeCountParams struct { + + /* Filter. + + Retrieve count of Kubernetes nodes that match a query in Falcon Query Language (FQL). Supported filters: aid,annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_count,container_runtime_version,first_seen,image_digest,ipv4,last_seen,node_name,pod_count + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read node count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodeCountParams) WithDefaults() *ReadNodeCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read node count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodeCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read node count params +func (o *ReadNodeCountParams) WithTimeout(timeout time.Duration) *ReadNodeCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read node count params +func (o *ReadNodeCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read node count params +func (o *ReadNodeCountParams) WithContext(ctx context.Context) *ReadNodeCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read node count params +func (o *ReadNodeCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read node count params +func (o *ReadNodeCountParams) WithHTTPClient(client *http.Client) *ReadNodeCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read node count params +func (o *ReadNodeCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read node count params +func (o *ReadNodeCountParams) WithFilter(filter *string) *ReadNodeCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read node count params +func (o *ReadNodeCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadNodeCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_node_count_responses.go b/falcon/client/kubernetes_protection/read_node_count_responses.go new file mode 100644 index 00000000..43228244 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_node_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadNodeCountReader is a Reader for the ReadNodeCount structure. +type ReadNodeCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadNodeCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadNodeCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadNodeCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadNodeCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadNodeCountInternalServerError() + 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/nodes/count/v1] ReadNodeCount", response, response.Code()) + } +} + +// NewReadNodeCountOK creates a ReadNodeCountOK with default headers values +func NewReadNodeCountOK() *ReadNodeCountOK { + return &ReadNodeCountOK{} +} + +/* +ReadNodeCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadNodeCountOK 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.CommonCountResponse +} + +// IsSuccess returns true when this read node count o k response has a 2xx status code +func (o *ReadNodeCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read node count o k response has a 3xx status code +func (o *ReadNodeCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node count o k response has a 4xx status code +func (o *ReadNodeCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read node count o k response has a 5xx status code +func (o *ReadNodeCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read node count o k response a status code equal to that given +func (o *ReadNodeCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read node count o k response +func (o *ReadNodeCountOK) Code() int { + return 200 +} + +func (o *ReadNodeCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodeCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodeCountOK) GetPayload() *models.CommonCountResponse { + return o.Payload +} + +func (o *ReadNodeCountOK) 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.CommonCountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadNodeCountForbidden creates a ReadNodeCountForbidden with default headers values +func NewReadNodeCountForbidden() *ReadNodeCountForbidden { + return &ReadNodeCountForbidden{} +} + +/* +ReadNodeCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadNodeCountForbidden 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 node count forbidden response has a 2xx status code +func (o *ReadNodeCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node count forbidden response has a 3xx status code +func (o *ReadNodeCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node count forbidden response has a 4xx status code +func (o *ReadNodeCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read node count forbidden response has a 5xx status code +func (o *ReadNodeCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read node count forbidden response a status code equal to that given +func (o *ReadNodeCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read node count forbidden response +func (o *ReadNodeCountForbidden) Code() int { + return 403 +} + +func (o *ReadNodeCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodeCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodeCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodeCountForbidden) 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 +} + +// NewReadNodeCountTooManyRequests creates a ReadNodeCountTooManyRequests with default headers values +func NewReadNodeCountTooManyRequests() *ReadNodeCountTooManyRequests { + return &ReadNodeCountTooManyRequests{} +} + +/* +ReadNodeCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadNodeCountTooManyRequests 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 node count too many requests response has a 2xx status code +func (o *ReadNodeCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node count too many requests response has a 3xx status code +func (o *ReadNodeCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node count too many requests response has a 4xx status code +func (o *ReadNodeCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read node count too many requests response has a 5xx status code +func (o *ReadNodeCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read node count too many requests response a status code equal to that given +func (o *ReadNodeCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read node count too many requests response +func (o *ReadNodeCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadNodeCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodeCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodeCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodeCountTooManyRequests) 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 +} + +// NewReadNodeCountInternalServerError creates a ReadNodeCountInternalServerError with default headers values +func NewReadNodeCountInternalServerError() *ReadNodeCountInternalServerError { + return &ReadNodeCountInternalServerError{} +} + +/* +ReadNodeCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadNodeCountInternalServerError 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 node count internal server error response has a 2xx status code +func (o *ReadNodeCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node count internal server error response has a 3xx status code +func (o *ReadNodeCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node count internal server error response has a 4xx status code +func (o *ReadNodeCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read node count internal server error response has a 5xx status code +func (o *ReadNodeCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read node count internal server error response a status code equal to that given +func (o *ReadNodeCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read node count internal server error response +func (o *ReadNodeCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadNodeCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodeCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count/v1][%d] readNodeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodeCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadNodeCountInternalServerError) 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/read_node_enrichment_parameters.go b/falcon/client/kubernetes_protection/read_node_enrichment_parameters.go new file mode 100644 index 00000000..d8df8aaa --- /dev/null +++ b/falcon/client/kubernetes_protection/read_node_enrichment_parameters.go @@ -0,0 +1,209 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadNodeEnrichmentParams creates a new ReadNodeEnrichmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadNodeEnrichmentParams() *ReadNodeEnrichmentParams { + return &ReadNodeEnrichmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadNodeEnrichmentParamsWithTimeout creates a new ReadNodeEnrichmentParams object +// with the ability to set a timeout on a request. +func NewReadNodeEnrichmentParamsWithTimeout(timeout time.Duration) *ReadNodeEnrichmentParams { + return &ReadNodeEnrichmentParams{ + timeout: timeout, + } +} + +// NewReadNodeEnrichmentParamsWithContext creates a new ReadNodeEnrichmentParams object +// with the ability to set a context for a request. +func NewReadNodeEnrichmentParamsWithContext(ctx context.Context) *ReadNodeEnrichmentParams { + return &ReadNodeEnrichmentParams{ + Context: ctx, + } +} + +// NewReadNodeEnrichmentParamsWithHTTPClient creates a new ReadNodeEnrichmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadNodeEnrichmentParamsWithHTTPClient(client *http.Client) *ReadNodeEnrichmentParams { + return &ReadNodeEnrichmentParams{ + HTTPClient: client, + } +} + +/* +ReadNodeEnrichmentParams contains all the parameters to send to the API endpoint + + for the read node enrichment operation. + + Typically these are written to a http.Request. +*/ +type ReadNodeEnrichmentParams struct { + + /* Filter. + + Supported filters: last_seen + */ + Filter *string + + /* NodeName. + + One or more node names for which to retrieve enrichment info + */ + NodeName []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read node enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodeEnrichmentParams) WithDefaults() *ReadNodeEnrichmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read node enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodeEnrichmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read node enrichment params +func (o *ReadNodeEnrichmentParams) WithTimeout(timeout time.Duration) *ReadNodeEnrichmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read node enrichment params +func (o *ReadNodeEnrichmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read node enrichment params +func (o *ReadNodeEnrichmentParams) WithContext(ctx context.Context) *ReadNodeEnrichmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read node enrichment params +func (o *ReadNodeEnrichmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read node enrichment params +func (o *ReadNodeEnrichmentParams) WithHTTPClient(client *http.Client) *ReadNodeEnrichmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read node enrichment params +func (o *ReadNodeEnrichmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read node enrichment params +func (o *ReadNodeEnrichmentParams) WithFilter(filter *string) *ReadNodeEnrichmentParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read node enrichment params +func (o *ReadNodeEnrichmentParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithNodeName adds the nodeName to the read node enrichment params +func (o *ReadNodeEnrichmentParams) WithNodeName(nodeName []string) *ReadNodeEnrichmentParams { + o.SetNodeName(nodeName) + return o +} + +// SetNodeName adds the nodeName to the read node enrichment params +func (o *ReadNodeEnrichmentParams) SetNodeName(nodeName []string) { + o.NodeName = nodeName +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadNodeEnrichmentParams) 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.NodeName != nil { + + // binding items for node_name + joinedNodeName := o.bindParamNodeName(reg) + + // query array param node_name + if err := r.SetQueryParam("node_name", joinedNodeName...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamReadNodeEnrichment binds the parameter node_name +func (o *ReadNodeEnrichmentParams) bindParamNodeName(formats strfmt.Registry) []string { + nodeNameIR := o.NodeName + + var nodeNameIC []string + for _, nodeNameIIR := range nodeNameIR { // explode []string + + nodeNameIIV := nodeNameIIR // string as string + nodeNameIC = append(nodeNameIC, nodeNameIIV) + } + + // items.CollectionFormat: "csv" + nodeNameIS := swag.JoinByFormat(nodeNameIC, "csv") + + return nodeNameIS +} diff --git a/falcon/client/kubernetes_protection/read_node_enrichment_responses.go b/falcon/client/kubernetes_protection/read_node_enrichment_responses.go new file mode 100644 index 00000000..2a525fcb --- /dev/null +++ b/falcon/client/kubernetes_protection/read_node_enrichment_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadNodeEnrichmentReader is a Reader for the ReadNodeEnrichment structure. +type ReadNodeEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadNodeEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadNodeEnrichmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadNodeEnrichmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadNodeEnrichmentTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadNodeEnrichmentInternalServerError() + 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/nodes/entities/v1] ReadNodeEnrichment", response, response.Code()) + } +} + +// NewReadNodeEnrichmentOK creates a ReadNodeEnrichmentOK with default headers values +func NewReadNodeEnrichmentOK() *ReadNodeEnrichmentOK { + return &ReadNodeEnrichmentOK{} +} + +/* +ReadNodeEnrichmentOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadNodeEnrichmentOK 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.K8sassetsNodeEnrichmentResponse +} + +// IsSuccess returns true when this read node enrichment o k response has a 2xx status code +func (o *ReadNodeEnrichmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read node enrichment o k response has a 3xx status code +func (o *ReadNodeEnrichmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node enrichment o k response has a 4xx status code +func (o *ReadNodeEnrichmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read node enrichment o k response has a 5xx status code +func (o *ReadNodeEnrichmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read node enrichment o k response a status code equal to that given +func (o *ReadNodeEnrichmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read node enrichment o k response +func (o *ReadNodeEnrichmentOK) Code() int { + return 200 +} + +func (o *ReadNodeEnrichmentOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadNodeEnrichmentOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadNodeEnrichmentOK) GetPayload() *models.K8sassetsNodeEnrichmentResponse { + return o.Payload +} + +func (o *ReadNodeEnrichmentOK) 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.K8sassetsNodeEnrichmentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadNodeEnrichmentForbidden creates a ReadNodeEnrichmentForbidden with default headers values +func NewReadNodeEnrichmentForbidden() *ReadNodeEnrichmentForbidden { + return &ReadNodeEnrichmentForbidden{} +} + +/* +ReadNodeEnrichmentForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadNodeEnrichmentForbidden 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 node enrichment forbidden response has a 2xx status code +func (o *ReadNodeEnrichmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node enrichment forbidden response has a 3xx status code +func (o *ReadNodeEnrichmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node enrichment forbidden response has a 4xx status code +func (o *ReadNodeEnrichmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read node enrichment forbidden response has a 5xx status code +func (o *ReadNodeEnrichmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read node enrichment forbidden response a status code equal to that given +func (o *ReadNodeEnrichmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read node enrichment forbidden response +func (o *ReadNodeEnrichmentForbidden) Code() int { + return 403 +} + +func (o *ReadNodeEnrichmentForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodeEnrichmentForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodeEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodeEnrichmentForbidden) 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 +} + +// NewReadNodeEnrichmentTooManyRequests creates a ReadNodeEnrichmentTooManyRequests with default headers values +func NewReadNodeEnrichmentTooManyRequests() *ReadNodeEnrichmentTooManyRequests { + return &ReadNodeEnrichmentTooManyRequests{} +} + +/* +ReadNodeEnrichmentTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadNodeEnrichmentTooManyRequests 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 node enrichment too many requests response has a 2xx status code +func (o *ReadNodeEnrichmentTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node enrichment too many requests response has a 3xx status code +func (o *ReadNodeEnrichmentTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node enrichment too many requests response has a 4xx status code +func (o *ReadNodeEnrichmentTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read node enrichment too many requests response has a 5xx status code +func (o *ReadNodeEnrichmentTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read node enrichment too many requests response a status code equal to that given +func (o *ReadNodeEnrichmentTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read node enrichment too many requests response +func (o *ReadNodeEnrichmentTooManyRequests) Code() int { + return 429 +} + +func (o *ReadNodeEnrichmentTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodeEnrichmentTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodeEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodeEnrichmentTooManyRequests) 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 +} + +// NewReadNodeEnrichmentInternalServerError creates a ReadNodeEnrichmentInternalServerError with default headers values +func NewReadNodeEnrichmentInternalServerError() *ReadNodeEnrichmentInternalServerError { + return &ReadNodeEnrichmentInternalServerError{} +} + +/* +ReadNodeEnrichmentInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadNodeEnrichmentInternalServerError 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 node enrichment internal server error response has a 2xx status code +func (o *ReadNodeEnrichmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read node enrichment internal server error response has a 3xx status code +func (o *ReadNodeEnrichmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read node enrichment internal server error response has a 4xx status code +func (o *ReadNodeEnrichmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read node enrichment internal server error response has a 5xx status code +func (o *ReadNodeEnrichmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read node enrichment internal server error response a status code equal to that given +func (o *ReadNodeEnrichmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read node enrichment internal server error response +func (o *ReadNodeEnrichmentInternalServerError) Code() int { + return 500 +} + +func (o *ReadNodeEnrichmentInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodeEnrichmentInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/nodes/entities/v1][%d] readNodeEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodeEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadNodeEnrichmentInternalServerError) 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/read_nodes_by_cloud_count_parameters.go b/falcon/client/kubernetes_protection/read_nodes_by_cloud_count_parameters.go new file mode 100644 index 00000000..2d22bb1c --- /dev/null +++ b/falcon/client/kubernetes_protection/read_nodes_by_cloud_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadNodesByCloudCountParams creates a new ReadNodesByCloudCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadNodesByCloudCountParams() *ReadNodesByCloudCountParams { + return &ReadNodesByCloudCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadNodesByCloudCountParamsWithTimeout creates a new ReadNodesByCloudCountParams object +// with the ability to set a timeout on a request. +func NewReadNodesByCloudCountParamsWithTimeout(timeout time.Duration) *ReadNodesByCloudCountParams { + return &ReadNodesByCloudCountParams{ + timeout: timeout, + } +} + +// NewReadNodesByCloudCountParamsWithContext creates a new ReadNodesByCloudCountParams object +// with the ability to set a context for a request. +func NewReadNodesByCloudCountParamsWithContext(ctx context.Context) *ReadNodesByCloudCountParams { + return &ReadNodesByCloudCountParams{ + Context: ctx, + } +} + +// NewReadNodesByCloudCountParamsWithHTTPClient creates a new ReadNodesByCloudCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadNodesByCloudCountParamsWithHTTPClient(client *http.Client) *ReadNodesByCloudCountParams { + return &ReadNodesByCloudCountParams{ + HTTPClient: client, + } +} + +/* +ReadNodesByCloudCountParams contains all the parameters to send to the API endpoint + + for the read nodes by cloud count operation. + + Typically these are written to a http.Request. +*/ +type ReadNodesByCloudCountParams struct { + + /* Filter. + + Search Kubernetes nodes using a query in Falcon Query Language (FQL). Supported filters: aid,annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_count,container_runtime_version,first_seen,image_digest,ipv4,last_seen,node_name,pod_count + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read nodes by cloud count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodesByCloudCountParams) WithDefaults() *ReadNodesByCloudCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read nodes by cloud count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodesByCloudCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) WithTimeout(timeout time.Duration) *ReadNodesByCloudCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) WithContext(ctx context.Context) *ReadNodesByCloudCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) WithHTTPClient(client *http.Client) *ReadNodesByCloudCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) WithFilter(filter *string) *ReadNodesByCloudCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read nodes by cloud count params +func (o *ReadNodesByCloudCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadNodesByCloudCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_nodes_by_cloud_count_responses.go b/falcon/client/kubernetes_protection/read_nodes_by_cloud_count_responses.go new file mode 100644 index 00000000..1d702f74 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_nodes_by_cloud_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadNodesByCloudCountReader is a Reader for the ReadNodesByCloudCount structure. +type ReadNodesByCloudCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadNodesByCloudCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadNodesByCloudCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadNodesByCloudCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadNodesByCloudCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadNodesByCloudCountInternalServerError() + 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/nodes/count-by-cloud/v1] ReadNodesByCloudCount", response, response.Code()) + } +} + +// NewReadNodesByCloudCountOK creates a ReadNodesByCloudCountOK with default headers values +func NewReadNodesByCloudCountOK() *ReadNodesByCloudCountOK { + return &ReadNodesByCloudCountOK{} +} + +/* +ReadNodesByCloudCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadNodesByCloudCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read nodes by cloud count o k response has a 2xx status code +func (o *ReadNodesByCloudCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read nodes by cloud count o k response has a 3xx status code +func (o *ReadNodesByCloudCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by cloud count o k response has a 4xx status code +func (o *ReadNodesByCloudCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read nodes by cloud count o k response has a 5xx status code +func (o *ReadNodesByCloudCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by cloud count o k response a status code equal to that given +func (o *ReadNodesByCloudCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read nodes by cloud count o k response +func (o *ReadNodesByCloudCountOK) Code() int { + return 200 +} + +func (o *ReadNodesByCloudCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodesByCloudCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodesByCloudCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadNodesByCloudCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadNodesByCloudCountForbidden creates a ReadNodesByCloudCountForbidden with default headers values +func NewReadNodesByCloudCountForbidden() *ReadNodesByCloudCountForbidden { + return &ReadNodesByCloudCountForbidden{} +} + +/* +ReadNodesByCloudCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadNodesByCloudCountForbidden 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 nodes by cloud count forbidden response has a 2xx status code +func (o *ReadNodesByCloudCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by cloud count forbidden response has a 3xx status code +func (o *ReadNodesByCloudCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by cloud count forbidden response has a 4xx status code +func (o *ReadNodesByCloudCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read nodes by cloud count forbidden response has a 5xx status code +func (o *ReadNodesByCloudCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by cloud count forbidden response a status code equal to that given +func (o *ReadNodesByCloudCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read nodes by cloud count forbidden response +func (o *ReadNodesByCloudCountForbidden) Code() int { + return 403 +} + +func (o *ReadNodesByCloudCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodesByCloudCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodesByCloudCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodesByCloudCountForbidden) 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 +} + +// NewReadNodesByCloudCountTooManyRequests creates a ReadNodesByCloudCountTooManyRequests with default headers values +func NewReadNodesByCloudCountTooManyRequests() *ReadNodesByCloudCountTooManyRequests { + return &ReadNodesByCloudCountTooManyRequests{} +} + +/* +ReadNodesByCloudCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadNodesByCloudCountTooManyRequests 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 nodes by cloud count too many requests response has a 2xx status code +func (o *ReadNodesByCloudCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by cloud count too many requests response has a 3xx status code +func (o *ReadNodesByCloudCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by cloud count too many requests response has a 4xx status code +func (o *ReadNodesByCloudCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read nodes by cloud count too many requests response has a 5xx status code +func (o *ReadNodesByCloudCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by cloud count too many requests response a status code equal to that given +func (o *ReadNodesByCloudCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read nodes by cloud count too many requests response +func (o *ReadNodesByCloudCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadNodesByCloudCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodesByCloudCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodesByCloudCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodesByCloudCountTooManyRequests) 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 +} + +// NewReadNodesByCloudCountInternalServerError creates a ReadNodesByCloudCountInternalServerError with default headers values +func NewReadNodesByCloudCountInternalServerError() *ReadNodesByCloudCountInternalServerError { + return &ReadNodesByCloudCountInternalServerError{} +} + +/* +ReadNodesByCloudCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadNodesByCloudCountInternalServerError 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 nodes by cloud count internal server error response has a 2xx status code +func (o *ReadNodesByCloudCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by cloud count internal server error response has a 3xx status code +func (o *ReadNodesByCloudCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by cloud count internal server error response has a 4xx status code +func (o *ReadNodesByCloudCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read nodes by cloud count internal server error response has a 5xx status code +func (o *ReadNodesByCloudCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read nodes by cloud count internal server error response a status code equal to that given +func (o *ReadNodesByCloudCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read nodes by cloud count internal server error response +func (o *ReadNodesByCloudCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadNodesByCloudCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodesByCloudCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-cloud/v1][%d] readNodesByCloudCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodesByCloudCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadNodesByCloudCountInternalServerError) 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/read_nodes_by_container_engine_version_count_parameters.go b/falcon/client/kubernetes_protection/read_nodes_by_container_engine_version_count_parameters.go new file mode 100644 index 00000000..3e3bb86f --- /dev/null +++ b/falcon/client/kubernetes_protection/read_nodes_by_container_engine_version_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadNodesByContainerEngineVersionCountParams creates a new ReadNodesByContainerEngineVersionCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadNodesByContainerEngineVersionCountParams() *ReadNodesByContainerEngineVersionCountParams { + return &ReadNodesByContainerEngineVersionCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadNodesByContainerEngineVersionCountParamsWithTimeout creates a new ReadNodesByContainerEngineVersionCountParams object +// with the ability to set a timeout on a request. +func NewReadNodesByContainerEngineVersionCountParamsWithTimeout(timeout time.Duration) *ReadNodesByContainerEngineVersionCountParams { + return &ReadNodesByContainerEngineVersionCountParams{ + timeout: timeout, + } +} + +// NewReadNodesByContainerEngineVersionCountParamsWithContext creates a new ReadNodesByContainerEngineVersionCountParams object +// with the ability to set a context for a request. +func NewReadNodesByContainerEngineVersionCountParamsWithContext(ctx context.Context) *ReadNodesByContainerEngineVersionCountParams { + return &ReadNodesByContainerEngineVersionCountParams{ + Context: ctx, + } +} + +// NewReadNodesByContainerEngineVersionCountParamsWithHTTPClient creates a new ReadNodesByContainerEngineVersionCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadNodesByContainerEngineVersionCountParamsWithHTTPClient(client *http.Client) *ReadNodesByContainerEngineVersionCountParams { + return &ReadNodesByContainerEngineVersionCountParams{ + HTTPClient: client, + } +} + +/* +ReadNodesByContainerEngineVersionCountParams contains all the parameters to send to the API endpoint + + for the read nodes by container engine version count operation. + + Typically these are written to a http.Request. +*/ +type ReadNodesByContainerEngineVersionCountParams struct { + + /* Filter. + + Search Kubernetes nodes using a query in Falcon Query Language (FQL). Supported filters: aid,annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_count,container_runtime_version,first_seen,image_digest,ipv4,last_seen,node_name,pod_count + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read nodes by container engine version count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodesByContainerEngineVersionCountParams) WithDefaults() *ReadNodesByContainerEngineVersionCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read nodes by container engine version count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodesByContainerEngineVersionCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) WithTimeout(timeout time.Duration) *ReadNodesByContainerEngineVersionCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) WithContext(ctx context.Context) *ReadNodesByContainerEngineVersionCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) WithHTTPClient(client *http.Client) *ReadNodesByContainerEngineVersionCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) WithFilter(filter *string) *ReadNodesByContainerEngineVersionCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read nodes by container engine version count params +func (o *ReadNodesByContainerEngineVersionCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadNodesByContainerEngineVersionCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_nodes_by_container_engine_version_count_responses.go b/falcon/client/kubernetes_protection/read_nodes_by_container_engine_version_count_responses.go new file mode 100644 index 00000000..c5cf2dac --- /dev/null +++ b/falcon/client/kubernetes_protection/read_nodes_by_container_engine_version_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadNodesByContainerEngineVersionCountReader is a Reader for the ReadNodesByContainerEngineVersionCount structure. +type ReadNodesByContainerEngineVersionCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadNodesByContainerEngineVersionCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadNodesByContainerEngineVersionCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadNodesByContainerEngineVersionCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadNodesByContainerEngineVersionCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadNodesByContainerEngineVersionCountInternalServerError() + 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/nodes/count-by-container-engine-version/v1] ReadNodesByContainerEngineVersionCount", response, response.Code()) + } +} + +// NewReadNodesByContainerEngineVersionCountOK creates a ReadNodesByContainerEngineVersionCountOK with default headers values +func NewReadNodesByContainerEngineVersionCountOK() *ReadNodesByContainerEngineVersionCountOK { + return &ReadNodesByContainerEngineVersionCountOK{} +} + +/* +ReadNodesByContainerEngineVersionCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadNodesByContainerEngineVersionCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read nodes by container engine version count o k response has a 2xx status code +func (o *ReadNodesByContainerEngineVersionCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read nodes by container engine version count o k response has a 3xx status code +func (o *ReadNodesByContainerEngineVersionCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by container engine version count o k response has a 4xx status code +func (o *ReadNodesByContainerEngineVersionCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read nodes by container engine version count o k response has a 5xx status code +func (o *ReadNodesByContainerEngineVersionCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by container engine version count o k response a status code equal to that given +func (o *ReadNodesByContainerEngineVersionCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read nodes by container engine version count o k response +func (o *ReadNodesByContainerEngineVersionCountOK) Code() int { + return 200 +} + +func (o *ReadNodesByContainerEngineVersionCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadNodesByContainerEngineVersionCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadNodesByContainerEngineVersionCountForbidden creates a ReadNodesByContainerEngineVersionCountForbidden with default headers values +func NewReadNodesByContainerEngineVersionCountForbidden() *ReadNodesByContainerEngineVersionCountForbidden { + return &ReadNodesByContainerEngineVersionCountForbidden{} +} + +/* +ReadNodesByContainerEngineVersionCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadNodesByContainerEngineVersionCountForbidden 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 nodes by container engine version count forbidden response has a 2xx status code +func (o *ReadNodesByContainerEngineVersionCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by container engine version count forbidden response has a 3xx status code +func (o *ReadNodesByContainerEngineVersionCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by container engine version count forbidden response has a 4xx status code +func (o *ReadNodesByContainerEngineVersionCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read nodes by container engine version count forbidden response has a 5xx status code +func (o *ReadNodesByContainerEngineVersionCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by container engine version count forbidden response a status code equal to that given +func (o *ReadNodesByContainerEngineVersionCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read nodes by container engine version count forbidden response +func (o *ReadNodesByContainerEngineVersionCountForbidden) Code() int { + return 403 +} + +func (o *ReadNodesByContainerEngineVersionCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodesByContainerEngineVersionCountForbidden) 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 +} + +// NewReadNodesByContainerEngineVersionCountTooManyRequests creates a ReadNodesByContainerEngineVersionCountTooManyRequests with default headers values +func NewReadNodesByContainerEngineVersionCountTooManyRequests() *ReadNodesByContainerEngineVersionCountTooManyRequests { + return &ReadNodesByContainerEngineVersionCountTooManyRequests{} +} + +/* +ReadNodesByContainerEngineVersionCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadNodesByContainerEngineVersionCountTooManyRequests 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 nodes by container engine version count too many requests response has a 2xx status code +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by container engine version count too many requests response has a 3xx status code +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by container engine version count too many requests response has a 4xx status code +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read nodes by container engine version count too many requests response has a 5xx status code +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by container engine version count too many requests response a status code equal to that given +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read nodes by container engine version count too many requests response +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodesByContainerEngineVersionCountTooManyRequests) 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 +} + +// NewReadNodesByContainerEngineVersionCountInternalServerError creates a ReadNodesByContainerEngineVersionCountInternalServerError with default headers values +func NewReadNodesByContainerEngineVersionCountInternalServerError() *ReadNodesByContainerEngineVersionCountInternalServerError { + return &ReadNodesByContainerEngineVersionCountInternalServerError{} +} + +/* +ReadNodesByContainerEngineVersionCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadNodesByContainerEngineVersionCountInternalServerError 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 nodes by container engine version count internal server error response has a 2xx status code +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by container engine version count internal server error response has a 3xx status code +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by container engine version count internal server error response has a 4xx status code +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read nodes by container engine version count internal server error response has a 5xx status code +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read nodes by container engine version count internal server error response a status code equal to that given +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read nodes by container engine version count internal server error response +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-container-engine-version/v1][%d] readNodesByContainerEngineVersionCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadNodesByContainerEngineVersionCountInternalServerError) 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/read_nodes_by_date_range_count_parameters.go b/falcon/client/kubernetes_protection/read_nodes_by_date_range_count_parameters.go new file mode 100644 index 00000000..f585f4c2 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_nodes_by_date_range_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadNodesByDateRangeCountParams creates a new ReadNodesByDateRangeCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadNodesByDateRangeCountParams() *ReadNodesByDateRangeCountParams { + return &ReadNodesByDateRangeCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadNodesByDateRangeCountParamsWithTimeout creates a new ReadNodesByDateRangeCountParams object +// with the ability to set a timeout on a request. +func NewReadNodesByDateRangeCountParamsWithTimeout(timeout time.Duration) *ReadNodesByDateRangeCountParams { + return &ReadNodesByDateRangeCountParams{ + timeout: timeout, + } +} + +// NewReadNodesByDateRangeCountParamsWithContext creates a new ReadNodesByDateRangeCountParams object +// with the ability to set a context for a request. +func NewReadNodesByDateRangeCountParamsWithContext(ctx context.Context) *ReadNodesByDateRangeCountParams { + return &ReadNodesByDateRangeCountParams{ + Context: ctx, + } +} + +// NewReadNodesByDateRangeCountParamsWithHTTPClient creates a new ReadNodesByDateRangeCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadNodesByDateRangeCountParamsWithHTTPClient(client *http.Client) *ReadNodesByDateRangeCountParams { + return &ReadNodesByDateRangeCountParams{ + HTTPClient: client, + } +} + +/* +ReadNodesByDateRangeCountParams contains all the parameters to send to the API endpoint + + for the read nodes by date range count operation. + + Typically these are written to a http.Request. +*/ +type ReadNodesByDateRangeCountParams struct { + + /* Filter. + + Search Kubernetes nodes using a query in Falcon Query Language (FQL). Supported filters: aid,annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_count,container_runtime_version,first_seen,image_digest,ipv4,last_seen,node_name,pod_count + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read nodes by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodesByDateRangeCountParams) WithDefaults() *ReadNodesByDateRangeCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read nodes by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadNodesByDateRangeCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) WithTimeout(timeout time.Duration) *ReadNodesByDateRangeCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) WithContext(ctx context.Context) *ReadNodesByDateRangeCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) WithHTTPClient(client *http.Client) *ReadNodesByDateRangeCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) WithFilter(filter *string) *ReadNodesByDateRangeCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read nodes by date range count params +func (o *ReadNodesByDateRangeCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadNodesByDateRangeCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_nodes_by_date_range_count_responses.go b/falcon/client/kubernetes_protection/read_nodes_by_date_range_count_responses.go new file mode 100644 index 00000000..1860d1e9 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_nodes_by_date_range_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadNodesByDateRangeCountReader is a Reader for the ReadNodesByDateRangeCount structure. +type ReadNodesByDateRangeCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadNodesByDateRangeCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadNodesByDateRangeCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadNodesByDateRangeCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadNodesByDateRangeCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadNodesByDateRangeCountInternalServerError() + 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/nodes/count-by-date/v1] ReadNodesByDateRangeCount", response, response.Code()) + } +} + +// NewReadNodesByDateRangeCountOK creates a ReadNodesByDateRangeCountOK with default headers values +func NewReadNodesByDateRangeCountOK() *ReadNodesByDateRangeCountOK { + return &ReadNodesByDateRangeCountOK{} +} + +/* +ReadNodesByDateRangeCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadNodesByDateRangeCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read nodes by date range count o k response has a 2xx status code +func (o *ReadNodesByDateRangeCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read nodes by date range count o k response has a 3xx status code +func (o *ReadNodesByDateRangeCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by date range count o k response has a 4xx status code +func (o *ReadNodesByDateRangeCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read nodes by date range count o k response has a 5xx status code +func (o *ReadNodesByDateRangeCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by date range count o k response a status code equal to that given +func (o *ReadNodesByDateRangeCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read nodes by date range count o k response +func (o *ReadNodesByDateRangeCountOK) Code() int { + return 200 +} + +func (o *ReadNodesByDateRangeCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodesByDateRangeCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadNodesByDateRangeCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadNodesByDateRangeCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadNodesByDateRangeCountForbidden creates a ReadNodesByDateRangeCountForbidden with default headers values +func NewReadNodesByDateRangeCountForbidden() *ReadNodesByDateRangeCountForbidden { + return &ReadNodesByDateRangeCountForbidden{} +} + +/* +ReadNodesByDateRangeCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadNodesByDateRangeCountForbidden 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 nodes by date range count forbidden response has a 2xx status code +func (o *ReadNodesByDateRangeCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by date range count forbidden response has a 3xx status code +func (o *ReadNodesByDateRangeCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by date range count forbidden response has a 4xx status code +func (o *ReadNodesByDateRangeCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read nodes by date range count forbidden response has a 5xx status code +func (o *ReadNodesByDateRangeCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by date range count forbidden response a status code equal to that given +func (o *ReadNodesByDateRangeCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read nodes by date range count forbidden response +func (o *ReadNodesByDateRangeCountForbidden) Code() int { + return 403 +} + +func (o *ReadNodesByDateRangeCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodesByDateRangeCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadNodesByDateRangeCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodesByDateRangeCountForbidden) 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 +} + +// NewReadNodesByDateRangeCountTooManyRequests creates a ReadNodesByDateRangeCountTooManyRequests with default headers values +func NewReadNodesByDateRangeCountTooManyRequests() *ReadNodesByDateRangeCountTooManyRequests { + return &ReadNodesByDateRangeCountTooManyRequests{} +} + +/* +ReadNodesByDateRangeCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadNodesByDateRangeCountTooManyRequests 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 nodes by date range count too many requests response has a 2xx status code +func (o *ReadNodesByDateRangeCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by date range count too many requests response has a 3xx status code +func (o *ReadNodesByDateRangeCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by date range count too many requests response has a 4xx status code +func (o *ReadNodesByDateRangeCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read nodes by date range count too many requests response has a 5xx status code +func (o *ReadNodesByDateRangeCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read nodes by date range count too many requests response a status code equal to that given +func (o *ReadNodesByDateRangeCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read nodes by date range count too many requests response +func (o *ReadNodesByDateRangeCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadNodesByDateRangeCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodesByDateRangeCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadNodesByDateRangeCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadNodesByDateRangeCountTooManyRequests) 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 +} + +// NewReadNodesByDateRangeCountInternalServerError creates a ReadNodesByDateRangeCountInternalServerError with default headers values +func NewReadNodesByDateRangeCountInternalServerError() *ReadNodesByDateRangeCountInternalServerError { + return &ReadNodesByDateRangeCountInternalServerError{} +} + +/* +ReadNodesByDateRangeCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadNodesByDateRangeCountInternalServerError 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 nodes by date range count internal server error response has a 2xx status code +func (o *ReadNodesByDateRangeCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read nodes by date range count internal server error response has a 3xx status code +func (o *ReadNodesByDateRangeCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read nodes by date range count internal server error response has a 4xx status code +func (o *ReadNodesByDateRangeCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read nodes by date range count internal server error response has a 5xx status code +func (o *ReadNodesByDateRangeCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read nodes by date range count internal server error response a status code equal to that given +func (o *ReadNodesByDateRangeCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read nodes by date range count internal server error response +func (o *ReadNodesByDateRangeCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadNodesByDateRangeCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodesByDateRangeCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/nodes/count-by-date/v1][%d] readNodesByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadNodesByDateRangeCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadNodesByDateRangeCountInternalServerError) 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/read_pod_combined_parameters.go b/falcon/client/kubernetes_protection/read_pod_combined_parameters.go new file mode 100644 index 00000000..1f22d573 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pod_combined_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadPodCombinedParams creates a new ReadPodCombinedParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadPodCombinedParams() *ReadPodCombinedParams { + return &ReadPodCombinedParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadPodCombinedParamsWithTimeout creates a new ReadPodCombinedParams object +// with the ability to set a timeout on a request. +func NewReadPodCombinedParamsWithTimeout(timeout time.Duration) *ReadPodCombinedParams { + return &ReadPodCombinedParams{ + timeout: timeout, + } +} + +// NewReadPodCombinedParamsWithContext creates a new ReadPodCombinedParams object +// with the ability to set a context for a request. +func NewReadPodCombinedParamsWithContext(ctx context.Context) *ReadPodCombinedParams { + return &ReadPodCombinedParams{ + Context: ctx, + } +} + +// NewReadPodCombinedParamsWithHTTPClient creates a new ReadPodCombinedParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadPodCombinedParamsWithHTTPClient(client *http.Client) *ReadPodCombinedParams { + return &ReadPodCombinedParams{ + HTTPClient: client, + } +} + +/* +ReadPodCombinedParams contains all the parameters to send to the API endpoint + + for the read pod combined operation. + + Typically these are written to a http.Request. +*/ +type ReadPodCombinedParams struct { + + /* Filter. + + Search Kubernetes pods using a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_count,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,owner_id,owner_type,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user + */ + 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. + + Field to sort results by + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read pod combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodCombinedParams) WithDefaults() *ReadPodCombinedParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read pod combined params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodCombinedParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read pod combined params +func (o *ReadPodCombinedParams) WithTimeout(timeout time.Duration) *ReadPodCombinedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read pod combined params +func (o *ReadPodCombinedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read pod combined params +func (o *ReadPodCombinedParams) WithContext(ctx context.Context) *ReadPodCombinedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read pod combined params +func (o *ReadPodCombinedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read pod combined params +func (o *ReadPodCombinedParams) WithHTTPClient(client *http.Client) *ReadPodCombinedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read pod combined params +func (o *ReadPodCombinedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read pod combined params +func (o *ReadPodCombinedParams) WithFilter(filter *string) *ReadPodCombinedParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read pod combined params +func (o *ReadPodCombinedParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the read pod combined params +func (o *ReadPodCombinedParams) WithLimit(limit *int64) *ReadPodCombinedParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read pod combined params +func (o *ReadPodCombinedParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the read pod combined params +func (o *ReadPodCombinedParams) WithOffset(offset *int64) *ReadPodCombinedParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the read pod combined params +func (o *ReadPodCombinedParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the read pod combined params +func (o *ReadPodCombinedParams) WithSort(sort *string) *ReadPodCombinedParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the read pod combined params +func (o *ReadPodCombinedParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadPodCombinedParams) 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/kubernetes_protection/read_pod_combined_responses.go b/falcon/client/kubernetes_protection/read_pod_combined_responses.go new file mode 100644 index 00000000..ecead117 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pod_combined_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadPodCombinedReader is a Reader for the ReadPodCombined structure. +type ReadPodCombinedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadPodCombinedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadPodCombinedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadPodCombinedForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadPodCombinedTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadPodCombinedInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/pods/v1] ReadPodCombined", response, response.Code()) + } +} + +// NewReadPodCombinedOK creates a ReadPodCombinedOK with default headers values +func NewReadPodCombinedOK() *ReadPodCombinedOK { + return &ReadPodCombinedOK{} +} + +/* +ReadPodCombinedOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadPodCombinedOK 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.ModelsPodEntityResponse +} + +// IsSuccess returns true when this read pod combined o k response has a 2xx status code +func (o *ReadPodCombinedOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read pod combined o k response has a 3xx status code +func (o *ReadPodCombinedOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod combined o k response has a 4xx status code +func (o *ReadPodCombinedOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pod combined o k response has a 5xx status code +func (o *ReadPodCombinedOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod combined o k response a status code equal to that given +func (o *ReadPodCombinedOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read pod combined o k response +func (o *ReadPodCombinedOK) Code() int { + return 200 +} + +func (o *ReadPodCombinedOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadPodCombinedOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedOK %+v", 200, o.Payload) +} + +func (o *ReadPodCombinedOK) GetPayload() *models.ModelsPodEntityResponse { + return o.Payload +} + +func (o *ReadPodCombinedOK) 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.ModelsPodEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadPodCombinedForbidden creates a ReadPodCombinedForbidden with default headers values +func NewReadPodCombinedForbidden() *ReadPodCombinedForbidden { + return &ReadPodCombinedForbidden{} +} + +/* +ReadPodCombinedForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadPodCombinedForbidden 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 pod combined forbidden response has a 2xx status code +func (o *ReadPodCombinedForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod combined forbidden response has a 3xx status code +func (o *ReadPodCombinedForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod combined forbidden response has a 4xx status code +func (o *ReadPodCombinedForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pod combined forbidden response has a 5xx status code +func (o *ReadPodCombinedForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod combined forbidden response a status code equal to that given +func (o *ReadPodCombinedForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read pod combined forbidden response +func (o *ReadPodCombinedForbidden) Code() int { + return 403 +} + +func (o *ReadPodCombinedForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodCombinedForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodCombinedForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodCombinedForbidden) 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 +} + +// NewReadPodCombinedTooManyRequests creates a ReadPodCombinedTooManyRequests with default headers values +func NewReadPodCombinedTooManyRequests() *ReadPodCombinedTooManyRequests { + return &ReadPodCombinedTooManyRequests{} +} + +/* +ReadPodCombinedTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadPodCombinedTooManyRequests 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 pod combined too many requests response has a 2xx status code +func (o *ReadPodCombinedTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod combined too many requests response has a 3xx status code +func (o *ReadPodCombinedTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod combined too many requests response has a 4xx status code +func (o *ReadPodCombinedTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pod combined too many requests response has a 5xx status code +func (o *ReadPodCombinedTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod combined too many requests response a status code equal to that given +func (o *ReadPodCombinedTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read pod combined too many requests response +func (o *ReadPodCombinedTooManyRequests) Code() int { + return 429 +} + +func (o *ReadPodCombinedTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodCombinedTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodCombinedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodCombinedTooManyRequests) 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 +} + +// NewReadPodCombinedInternalServerError creates a ReadPodCombinedInternalServerError with default headers values +func NewReadPodCombinedInternalServerError() *ReadPodCombinedInternalServerError { + return &ReadPodCombinedInternalServerError{} +} + +/* +ReadPodCombinedInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadPodCombinedInternalServerError 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 pod combined internal server error response has a 2xx status code +func (o *ReadPodCombinedInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod combined internal server error response has a 3xx status code +func (o *ReadPodCombinedInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod combined internal server error response has a 4xx status code +func (o *ReadPodCombinedInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pod combined internal server error response has a 5xx status code +func (o *ReadPodCombinedInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read pod combined internal server error response a status code equal to that given +func (o *ReadPodCombinedInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read pod combined internal server error response +func (o *ReadPodCombinedInternalServerError) Code() int { + return 500 +} + +func (o *ReadPodCombinedInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodCombinedInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/pods/v1][%d] readPodCombinedInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodCombinedInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadPodCombinedInternalServerError) 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/read_pod_count_parameters.go b/falcon/client/kubernetes_protection/read_pod_count_parameters.go new file mode 100644 index 00000000..59892c8e --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pod_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadPodCountParams creates a new ReadPodCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadPodCountParams() *ReadPodCountParams { + return &ReadPodCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadPodCountParamsWithTimeout creates a new ReadPodCountParams object +// with the ability to set a timeout on a request. +func NewReadPodCountParamsWithTimeout(timeout time.Duration) *ReadPodCountParams { + return &ReadPodCountParams{ + timeout: timeout, + } +} + +// NewReadPodCountParamsWithContext creates a new ReadPodCountParams object +// with the ability to set a context for a request. +func NewReadPodCountParamsWithContext(ctx context.Context) *ReadPodCountParams { + return &ReadPodCountParams{ + Context: ctx, + } +} + +// NewReadPodCountParamsWithHTTPClient creates a new ReadPodCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadPodCountParamsWithHTTPClient(client *http.Client) *ReadPodCountParams { + return &ReadPodCountParams{ + HTTPClient: client, + } +} + +/* +ReadPodCountParams contains all the parameters to send to the API endpoint + + for the read pod count operation. + + Typically these are written to a http.Request. +*/ +type ReadPodCountParams struct { + + /* Filter. + + Retrieve count of Kubernetes pods that match a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,annotations_list,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_count,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,owner_id,owner_type,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read pod count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodCountParams) WithDefaults() *ReadPodCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read pod count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read pod count params +func (o *ReadPodCountParams) WithTimeout(timeout time.Duration) *ReadPodCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read pod count params +func (o *ReadPodCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read pod count params +func (o *ReadPodCountParams) WithContext(ctx context.Context) *ReadPodCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read pod count params +func (o *ReadPodCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read pod count params +func (o *ReadPodCountParams) WithHTTPClient(client *http.Client) *ReadPodCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read pod count params +func (o *ReadPodCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read pod count params +func (o *ReadPodCountParams) WithFilter(filter *string) *ReadPodCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read pod count params +func (o *ReadPodCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadPodCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_pod_count_responses.go b/falcon/client/kubernetes_protection/read_pod_count_responses.go new file mode 100644 index 00000000..e2544e48 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pod_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadPodCountReader is a Reader for the ReadPodCount structure. +type ReadPodCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadPodCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadPodCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadPodCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadPodCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadPodCountInternalServerError() + 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/pods/count/v1] ReadPodCount", response, response.Code()) + } +} + +// NewReadPodCountOK creates a ReadPodCountOK with default headers values +func NewReadPodCountOK() *ReadPodCountOK { + return &ReadPodCountOK{} +} + +/* +ReadPodCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadPodCountOK 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.CommonCountResponse +} + +// IsSuccess returns true when this read pod count o k response has a 2xx status code +func (o *ReadPodCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read pod count o k response has a 3xx status code +func (o *ReadPodCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod count o k response has a 4xx status code +func (o *ReadPodCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pod count o k response has a 5xx status code +func (o *ReadPodCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod count o k response a status code equal to that given +func (o *ReadPodCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read pod count o k response +func (o *ReadPodCountOK) Code() int { + return 200 +} + +func (o *ReadPodCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountOK %+v", 200, o.Payload) +} + +func (o *ReadPodCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountOK %+v", 200, o.Payload) +} + +func (o *ReadPodCountOK) GetPayload() *models.CommonCountResponse { + return o.Payload +} + +func (o *ReadPodCountOK) 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.CommonCountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadPodCountForbidden creates a ReadPodCountForbidden with default headers values +func NewReadPodCountForbidden() *ReadPodCountForbidden { + return &ReadPodCountForbidden{} +} + +/* +ReadPodCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadPodCountForbidden 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 pod count forbidden response has a 2xx status code +func (o *ReadPodCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod count forbidden response has a 3xx status code +func (o *ReadPodCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod count forbidden response has a 4xx status code +func (o *ReadPodCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pod count forbidden response has a 5xx status code +func (o *ReadPodCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod count forbidden response a status code equal to that given +func (o *ReadPodCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read pod count forbidden response +func (o *ReadPodCountForbidden) Code() int { + return 403 +} + +func (o *ReadPodCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodCountForbidden) 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 +} + +// NewReadPodCountTooManyRequests creates a ReadPodCountTooManyRequests with default headers values +func NewReadPodCountTooManyRequests() *ReadPodCountTooManyRequests { + return &ReadPodCountTooManyRequests{} +} + +/* +ReadPodCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadPodCountTooManyRequests 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 pod count too many requests response has a 2xx status code +func (o *ReadPodCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod count too many requests response has a 3xx status code +func (o *ReadPodCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod count too many requests response has a 4xx status code +func (o *ReadPodCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pod count too many requests response has a 5xx status code +func (o *ReadPodCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod count too many requests response a status code equal to that given +func (o *ReadPodCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read pod count too many requests response +func (o *ReadPodCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadPodCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodCountTooManyRequests) 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 +} + +// NewReadPodCountInternalServerError creates a ReadPodCountInternalServerError with default headers values +func NewReadPodCountInternalServerError() *ReadPodCountInternalServerError { + return &ReadPodCountInternalServerError{} +} + +/* +ReadPodCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadPodCountInternalServerError 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 pod count internal server error response has a 2xx status code +func (o *ReadPodCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod count internal server error response has a 3xx status code +func (o *ReadPodCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod count internal server error response has a 4xx status code +func (o *ReadPodCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pod count internal server error response has a 5xx status code +func (o *ReadPodCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read pod count internal server error response a status code equal to that given +func (o *ReadPodCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read pod count internal server error response +func (o *ReadPodCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadPodCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count/v1][%d] readPodCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadPodCountInternalServerError) 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/read_pod_enrichment_parameters.go b/falcon/client/kubernetes_protection/read_pod_enrichment_parameters.go new file mode 100644 index 00000000..6905b647 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pod_enrichment_parameters.go @@ -0,0 +1,209 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadPodEnrichmentParams creates a new ReadPodEnrichmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadPodEnrichmentParams() *ReadPodEnrichmentParams { + return &ReadPodEnrichmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadPodEnrichmentParamsWithTimeout creates a new ReadPodEnrichmentParams object +// with the ability to set a timeout on a request. +func NewReadPodEnrichmentParamsWithTimeout(timeout time.Duration) *ReadPodEnrichmentParams { + return &ReadPodEnrichmentParams{ + timeout: timeout, + } +} + +// NewReadPodEnrichmentParamsWithContext creates a new ReadPodEnrichmentParams object +// with the ability to set a context for a request. +func NewReadPodEnrichmentParamsWithContext(ctx context.Context) *ReadPodEnrichmentParams { + return &ReadPodEnrichmentParams{ + Context: ctx, + } +} + +// NewReadPodEnrichmentParamsWithHTTPClient creates a new ReadPodEnrichmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadPodEnrichmentParamsWithHTTPClient(client *http.Client) *ReadPodEnrichmentParams { + return &ReadPodEnrichmentParams{ + HTTPClient: client, + } +} + +/* +ReadPodEnrichmentParams contains all the parameters to send to the API endpoint + + for the read pod enrichment operation. + + Typically these are written to a http.Request. +*/ +type ReadPodEnrichmentParams 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 +} + +// WithDefaults hydrates default values in the read pod enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodEnrichmentParams) WithDefaults() *ReadPodEnrichmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read pod enrichment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodEnrichmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read pod enrichment params +func (o *ReadPodEnrichmentParams) WithTimeout(timeout time.Duration) *ReadPodEnrichmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read pod enrichment params +func (o *ReadPodEnrichmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read pod enrichment params +func (o *ReadPodEnrichmentParams) WithContext(ctx context.Context) *ReadPodEnrichmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read pod enrichment params +func (o *ReadPodEnrichmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read pod enrichment params +func (o *ReadPodEnrichmentParams) WithHTTPClient(client *http.Client) *ReadPodEnrichmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read pod enrichment params +func (o *ReadPodEnrichmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read pod enrichment params +func (o *ReadPodEnrichmentParams) WithFilter(filter *string) *ReadPodEnrichmentParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read pod enrichment params +func (o *ReadPodEnrichmentParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithPodID adds the podID to the read pod enrichment params +func (o *ReadPodEnrichmentParams) WithPodID(podID []string) *ReadPodEnrichmentParams { + o.SetPodID(podID) + return o +} + +// SetPodID adds the podId to the read pod enrichment params +func (o *ReadPodEnrichmentParams) SetPodID(podID []string) { + o.PodID = podID +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadPodEnrichmentParams) 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.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 +} + +// bindParamReadPodEnrichment binds the parameter pod_id +func (o *ReadPodEnrichmentParams) 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/kubernetes_protection/read_pod_enrichment_responses.go b/falcon/client/kubernetes_protection/read_pod_enrichment_responses.go new file mode 100644 index 00000000..c2f43385 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pod_enrichment_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadPodEnrichmentReader is a Reader for the ReadPodEnrichment structure. +type ReadPodEnrichmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadPodEnrichmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadPodEnrichmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadPodEnrichmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadPodEnrichmentTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadPodEnrichmentInternalServerError() + 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] ReadPodEnrichment", response, response.Code()) + } +} + +// NewReadPodEnrichmentOK creates a ReadPodEnrichmentOK with default headers values +func NewReadPodEnrichmentOK() *ReadPodEnrichmentOK { + return &ReadPodEnrichmentOK{} +} + +/* +ReadPodEnrichmentOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadPodEnrichmentOK 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.K8sassetsPodEnrichmentResponse +} + +// IsSuccess returns true when this read pod enrichment o k response has a 2xx status code +func (o *ReadPodEnrichmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read pod enrichment o k response has a 3xx status code +func (o *ReadPodEnrichmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod enrichment o k response has a 4xx status code +func (o *ReadPodEnrichmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pod enrichment o k response has a 5xx status code +func (o *ReadPodEnrichmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod enrichment o k response a status code equal to that given +func (o *ReadPodEnrichmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read pod enrichment o k response +func (o *ReadPodEnrichmentOK) Code() int { + return 200 +} + +func (o *ReadPodEnrichmentOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadPodEnrichmentOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentOK %+v", 200, o.Payload) +} + +func (o *ReadPodEnrichmentOK) GetPayload() *models.K8sassetsPodEnrichmentResponse { + return o.Payload +} + +func (o *ReadPodEnrichmentOK) 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.K8sassetsPodEnrichmentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadPodEnrichmentForbidden creates a ReadPodEnrichmentForbidden with default headers values +func NewReadPodEnrichmentForbidden() *ReadPodEnrichmentForbidden { + return &ReadPodEnrichmentForbidden{} +} + +/* +ReadPodEnrichmentForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadPodEnrichmentForbidden 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 pod enrichment forbidden response has a 2xx status code +func (o *ReadPodEnrichmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod enrichment forbidden response has a 3xx status code +func (o *ReadPodEnrichmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod enrichment forbidden response has a 4xx status code +func (o *ReadPodEnrichmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pod enrichment forbidden response has a 5xx status code +func (o *ReadPodEnrichmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod enrichment forbidden response a status code equal to that given +func (o *ReadPodEnrichmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read pod enrichment forbidden response +func (o *ReadPodEnrichmentForbidden) Code() int { + return 403 +} + +func (o *ReadPodEnrichmentForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodEnrichmentForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodEnrichmentForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodEnrichmentForbidden) 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 +} + +// NewReadPodEnrichmentTooManyRequests creates a ReadPodEnrichmentTooManyRequests with default headers values +func NewReadPodEnrichmentTooManyRequests() *ReadPodEnrichmentTooManyRequests { + return &ReadPodEnrichmentTooManyRequests{} +} + +/* +ReadPodEnrichmentTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadPodEnrichmentTooManyRequests 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 pod enrichment too many requests response has a 2xx status code +func (o *ReadPodEnrichmentTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod enrichment too many requests response has a 3xx status code +func (o *ReadPodEnrichmentTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod enrichment too many requests response has a 4xx status code +func (o *ReadPodEnrichmentTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pod enrichment too many requests response has a 5xx status code +func (o *ReadPodEnrichmentTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read pod enrichment too many requests response a status code equal to that given +func (o *ReadPodEnrichmentTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read pod enrichment too many requests response +func (o *ReadPodEnrichmentTooManyRequests) Code() int { + return 429 +} + +func (o *ReadPodEnrichmentTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodEnrichmentTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodEnrichmentTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodEnrichmentTooManyRequests) 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 +} + +// NewReadPodEnrichmentInternalServerError creates a ReadPodEnrichmentInternalServerError with default headers values +func NewReadPodEnrichmentInternalServerError() *ReadPodEnrichmentInternalServerError { + return &ReadPodEnrichmentInternalServerError{} +} + +/* +ReadPodEnrichmentInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadPodEnrichmentInternalServerError 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 pod enrichment internal server error response has a 2xx status code +func (o *ReadPodEnrichmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pod enrichment internal server error response has a 3xx status code +func (o *ReadPodEnrichmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pod enrichment internal server error response has a 4xx status code +func (o *ReadPodEnrichmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pod enrichment internal server error response has a 5xx status code +func (o *ReadPodEnrichmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read pod enrichment internal server error response a status code equal to that given +func (o *ReadPodEnrichmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read pod enrichment internal server error response +func (o *ReadPodEnrichmentInternalServerError) Code() int { + return 500 +} + +func (o *ReadPodEnrichmentInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodEnrichmentInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/enrichment/pods/entities/v1][%d] readPodEnrichmentInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodEnrichmentInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadPodEnrichmentInternalServerError) 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/read_pods_by_date_range_count_parameters.go b/falcon/client/kubernetes_protection/read_pods_by_date_range_count_parameters.go new file mode 100644 index 00000000..a5d6f2ed --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pods_by_date_range_count_parameters.go @@ -0,0 +1,128 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadPodsByDateRangeCountParams creates a new ReadPodsByDateRangeCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadPodsByDateRangeCountParams() *ReadPodsByDateRangeCountParams { + return &ReadPodsByDateRangeCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadPodsByDateRangeCountParamsWithTimeout creates a new ReadPodsByDateRangeCountParams object +// with the ability to set a timeout on a request. +func NewReadPodsByDateRangeCountParamsWithTimeout(timeout time.Duration) *ReadPodsByDateRangeCountParams { + return &ReadPodsByDateRangeCountParams{ + timeout: timeout, + } +} + +// NewReadPodsByDateRangeCountParamsWithContext creates a new ReadPodsByDateRangeCountParams object +// with the ability to set a context for a request. +func NewReadPodsByDateRangeCountParamsWithContext(ctx context.Context) *ReadPodsByDateRangeCountParams { + return &ReadPodsByDateRangeCountParams{ + Context: ctx, + } +} + +// NewReadPodsByDateRangeCountParamsWithHTTPClient creates a new ReadPodsByDateRangeCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadPodsByDateRangeCountParamsWithHTTPClient(client *http.Client) *ReadPodsByDateRangeCountParams { + return &ReadPodsByDateRangeCountParams{ + HTTPClient: client, + } +} + +/* +ReadPodsByDateRangeCountParams contains all the parameters to send to the API endpoint + + for the read pods by date range count operation. + + Typically these are written to a http.Request. +*/ +type ReadPodsByDateRangeCountParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read pods by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodsByDateRangeCountParams) WithDefaults() *ReadPodsByDateRangeCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read pods by date range count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadPodsByDateRangeCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read pods by date range count params +func (o *ReadPodsByDateRangeCountParams) WithTimeout(timeout time.Duration) *ReadPodsByDateRangeCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read pods by date range count params +func (o *ReadPodsByDateRangeCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read pods by date range count params +func (o *ReadPodsByDateRangeCountParams) WithContext(ctx context.Context) *ReadPodsByDateRangeCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read pods by date range count params +func (o *ReadPodsByDateRangeCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read pods by date range count params +func (o *ReadPodsByDateRangeCountParams) WithHTTPClient(client *http.Client) *ReadPodsByDateRangeCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read pods by date range count params +func (o *ReadPodsByDateRangeCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadPodsByDateRangeCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_pods_by_date_range_count_responses.go b/falcon/client/kubernetes_protection/read_pods_by_date_range_count_responses.go new file mode 100644 index 00000000..9246b077 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_pods_by_date_range_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadPodsByDateRangeCountReader is a Reader for the ReadPodsByDateRangeCount structure. +type ReadPodsByDateRangeCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadPodsByDateRangeCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadPodsByDateRangeCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadPodsByDateRangeCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadPodsByDateRangeCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadPodsByDateRangeCountInternalServerError() + 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/pods/count-by-date/v1] ReadPodsByDateRangeCount", response, response.Code()) + } +} + +// NewReadPodsByDateRangeCountOK creates a ReadPodsByDateRangeCountOK with default headers values +func NewReadPodsByDateRangeCountOK() *ReadPodsByDateRangeCountOK { + return &ReadPodsByDateRangeCountOK{} +} + +/* +ReadPodsByDateRangeCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadPodsByDateRangeCountOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this read pods by date range count o k response has a 2xx status code +func (o *ReadPodsByDateRangeCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read pods by date range count o k response has a 3xx status code +func (o *ReadPodsByDateRangeCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pods by date range count o k response has a 4xx status code +func (o *ReadPodsByDateRangeCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pods by date range count o k response has a 5xx status code +func (o *ReadPodsByDateRangeCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read pods by date range count o k response a status code equal to that given +func (o *ReadPodsByDateRangeCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read pods by date range count o k response +func (o *ReadPodsByDateRangeCountOK) Code() int { + return 200 +} + +func (o *ReadPodsByDateRangeCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadPodsByDateRangeCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountOK %+v", 200, o.Payload) +} + +func (o *ReadPodsByDateRangeCountOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *ReadPodsByDateRangeCountOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadPodsByDateRangeCountForbidden creates a ReadPodsByDateRangeCountForbidden with default headers values +func NewReadPodsByDateRangeCountForbidden() *ReadPodsByDateRangeCountForbidden { + return &ReadPodsByDateRangeCountForbidden{} +} + +/* +ReadPodsByDateRangeCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadPodsByDateRangeCountForbidden 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 pods by date range count forbidden response has a 2xx status code +func (o *ReadPodsByDateRangeCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pods by date range count forbidden response has a 3xx status code +func (o *ReadPodsByDateRangeCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pods by date range count forbidden response has a 4xx status code +func (o *ReadPodsByDateRangeCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pods by date range count forbidden response has a 5xx status code +func (o *ReadPodsByDateRangeCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read pods by date range count forbidden response a status code equal to that given +func (o *ReadPodsByDateRangeCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read pods by date range count forbidden response +func (o *ReadPodsByDateRangeCountForbidden) Code() int { + return 403 +} + +func (o *ReadPodsByDateRangeCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodsByDateRangeCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadPodsByDateRangeCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodsByDateRangeCountForbidden) 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 +} + +// NewReadPodsByDateRangeCountTooManyRequests creates a ReadPodsByDateRangeCountTooManyRequests with default headers values +func NewReadPodsByDateRangeCountTooManyRequests() *ReadPodsByDateRangeCountTooManyRequests { + return &ReadPodsByDateRangeCountTooManyRequests{} +} + +/* +ReadPodsByDateRangeCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadPodsByDateRangeCountTooManyRequests 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 pods by date range count too many requests response has a 2xx status code +func (o *ReadPodsByDateRangeCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pods by date range count too many requests response has a 3xx status code +func (o *ReadPodsByDateRangeCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pods by date range count too many requests response has a 4xx status code +func (o *ReadPodsByDateRangeCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read pods by date range count too many requests response has a 5xx status code +func (o *ReadPodsByDateRangeCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read pods by date range count too many requests response a status code equal to that given +func (o *ReadPodsByDateRangeCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read pods by date range count too many requests response +func (o *ReadPodsByDateRangeCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadPodsByDateRangeCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodsByDateRangeCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadPodsByDateRangeCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadPodsByDateRangeCountTooManyRequests) 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 +} + +// NewReadPodsByDateRangeCountInternalServerError creates a ReadPodsByDateRangeCountInternalServerError with default headers values +func NewReadPodsByDateRangeCountInternalServerError() *ReadPodsByDateRangeCountInternalServerError { + return &ReadPodsByDateRangeCountInternalServerError{} +} + +/* +ReadPodsByDateRangeCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadPodsByDateRangeCountInternalServerError 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 pods by date range count internal server error response has a 2xx status code +func (o *ReadPodsByDateRangeCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read pods by date range count internal server error response has a 3xx status code +func (o *ReadPodsByDateRangeCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read pods by date range count internal server error response has a 4xx status code +func (o *ReadPodsByDateRangeCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read pods by date range count internal server error response has a 5xx status code +func (o *ReadPodsByDateRangeCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read pods by date range count internal server error response a status code equal to that given +func (o *ReadPodsByDateRangeCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read pods by date range count internal server error response +func (o *ReadPodsByDateRangeCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadPodsByDateRangeCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodsByDateRangeCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/pods/count-by-date/v1][%d] readPodsByDateRangeCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadPodsByDateRangeCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadPodsByDateRangeCountInternalServerError) 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/read_running_container_images_parameters.go b/falcon/client/kubernetes_protection/read_running_container_images_parameters.go new file mode 100644 index 00000000..9ddf9c0f --- /dev/null +++ b/falcon/client/kubernetes_protection/read_running_container_images_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewReadRunningContainerImagesParams creates a new ReadRunningContainerImagesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadRunningContainerImagesParams() *ReadRunningContainerImagesParams { + return &ReadRunningContainerImagesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadRunningContainerImagesParamsWithTimeout creates a new ReadRunningContainerImagesParams object +// with the ability to set a timeout on a request. +func NewReadRunningContainerImagesParamsWithTimeout(timeout time.Duration) *ReadRunningContainerImagesParams { + return &ReadRunningContainerImagesParams{ + timeout: timeout, + } +} + +// NewReadRunningContainerImagesParamsWithContext creates a new ReadRunningContainerImagesParams object +// with the ability to set a context for a request. +func NewReadRunningContainerImagesParamsWithContext(ctx context.Context) *ReadRunningContainerImagesParams { + return &ReadRunningContainerImagesParams{ + Context: ctx, + } +} + +// NewReadRunningContainerImagesParamsWithHTTPClient creates a new ReadRunningContainerImagesParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadRunningContainerImagesParamsWithHTTPClient(client *http.Client) *ReadRunningContainerImagesParams { + return &ReadRunningContainerImagesParams{ + HTTPClient: client, + } +} + +/* +ReadRunningContainerImagesParams contains all the parameters to send to the API endpoint + + for the read running container images operation. + + Typically these are written to a http.Request. +*/ +type ReadRunningContainerImagesParams struct { + + /* Filter. + + Retrieve list of images on running containers using a query in Falcon Query Language (FQL). Supported filters: cid,hosts,image_digest,image_has_been_assessed,image_id,image_name,image_registry,image_repository,image_tag,last_seen,running_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. + + Field to sort results by + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read running container images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadRunningContainerImagesParams) WithDefaults() *ReadRunningContainerImagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read running container images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadRunningContainerImagesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read running container images params +func (o *ReadRunningContainerImagesParams) WithTimeout(timeout time.Duration) *ReadRunningContainerImagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read running container images params +func (o *ReadRunningContainerImagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read running container images params +func (o *ReadRunningContainerImagesParams) WithContext(ctx context.Context) *ReadRunningContainerImagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read running container images params +func (o *ReadRunningContainerImagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read running container images params +func (o *ReadRunningContainerImagesParams) WithHTTPClient(client *http.Client) *ReadRunningContainerImagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read running container images params +func (o *ReadRunningContainerImagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read running container images params +func (o *ReadRunningContainerImagesParams) WithFilter(filter *string) *ReadRunningContainerImagesParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read running container images params +func (o *ReadRunningContainerImagesParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the read running container images params +func (o *ReadRunningContainerImagesParams) WithLimit(limit *int64) *ReadRunningContainerImagesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the read running container images params +func (o *ReadRunningContainerImagesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the read running container images params +func (o *ReadRunningContainerImagesParams) WithOffset(offset *int64) *ReadRunningContainerImagesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the read running container images params +func (o *ReadRunningContainerImagesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the read running container images params +func (o *ReadRunningContainerImagesParams) WithSort(sort *string) *ReadRunningContainerImagesParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the read running container images params +func (o *ReadRunningContainerImagesParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadRunningContainerImagesParams) 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/kubernetes_protection/read_running_container_images_responses.go b/falcon/client/kubernetes_protection/read_running_container_images_responses.go new file mode 100644 index 00000000..476f99cb --- /dev/null +++ b/falcon/client/kubernetes_protection/read_running_container_images_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadRunningContainerImagesReader is a Reader for the ReadRunningContainerImages structure. +type ReadRunningContainerImagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadRunningContainerImagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadRunningContainerImagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadRunningContainerImagesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadRunningContainerImagesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadRunningContainerImagesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/container-images/v1] ReadRunningContainerImages", response, response.Code()) + } +} + +// NewReadRunningContainerImagesOK creates a ReadRunningContainerImagesOK with default headers values +func NewReadRunningContainerImagesOK() *ReadRunningContainerImagesOK { + return &ReadRunningContainerImagesOK{} +} + +/* +ReadRunningContainerImagesOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadRunningContainerImagesOK 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.ModelsContainerImage +} + +// IsSuccess returns true when this read running container images o k response has a 2xx status code +func (o *ReadRunningContainerImagesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read running container images o k response has a 3xx status code +func (o *ReadRunningContainerImagesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read running container images o k response has a 4xx status code +func (o *ReadRunningContainerImagesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read running container images o k response has a 5xx status code +func (o *ReadRunningContainerImagesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read running container images o k response a status code equal to that given +func (o *ReadRunningContainerImagesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read running container images o k response +func (o *ReadRunningContainerImagesOK) Code() int { + return 200 +} + +func (o *ReadRunningContainerImagesOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesOK %+v", 200, o.Payload) +} + +func (o *ReadRunningContainerImagesOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesOK %+v", 200, o.Payload) +} + +func (o *ReadRunningContainerImagesOK) GetPayload() *models.ModelsContainerImage { + return o.Payload +} + +func (o *ReadRunningContainerImagesOK) 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.ModelsContainerImage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadRunningContainerImagesForbidden creates a ReadRunningContainerImagesForbidden with default headers values +func NewReadRunningContainerImagesForbidden() *ReadRunningContainerImagesForbidden { + return &ReadRunningContainerImagesForbidden{} +} + +/* +ReadRunningContainerImagesForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadRunningContainerImagesForbidden 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 running container images forbidden response has a 2xx status code +func (o *ReadRunningContainerImagesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read running container images forbidden response has a 3xx status code +func (o *ReadRunningContainerImagesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read running container images forbidden response has a 4xx status code +func (o *ReadRunningContainerImagesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read running container images forbidden response has a 5xx status code +func (o *ReadRunningContainerImagesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read running container images forbidden response a status code equal to that given +func (o *ReadRunningContainerImagesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read running container images forbidden response +func (o *ReadRunningContainerImagesForbidden) Code() int { + return 403 +} + +func (o *ReadRunningContainerImagesForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesForbidden %+v", 403, o.Payload) +} + +func (o *ReadRunningContainerImagesForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesForbidden %+v", 403, o.Payload) +} + +func (o *ReadRunningContainerImagesForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadRunningContainerImagesForbidden) 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 +} + +// NewReadRunningContainerImagesTooManyRequests creates a ReadRunningContainerImagesTooManyRequests with default headers values +func NewReadRunningContainerImagesTooManyRequests() *ReadRunningContainerImagesTooManyRequests { + return &ReadRunningContainerImagesTooManyRequests{} +} + +/* +ReadRunningContainerImagesTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadRunningContainerImagesTooManyRequests 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 running container images too many requests response has a 2xx status code +func (o *ReadRunningContainerImagesTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read running container images too many requests response has a 3xx status code +func (o *ReadRunningContainerImagesTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read running container images too many requests response has a 4xx status code +func (o *ReadRunningContainerImagesTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read running container images too many requests response has a 5xx status code +func (o *ReadRunningContainerImagesTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read running container images too many requests response a status code equal to that given +func (o *ReadRunningContainerImagesTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read running container images too many requests response +func (o *ReadRunningContainerImagesTooManyRequests) Code() int { + return 429 +} + +func (o *ReadRunningContainerImagesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadRunningContainerImagesTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadRunningContainerImagesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadRunningContainerImagesTooManyRequests) 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 +} + +// NewReadRunningContainerImagesInternalServerError creates a ReadRunningContainerImagesInternalServerError with default headers values +func NewReadRunningContainerImagesInternalServerError() *ReadRunningContainerImagesInternalServerError { + return &ReadRunningContainerImagesInternalServerError{} +} + +/* +ReadRunningContainerImagesInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadRunningContainerImagesInternalServerError 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 running container images internal server error response has a 2xx status code +func (o *ReadRunningContainerImagesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read running container images internal server error response has a 3xx status code +func (o *ReadRunningContainerImagesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read running container images internal server error response has a 4xx status code +func (o *ReadRunningContainerImagesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read running container images internal server error response has a 5xx status code +func (o *ReadRunningContainerImagesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read running container images internal server error response a status code equal to that given +func (o *ReadRunningContainerImagesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read running container images internal server error response +func (o *ReadRunningContainerImagesInternalServerError) Code() int { + return 500 +} + +func (o *ReadRunningContainerImagesInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadRunningContainerImagesInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/container-images/v1][%d] readRunningContainerImagesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadRunningContainerImagesInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadRunningContainerImagesInternalServerError) 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/read_vulnerable_container_image_count_parameters.go b/falcon/client/kubernetes_protection/read_vulnerable_container_image_count_parameters.go new file mode 100644 index 00000000..931a3b9f --- /dev/null +++ b/falcon/client/kubernetes_protection/read_vulnerable_container_image_count_parameters.go @@ -0,0 +1,163 @@ +// 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 ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReadVulnerableContainerImageCountParams creates a new ReadVulnerableContainerImageCountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReadVulnerableContainerImageCountParams() *ReadVulnerableContainerImageCountParams { + return &ReadVulnerableContainerImageCountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReadVulnerableContainerImageCountParamsWithTimeout creates a new ReadVulnerableContainerImageCountParams object +// with the ability to set a timeout on a request. +func NewReadVulnerableContainerImageCountParamsWithTimeout(timeout time.Duration) *ReadVulnerableContainerImageCountParams { + return &ReadVulnerableContainerImageCountParams{ + timeout: timeout, + } +} + +// NewReadVulnerableContainerImageCountParamsWithContext creates a new ReadVulnerableContainerImageCountParams object +// with the ability to set a context for a request. +func NewReadVulnerableContainerImageCountParamsWithContext(ctx context.Context) *ReadVulnerableContainerImageCountParams { + return &ReadVulnerableContainerImageCountParams{ + Context: ctx, + } +} + +// NewReadVulnerableContainerImageCountParamsWithHTTPClient creates a new ReadVulnerableContainerImageCountParams object +// with the ability to set a custom HTTPClient for a request. +func NewReadVulnerableContainerImageCountParamsWithHTTPClient(client *http.Client) *ReadVulnerableContainerImageCountParams { + return &ReadVulnerableContainerImageCountParams{ + HTTPClient: client, + } +} + +/* +ReadVulnerableContainerImageCountParams contains all the parameters to send to the API endpoint + + for the read vulnerable container image count operation. + + Typically these are written to a http.Request. +*/ +type ReadVulnerableContainerImageCountParams struct { + + /* Filter. + + Retrieve count of Kubernetes containers that match a query in Falcon Query Language (FQL). Supported filters: agent_id,agent_type,allow_privilege_escalation,cid,cloud_account_id,cloud_name,cloud_region,cluster_id,cluster_name,container_id,container_name,cve_id,detection_name,first_seen,image_detection_count,image_digest,image_has_been_assessed,image_id,image_registry,image_repository,image_tag,image_vulnerability_count,insecure_mount_source,insecure_mount_type,insecure_propagation_mode,interactive_mode,ipv4,ipv6,labels,last_seen,namespace,node_name,node_uid,package_name_version,pod_id,pod_name,port,privileged,root_write_access,run_as_root_group,run_as_root_user,running_status + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the read vulnerable container image count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadVulnerableContainerImageCountParams) WithDefaults() *ReadVulnerableContainerImageCountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the read vulnerable container image count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReadVulnerableContainerImageCountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) WithTimeout(timeout time.Duration) *ReadVulnerableContainerImageCountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) WithContext(ctx context.Context) *ReadVulnerableContainerImageCountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) WithHTTPClient(client *http.Client) *ReadVulnerableContainerImageCountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) WithFilter(filter *string) *ReadVulnerableContainerImageCountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the read vulnerable container image count params +func (o *ReadVulnerableContainerImageCountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *ReadVulnerableContainerImageCountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/kubernetes_protection/read_vulnerable_container_image_count_responses.go b/falcon/client/kubernetes_protection/read_vulnerable_container_image_count_responses.go new file mode 100644 index 00000000..a0f3af91 --- /dev/null +++ b/falcon/client/kubernetes_protection/read_vulnerable_container_image_count_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// ReadVulnerableContainerImageCountReader is a Reader for the ReadVulnerableContainerImageCount structure. +type ReadVulnerableContainerImageCountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReadVulnerableContainerImageCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReadVulnerableContainerImageCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewReadVulnerableContainerImageCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReadVulnerableContainerImageCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReadVulnerableContainerImageCountInternalServerError() + 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/containers/count-vulnerable-images/v1] ReadVulnerableContainerImageCount", response, response.Code()) + } +} + +// NewReadVulnerableContainerImageCountOK creates a ReadVulnerableContainerImageCountOK with default headers values +func NewReadVulnerableContainerImageCountOK() *ReadVulnerableContainerImageCountOK { + return &ReadVulnerableContainerImageCountOK{} +} + +/* +ReadVulnerableContainerImageCountOK describes a response with status code 200, with default header values. + +OK +*/ +type ReadVulnerableContainerImageCountOK 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.ModelsAPIFilterResponse +} + +// IsSuccess returns true when this read vulnerable container image count o k response has a 2xx status code +func (o *ReadVulnerableContainerImageCountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this read vulnerable container image count o k response has a 3xx status code +func (o *ReadVulnerableContainerImageCountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read vulnerable container image count o k response has a 4xx status code +func (o *ReadVulnerableContainerImageCountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this read vulnerable container image count o k response has a 5xx status code +func (o *ReadVulnerableContainerImageCountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this read vulnerable container image count o k response a status code equal to that given +func (o *ReadVulnerableContainerImageCountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the read vulnerable container image count o k response +func (o *ReadVulnerableContainerImageCountOK) Code() int { + return 200 +} + +func (o *ReadVulnerableContainerImageCountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountOK %+v", 200, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountOK %+v", 200, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountOK) GetPayload() *models.ModelsAPIFilterResponse { + return o.Payload +} + +func (o *ReadVulnerableContainerImageCountOK) 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.ModelsAPIFilterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReadVulnerableContainerImageCountForbidden creates a ReadVulnerableContainerImageCountForbidden with default headers values +func NewReadVulnerableContainerImageCountForbidden() *ReadVulnerableContainerImageCountForbidden { + return &ReadVulnerableContainerImageCountForbidden{} +} + +/* +ReadVulnerableContainerImageCountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReadVulnerableContainerImageCountForbidden 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 vulnerable container image count forbidden response has a 2xx status code +func (o *ReadVulnerableContainerImageCountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read vulnerable container image count forbidden response has a 3xx status code +func (o *ReadVulnerableContainerImageCountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read vulnerable container image count forbidden response has a 4xx status code +func (o *ReadVulnerableContainerImageCountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this read vulnerable container image count forbidden response has a 5xx status code +func (o *ReadVulnerableContainerImageCountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this read vulnerable container image count forbidden response a status code equal to that given +func (o *ReadVulnerableContainerImageCountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the read vulnerable container image count forbidden response +func (o *ReadVulnerableContainerImageCountForbidden) Code() int { + return 403 +} + +func (o *ReadVulnerableContainerImageCountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountForbidden %+v", 403, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadVulnerableContainerImageCountForbidden) 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 +} + +// NewReadVulnerableContainerImageCountTooManyRequests creates a ReadVulnerableContainerImageCountTooManyRequests with default headers values +func NewReadVulnerableContainerImageCountTooManyRequests() *ReadVulnerableContainerImageCountTooManyRequests { + return &ReadVulnerableContainerImageCountTooManyRequests{} +} + +/* +ReadVulnerableContainerImageCountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReadVulnerableContainerImageCountTooManyRequests 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 vulnerable container image count too many requests response has a 2xx status code +func (o *ReadVulnerableContainerImageCountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read vulnerable container image count too many requests response has a 3xx status code +func (o *ReadVulnerableContainerImageCountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read vulnerable container image count too many requests response has a 4xx status code +func (o *ReadVulnerableContainerImageCountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this read vulnerable container image count too many requests response has a 5xx status code +func (o *ReadVulnerableContainerImageCountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this read vulnerable container image count too many requests response a status code equal to that given +func (o *ReadVulnerableContainerImageCountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the read vulnerable container image count too many requests response +func (o *ReadVulnerableContainerImageCountTooManyRequests) Code() int { + return 429 +} + +func (o *ReadVulnerableContainerImageCountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountTooManyRequests %+v", 429, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReadVulnerableContainerImageCountTooManyRequests) 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 +} + +// NewReadVulnerableContainerImageCountInternalServerError creates a ReadVulnerableContainerImageCountInternalServerError with default headers values +func NewReadVulnerableContainerImageCountInternalServerError() *ReadVulnerableContainerImageCountInternalServerError { + return &ReadVulnerableContainerImageCountInternalServerError{} +} + +/* +ReadVulnerableContainerImageCountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ReadVulnerableContainerImageCountInternalServerError 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 vulnerable container image count internal server error response has a 2xx status code +func (o *ReadVulnerableContainerImageCountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this read vulnerable container image count internal server error response has a 3xx status code +func (o *ReadVulnerableContainerImageCountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this read vulnerable container image count internal server error response has a 4xx status code +func (o *ReadVulnerableContainerImageCountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this read vulnerable container image count internal server error response has a 5xx status code +func (o *ReadVulnerableContainerImageCountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this read vulnerable container image count internal server error response a status code equal to that given +func (o *ReadVulnerableContainerImageCountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the read vulnerable container image count internal server error response +func (o *ReadVulnerableContainerImageCountInternalServerError) Code() int { + return 500 +} + +func (o *ReadVulnerableContainerImageCountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/containers/count-vulnerable-images/v1][%d] readVulnerableContainerImageCountInternalServerError %+v", 500, o.Payload) +} + +func (o *ReadVulnerableContainerImageCountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *ReadVulnerableContainerImageCountInternalServerError) 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/search_and_read_kubernetes_iom_entities_parameters.go b/falcon/client/kubernetes_protection/search_and_read_kubernetes_iom_entities_parameters.go new file mode 100644 index 00000000..e29497a3 --- /dev/null +++ b/falcon/client/kubernetes_protection/search_and_read_kubernetes_iom_entities_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewSearchAndReadKubernetesIomEntitiesParams creates a new SearchAndReadKubernetesIomEntitiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSearchAndReadKubernetesIomEntitiesParams() *SearchAndReadKubernetesIomEntitiesParams { + return &SearchAndReadKubernetesIomEntitiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSearchAndReadKubernetesIomEntitiesParamsWithTimeout creates a new SearchAndReadKubernetesIomEntitiesParams object +// with the ability to set a timeout on a request. +func NewSearchAndReadKubernetesIomEntitiesParamsWithTimeout(timeout time.Duration) *SearchAndReadKubernetesIomEntitiesParams { + return &SearchAndReadKubernetesIomEntitiesParams{ + timeout: timeout, + } +} + +// NewSearchAndReadKubernetesIomEntitiesParamsWithContext creates a new SearchAndReadKubernetesIomEntitiesParams object +// with the ability to set a context for a request. +func NewSearchAndReadKubernetesIomEntitiesParamsWithContext(ctx context.Context) *SearchAndReadKubernetesIomEntitiesParams { + return &SearchAndReadKubernetesIomEntitiesParams{ + Context: ctx, + } +} + +// NewSearchAndReadKubernetesIomEntitiesParamsWithHTTPClient creates a new SearchAndReadKubernetesIomEntitiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewSearchAndReadKubernetesIomEntitiesParamsWithHTTPClient(client *http.Client) *SearchAndReadKubernetesIomEntitiesParams { + return &SearchAndReadKubernetesIomEntitiesParams{ + HTTPClient: client, + } +} + +/* +SearchAndReadKubernetesIomEntitiesParams contains all the parameters to send to the API endpoint + + for the search and read kubernetes iom entities operation. + + Typically these are written to a http.Request. +*/ +type SearchAndReadKubernetesIomEntitiesParams 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 + */ + 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. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the search and read kubernetes iom entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchAndReadKubernetesIomEntitiesParams) WithDefaults() *SearchAndReadKubernetesIomEntitiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search and read kubernetes iom entities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchAndReadKubernetesIomEntitiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) WithTimeout(timeout time.Duration) *SearchAndReadKubernetesIomEntitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) WithContext(ctx context.Context) *SearchAndReadKubernetesIomEntitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) WithHTTPClient(client *http.Client) *SearchAndReadKubernetesIomEntitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) WithFilter(filter *string) *SearchAndReadKubernetesIomEntitiesParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) WithLimit(limit *int64) *SearchAndReadKubernetesIomEntitiesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) WithOffset(offset *int64) *SearchAndReadKubernetesIomEntitiesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) WithSort(sort *string) *SearchAndReadKubernetesIomEntitiesParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the search and read kubernetes iom entities params +func (o *SearchAndReadKubernetesIomEntitiesParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *SearchAndReadKubernetesIomEntitiesParams) 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/kubernetes_protection/search_and_read_kubernetes_iom_entities_responses.go b/falcon/client/kubernetes_protection/search_and_read_kubernetes_iom_entities_responses.go new file mode 100644 index 00000000..71d5305c --- /dev/null +++ b/falcon/client/kubernetes_protection/search_and_read_kubernetes_iom_entities_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// SearchAndReadKubernetesIomEntitiesReader is a Reader for the SearchAndReadKubernetesIomEntities structure. +type SearchAndReadKubernetesIomEntitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SearchAndReadKubernetesIomEntitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSearchAndReadKubernetesIomEntitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewSearchAndReadKubernetesIomEntitiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewSearchAndReadKubernetesIomEntitiesTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewSearchAndReadKubernetesIomEntitiesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/kubernetes-ioms/v1] SearchAndReadKubernetesIomEntities", response, response.Code()) + } +} + +// NewSearchAndReadKubernetesIomEntitiesOK creates a SearchAndReadKubernetesIomEntitiesOK with default headers values +func NewSearchAndReadKubernetesIomEntitiesOK() *SearchAndReadKubernetesIomEntitiesOK { + return &SearchAndReadKubernetesIomEntitiesOK{} +} + +/* +SearchAndReadKubernetesIomEntitiesOK describes a response with status code 200, with default header values. + +OK +*/ +type SearchAndReadKubernetesIomEntitiesOK 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.K8siomsKubernetesIOMEntityResponse +} + +// IsSuccess returns true when this search and read kubernetes iom entities o k response has a 2xx status code +func (o *SearchAndReadKubernetesIomEntitiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this search and read kubernetes iom entities o k response has a 3xx status code +func (o *SearchAndReadKubernetesIomEntitiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search and read kubernetes iom entities o k response has a 4xx status code +func (o *SearchAndReadKubernetesIomEntitiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this search and read kubernetes iom entities o k response has a 5xx status code +func (o *SearchAndReadKubernetesIomEntitiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this search and read kubernetes iom entities o k response a status code equal to that given +func (o *SearchAndReadKubernetesIomEntitiesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the search and read kubernetes iom entities o k response +func (o *SearchAndReadKubernetesIomEntitiesOK) Code() int { + return 200 +} + +func (o *SearchAndReadKubernetesIomEntitiesOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesOK %+v", 200, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesOK %+v", 200, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesOK) GetPayload() *models.K8siomsKubernetesIOMEntityResponse { + return o.Payload +} + +func (o *SearchAndReadKubernetesIomEntitiesOK) 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.K8siomsKubernetesIOMEntityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSearchAndReadKubernetesIomEntitiesForbidden creates a SearchAndReadKubernetesIomEntitiesForbidden with default headers values +func NewSearchAndReadKubernetesIomEntitiesForbidden() *SearchAndReadKubernetesIomEntitiesForbidden { + return &SearchAndReadKubernetesIomEntitiesForbidden{} +} + +/* +SearchAndReadKubernetesIomEntitiesForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type SearchAndReadKubernetesIomEntitiesForbidden 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 search and read kubernetes iom entities forbidden response has a 2xx status code +func (o *SearchAndReadKubernetesIomEntitiesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search and read kubernetes iom entities forbidden response has a 3xx status code +func (o *SearchAndReadKubernetesIomEntitiesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search and read kubernetes iom entities forbidden response has a 4xx status code +func (o *SearchAndReadKubernetesIomEntitiesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this search and read kubernetes iom entities forbidden response has a 5xx status code +func (o *SearchAndReadKubernetesIomEntitiesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this search and read kubernetes iom entities forbidden response a status code equal to that given +func (o *SearchAndReadKubernetesIomEntitiesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the search and read kubernetes iom entities forbidden response +func (o *SearchAndReadKubernetesIomEntitiesForbidden) Code() int { + return 403 +} + +func (o *SearchAndReadKubernetesIomEntitiesForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesForbidden %+v", 403, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *SearchAndReadKubernetesIomEntitiesForbidden) 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 +} + +// NewSearchAndReadKubernetesIomEntitiesTooManyRequests creates a SearchAndReadKubernetesIomEntitiesTooManyRequests with default headers values +func NewSearchAndReadKubernetesIomEntitiesTooManyRequests() *SearchAndReadKubernetesIomEntitiesTooManyRequests { + return &SearchAndReadKubernetesIomEntitiesTooManyRequests{} +} + +/* +SearchAndReadKubernetesIomEntitiesTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type SearchAndReadKubernetesIomEntitiesTooManyRequests 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 search and read kubernetes iom entities too many requests response has a 2xx status code +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search and read kubernetes iom entities too many requests response has a 3xx status code +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search and read kubernetes iom entities too many requests response has a 4xx status code +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this search and read kubernetes iom entities too many requests response has a 5xx status code +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this search and read kubernetes iom entities too many requests response a status code equal to that given +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the search and read kubernetes iom entities too many requests response +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) Code() int { + return 429 +} + +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesTooManyRequests %+v", 429, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *SearchAndReadKubernetesIomEntitiesTooManyRequests) 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 +} + +// NewSearchAndReadKubernetesIomEntitiesInternalServerError creates a SearchAndReadKubernetesIomEntitiesInternalServerError with default headers values +func NewSearchAndReadKubernetesIomEntitiesInternalServerError() *SearchAndReadKubernetesIomEntitiesInternalServerError { + return &SearchAndReadKubernetesIomEntitiesInternalServerError{} +} + +/* +SearchAndReadKubernetesIomEntitiesInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type SearchAndReadKubernetesIomEntitiesInternalServerError 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 search and read kubernetes iom entities internal server error response has a 2xx status code +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search and read kubernetes iom entities internal server error response has a 3xx status code +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search and read kubernetes iom entities internal server error response has a 4xx status code +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this search and read kubernetes iom entities internal server error response has a 5xx status code +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this search and read kubernetes iom entities internal server error response a status code equal to that given +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the search and read kubernetes iom entities internal server error response +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) Code() int { + return 500 +} + +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/kubernetes-ioms/v1][%d] searchAndReadKubernetesIomEntitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *SearchAndReadKubernetesIomEntitiesInternalServerError) 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/search_kubernetes_ioms_parameters.go b/falcon/client/kubernetes_protection/search_kubernetes_ioms_parameters.go new file mode 100644 index 00000000..d0c4adf3 --- /dev/null +++ b/falcon/client/kubernetes_protection/search_kubernetes_ioms_parameters.go @@ -0,0 +1,266 @@ +// 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 ( + "context" + "net/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" +) + +// NewSearchKubernetesIomsParams creates a new SearchKubernetesIomsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSearchKubernetesIomsParams() *SearchKubernetesIomsParams { + return &SearchKubernetesIomsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSearchKubernetesIomsParamsWithTimeout creates a new SearchKubernetesIomsParams object +// with the ability to set a timeout on a request. +func NewSearchKubernetesIomsParamsWithTimeout(timeout time.Duration) *SearchKubernetesIomsParams { + return &SearchKubernetesIomsParams{ + timeout: timeout, + } +} + +// NewSearchKubernetesIomsParamsWithContext creates a new SearchKubernetesIomsParams object +// with the ability to set a context for a request. +func NewSearchKubernetesIomsParamsWithContext(ctx context.Context) *SearchKubernetesIomsParams { + return &SearchKubernetesIomsParams{ + Context: ctx, + } +} + +// NewSearchKubernetesIomsParamsWithHTTPClient creates a new SearchKubernetesIomsParams object +// with the ability to set a custom HTTPClient for a request. +func NewSearchKubernetesIomsParamsWithHTTPClient(client *http.Client) *SearchKubernetesIomsParams { + return &SearchKubernetesIomsParams{ + HTTPClient: client, + } +} + +/* +SearchKubernetesIomsParams contains all the parameters to send to the API endpoint + + for the search kubernetes ioms operation. + + Typically these are written to a http.Request. +*/ +type SearchKubernetesIomsParams 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 + */ + 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. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the search kubernetes ioms params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchKubernetesIomsParams) WithDefaults() *SearchKubernetesIomsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search kubernetes ioms params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchKubernetesIomsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) WithTimeout(timeout time.Duration) *SearchKubernetesIomsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) WithContext(ctx context.Context) *SearchKubernetesIomsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) WithHTTPClient(client *http.Client) *SearchKubernetesIomsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) WithFilter(filter *string) *SearchKubernetesIomsParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) WithLimit(limit *int64) *SearchKubernetesIomsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) WithOffset(offset *int64) *SearchKubernetesIomsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) WithSort(sort *string) *SearchKubernetesIomsParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the search kubernetes ioms params +func (o *SearchKubernetesIomsParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *SearchKubernetesIomsParams) 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/kubernetes_protection/search_kubernetes_ioms_responses.go b/falcon/client/kubernetes_protection/search_kubernetes_ioms_responses.go new file mode 100644 index 00000000..cf7f73b5 --- /dev/null +++ b/falcon/client/kubernetes_protection/search_kubernetes_ioms_responses.go @@ -0,0 +1,510 @@ +// 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" +) + +// SearchKubernetesIomsReader is a Reader for the SearchKubernetesIoms structure. +type SearchKubernetesIomsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SearchKubernetesIomsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSearchKubernetesIomsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewSearchKubernetesIomsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewSearchKubernetesIomsTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewSearchKubernetesIomsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/queries/kubernetes-ioms/v1] SearchKubernetesIoms", response, response.Code()) + } +} + +// NewSearchKubernetesIomsOK creates a SearchKubernetesIomsOK with default headers values +func NewSearchKubernetesIomsOK() *SearchKubernetesIomsOK { + return &SearchKubernetesIomsOK{} +} + +/* +SearchKubernetesIomsOK describes a response with status code 200, with default header values. + +OK +*/ +type SearchKubernetesIomsOK 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.CommonGenericEntityResponseString +} + +// IsSuccess returns true when this search kubernetes ioms o k response has a 2xx status code +func (o *SearchKubernetesIomsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this search kubernetes ioms o k response has a 3xx status code +func (o *SearchKubernetesIomsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search kubernetes ioms o k response has a 4xx status code +func (o *SearchKubernetesIomsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this search kubernetes ioms o k response has a 5xx status code +func (o *SearchKubernetesIomsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this search kubernetes ioms o k response a status code equal to that given +func (o *SearchKubernetesIomsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the search kubernetes ioms o k response +func (o *SearchKubernetesIomsOK) Code() int { + return 200 +} + +func (o *SearchKubernetesIomsOK) Error() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsOK %+v", 200, o.Payload) +} + +func (o *SearchKubernetesIomsOK) String() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsOK %+v", 200, o.Payload) +} + +func (o *SearchKubernetesIomsOK) GetPayload() *models.CommonGenericEntityResponseString { + return o.Payload +} + +func (o *SearchKubernetesIomsOK) 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.CommonGenericEntityResponseString) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSearchKubernetesIomsForbidden creates a SearchKubernetesIomsForbidden with default headers values +func NewSearchKubernetesIomsForbidden() *SearchKubernetesIomsForbidden { + return &SearchKubernetesIomsForbidden{} +} + +/* +SearchKubernetesIomsForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type SearchKubernetesIomsForbidden 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 search kubernetes ioms forbidden response has a 2xx status code +func (o *SearchKubernetesIomsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search kubernetes ioms forbidden response has a 3xx status code +func (o *SearchKubernetesIomsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search kubernetes ioms forbidden response has a 4xx status code +func (o *SearchKubernetesIomsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this search kubernetes ioms forbidden response has a 5xx status code +func (o *SearchKubernetesIomsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this search kubernetes ioms forbidden response a status code equal to that given +func (o *SearchKubernetesIomsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the search kubernetes ioms forbidden response +func (o *SearchKubernetesIomsForbidden) Code() int { + return 403 +} + +func (o *SearchKubernetesIomsForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsForbidden %+v", 403, o.Payload) +} + +func (o *SearchKubernetesIomsForbidden) String() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsForbidden %+v", 403, o.Payload) +} + +func (o *SearchKubernetesIomsForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *SearchKubernetesIomsForbidden) 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 +} + +// NewSearchKubernetesIomsTooManyRequests creates a SearchKubernetesIomsTooManyRequests with default headers values +func NewSearchKubernetesIomsTooManyRequests() *SearchKubernetesIomsTooManyRequests { + return &SearchKubernetesIomsTooManyRequests{} +} + +/* +SearchKubernetesIomsTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type SearchKubernetesIomsTooManyRequests 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 search kubernetes ioms too many requests response has a 2xx status code +func (o *SearchKubernetesIomsTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search kubernetes ioms too many requests response has a 3xx status code +func (o *SearchKubernetesIomsTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search kubernetes ioms too many requests response has a 4xx status code +func (o *SearchKubernetesIomsTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this search kubernetes ioms too many requests response has a 5xx status code +func (o *SearchKubernetesIomsTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this search kubernetes ioms too many requests response a status code equal to that given +func (o *SearchKubernetesIomsTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the search kubernetes ioms too many requests response +func (o *SearchKubernetesIomsTooManyRequests) Code() int { + return 429 +} + +func (o *SearchKubernetesIomsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsTooManyRequests %+v", 429, o.Payload) +} + +func (o *SearchKubernetesIomsTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsTooManyRequests %+v", 429, o.Payload) +} + +func (o *SearchKubernetesIomsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *SearchKubernetesIomsTooManyRequests) 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 +} + +// NewSearchKubernetesIomsInternalServerError creates a SearchKubernetesIomsInternalServerError with default headers values +func NewSearchKubernetesIomsInternalServerError() *SearchKubernetesIomsInternalServerError { + return &SearchKubernetesIomsInternalServerError{} +} + +/* +SearchKubernetesIomsInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type SearchKubernetesIomsInternalServerError 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 search kubernetes ioms internal server error response has a 2xx status code +func (o *SearchKubernetesIomsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search kubernetes ioms internal server error response has a 3xx status code +func (o *SearchKubernetesIomsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search kubernetes ioms internal server error response has a 4xx status code +func (o *SearchKubernetesIomsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this search kubernetes ioms internal server error response has a 5xx status code +func (o *SearchKubernetesIomsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this search kubernetes ioms internal server error response a status code equal to that given +func (o *SearchKubernetesIomsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the search kubernetes ioms internal server error response +func (o *SearchKubernetesIomsInternalServerError) Code() int { + return 500 +} + +func (o *SearchKubernetesIomsInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsInternalServerError %+v", 500, o.Payload) +} + +func (o *SearchKubernetesIomsInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/queries/kubernetes-ioms/v1][%d] searchKubernetesIomsInternalServerError %+v", 500, o.Payload) +} + +func (o *SearchKubernetesIomsInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *SearchKubernetesIomsInternalServerError) 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/logscale_management/create_view_parameters.go b/falcon/client/logscale_management/create_view_parameters.go deleted file mode 100644 index eec2eaa1..00000000 --- a/falcon/client/logscale_management/create_view_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package logscale_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" -) - -// NewCreateViewParams creates a new CreateViewParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateViewParams() *CreateViewParams { - return &CreateViewParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateViewParamsWithTimeout creates a new CreateViewParams object -// with the ability to set a timeout on a request. -func NewCreateViewParamsWithTimeout(timeout time.Duration) *CreateViewParams { - return &CreateViewParams{ - timeout: timeout, - } -} - -// NewCreateViewParamsWithContext creates a new CreateViewParams object -// with the ability to set a context for a request. -func NewCreateViewParamsWithContext(ctx context.Context) *CreateViewParams { - return &CreateViewParams{ - Context: ctx, - } -} - -// NewCreateViewParamsWithHTTPClient creates a new CreateViewParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateViewParamsWithHTTPClient(client *http.Client) *CreateViewParams { - return &CreateViewParams{ - HTTPClient: client, - } -} - -/* -CreateViewParams contains all the parameters to send to the API endpoint - - for the create view operation. - - Typically these are written to a http.Request. -*/ -type CreateViewParams struct { - - // Body. - Body *models.HumioView - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create view params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateViewParams) WithDefaults() *CreateViewParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create view params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateViewParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create view params -func (o *CreateViewParams) WithTimeout(timeout time.Duration) *CreateViewParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create view params -func (o *CreateViewParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create view params -func (o *CreateViewParams) WithContext(ctx context.Context) *CreateViewParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create view params -func (o *CreateViewParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create view params -func (o *CreateViewParams) WithHTTPClient(client *http.Client) *CreateViewParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create view params -func (o *CreateViewParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create view params -func (o *CreateViewParams) WithBody(body *models.HumioView) *CreateViewParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create view params -func (o *CreateViewParams) SetBody(body *models.HumioView) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateViewParams) 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/logscale_management/initialize_parameters.go b/falcon/client/logscale_management/initialize_parameters.go deleted file mode 100644 index d101e31e..00000000 --- a/falcon/client/logscale_management/initialize_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package logscale_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" -) - -// NewInitializeParams creates a new InitializeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewInitializeParams() *InitializeParams { - return &InitializeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInitializeParamsWithTimeout creates a new InitializeParams object -// with the ability to set a timeout on a request. -func NewInitializeParamsWithTimeout(timeout time.Duration) *InitializeParams { - return &InitializeParams{ - timeout: timeout, - } -} - -// NewInitializeParamsWithContext creates a new InitializeParams object -// with the ability to set a context for a request. -func NewInitializeParamsWithContext(ctx context.Context) *InitializeParams { - return &InitializeParams{ - Context: ctx, - } -} - -// NewInitializeParamsWithHTTPClient creates a new InitializeParams object -// with the ability to set a custom HTTPClient for a request. -func NewInitializeParamsWithHTTPClient(client *http.Client) *InitializeParams { - return &InitializeParams{ - HTTPClient: client, - } -} - -/* -InitializeParams contains all the parameters to send to the API endpoint - - for the initialize operation. - - Typically these are written to a http.Request. -*/ -type InitializeParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the initialize params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeParams) WithDefaults() *InitializeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the initialize params -func (o *InitializeParams) WithTimeout(timeout time.Duration) *InitializeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the initialize params -func (o *InitializeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the initialize params -func (o *InitializeParams) WithContext(ctx context.Context) *InitializeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the initialize params -func (o *InitializeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the initialize params -func (o *InitializeParams) WithHTTPClient(client *http.Client) *InitializeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the initialize params -func (o *InitializeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *InitializeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/logscale_management/initialize_responses.go b/falcon/client/logscale_management/initialize_responses.go deleted file mode 100644 index 19371fdd..00000000 --- a/falcon/client/logscale_management/initialize_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package logscale_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" -) - -// InitializeReader is a Reader for the Initialize structure. -type InitializeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InitializeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInitializeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewInitializeForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewInitializeTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /loggingapi/combined/initialize/v1] Initialize", response, response.Code()) - } -} - -// NewInitializeOK creates a InitializeOK with default headers values -func NewInitializeOK() *InitializeOK { - return &InitializeOK{} -} - -/* -InitializeOK describes a response with status code 200, with default header values. - -OK -*/ -type InitializeOK 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.ApidomainInitializeResponseWrapperV1 -} - -// IsSuccess returns true when this initialize o k response has a 2xx status code -func (o *InitializeOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this initialize o k response has a 3xx status code -func (o *InitializeOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this initialize o k response has a 4xx status code -func (o *InitializeOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this initialize o k response has a 5xx status code -func (o *InitializeOK) IsServerError() bool { - return false -} - -// IsCode returns true when this initialize o k response a status code equal to that given -func (o *InitializeOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the initialize o k response -func (o *InitializeOK) Code() int { - return 200 -} - -func (o *InitializeOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/combined/initialize/v1][%d] initializeOK %+v", 200, o.Payload) -} - -func (o *InitializeOK) String() string { - return fmt.Sprintf("[POST /loggingapi/combined/initialize/v1][%d] initializeOK %+v", 200, o.Payload) -} - -func (o *InitializeOK) GetPayload() *models.ApidomainInitializeResponseWrapperV1 { - return o.Payload -} - -func (o *InitializeOK) 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.ApidomainInitializeResponseWrapperV1) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInitializeForbidden creates a InitializeForbidden with default headers values -func NewInitializeForbidden() *InitializeForbidden { - return &InitializeForbidden{} -} - -/* -InitializeForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type InitializeForbidden 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 initialize forbidden response has a 2xx status code -func (o *InitializeForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this initialize forbidden response has a 3xx status code -func (o *InitializeForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this initialize forbidden response has a 4xx status code -func (o *InitializeForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this initialize forbidden response has a 5xx status code -func (o *InitializeForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this initialize forbidden response a status code equal to that given -func (o *InitializeForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the initialize forbidden response -func (o *InitializeForbidden) Code() int { - return 403 -} - -func (o *InitializeForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/combined/initialize/v1][%d] initializeForbidden %+v", 403, o.Payload) -} - -func (o *InitializeForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/combined/initialize/v1][%d] initializeForbidden %+v", 403, o.Payload) -} - -func (o *InitializeForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *InitializeForbidden) 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 -} - -// NewInitializeTooManyRequests creates a InitializeTooManyRequests with default headers values -func NewInitializeTooManyRequests() *InitializeTooManyRequests { - return &InitializeTooManyRequests{} -} - -/* -InitializeTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type InitializeTooManyRequests 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 initialize too many requests response has a 2xx status code -func (o *InitializeTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this initialize too many requests response has a 3xx status code -func (o *InitializeTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this initialize too many requests response has a 4xx status code -func (o *InitializeTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this initialize too many requests response has a 5xx status code -func (o *InitializeTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this initialize too many requests response a status code equal to that given -func (o *InitializeTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the initialize too many requests response -func (o *InitializeTooManyRequests) Code() int { - return 429 -} - -func (o *InitializeTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/combined/initialize/v1][%d] initializeTooManyRequests %+v", 429, o.Payload) -} - -func (o *InitializeTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/combined/initialize/v1][%d] initializeTooManyRequests %+v", 429, o.Payload) -} - -func (o *InitializeTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *InitializeTooManyRequests) 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/logscale_management/logscale_management_client.go b/falcon/client/logscale_management/logscale_management_client.go deleted file mode 100644 index 87ab1616..00000000 --- a/falcon/client/logscale_management/logscale_management_client.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package logscale_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 logscale management API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for logscale 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 { - CreateView(params *CreateViewParams, opts ...ClientOption) (*CreateViewOK, error) - - Initialize(params *InitializeParams, opts ...ClientOption) (*InitializeOK, error) - - ListRepos(params *ListReposParams, opts ...ClientOption) (*ListReposOK, error) - - ListViews(params *ListViewsParams, opts ...ClientOption) (*ListViewsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateView creates a view -*/ -func (a *Client) CreateView(params *CreateViewParams, opts ...ClientOption) (*CreateViewOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateViewParams() - } - op := &runtime.ClientOperation{ - ID: "CreateView", - Method: "POST", - PathPattern: "/loggingapi/entities/views/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateViewReader{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.(*CreateViewOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateView: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -Initialize initializes the required logscale artifacts -*/ -func (a *Client) Initialize(params *InitializeParams, opts ...ClientOption) (*InitializeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInitializeParams() - } - op := &runtime.ClientOperation{ - ID: "Initialize", - Method: "POST", - PathPattern: "/loggingapi/combined/initialize/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"*/*"}, - Schemes: []string{"https"}, - Params: params, - Reader: &InitializeReader{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.(*InitializeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Initialize: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ListRepos lists available repositories and views -*/ -func (a *Client) ListRepos(params *ListReposParams, opts ...ClientOption) (*ListReposOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListReposParams() - } - op := &runtime.ClientOperation{ - ID: "ListRepos", - Method: "GET", - PathPattern: "/loggingapi/combined/repos/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListReposReader{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.(*ListReposOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ListRepos: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ListViews lists views -*/ -func (a *Client) ListViews(params *ListViewsParams, opts ...ClientOption) (*ListViewsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListViewsParams() - } - op := &runtime.ClientOperation{ - ID: "ListViews", - Method: "GET", - PathPattern: "/loggingapi/entities/views/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListViewsReader{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.(*ListViewsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ListViews: 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/ods/aggregate_query_scan_host_metadata_parameters.go b/falcon/client/ods/aggregate_query_scan_host_metadata_parameters.go index 0c22e819..97c4a548 100644 --- a/falcon/client/ods/aggregate_query_scan_host_metadata_parameters.go +++ b/falcon/client/ods/aggregate_query_scan_host_metadata_parameters.go @@ -63,6 +63,12 @@ AggregateQueryScanHostMetadataParams contains all the parameters to send to the */ type AggregateQueryScanHostMetadataParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + // Body. Body []*models.MsaAggregateQueryRequest @@ -119,6 +125,17 @@ func (o *AggregateQueryScanHostMetadataParams) SetHTTPClient(client *http.Client o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the aggregate query scan host metadata params +func (o *AggregateQueryScanHostMetadataParams) WithXCSUSERUUID(xCSUSERUUID string) *AggregateQueryScanHostMetadataParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the aggregate query scan host metadata params +func (o *AggregateQueryScanHostMetadataParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithBody adds the body to the aggregate query scan host metadata params func (o *AggregateQueryScanHostMetadataParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregateQueryScanHostMetadataParams { o.SetBody(body) @@ -137,6 +154,11 @@ func (o *AggregateQueryScanHostMetadataParams) WriteToRequest(r runtime.ClientRe return err } var res []error + + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/falcon/client/ods/aggregate_scans_parameters.go b/falcon/client/ods/aggregate_scans_parameters.go index 9b7af9e6..6d893daa 100644 --- a/falcon/client/ods/aggregate_scans_parameters.go +++ b/falcon/client/ods/aggregate_scans_parameters.go @@ -63,6 +63,12 @@ AggregateScansParams contains all the parameters to send to the API endpoint */ type AggregateScansParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + // Body. Body []*models.MsaAggregateQueryRequest @@ -119,6 +125,17 @@ func (o *AggregateScansParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the aggregate scans params +func (o *AggregateScansParams) WithXCSUSERUUID(xCSUSERUUID string) *AggregateScansParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the aggregate scans params +func (o *AggregateScansParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithBody adds the body to the aggregate scans params func (o *AggregateScansParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregateScansParams { o.SetBody(body) @@ -137,6 +154,11 @@ func (o *AggregateScansParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error + + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/falcon/client/ods/aggregate_scheduled_scans_parameters.go b/falcon/client/ods/aggregate_scheduled_scans_parameters.go index e9c55be5..159d428e 100644 --- a/falcon/client/ods/aggregate_scheduled_scans_parameters.go +++ b/falcon/client/ods/aggregate_scheduled_scans_parameters.go @@ -63,6 +63,12 @@ AggregateScheduledScansParams contains all the parameters to send to the API end */ type AggregateScheduledScansParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + // Body. Body []*models.MsaAggregateQueryRequest @@ -119,6 +125,17 @@ func (o *AggregateScheduledScansParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the aggregate scheduled scans params +func (o *AggregateScheduledScansParams) WithXCSUSERUUID(xCSUSERUUID string) *AggregateScheduledScansParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the aggregate scheduled scans params +func (o *AggregateScheduledScansParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithBody adds the body to the aggregate scheduled scans params func (o *AggregateScheduledScansParams) WithBody(body []*models.MsaAggregateQueryRequest) *AggregateScheduledScansParams { o.SetBody(body) @@ -137,6 +154,11 @@ func (o *AggregateScheduledScansParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error + + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/falcon/client/ods/cancel_scans_parameters.go b/falcon/client/ods/cancel_scans_parameters.go index e7c25473..5dcde7c2 100644 --- a/falcon/client/ods/cancel_scans_parameters.go +++ b/falcon/client/ods/cancel_scans_parameters.go @@ -63,6 +63,12 @@ CancelScansParams contains all the parameters to send to the API endpoint */ type CancelScansParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + // Body. Body *models.EntitiesODSCancelScanRequest @@ -119,6 +125,17 @@ func (o *CancelScansParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the cancel scans params +func (o *CancelScansParams) WithXCSUSERUUID(xCSUSERUUID string) *CancelScansParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the cancel scans params +func (o *CancelScansParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithBody adds the body to the cancel scans params func (o *CancelScansParams) WithBody(body *models.EntitiesODSCancelScanRequest) *CancelScansParams { o.SetBody(body) @@ -137,6 +154,11 @@ func (o *CancelScansParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error + + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/falcon/client/ods/create_scan_parameters.go b/falcon/client/ods/create_scan_parameters.go index 0f7ea143..f3bc312c 100644 --- a/falcon/client/ods/create_scan_parameters.go +++ b/falcon/client/ods/create_scan_parameters.go @@ -63,6 +63,12 @@ CreateScanParams contains all the parameters to send to the API endpoint */ type CreateScanParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + // Body. Body *models.EntitiesODSScanRequest @@ -119,6 +125,17 @@ func (o *CreateScanParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the create scan params +func (o *CreateScanParams) WithXCSUSERUUID(xCSUSERUUID string) *CreateScanParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the create scan params +func (o *CreateScanParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithBody adds the body to the create scan params func (o *CreateScanParams) WithBody(body *models.EntitiesODSScanRequest) *CreateScanParams { o.SetBody(body) @@ -137,6 +154,11 @@ func (o *CreateScanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error + + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/falcon/client/ods/delete_scheduled_scans_parameters.go b/falcon/client/ods/delete_scheduled_scans_parameters.go index 616ded82..2659efb9 100644 --- a/falcon/client/ods/delete_scheduled_scans_parameters.go +++ b/falcon/client/ods/delete_scheduled_scans_parameters.go @@ -62,6 +62,12 @@ DeleteScheduledScansParams contains all the parameters to send to the API endpoi */ type DeleteScheduledScansParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Filter. A FQL compatible query string. @@ -127,6 +133,17 @@ func (o *DeleteScheduledScansParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the delete scheduled scans params +func (o *DeleteScheduledScansParams) WithXCSUSERUUID(xCSUSERUUID string) *DeleteScheduledScansParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the delete scheduled scans params +func (o *DeleteScheduledScansParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithFilter adds the filter to the delete scheduled scans params func (o *DeleteScheduledScansParams) WithFilter(filter *string) *DeleteScheduledScansParams { o.SetFilter(filter) @@ -157,6 +174,11 @@ func (o *DeleteScheduledScansParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + if o.Filter != nil { // query param filter diff --git a/falcon/client/ods/get_malicious_files_by_ids_parameters.go b/falcon/client/ods/get_malicious_files_by_ids_parameters.go index 26622187..715e296a 100644 --- a/falcon/client/ods/get_malicious_files_by_ids_parameters.go +++ b/falcon/client/ods/get_malicious_files_by_ids_parameters.go @@ -62,6 +62,12 @@ GetMaliciousFilesByIdsParams contains all the parameters to send to the API endp */ type GetMaliciousFilesByIdsParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Ids. The scan IDs to retrieve the scan entities @@ -121,6 +127,17 @@ func (o *GetMaliciousFilesByIdsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the get malicious files by ids params +func (o *GetMaliciousFilesByIdsParams) WithXCSUSERUUID(xCSUSERUUID string) *GetMaliciousFilesByIdsParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the get malicious files by ids params +func (o *GetMaliciousFilesByIdsParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithIds adds the ids to the get malicious files by ids params func (o *GetMaliciousFilesByIdsParams) WithIds(ids []string) *GetMaliciousFilesByIdsParams { o.SetIds(ids) @@ -140,6 +157,11 @@ func (o *GetMaliciousFilesByIdsParams) WriteToRequest(r runtime.ClientRequest, r } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + if o.Ids != nil { // binding items for ids diff --git a/falcon/client/ods/get_scan_host_metadata_by_ids_parameters.go b/falcon/client/ods/get_scan_host_metadata_by_ids_parameters.go index 2a038cbe..780bda6d 100644 --- a/falcon/client/ods/get_scan_host_metadata_by_ids_parameters.go +++ b/falcon/client/ods/get_scan_host_metadata_by_ids_parameters.go @@ -62,6 +62,12 @@ GetScanHostMetadataByIdsParams contains all the parameters to send to the API en */ type GetScanHostMetadataByIdsParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Ids. The scan IDs to retrieve the scan entities @@ -121,6 +127,17 @@ func (o *GetScanHostMetadataByIdsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the get scan host metadata by ids params +func (o *GetScanHostMetadataByIdsParams) WithXCSUSERUUID(xCSUSERUUID string) *GetScanHostMetadataByIdsParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the get scan host metadata by ids params +func (o *GetScanHostMetadataByIdsParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithIds adds the ids to the get scan host metadata by ids params func (o *GetScanHostMetadataByIdsParams) WithIds(ids []string) *GetScanHostMetadataByIdsParams { o.SetIds(ids) @@ -140,6 +157,11 @@ func (o *GetScanHostMetadataByIdsParams) WriteToRequest(r runtime.ClientRequest, } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + if o.Ids != nil { // binding items for ids diff --git a/falcon/client/ods/get_scans_by_scan_ids_parameters.go b/falcon/client/ods/get_scans_by_scan_ids_parameters.go index 16f7d8df..11d2a918 100644 --- a/falcon/client/ods/get_scans_by_scan_ids_parameters.go +++ b/falcon/client/ods/get_scans_by_scan_ids_parameters.go @@ -62,6 +62,12 @@ GetScansByScanIdsParams contains all the parameters to send to the API endpoint */ type GetScansByScanIdsParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Ids. The scan IDs to retrieve the scan entities @@ -121,6 +127,17 @@ func (o *GetScansByScanIdsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the get scans by scan ids params +func (o *GetScansByScanIdsParams) WithXCSUSERUUID(xCSUSERUUID string) *GetScansByScanIdsParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the get scans by scan ids params +func (o *GetScansByScanIdsParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithIds adds the ids to the get scans by scan ids params func (o *GetScansByScanIdsParams) WithIds(ids []string) *GetScansByScanIdsParams { o.SetIds(ids) @@ -140,6 +157,11 @@ func (o *GetScansByScanIdsParams) WriteToRequest(r runtime.ClientRequest, reg st } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + if o.Ids != nil { // binding items for ids diff --git a/falcon/client/ods/get_scans_by_scan_ids_v2_parameters.go b/falcon/client/ods/get_scans_by_scan_ids_v2_parameters.go index 8eff2b94..23528d7f 100644 --- a/falcon/client/ods/get_scans_by_scan_ids_v2_parameters.go +++ b/falcon/client/ods/get_scans_by_scan_ids_v2_parameters.go @@ -62,6 +62,12 @@ GetScansByScanIdsV2Params contains all the parameters to send to the API endpoin */ type GetScansByScanIdsV2Params struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Ids. The scan IDs to retrieve the scan entities @@ -121,6 +127,17 @@ func (o *GetScansByScanIdsV2Params) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the get scans by scan ids v2 params +func (o *GetScansByScanIdsV2Params) WithXCSUSERUUID(xCSUSERUUID string) *GetScansByScanIdsV2Params { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the get scans by scan ids v2 params +func (o *GetScansByScanIdsV2Params) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithIds adds the ids to the get scans by scan ids v2 params func (o *GetScansByScanIdsV2Params) WithIds(ids []string) *GetScansByScanIdsV2Params { o.SetIds(ids) @@ -140,6 +157,11 @@ func (o *GetScansByScanIdsV2Params) WriteToRequest(r runtime.ClientRequest, reg } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + if o.Ids != nil { // binding items for ids diff --git a/falcon/client/ods/get_scheduled_scans_by_scan_ids_parameters.go b/falcon/client/ods/get_scheduled_scans_by_scan_ids_parameters.go index a3c838e7..6c6038b7 100644 --- a/falcon/client/ods/get_scheduled_scans_by_scan_ids_parameters.go +++ b/falcon/client/ods/get_scheduled_scans_by_scan_ids_parameters.go @@ -62,6 +62,12 @@ GetScheduledScansByScanIdsParams contains all the parameters to send to the API */ type GetScheduledScansByScanIdsParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Ids. The scan IDs to retrieve the scan entities @@ -121,6 +127,17 @@ func (o *GetScheduledScansByScanIdsParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the get scheduled scans by scan ids params +func (o *GetScheduledScansByScanIdsParams) WithXCSUSERUUID(xCSUSERUUID string) *GetScheduledScansByScanIdsParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the get scheduled scans by scan ids params +func (o *GetScheduledScansByScanIdsParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithIds adds the ids to the get scheduled scans by scan ids params func (o *GetScheduledScansByScanIdsParams) WithIds(ids []string) *GetScheduledScansByScanIdsParams { o.SetIds(ids) @@ -140,6 +157,11 @@ func (o *GetScheduledScansByScanIdsParams) WriteToRequest(r runtime.ClientReques } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + if o.Ids != nil { // binding items for ids diff --git a/falcon/client/ods/query_malicious_files_parameters.go b/falcon/client/ods/query_malicious_files_parameters.go index 5ec96b2b..64c3000d 100644 --- a/falcon/client/ods/query_malicious_files_parameters.go +++ b/falcon/client/ods/query_malicious_files_parameters.go @@ -62,6 +62,12 @@ QueryMaliciousFilesParams contains all the parameters to send to the API endpoin */ type QueryMaliciousFilesParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Filter. A FQL compatible query string. Terms: [id scan_id host_id host_scan_id filepath filename hash pattern_id severity quarantined last_updated] @@ -160,6 +166,17 @@ func (o *QueryMaliciousFilesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the query malicious files params +func (o *QueryMaliciousFilesParams) WithXCSUSERUUID(xCSUSERUUID string) *QueryMaliciousFilesParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the query malicious files params +func (o *QueryMaliciousFilesParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithFilter adds the filter to the query malicious files params func (o *QueryMaliciousFilesParams) WithFilter(filter string) *QueryMaliciousFilesParams { o.SetFilter(filter) @@ -212,6 +229,11 @@ func (o *QueryMaliciousFilesParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + // query param filter qrFilter := o.Filter qFilter := qrFilter diff --git a/falcon/client/ods/query_scan_host_metadata_parameters.go b/falcon/client/ods/query_scan_host_metadata_parameters.go index 57cf7db4..de3ec251 100644 --- a/falcon/client/ods/query_scan_host_metadata_parameters.go +++ b/falcon/client/ods/query_scan_host_metadata_parameters.go @@ -62,6 +62,12 @@ QueryScanHostMetadataParams contains all the parameters to send to the API endpo */ type QueryScanHostMetadataParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Filter. A FQL compatible query string. Terms: [id profile_id host_id scan_id host_scan_id filecount.scanned filecount.malicious filecount.quarantined filecount.skipped affected_hosts_count status severity completed_on started_on last_updated scan_control_reason] @@ -160,6 +166,17 @@ func (o *QueryScanHostMetadataParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the query scan host metadata params +func (o *QueryScanHostMetadataParams) WithXCSUSERUUID(xCSUSERUUID string) *QueryScanHostMetadataParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the query scan host metadata params +func (o *QueryScanHostMetadataParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithFilter adds the filter to the query scan host metadata params func (o *QueryScanHostMetadataParams) WithFilter(filter string) *QueryScanHostMetadataParams { o.SetFilter(filter) @@ -212,6 +229,11 @@ func (o *QueryScanHostMetadataParams) WriteToRequest(r runtime.ClientRequest, re } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + // query param filter qrFilter := o.Filter qFilter := qrFilter diff --git a/falcon/client/ods/query_scans_parameters.go b/falcon/client/ods/query_scans_parameters.go index 7e3f9f9b..d872b2c0 100644 --- a/falcon/client/ods/query_scans_parameters.go +++ b/falcon/client/ods/query_scans_parameters.go @@ -62,9 +62,15 @@ QueryScansParams contains all the parameters to send to the API endpoint */ type QueryScansParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Filter. - A FQL compatible query string. Terms: [id profile_id description.keyword initiated_from filecount.scanned filecount.malicious filecount.quarantined filecount.skipped affected_hosts_count status severity scan_started_on scan_completed_on created_on created_by last_updated targeted_hosts_count missing_hosts_count] + A FQL compatible query string. Terms: [id profile_id description.keyword initiated_from filecount.scanned filecount.malicious filecount.quarantined filecount.skipped affected_hosts_count status severity scan_started_on scan_completed_on created_on created_by last_updated targeted_host_count missing_host_count] */ Filter string @@ -160,6 +166,17 @@ func (o *QueryScansParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the query scans params +func (o *QueryScansParams) WithXCSUSERUUID(xCSUSERUUID string) *QueryScansParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the query scans params +func (o *QueryScansParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithFilter adds the filter to the query scans params func (o *QueryScansParams) WithFilter(filter string) *QueryScansParams { o.SetFilter(filter) @@ -212,6 +229,11 @@ func (o *QueryScansParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + // query param filter qrFilter := o.Filter qFilter := qrFilter diff --git a/falcon/client/ods/query_scheduled_scans_parameters.go b/falcon/client/ods/query_scheduled_scans_parameters.go index 7c908656..71f0bea6 100644 --- a/falcon/client/ods/query_scheduled_scans_parameters.go +++ b/falcon/client/ods/query_scheduled_scans_parameters.go @@ -62,6 +62,12 @@ QueryScheduledScansParams contains all the parameters to send to the API endpoin */ type QueryScheduledScansParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + /* Filter. A FQL compatible query string. Terms: [id description initiated_from status schedule.start_timestamp schedule.Interval created_on created_by last_updated deleted] @@ -160,6 +166,17 @@ func (o *QueryScheduledScansParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the query scheduled scans params +func (o *QueryScheduledScansParams) WithXCSUSERUUID(xCSUSERUUID string) *QueryScheduledScansParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the query scheduled scans params +func (o *QueryScheduledScansParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithFilter adds the filter to the query scheduled scans params func (o *QueryScheduledScansParams) WithFilter(filter string) *QueryScheduledScansParams { o.SetFilter(filter) @@ -212,6 +229,11 @@ func (o *QueryScheduledScansParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + // query param filter qrFilter := o.Filter qFilter := qrFilter diff --git a/falcon/client/ods/schedule_scan_parameters.go b/falcon/client/ods/schedule_scan_parameters.go index 95a332b9..e7b6abc4 100644 --- a/falcon/client/ods/schedule_scan_parameters.go +++ b/falcon/client/ods/schedule_scan_parameters.go @@ -63,6 +63,12 @@ ScheduleScanParams contains all the parameters to send to the API endpoint */ type ScheduleScanParams struct { + /* XCSUSERUUID. + + The user ID + */ + XCSUSERUUID string + // Body. Body *models.EntitiesODSScheduleScanRequest @@ -119,6 +125,17 @@ func (o *ScheduleScanParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithXCSUSERUUID adds the xCSUSERUUID to the schedule scan params +func (o *ScheduleScanParams) WithXCSUSERUUID(xCSUSERUUID string) *ScheduleScanParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the schedule scan params +func (o *ScheduleScanParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + // WithBody adds the body to the schedule scan params func (o *ScheduleScanParams) WithBody(body *models.EntitiesODSScheduleScanRequest) *ScheduleScanParams { o.SetBody(body) @@ -137,6 +154,11 @@ func (o *ScheduleScanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error + + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/falcon/client/registration/register_cspm_snapshot_account_parameters.go b/falcon/client/registration/register_cspm_snapshot_account_parameters.go deleted file mode 100644 index 60c4e0f4..00000000 --- a/falcon/client/registration/register_cspm_snapshot_account_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package 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" -) - -// NewRegisterCspmSnapshotAccountParams creates a new RegisterCspmSnapshotAccountParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewRegisterCspmSnapshotAccountParams() *RegisterCspmSnapshotAccountParams { - return &RegisterCspmSnapshotAccountParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRegisterCspmSnapshotAccountParamsWithTimeout creates a new RegisterCspmSnapshotAccountParams object -// with the ability to set a timeout on a request. -func NewRegisterCspmSnapshotAccountParamsWithTimeout(timeout time.Duration) *RegisterCspmSnapshotAccountParams { - return &RegisterCspmSnapshotAccountParams{ - timeout: timeout, - } -} - -// NewRegisterCspmSnapshotAccountParamsWithContext creates a new RegisterCspmSnapshotAccountParams object -// with the ability to set a context for a request. -func NewRegisterCspmSnapshotAccountParamsWithContext(ctx context.Context) *RegisterCspmSnapshotAccountParams { - return &RegisterCspmSnapshotAccountParams{ - Context: ctx, - } -} - -// NewRegisterCspmSnapshotAccountParamsWithHTTPClient creates a new RegisterCspmSnapshotAccountParams object -// with the ability to set a custom HTTPClient for a request. -func NewRegisterCspmSnapshotAccountParamsWithHTTPClient(client *http.Client) *RegisterCspmSnapshotAccountParams { - return &RegisterCspmSnapshotAccountParams{ - HTTPClient: client, - } -} - -/* -RegisterCspmSnapshotAccountParams contains all the parameters to send to the API endpoint - - for the register cspm snapshot account operation. - - Typically these are written to a http.Request. -*/ -type RegisterCspmSnapshotAccountParams struct { - - // Body. - Body *models.ModelsAccountEntitiesInput - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the register cspm snapshot account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RegisterCspmSnapshotAccountParams) WithDefaults() *RegisterCspmSnapshotAccountParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the register cspm snapshot account params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RegisterCspmSnapshotAccountParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) WithTimeout(timeout time.Duration) *RegisterCspmSnapshotAccountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) WithContext(ctx context.Context) *RegisterCspmSnapshotAccountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) WithHTTPClient(client *http.Client) *RegisterCspmSnapshotAccountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) WithBody(body *models.ModelsAccountEntitiesInput) *RegisterCspmSnapshotAccountParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the register cspm snapshot account params -func (o *RegisterCspmSnapshotAccountParams) SetBody(body *models.ModelsAccountEntitiesInput) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *RegisterCspmSnapshotAccountParams) 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/registration/registration_client.go b/falcon/client/registration/registration_client.go deleted file mode 100644 index 1f87f9f8..00000000 --- a/falcon/client/registration/registration_client.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package 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" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new registration API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for registration 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 { - RegisterCspmSnapshotAccount(params *RegisterCspmSnapshotAccountParams, opts ...ClientOption) (*RegisterCspmSnapshotAccountOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -RegisterCspmSnapshotAccount registers customer cloud account for snapshot scanning -*/ -func (a *Client) RegisterCspmSnapshotAccount(params *RegisterCspmSnapshotAccountParams, opts ...ClientOption) (*RegisterCspmSnapshotAccountOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRegisterCspmSnapshotAccountParams() - } - op := &runtime.ClientOperation{ - ID: "RegisterCspmSnapshotAccount", - Method: "POST", - PathPattern: "/snapshots/entities/accounts/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &RegisterCspmSnapshotAccountReader{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.(*RegisterCspmSnapshotAccountOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for RegisterCspmSnapshotAccount: 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/saved_searches/create_saved_search_parameters.go b/falcon/client/saved_searches/create_saved_search_parameters.go deleted file mode 100644 index 4b2bde2f..00000000 --- a/falcon/client/saved_searches/create_saved_search_parameters.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewCreateSavedSearchParams creates a new CreateSavedSearchParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateSavedSearchParams() *CreateSavedSearchParams { - return &CreateSavedSearchParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateSavedSearchParamsWithTimeout creates a new CreateSavedSearchParams object -// with the ability to set a timeout on a request. -func NewCreateSavedSearchParamsWithTimeout(timeout time.Duration) *CreateSavedSearchParams { - return &CreateSavedSearchParams{ - timeout: timeout, - } -} - -// NewCreateSavedSearchParamsWithContext creates a new CreateSavedSearchParams object -// with the ability to set a context for a request. -func NewCreateSavedSearchParamsWithContext(ctx context.Context) *CreateSavedSearchParams { - return &CreateSavedSearchParams{ - Context: ctx, - } -} - -// NewCreateSavedSearchParamsWithHTTPClient creates a new CreateSavedSearchParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateSavedSearchParamsWithHTTPClient(client *http.Client) *CreateSavedSearchParams { - return &CreateSavedSearchParams{ - HTTPClient: client, - } -} - -/* -CreateSavedSearchParams contains all the parameters to send to the API endpoint - - for the create saved search operation. - - Typically these are written to a http.Request. -*/ -type CreateSavedSearchParams struct { - - /* XCSCREATEORIGIN. - - Create / Update request origin . - */ - XCSCREATEORIGIN *string - - /* XCsAppName. - - App name used to name repository and workflow action - */ - XCsAppName *string - - // Body. - Body *models.ApidomainSavedSearchCreateRequestV1 - - /* DryRun. - - Only test for correctness without saving / updating - */ - DryRun *bool - - /* Version. - - Version of resource being created - */ - Version *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create saved search params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateSavedSearchParams) WithDefaults() *CreateSavedSearchParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create saved search params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateSavedSearchParams) SetDefaults() { - var ( - dryRunDefault = bool(false) - ) - - val := CreateSavedSearchParams{ - DryRun: &dryRunDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the create saved search params -func (o *CreateSavedSearchParams) WithTimeout(timeout time.Duration) *CreateSavedSearchParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create saved search params -func (o *CreateSavedSearchParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create saved search params -func (o *CreateSavedSearchParams) WithContext(ctx context.Context) *CreateSavedSearchParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create saved search params -func (o *CreateSavedSearchParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create saved search params -func (o *CreateSavedSearchParams) WithHTTPClient(client *http.Client) *CreateSavedSearchParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create saved search params -func (o *CreateSavedSearchParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSCREATEORIGIN adds the xCSCREATEORIGIN to the create saved search params -func (o *CreateSavedSearchParams) WithXCSCREATEORIGIN(xCSCREATEORIGIN *string) *CreateSavedSearchParams { - o.SetXCSCREATEORIGIN(xCSCREATEORIGIN) - return o -} - -// SetXCSCREATEORIGIN adds the xCSCREATEORIGIN to the create saved search params -func (o *CreateSavedSearchParams) SetXCSCREATEORIGIN(xCSCREATEORIGIN *string) { - o.XCSCREATEORIGIN = xCSCREATEORIGIN -} - -// WithXCsAppName adds the xCsAppName to the create saved search params -func (o *CreateSavedSearchParams) WithXCsAppName(xCsAppName *string) *CreateSavedSearchParams { - o.SetXCsAppName(xCsAppName) - return o -} - -// SetXCsAppName adds the xCsAppName to the create saved search params -func (o *CreateSavedSearchParams) SetXCsAppName(xCsAppName *string) { - o.XCsAppName = xCsAppName -} - -// WithBody adds the body to the create saved search params -func (o *CreateSavedSearchParams) WithBody(body *models.ApidomainSavedSearchCreateRequestV1) *CreateSavedSearchParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create saved search params -func (o *CreateSavedSearchParams) SetBody(body *models.ApidomainSavedSearchCreateRequestV1) { - o.Body = body -} - -// WithDryRun adds the dryRun to the create saved search params -func (o *CreateSavedSearchParams) WithDryRun(dryRun *bool) *CreateSavedSearchParams { - o.SetDryRun(dryRun) - return o -} - -// SetDryRun adds the dryRun to the create saved search params -func (o *CreateSavedSearchParams) SetDryRun(dryRun *bool) { - o.DryRun = dryRun -} - -// WithVersion adds the version to the create saved search params -func (o *CreateSavedSearchParams) WithVersion(version *string) *CreateSavedSearchParams { - o.SetVersion(version) - return o -} - -// SetVersion adds the version to the create saved search params -func (o *CreateSavedSearchParams) SetVersion(version *string) { - o.Version = version -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateSavedSearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XCSCREATEORIGIN != nil { - - // header param X-CS-CREATE-ORIGIN - if err := r.SetHeaderParam("X-CS-CREATE-ORIGIN", *o.XCSCREATEORIGIN); err != nil { - return err - } - } - - if o.XCsAppName != nil { - - // header param X-Cs-App-Name - if err := r.SetHeaderParam("X-Cs-App-Name", *o.XCsAppName); err != nil { - return err - } - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if o.DryRun != nil { - - // query param dry_run - var qrDryRun bool - - if o.DryRun != nil { - qrDryRun = *o.DryRun - } - qDryRun := swag.FormatBool(qrDryRun) - if qDryRun != "" { - - if err := r.SetQueryParam("dry_run", qDryRun); err != nil { - return err - } - } - } - - if o.Version != nil { - - // query param version - var qrVersion string - - if o.Version != nil { - qrVersion = *o.Version - } - qVersion := qrVersion - if qVersion != "" { - - if err := r.SetQueryParam("version", qVersion); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/saved_searches/create_saved_search_responses.go b/falcon/client/saved_searches/create_saved_search_responses.go deleted file mode 100644 index 5812568e..00000000 --- a/falcon/client/saved_searches/create_saved_search_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by 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" -) - -// CreateSavedSearchReader is a Reader for the CreateSavedSearch structure. -type CreateSavedSearchReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateSavedSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateSavedSearchOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewCreateSavedSearchForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewCreateSavedSearchTooManyRequests() - 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/v1] CreateSavedSearch", response, response.Code()) - } -} - -// NewCreateSavedSearchOK creates a CreateSavedSearchOK with default headers values -func NewCreateSavedSearchOK() *CreateSavedSearchOK { - return &CreateSavedSearchOK{} -} - -/* -CreateSavedSearchOK describes a response with status code 200, with default header values. - -OK -*/ -type CreateSavedSearchOK 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.DomainSavedSearchWrapper -} - -// IsSuccess returns true when this create saved search o k response has a 2xx status code -func (o *CreateSavedSearchOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create saved search o k response has a 3xx status code -func (o *CreateSavedSearchOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create saved search o k response has a 4xx status code -func (o *CreateSavedSearchOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create saved search o k response has a 5xx status code -func (o *CreateSavedSearchOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create saved search o k response a status code equal to that given -func (o *CreateSavedSearchOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create saved search o k response -func (o *CreateSavedSearchOK) Code() int { - return 200 -} - -func (o *CreateSavedSearchOK) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/v1][%d] createSavedSearchOK %+v", 200, o.Payload) -} - -func (o *CreateSavedSearchOK) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/v1][%d] createSavedSearchOK %+v", 200, o.Payload) -} - -func (o *CreateSavedSearchOK) GetPayload() *models.DomainSavedSearchWrapper { - return o.Payload -} - -func (o *CreateSavedSearchOK) 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.DomainSavedSearchWrapper) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSavedSearchForbidden creates a CreateSavedSearchForbidden with default headers values -func NewCreateSavedSearchForbidden() *CreateSavedSearchForbidden { - return &CreateSavedSearchForbidden{} -} - -/* -CreateSavedSearchForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type CreateSavedSearchForbidden 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 create saved search forbidden response has a 2xx status code -func (o *CreateSavedSearchForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create saved search forbidden response has a 3xx status code -func (o *CreateSavedSearchForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create saved search forbidden response has a 4xx status code -func (o *CreateSavedSearchForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create saved search forbidden response has a 5xx status code -func (o *CreateSavedSearchForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create saved search forbidden response a status code equal to that given -func (o *CreateSavedSearchForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create saved search forbidden response -func (o *CreateSavedSearchForbidden) Code() int { - return 403 -} - -func (o *CreateSavedSearchForbidden) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/v1][%d] createSavedSearchForbidden %+v", 403, o.Payload) -} - -func (o *CreateSavedSearchForbidden) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/v1][%d] createSavedSearchForbidden %+v", 403, o.Payload) -} - -func (o *CreateSavedSearchForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *CreateSavedSearchForbidden) 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 -} - -// NewCreateSavedSearchTooManyRequests creates a CreateSavedSearchTooManyRequests with default headers values -func NewCreateSavedSearchTooManyRequests() *CreateSavedSearchTooManyRequests { - return &CreateSavedSearchTooManyRequests{} -} - -/* -CreateSavedSearchTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type CreateSavedSearchTooManyRequests 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 saved search too many requests response has a 2xx status code -func (o *CreateSavedSearchTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create saved search too many requests response has a 3xx status code -func (o *CreateSavedSearchTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create saved search too many requests response has a 4xx status code -func (o *CreateSavedSearchTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this create saved search too many requests response has a 5xx status code -func (o *CreateSavedSearchTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this create saved search too many requests response a status code equal to that given -func (o *CreateSavedSearchTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the create saved search too many requests response -func (o *CreateSavedSearchTooManyRequests) Code() int { - return 429 -} - -func (o *CreateSavedSearchTooManyRequests) Error() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/v1][%d] createSavedSearchTooManyRequests %+v", 429, o.Payload) -} - -func (o *CreateSavedSearchTooManyRequests) String() string { - return fmt.Sprintf("[POST /loggingapi/entities/saved-searches/v1][%d] createSavedSearchTooManyRequests %+v", 429, o.Payload) -} - -func (o *CreateSavedSearchTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *CreateSavedSearchTooManyRequests) 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/saved_searches/delete_saved_search_parameters.go b/falcon/client/saved_searches/delete_saved_search_parameters.go deleted file mode 100644 index 390793ad..00000000 --- a/falcon/client/saved_searches/delete_saved_search_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewDeleteSavedSearchParams creates a new DeleteSavedSearchParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteSavedSearchParams() *DeleteSavedSearchParams { - return &DeleteSavedSearchParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteSavedSearchParamsWithTimeout creates a new DeleteSavedSearchParams object -// with the ability to set a timeout on a request. -func NewDeleteSavedSearchParamsWithTimeout(timeout time.Duration) *DeleteSavedSearchParams { - return &DeleteSavedSearchParams{ - timeout: timeout, - } -} - -// NewDeleteSavedSearchParamsWithContext creates a new DeleteSavedSearchParams object -// with the ability to set a context for a request. -func NewDeleteSavedSearchParamsWithContext(ctx context.Context) *DeleteSavedSearchParams { - return &DeleteSavedSearchParams{ - Context: ctx, - } -} - -// NewDeleteSavedSearchParamsWithHTTPClient creates a new DeleteSavedSearchParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteSavedSearchParamsWithHTTPClient(client *http.Client) *DeleteSavedSearchParams { - return &DeleteSavedSearchParams{ - HTTPClient: client, - } -} - -/* -DeleteSavedSearchParams contains all the parameters to send to the API endpoint - - for the delete saved search operation. - - Typically these are written to a http.Request. -*/ -type DeleteSavedSearchParams struct { - - /* Ids. - - IDs of resources to retrieve details. - */ - Ids []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete saved search params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteSavedSearchParams) WithDefaults() *DeleteSavedSearchParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete saved search params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteSavedSearchParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete saved search params -func (o *DeleteSavedSearchParams) WithTimeout(timeout time.Duration) *DeleteSavedSearchParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete saved search params -func (o *DeleteSavedSearchParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete saved search params -func (o *DeleteSavedSearchParams) WithContext(ctx context.Context) *DeleteSavedSearchParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete saved search params -func (o *DeleteSavedSearchParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete saved search params -func (o *DeleteSavedSearchParams) WithHTTPClient(client *http.Client) *DeleteSavedSearchParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete saved search params -func (o *DeleteSavedSearchParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIds adds the ids to the delete saved search params -func (o *DeleteSavedSearchParams) WithIds(ids []string) *DeleteSavedSearchParams { - o.SetIds(ids) - return o -} - -// SetIds adds the ids to the delete saved search params -func (o *DeleteSavedSearchParams) SetIds(ids []string) { - o.Ids = ids -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteSavedSearchParams) 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 -} - -// bindParamDeleteSavedSearch binds the parameter ids -func (o *DeleteSavedSearchParams) 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/saved_searches/delete_saved_search_responses.go b/falcon/client/saved_searches/delete_saved_search_responses.go deleted file mode 100644 index 3de502c3..00000000 --- a/falcon/client/saved_searches/delete_saved_search_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by 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" -) - -// DeleteSavedSearchReader is a Reader for the DeleteSavedSearch structure. -type DeleteSavedSearchReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteSavedSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteSavedSearchOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewDeleteSavedSearchForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewDeleteSavedSearchTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /loggingapi/entities/saved-searches/v1] DeleteSavedSearch", response, response.Code()) - } -} - -// NewDeleteSavedSearchOK creates a DeleteSavedSearchOK with default headers values -func NewDeleteSavedSearchOK() *DeleteSavedSearchOK { - return &DeleteSavedSearchOK{} -} - -/* -DeleteSavedSearchOK describes a response with status code 200, with default header values. - -OK -*/ -type DeleteSavedSearchOK 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.CsrestfulEntitiesResponse -} - -// IsSuccess returns true when this delete saved search o k response has a 2xx status code -func (o *DeleteSavedSearchOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete saved search o k response has a 3xx status code -func (o *DeleteSavedSearchOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete saved search o k response has a 4xx status code -func (o *DeleteSavedSearchOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete saved search o k response has a 5xx status code -func (o *DeleteSavedSearchOK) IsServerError() bool { - return false -} - -// IsCode returns true when this delete saved search o k response a status code equal to that given -func (o *DeleteSavedSearchOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the delete saved search o k response -func (o *DeleteSavedSearchOK) Code() int { - return 200 -} - -func (o *DeleteSavedSearchOK) Error() string { - return fmt.Sprintf("[DELETE /loggingapi/entities/saved-searches/v1][%d] deleteSavedSearchOK %+v", 200, o.Payload) -} - -func (o *DeleteSavedSearchOK) String() string { - return fmt.Sprintf("[DELETE /loggingapi/entities/saved-searches/v1][%d] deleteSavedSearchOK %+v", 200, o.Payload) -} - -func (o *DeleteSavedSearchOK) GetPayload() *models.CsrestfulEntitiesResponse { - return o.Payload -} - -func (o *DeleteSavedSearchOK) 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.CsrestfulEntitiesResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteSavedSearchForbidden creates a DeleteSavedSearchForbidden with default headers values -func NewDeleteSavedSearchForbidden() *DeleteSavedSearchForbidden { - return &DeleteSavedSearchForbidden{} -} - -/* -DeleteSavedSearchForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeleteSavedSearchForbidden 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 delete saved search forbidden response has a 2xx status code -func (o *DeleteSavedSearchForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete saved search forbidden response has a 3xx status code -func (o *DeleteSavedSearchForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete saved search forbidden response has a 4xx status code -func (o *DeleteSavedSearchForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete saved search forbidden response has a 5xx status code -func (o *DeleteSavedSearchForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this delete saved search forbidden response a status code equal to that given -func (o *DeleteSavedSearchForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the delete saved search forbidden response -func (o *DeleteSavedSearchForbidden) Code() int { - return 403 -} - -func (o *DeleteSavedSearchForbidden) Error() string { - return fmt.Sprintf("[DELETE /loggingapi/entities/saved-searches/v1][%d] deleteSavedSearchForbidden %+v", 403, o.Payload) -} - -func (o *DeleteSavedSearchForbidden) String() string { - return fmt.Sprintf("[DELETE /loggingapi/entities/saved-searches/v1][%d] deleteSavedSearchForbidden %+v", 403, o.Payload) -} - -func (o *DeleteSavedSearchForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeleteSavedSearchForbidden) 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 -} - -// NewDeleteSavedSearchTooManyRequests creates a DeleteSavedSearchTooManyRequests with default headers values -func NewDeleteSavedSearchTooManyRequests() *DeleteSavedSearchTooManyRequests { - return &DeleteSavedSearchTooManyRequests{} -} - -/* -DeleteSavedSearchTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type DeleteSavedSearchTooManyRequests 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 saved search too many requests response has a 2xx status code -func (o *DeleteSavedSearchTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete saved search too many requests response has a 3xx status code -func (o *DeleteSavedSearchTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete saved search too many requests response has a 4xx status code -func (o *DeleteSavedSearchTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete saved search too many requests response has a 5xx status code -func (o *DeleteSavedSearchTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this delete saved search too many requests response a status code equal to that given -func (o *DeleteSavedSearchTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the delete saved search too many requests response -func (o *DeleteSavedSearchTooManyRequests) Code() int { - return 429 -} - -func (o *DeleteSavedSearchTooManyRequests) Error() string { - return fmt.Sprintf("[DELETE /loggingapi/entities/saved-searches/v1][%d] deleteSavedSearchTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeleteSavedSearchTooManyRequests) String() string { - return fmt.Sprintf("[DELETE /loggingapi/entities/saved-searches/v1][%d] deleteSavedSearchTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeleteSavedSearchTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeleteSavedSearchTooManyRequests) 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/saved_searches/deploy_parameters.go b/falcon/client/saved_searches/deploy_parameters.go deleted file mode 100644 index 06ce6092..00000000 --- a/falcon/client/saved_searches/deploy_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewDeployParams creates a new DeployParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeployParams() *DeployParams { - return &DeployParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeployParamsWithTimeout creates a new DeployParams object -// with the ability to set a timeout on a request. -func NewDeployParamsWithTimeout(timeout time.Duration) *DeployParams { - return &DeployParams{ - timeout: timeout, - } -} - -// NewDeployParamsWithContext creates a new DeployParams object -// with the ability to set a context for a request. -func NewDeployParamsWithContext(ctx context.Context) *DeployParams { - return &DeployParams{ - Context: ctx, - } -} - -// NewDeployParamsWithHTTPClient creates a new DeployParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeployParamsWithHTTPClient(client *http.Client) *DeployParams { - return &DeployParams{ - HTTPClient: client, - } -} - -/* -DeployParams contains all the parameters to send to the API endpoint - - for the deploy operation. - - Typically these are written to a http.Request. -*/ -type DeployParams struct { - - // Body. - Body *models.ApidomainSavedSearchDeployRequestV1 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the deploy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeployParams) WithDefaults() *DeployParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the deploy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeployParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the deploy params -func (o *DeployParams) WithTimeout(timeout time.Duration) *DeployParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the deploy params -func (o *DeployParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the deploy params -func (o *DeployParams) WithContext(ctx context.Context) *DeployParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the deploy params -func (o *DeployParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the deploy params -func (o *DeployParams) WithHTTPClient(client *http.Client) *DeployParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the deploy params -func (o *DeployParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the deploy params -func (o *DeployParams) WithBody(body *models.ApidomainSavedSearchDeployRequestV1) *DeployParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the deploy params -func (o *DeployParams) SetBody(body *models.ApidomainSavedSearchDeployRequestV1) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *DeployParams) 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/saved_searches/ingest_parameters.go b/falcon/client/saved_searches/ingest_parameters.go deleted file mode 100644 index 322d7b6a..00000000 --- a/falcon/client/saved_searches/ingest_parameters.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewIngestParams creates a new IngestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewIngestParams() *IngestParams { - return &IngestParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewIngestParamsWithTimeout creates a new IngestParams object -// with the ability to set a timeout on a request. -func NewIngestParamsWithTimeout(timeout time.Duration) *IngestParams { - return &IngestParams{ - timeout: timeout, - } -} - -// NewIngestParamsWithContext creates a new IngestParams object -// with the ability to set a context for a request. -func NewIngestParamsWithContext(ctx context.Context) *IngestParams { - return &IngestParams{ - Context: ctx, - } -} - -// NewIngestParamsWithHTTPClient creates a new IngestParams object -// with the ability to set a custom HTTPClient for a request. -func NewIngestParamsWithHTTPClient(client *http.Client) *IngestParams { - return &IngestParams{ - HTTPClient: client, - } -} - -/* -IngestParams contains all the parameters to send to the API endpoint - - for the ingest operation. - - Typically these are written to a http.Request. -*/ -type IngestParams struct { - - /* XCsAppName. - - App name used to name repository and workflow action - */ - XCsAppName *string - - /* DataFile. - - Data file to ingest. Currently limited to line delimited JSON - */ - DataFile runtime.NamedReadCloser - - /* 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 params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IngestParams) WithDefaults() *IngestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the ingest params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IngestParams) SetDefaults() { - var ( - testDataDefault = bool(false) - ) - - val := IngestParams{ - TestData: &testDataDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the ingest params -func (o *IngestParams) WithTimeout(timeout time.Duration) *IngestParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the ingest params -func (o *IngestParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the ingest params -func (o *IngestParams) WithContext(ctx context.Context) *IngestParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the ingest params -func (o *IngestParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the ingest params -func (o *IngestParams) WithHTTPClient(client *http.Client) *IngestParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the ingest params -func (o *IngestParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCsAppName adds the xCsAppName to the ingest params -func (o *IngestParams) WithXCsAppName(xCsAppName *string) *IngestParams { - o.SetXCsAppName(xCsAppName) - return o -} - -// SetXCsAppName adds the xCsAppName to the ingest params -func (o *IngestParams) SetXCsAppName(xCsAppName *string) { - o.XCsAppName = xCsAppName -} - -// WithDataFile adds the dataFile to the ingest params -func (o *IngestParams) WithDataFile(dataFile runtime.NamedReadCloser) *IngestParams { - o.SetDataFile(dataFile) - return o -} - -// SetDataFile adds the dataFile to the ingest params -func (o *IngestParams) SetDataFile(dataFile runtime.NamedReadCloser) { - o.DataFile = dataFile -} - -// WithTag adds the tag to the ingest params -func (o *IngestParams) WithTag(tag []string) *IngestParams { - o.SetTag(tag) - return o -} - -// SetTag adds the tag to the ingest params -func (o *IngestParams) SetTag(tag []string) { - o.Tag = tag -} - -// WithTagSource adds the tagSource to the ingest params -func (o *IngestParams) WithTagSource(tagSource *string) *IngestParams { - o.SetTagSource(tagSource) - return o -} - -// SetTagSource adds the tagSource to the ingest params -func (o *IngestParams) SetTagSource(tagSource *string) { - o.TagSource = tagSource -} - -// WithTestData adds the testData to the ingest params -func (o *IngestParams) WithTestData(testData *bool) *IngestParams { - o.SetTestData(testData) - return o -} - -// SetTestData adds the testData to the ingest params -func (o *IngestParams) SetTestData(testData *bool) { - o.TestData = testData -} - -// WriteToRequest writes these params to a swagger request -func (o *IngestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XCsAppName != nil { - - // header param X-Cs-App-Name - if err := r.SetHeaderParam("X-Cs-App-Name", *o.XCsAppName); err != nil { - return err - } - } - // form file param data_file - if err := r.SetFileParam("data_file", o.DataFile); 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 -} - -// bindParamIngest binds the parameter tag -func (o *IngestParams) 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/saved_searches/query_by_id_parameters.go b/falcon/client/saved_searches/query_by_id_parameters.go deleted file mode 100644 index 9fc86f8c..00000000 --- a/falcon/client/saved_searches/query_by_id_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewQueryByIDParams creates a new QueryByIDParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewQueryByIDParams() *QueryByIDParams { - return &QueryByIDParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewQueryByIDParamsWithTimeout creates a new QueryByIDParams object -// with the ability to set a timeout on a request. -func NewQueryByIDParamsWithTimeout(timeout time.Duration) *QueryByIDParams { - return &QueryByIDParams{ - timeout: timeout, - } -} - -// NewQueryByIDParamsWithContext creates a new QueryByIDParams object -// with the ability to set a context for a request. -func NewQueryByIDParamsWithContext(ctx context.Context) *QueryByIDParams { - return &QueryByIDParams{ - Context: ctx, - } -} - -// NewQueryByIDParamsWithHTTPClient creates a new QueryByIDParams object -// with the ability to set a custom HTTPClient for a request. -func NewQueryByIDParamsWithHTTPClient(client *http.Client) *QueryByIDParams { - return &QueryByIDParams{ - HTTPClient: client, - } -} - -/* -QueryByIDParams contains all the parameters to send to the API endpoint - - for the query by Id operation. - - Typically these are written to a http.Request. -*/ -type QueryByIDParams struct { - - /* Ids. - - IDs of resources to retrieve details. - */ - Ids []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the query by Id params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryByIDParams) WithDefaults() *QueryByIDParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the query by Id params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryByIDParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the query by Id params -func (o *QueryByIDParams) WithTimeout(timeout time.Duration) *QueryByIDParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the query by Id params -func (o *QueryByIDParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the query by Id params -func (o *QueryByIDParams) WithContext(ctx context.Context) *QueryByIDParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the query by Id params -func (o *QueryByIDParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the query by Id params -func (o *QueryByIDParams) WithHTTPClient(client *http.Client) *QueryByIDParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the query by Id params -func (o *QueryByIDParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIds adds the ids to the query by Id params -func (o *QueryByIDParams) WithIds(ids []string) *QueryByIDParams { - o.SetIds(ids) - return o -} - -// SetIds adds the ids to the query by Id params -func (o *QueryByIDParams) SetIds(ids []string) { - o.Ids = ids -} - -// WriteToRequest writes these params to a swagger request -func (o *QueryByIDParams) 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 -} - -// bindParamQueryByID binds the parameter ids -func (o *QueryByIDParams) 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/saved_searches/query_combined_parameters.go b/falcon/client/saved_searches/query_combined_parameters.go deleted file mode 100644 index 5d1426f2..00000000 --- a/falcon/client/saved_searches/query_combined_parameters.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewQueryCombinedParams creates a new QueryCombinedParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewQueryCombinedParams() *QueryCombinedParams { - return &QueryCombinedParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewQueryCombinedParamsWithTimeout creates a new QueryCombinedParams object -// with the ability to set a timeout on a request. -func NewQueryCombinedParamsWithTimeout(timeout time.Duration) *QueryCombinedParams { - return &QueryCombinedParams{ - timeout: timeout, - } -} - -// NewQueryCombinedParamsWithContext creates a new QueryCombinedParams object -// with the ability to set a context for a request. -func NewQueryCombinedParamsWithContext(ctx context.Context) *QueryCombinedParams { - return &QueryCombinedParams{ - Context: ctx, - } -} - -// NewQueryCombinedParamsWithHTTPClient creates a new QueryCombinedParams object -// with the ability to set a custom HTTPClient for a request. -func NewQueryCombinedParamsWithHTTPClient(client *http.Client) *QueryCombinedParams { - return &QueryCombinedParams{ - HTTPClient: client, - } -} - -/* -QueryCombinedParams contains all the parameters to send to the API endpoint - - for the query combined operation. - - Typically these are written to a http.Request. -*/ -type QueryCombinedParams struct { - - /* Filter. - - FQL query specifying filter parameters. - */ - Filter string - - /* Limit. - - Maximum number of records to return. - */ - Limit *int64 - - /* Offset. - - Starting pagination offset of records to return. - */ - Offset *string - - /* Sort. - - Sort items by providing a comma separated list of property and direction (eg name.desc,time.asc). If direction is omitted, defaults to descending. - */ - Sort *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the query combined params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryCombinedParams) WithDefaults() *QueryCombinedParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the query combined params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryCombinedParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the query combined params -func (o *QueryCombinedParams) WithTimeout(timeout time.Duration) *QueryCombinedParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the query combined params -func (o *QueryCombinedParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the query combined params -func (o *QueryCombinedParams) WithContext(ctx context.Context) *QueryCombinedParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the query combined params -func (o *QueryCombinedParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the query combined params -func (o *QueryCombinedParams) WithHTTPClient(client *http.Client) *QueryCombinedParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the query combined params -func (o *QueryCombinedParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the query combined params -func (o *QueryCombinedParams) WithFilter(filter string) *QueryCombinedParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the query combined params -func (o *QueryCombinedParams) SetFilter(filter string) { - o.Filter = filter -} - -// WithLimit adds the limit to the query combined params -func (o *QueryCombinedParams) WithLimit(limit *int64) *QueryCombinedParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the query combined params -func (o *QueryCombinedParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the query combined params -func (o *QueryCombinedParams) WithOffset(offset *string) *QueryCombinedParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the query combined params -func (o *QueryCombinedParams) SetOffset(offset *string) { - o.Offset = offset -} - -// WithSort adds the sort to the query combined params -func (o *QueryCombinedParams) WithSort(sort *string) *QueryCombinedParams { - o.SetSort(sort) - return o -} - -// SetSort adds the sort to the query combined params -func (o *QueryCombinedParams) SetSort(sort *string) { - o.Sort = sort -} - -// WriteToRequest writes these params to a swagger request -func (o *QueryCombinedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param filter - qrFilter := o.Filter - qFilter := qrFilter - - 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/saved_searches/query_combined_responses.go b/falcon/client/saved_searches/query_combined_responses.go deleted file mode 100644 index 99da0759..00000000 --- a/falcon/client/saved_searches/query_combined_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by 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" -) - -// QueryCombinedReader is a Reader for the QueryCombined structure. -type QueryCombinedReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *QueryCombinedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewQueryCombinedOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewQueryCombinedForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewQueryCombinedTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /loggingapi/combined/saved-searches/v1] QueryCombined", response, response.Code()) - } -} - -// NewQueryCombinedOK creates a QueryCombinedOK with default headers values -func NewQueryCombinedOK() *QueryCombinedOK { - return &QueryCombinedOK{} -} - -/* -QueryCombinedOK describes a response with status code 200, with default header values. - -OK -*/ -type QueryCombinedOK 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.DomainSavedSearchWrapper -} - -// IsSuccess returns true when this query combined o k response has a 2xx status code -func (o *QueryCombinedOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this query combined o k response has a 3xx status code -func (o *QueryCombinedOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this query combined o k response has a 4xx status code -func (o *QueryCombinedOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this query combined o k response has a 5xx status code -func (o *QueryCombinedOK) IsServerError() bool { - return false -} - -// IsCode returns true when this query combined o k response a status code equal to that given -func (o *QueryCombinedOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the query combined o k response -func (o *QueryCombinedOK) Code() int { - return 200 -} - -func (o *QueryCombinedOK) Error() string { - return fmt.Sprintf("[GET /loggingapi/combined/saved-searches/v1][%d] queryCombinedOK %+v", 200, o.Payload) -} - -func (o *QueryCombinedOK) String() string { - return fmt.Sprintf("[GET /loggingapi/combined/saved-searches/v1][%d] queryCombinedOK %+v", 200, o.Payload) -} - -func (o *QueryCombinedOK) GetPayload() *models.DomainSavedSearchWrapper { - return o.Payload -} - -func (o *QueryCombinedOK) 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.DomainSavedSearchWrapper) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewQueryCombinedForbidden creates a QueryCombinedForbidden with default headers values -func NewQueryCombinedForbidden() *QueryCombinedForbidden { - return &QueryCombinedForbidden{} -} - -/* -QueryCombinedForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type QueryCombinedForbidden 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 combined forbidden response has a 2xx status code -func (o *QueryCombinedForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this query combined forbidden response has a 3xx status code -func (o *QueryCombinedForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this query combined forbidden response has a 4xx status code -func (o *QueryCombinedForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this query combined forbidden response has a 5xx status code -func (o *QueryCombinedForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this query combined forbidden response a status code equal to that given -func (o *QueryCombinedForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the query combined forbidden response -func (o *QueryCombinedForbidden) Code() int { - return 403 -} - -func (o *QueryCombinedForbidden) Error() string { - return fmt.Sprintf("[GET /loggingapi/combined/saved-searches/v1][%d] queryCombinedForbidden %+v", 403, o.Payload) -} - -func (o *QueryCombinedForbidden) String() string { - return fmt.Sprintf("[GET /loggingapi/combined/saved-searches/v1][%d] queryCombinedForbidden %+v", 403, o.Payload) -} - -func (o *QueryCombinedForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *QueryCombinedForbidden) 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 -} - -// NewQueryCombinedTooManyRequests creates a QueryCombinedTooManyRequests with default headers values -func NewQueryCombinedTooManyRequests() *QueryCombinedTooManyRequests { - return &QueryCombinedTooManyRequests{} -} - -/* -QueryCombinedTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type QueryCombinedTooManyRequests 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 combined too many requests response has a 2xx status code -func (o *QueryCombinedTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this query combined too many requests response has a 3xx status code -func (o *QueryCombinedTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this query combined too many requests response has a 4xx status code -func (o *QueryCombinedTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this query combined too many requests response has a 5xx status code -func (o *QueryCombinedTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this query combined too many requests response a status code equal to that given -func (o *QueryCombinedTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the query combined too many requests response -func (o *QueryCombinedTooManyRequests) Code() int { - return 429 -} - -func (o *QueryCombinedTooManyRequests) Error() string { - return fmt.Sprintf("[GET /loggingapi/combined/saved-searches/v1][%d] queryCombinedTooManyRequests %+v", 429, o.Payload) -} - -func (o *QueryCombinedTooManyRequests) String() string { - return fmt.Sprintf("[GET /loggingapi/combined/saved-searches/v1][%d] queryCombinedTooManyRequests %+v", 429, o.Payload) -} - -func (o *QueryCombinedTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *QueryCombinedTooManyRequests) 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/saved_searches/query_parameters.go b/falcon/client/saved_searches/query_parameters.go deleted file mode 100644 index 34fe6a5c..00000000 --- a/falcon/client/saved_searches/query_parameters.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewQueryParams creates a new QueryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewQueryParams() *QueryParams { - return &QueryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewQueryParamsWithTimeout creates a new QueryParams object -// with the ability to set a timeout on a request. -func NewQueryParamsWithTimeout(timeout time.Duration) *QueryParams { - return &QueryParams{ - timeout: timeout, - } -} - -// NewQueryParamsWithContext creates a new QueryParams object -// with the ability to set a context for a request. -func NewQueryParamsWithContext(ctx context.Context) *QueryParams { - return &QueryParams{ - Context: ctx, - } -} - -// NewQueryParamsWithHTTPClient creates a new QueryParams object -// with the ability to set a custom HTTPClient for a request. -func NewQueryParamsWithHTTPClient(client *http.Client) *QueryParams { - return &QueryParams{ - HTTPClient: client, - } -} - -/* -QueryParams contains all the parameters to send to the API endpoint - - for the query operation. - - Typically these are written to a http.Request. -*/ -type QueryParams struct { - - /* Filter. - - FQL query specifying filter parameters. - */ - Filter string - - /* Limit. - - Maximum number of records to return. - */ - Limit *int64 - - /* Offset. - - Starting pagination offset of records to return. - */ - Offset *string - - /* Sort. - - Sort items by providing a comma separated list of property and direction (eg name.desc,time.asc). If direction is omitted, defaults to descending. - */ - Sort *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the query params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryParams) WithDefaults() *QueryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the query params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *QueryParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the query params -func (o *QueryParams) WithTimeout(timeout time.Duration) *QueryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the query params -func (o *QueryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the query params -func (o *QueryParams) WithContext(ctx context.Context) *QueryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the query params -func (o *QueryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the query params -func (o *QueryParams) WithHTTPClient(client *http.Client) *QueryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the query params -func (o *QueryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the query params -func (o *QueryParams) WithFilter(filter string) *QueryParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the query params -func (o *QueryParams) SetFilter(filter string) { - o.Filter = filter -} - -// WithLimit adds the limit to the query params -func (o *QueryParams) WithLimit(limit *int64) *QueryParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the query params -func (o *QueryParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the query params -func (o *QueryParams) WithOffset(offset *string) *QueryParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the query params -func (o *QueryParams) SetOffset(offset *string) { - o.Offset = offset -} - -// WithSort adds the sort to the query params -func (o *QueryParams) WithSort(sort *string) *QueryParams { - o.SetSort(sort) - return o -} - -// SetSort adds the sort to the query params -func (o *QueryParams) SetSort(sort *string) { - o.Sort = sort -} - -// WriteToRequest writes these params to a swagger request -func (o *QueryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param filter - qrFilter := o.Filter - qFilter := qrFilter - - 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/saved_searches/query_responses.go b/falcon/client/saved_searches/query_responses.go deleted file mode 100644 index 802970d5..00000000 --- a/falcon/client/saved_searches/query_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by 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" -) - -// QueryReader is a Reader for the Query structure. -type QueryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *QueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewQueryOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewQueryForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewQueryTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /loggingapi/queries/saved-searches/v1] Query", response, response.Code()) - } -} - -// NewQueryOK creates a QueryOK with default headers values -func NewQueryOK() *QueryOK { - return &QueryOK{} -} - -/* -QueryOK describes a response with status code 200, with default header values. - -OK -*/ -type QueryOK 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.StringWrapper -} - -// IsSuccess returns true when this query o k response has a 2xx status code -func (o *QueryOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this query o k response has a 3xx status code -func (o *QueryOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this query o k response has a 4xx status code -func (o *QueryOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this query o k response has a 5xx status code -func (o *QueryOK) IsServerError() bool { - return false -} - -// IsCode returns true when this query o k response a status code equal to that given -func (o *QueryOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the query o k response -func (o *QueryOK) Code() int { - return 200 -} - -func (o *QueryOK) Error() string { - return fmt.Sprintf("[GET /loggingapi/queries/saved-searches/v1][%d] queryOK %+v", 200, o.Payload) -} - -func (o *QueryOK) String() string { - return fmt.Sprintf("[GET /loggingapi/queries/saved-searches/v1][%d] queryOK %+v", 200, o.Payload) -} - -func (o *QueryOK) GetPayload() *models.StringWrapper { - return o.Payload -} - -func (o *QueryOK) 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.StringWrapper) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewQueryForbidden creates a QueryForbidden with default headers values -func NewQueryForbidden() *QueryForbidden { - return &QueryForbidden{} -} - -/* -QueryForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type QueryForbidden 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 forbidden response has a 2xx status code -func (o *QueryForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this query forbidden response has a 3xx status code -func (o *QueryForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this query forbidden response has a 4xx status code -func (o *QueryForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this query forbidden response has a 5xx status code -func (o *QueryForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this query forbidden response a status code equal to that given -func (o *QueryForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the query forbidden response -func (o *QueryForbidden) Code() int { - return 403 -} - -func (o *QueryForbidden) Error() string { - return fmt.Sprintf("[GET /loggingapi/queries/saved-searches/v1][%d] queryForbidden %+v", 403, o.Payload) -} - -func (o *QueryForbidden) String() string { - return fmt.Sprintf("[GET /loggingapi/queries/saved-searches/v1][%d] queryForbidden %+v", 403, o.Payload) -} - -func (o *QueryForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *QueryForbidden) 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 -} - -// NewQueryTooManyRequests creates a QueryTooManyRequests with default headers values -func NewQueryTooManyRequests() *QueryTooManyRequests { - return &QueryTooManyRequests{} -} - -/* -QueryTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type QueryTooManyRequests 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 too many requests response has a 2xx status code -func (o *QueryTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this query too many requests response has a 3xx status code -func (o *QueryTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this query too many requests response has a 4xx status code -func (o *QueryTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this query too many requests response has a 5xx status code -func (o *QueryTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this query too many requests response a status code equal to that given -func (o *QueryTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the query too many requests response -func (o *QueryTooManyRequests) Code() int { - return 429 -} - -func (o *QueryTooManyRequests) Error() string { - return fmt.Sprintf("[GET /loggingapi/queries/saved-searches/v1][%d] queryTooManyRequests %+v", 429, o.Payload) -} - -func (o *QueryTooManyRequests) String() string { - return fmt.Sprintf("[GET /loggingapi/queries/saved-searches/v1][%d] queryTooManyRequests %+v", 429, o.Payload) -} - -func (o *QueryTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *QueryTooManyRequests) 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/saved_searches/result_parameters.go b/falcon/client/saved_searches/result_parameters.go deleted file mode 100644 index 43dac4ea..00000000 --- a/falcon/client/saved_searches/result_parameters.go +++ /dev/null @@ -1,304 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewResultParams creates a new ResultParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewResultParams() *ResultParams { - return &ResultParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewResultParamsWithTimeout creates a new ResultParams object -// with the ability to set a timeout on a request. -func NewResultParamsWithTimeout(timeout time.Duration) *ResultParams { - return &ResultParams{ - timeout: timeout, - } -} - -// NewResultParamsWithContext creates a new ResultParams object -// with the ability to set a context for a request. -func NewResultParamsWithContext(ctx context.Context) *ResultParams { - return &ResultParams{ - Context: ctx, - } -} - -// NewResultParamsWithHTTPClient creates a new ResultParams object -// with the ability to set a custom HTTPClient for a request. -func NewResultParamsWithHTTPClient(client *http.Client) *ResultParams { - return &ResultParams{ - HTTPClient: client, - } -} - -/* -ResultParams contains all the parameters to send to the API endpoint - - for the result operation. - - Typically these are written to a http.Request. -*/ -type ResultParams struct { - - /* JobID. - - Job ID for a previously executed async query - */ - JobID string - - /* Limit. - - Maximum number of records to return. - */ - Limit *string - - /* Metadata. - - Whether to include metadata in the response - */ - Metadata *bool - - /* Offset. - - Starting pagination offset of records to return. - */ - Offset *string - - /* Version. - - Version of resource being created - */ - Version *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the result params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ResultParams) WithDefaults() *ResultParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the result params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ResultParams) SetDefaults() { - var ( - metadataDefault = bool(false) - ) - - val := ResultParams{ - Metadata: &metadataDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the result params -func (o *ResultParams) WithTimeout(timeout time.Duration) *ResultParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the result params -func (o *ResultParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the result params -func (o *ResultParams) WithContext(ctx context.Context) *ResultParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the result params -func (o *ResultParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the result params -func (o *ResultParams) WithHTTPClient(client *http.Client) *ResultParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the result params -func (o *ResultParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithJobID adds the jobID to the result params -func (o *ResultParams) WithJobID(jobID string) *ResultParams { - o.SetJobID(jobID) - return o -} - -// SetJobID adds the jobId to the result params -func (o *ResultParams) SetJobID(jobID string) { - o.JobID = jobID -} - -// WithLimit adds the limit to the result params -func (o *ResultParams) WithLimit(limit *string) *ResultParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the result params -func (o *ResultParams) SetLimit(limit *string) { - o.Limit = limit -} - -// WithMetadata adds the metadata to the result params -func (o *ResultParams) WithMetadata(metadata *bool) *ResultParams { - o.SetMetadata(metadata) - return o -} - -// SetMetadata adds the metadata to the result params -func (o *ResultParams) SetMetadata(metadata *bool) { - o.Metadata = metadata -} - -// WithOffset adds the offset to the result params -func (o *ResultParams) WithOffset(offset *string) *ResultParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the result params -func (o *ResultParams) SetOffset(offset *string) { - o.Offset = offset -} - -// WithVersion adds the version to the result params -func (o *ResultParams) WithVersion(version *string) *ResultParams { - o.SetVersion(version) - return o -} - -// SetVersion adds the version to the result params -func (o *ResultParams) SetVersion(version *string) { - o.Version = version -} - -// WriteToRequest writes these params to a swagger request -func (o *ResultParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param job_id - qrJobID := o.JobID - qJobID := qrJobID - if qJobID != "" { - - if err := r.SetQueryParam("job_id", qJobID); err != nil { - return err - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit string - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := qrLimit - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Metadata != nil { - - // query param metadata - var qrMetadata bool - - if o.Metadata != nil { - qrMetadata = *o.Metadata - } - qMetadata := swag.FormatBool(qrMetadata) - if qMetadata != "" { - - if err := r.SetQueryParam("metadata", qMetadata); 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.Version != nil { - - // query param version - var qrVersion string - - if o.Version != nil { - qrVersion = *o.Version - } - qVersion := qrVersion - if qVersion != "" { - - if err := r.SetQueryParam("version", qVersion); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/saved_searches/saved_searches_client.go b/falcon/client/saved_searches/saved_searches_client.go deleted file mode 100644 index ba14d2bf..00000000 --- a/falcon/client/saved_searches/saved_searches_client.go +++ /dev/null @@ -1,519 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// 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 saved searches API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for saved searches 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 { - CreateSavedSearch(params *CreateSavedSearchParams, opts ...ClientOption) (*CreateSavedSearchOK, error) - - DeleteSavedSearch(params *DeleteSavedSearchParams, opts ...ClientOption) (*DeleteSavedSearchOK, error) - - Deploy(params *DeployParams, opts ...ClientOption) (*DeployOK, error) - - Execute(params *ExecuteParams, opts ...ClientOption) (*ExecuteOK, error) - - ExecuteDynamic(params *ExecuteDynamicParams, opts ...ClientOption) (*ExecuteDynamicOK, error) - - Ingest(params *IngestParams, opts ...ClientOption) (*IngestOK, error) - - Query(params *QueryParams, opts ...ClientOption) (*QueryOK, error) - - QueryByID(params *QueryByIDParams, opts ...ClientOption) (*QueryByIDOK, error) - - QueryCombined(params *QueryCombinedParams, opts ...ClientOption) (*QueryCombinedOK, error) - - Result(params *ResultParams, opts ...ClientOption) (*ResultOK, error) - - UpdateSavedSearch(params *UpdateSavedSearchParams, opts ...ClientOption) (*UpdateSavedSearchOK, error) - - Validate(params *ValidateParams, opts ...ClientOption) (*ValidateOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateSavedSearch creates a saved searches resource -*/ -func (a *Client) CreateSavedSearch(params *CreateSavedSearchParams, opts ...ClientOption) (*CreateSavedSearchOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateSavedSearchParams() - } - op := &runtime.ClientOperation{ - ID: "CreateSavedSearch", - Method: "POST", - PathPattern: "/loggingapi/entities/saved-searches/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateSavedSearchReader{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.(*CreateSavedSearchOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateSavedSearch: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -DeleteSavedSearch deletes a saved searches resource -*/ -func (a *Client) DeleteSavedSearch(params *DeleteSavedSearchParams, opts ...ClientOption) (*DeleteSavedSearchOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteSavedSearchParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteSavedSearch", - Method: "DELETE", - PathPattern: "/loggingapi/entities/saved-searches/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteSavedSearchReader{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.(*DeleteSavedSearchOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteSavedSearch: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -Deploy deploys a saved search -*/ -func (a *Client) Deploy(params *DeployParams, opts ...ClientOption) (*DeployOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeployParams() - } - op := &runtime.ClientOperation{ - ID: "Deploy", - Method: "POST", - PathPattern: "/loggingapi/entities/saved-searches-deploy/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeployReader{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.(*DeployOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Deploy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -Execute executes a saved search -*/ -func (a *Client) Execute(params *ExecuteParams, opts ...ClientOption) (*ExecuteOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExecuteParams() - } - op := &runtime.ClientOperation{ - ID: "Execute", - Method: "POST", - PathPattern: "/loggingapi/entities/saved-searches-execute/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ExecuteReader{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.(*ExecuteOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Execute: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ExecuteDynamic executes a dynamic saved search -*/ -func (a *Client) ExecuteDynamic(params *ExecuteDynamicParams, opts ...ClientOption) (*ExecuteDynamicOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExecuteDynamicParams() - } - op := &runtime.ClientOperation{ - ID: "ExecuteDynamic", - Method: "POST", - PathPattern: "/loggingapi/entities/saved-searches-dynamic-execute/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ExecuteDynamicReader{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.(*ExecuteDynamicOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ExecuteDynamic: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -Ingest populates a saved search -*/ -func (a *Client) Ingest(params *IngestParams, opts ...ClientOption) (*IngestOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewIngestParams() - } - op := &runtime.ClientOperation{ - ID: "Ingest", - Method: "POST", - PathPattern: "/loggingapi/entities/saved-searches-ingest/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"multipart/form-data"}, - Schemes: []string{"https"}, - Params: params, - Reader: &IngestReader{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.(*IngestOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Ingest: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -Query queries for saved searches resources and returns ids -*/ -func (a *Client) Query(params *QueryParams, opts ...ClientOption) (*QueryOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewQueryParams() - } - op := &runtime.ClientOperation{ - ID: "Query", - Method: "GET", - PathPattern: "/loggingapi/queries/saved-searches/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &QueryReader{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.(*QueryOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, 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: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -QueryByID retrieves saved searches resources by ids -*/ -func (a *Client) QueryByID(params *QueryByIDParams, opts ...ClientOption) (*QueryByIDOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewQueryByIDParams() - } - op := &runtime.ClientOperation{ - ID: "QueryById", - Method: "GET", - PathPattern: "/loggingapi/entities/saved-searches/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &QueryByIDReader{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.(*QueryByIDOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for QueryById: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -QueryCombined queries for saved searches resources and returns details -*/ -func (a *Client) QueryCombined(params *QueryCombinedParams, opts ...ClientOption) (*QueryCombinedOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewQueryCombinedParams() - } - op := &runtime.ClientOperation{ - ID: "QueryCombined", - Method: "GET", - PathPattern: "/loggingapi/combined/saved-searches/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &QueryCombinedReader{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.(*QueryCombinedOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for QueryCombined: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -Result gets the results of a saved search -*/ -func (a *Client) Result(params *ResultParams, opts ...ClientOption) (*ResultOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewResultParams() - } - op := &runtime.ClientOperation{ - ID: "Result", - Method: "GET", - PathPattern: "/loggingapi/entities/saved-searches-execute/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ResultReader{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.(*ResultOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Result: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -UpdateSavedSearch updates a saved searches resource -*/ -func (a *Client) UpdateSavedSearch(params *UpdateSavedSearchParams, opts ...ClientOption) (*UpdateSavedSearchOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateSavedSearchParams() - } - op := &runtime.ClientOperation{ - ID: "UpdateSavedSearch", - Method: "PATCH", - PathPattern: "/loggingapi/entities/saved-searches/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateSavedSearchReader{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.(*UpdateSavedSearchOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for UpdateSavedSearch: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -Validate validates a search -*/ -func (a *Client) Validate(params *ValidateParams, opts ...ClientOption) (*ValidateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewValidateParams() - } - op := &runtime.ClientOperation{ - ID: "Validate", - Method: "POST", - PathPattern: "/loggingapi/entities/saved-searches-validate/v1", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ValidateReader{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.(*ValidateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for Validate: 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/saved_searches/update_saved_search_parameters.go b/falcon/client/saved_searches/update_saved_search_parameters.go deleted file mode 100644 index 367c7aa3..00000000 --- a/falcon/client/saved_searches/update_saved_search_parameters.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewUpdateSavedSearchParams creates a new UpdateSavedSearchParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateSavedSearchParams() *UpdateSavedSearchParams { - return &UpdateSavedSearchParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateSavedSearchParamsWithTimeout creates a new UpdateSavedSearchParams object -// with the ability to set a timeout on a request. -func NewUpdateSavedSearchParamsWithTimeout(timeout time.Duration) *UpdateSavedSearchParams { - return &UpdateSavedSearchParams{ - timeout: timeout, - } -} - -// NewUpdateSavedSearchParamsWithContext creates a new UpdateSavedSearchParams object -// with the ability to set a context for a request. -func NewUpdateSavedSearchParamsWithContext(ctx context.Context) *UpdateSavedSearchParams { - return &UpdateSavedSearchParams{ - Context: ctx, - } -} - -// NewUpdateSavedSearchParamsWithHTTPClient creates a new UpdateSavedSearchParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateSavedSearchParamsWithHTTPClient(client *http.Client) *UpdateSavedSearchParams { - return &UpdateSavedSearchParams{ - HTTPClient: client, - } -} - -/* -UpdateSavedSearchParams contains all the parameters to send to the API endpoint - - for the update saved search operation. - - Typically these are written to a http.Request. -*/ -type UpdateSavedSearchParams struct { - - /* XCSCREATEORIGIN. - - Create / Update request origin . - */ - XCSCREATEORIGIN *string - - /* XCsAppName. - - App name used to name repository and workflow action - */ - XCsAppName *string - - // Body. - Body *models.ApidomainSavedSearchUpdateRequestV1 - - /* Version. - - Version of resource being created - */ - Version *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update saved search params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateSavedSearchParams) WithDefaults() *UpdateSavedSearchParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update saved search params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateSavedSearchParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update saved search params -func (o *UpdateSavedSearchParams) WithTimeout(timeout time.Duration) *UpdateSavedSearchParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update saved search params -func (o *UpdateSavedSearchParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update saved search params -func (o *UpdateSavedSearchParams) WithContext(ctx context.Context) *UpdateSavedSearchParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update saved search params -func (o *UpdateSavedSearchParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update saved search params -func (o *UpdateSavedSearchParams) WithHTTPClient(client *http.Client) *UpdateSavedSearchParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update saved search params -func (o *UpdateSavedSearchParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithXCSCREATEORIGIN adds the xCSCREATEORIGIN to the update saved search params -func (o *UpdateSavedSearchParams) WithXCSCREATEORIGIN(xCSCREATEORIGIN *string) *UpdateSavedSearchParams { - o.SetXCSCREATEORIGIN(xCSCREATEORIGIN) - return o -} - -// SetXCSCREATEORIGIN adds the xCSCREATEORIGIN to the update saved search params -func (o *UpdateSavedSearchParams) SetXCSCREATEORIGIN(xCSCREATEORIGIN *string) { - o.XCSCREATEORIGIN = xCSCREATEORIGIN -} - -// WithXCsAppName adds the xCsAppName to the update saved search params -func (o *UpdateSavedSearchParams) WithXCsAppName(xCsAppName *string) *UpdateSavedSearchParams { - o.SetXCsAppName(xCsAppName) - return o -} - -// SetXCsAppName adds the xCsAppName to the update saved search params -func (o *UpdateSavedSearchParams) SetXCsAppName(xCsAppName *string) { - o.XCsAppName = xCsAppName -} - -// WithBody adds the body to the update saved search params -func (o *UpdateSavedSearchParams) WithBody(body *models.ApidomainSavedSearchUpdateRequestV1) *UpdateSavedSearchParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update saved search params -func (o *UpdateSavedSearchParams) SetBody(body *models.ApidomainSavedSearchUpdateRequestV1) { - o.Body = body -} - -// WithVersion adds the version to the update saved search params -func (o *UpdateSavedSearchParams) WithVersion(version *string) *UpdateSavedSearchParams { - o.SetVersion(version) - return o -} - -// SetVersion adds the version to the update saved search params -func (o *UpdateSavedSearchParams) SetVersion(version *string) { - o.Version = version -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateSavedSearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.XCSCREATEORIGIN != nil { - - // header param X-CS-CREATE-ORIGIN - if err := r.SetHeaderParam("X-CS-CREATE-ORIGIN", *o.XCSCREATEORIGIN); err != nil { - return err - } - } - - if o.XCsAppName != nil { - - // header param X-Cs-App-Name - if err := r.SetHeaderParam("X-Cs-App-Name", *o.XCsAppName); err != nil { - return err - } - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if o.Version != nil { - - // query param version - var qrVersion string - - if o.Version != nil { - qrVersion = *o.Version - } - qVersion := qrVersion - if qVersion != "" { - - if err := r.SetQueryParam("version", qVersion); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/falcon/client/saved_searches/update_saved_search_responses.go b/falcon/client/saved_searches/update_saved_search_responses.go deleted file mode 100644 index 8029ef11..00000000 --- a/falcon/client/saved_searches/update_saved_search_responses.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by 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" -) - -// UpdateSavedSearchReader is a Reader for the UpdateSavedSearch structure. -type UpdateSavedSearchReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateSavedSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateSavedSearchOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewUpdateSavedSearchForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewUpdateSavedSearchTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /loggingapi/entities/saved-searches/v1] UpdateSavedSearch", response, response.Code()) - } -} - -// NewUpdateSavedSearchOK creates a UpdateSavedSearchOK with default headers values -func NewUpdateSavedSearchOK() *UpdateSavedSearchOK { - return &UpdateSavedSearchOK{} -} - -/* -UpdateSavedSearchOK describes a response with status code 200, with default header values. - -OK -*/ -type UpdateSavedSearchOK 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.DomainSavedSearchWrapper -} - -// IsSuccess returns true when this update saved search o k response has a 2xx status code -func (o *UpdateSavedSearchOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update saved search o k response has a 3xx status code -func (o *UpdateSavedSearchOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update saved search o k response has a 4xx status code -func (o *UpdateSavedSearchOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update saved search o k response has a 5xx status code -func (o *UpdateSavedSearchOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update saved search o k response a status code equal to that given -func (o *UpdateSavedSearchOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update saved search o k response -func (o *UpdateSavedSearchOK) Code() int { - return 200 -} - -func (o *UpdateSavedSearchOK) Error() string { - return fmt.Sprintf("[PATCH /loggingapi/entities/saved-searches/v1][%d] updateSavedSearchOK %+v", 200, o.Payload) -} - -func (o *UpdateSavedSearchOK) String() string { - return fmt.Sprintf("[PATCH /loggingapi/entities/saved-searches/v1][%d] updateSavedSearchOK %+v", 200, o.Payload) -} - -func (o *UpdateSavedSearchOK) GetPayload() *models.DomainSavedSearchWrapper { - return o.Payload -} - -func (o *UpdateSavedSearchOK) 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.DomainSavedSearchWrapper) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateSavedSearchForbidden creates a UpdateSavedSearchForbidden with default headers values -func NewUpdateSavedSearchForbidden() *UpdateSavedSearchForbidden { - return &UpdateSavedSearchForbidden{} -} - -/* -UpdateSavedSearchForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type UpdateSavedSearchForbidden 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 update saved search forbidden response has a 2xx status code -func (o *UpdateSavedSearchForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update saved search forbidden response has a 3xx status code -func (o *UpdateSavedSearchForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update saved search forbidden response has a 4xx status code -func (o *UpdateSavedSearchForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update saved search forbidden response has a 5xx status code -func (o *UpdateSavedSearchForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update saved search forbidden response a status code equal to that given -func (o *UpdateSavedSearchForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update saved search forbidden response -func (o *UpdateSavedSearchForbidden) Code() int { - return 403 -} - -func (o *UpdateSavedSearchForbidden) Error() string { - return fmt.Sprintf("[PATCH /loggingapi/entities/saved-searches/v1][%d] updateSavedSearchForbidden %+v", 403, o.Payload) -} - -func (o *UpdateSavedSearchForbidden) String() string { - return fmt.Sprintf("[PATCH /loggingapi/entities/saved-searches/v1][%d] updateSavedSearchForbidden %+v", 403, o.Payload) -} - -func (o *UpdateSavedSearchForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *UpdateSavedSearchForbidden) 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 -} - -// NewUpdateSavedSearchTooManyRequests creates a UpdateSavedSearchTooManyRequests with default headers values -func NewUpdateSavedSearchTooManyRequests() *UpdateSavedSearchTooManyRequests { - return &UpdateSavedSearchTooManyRequests{} -} - -/* -UpdateSavedSearchTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type UpdateSavedSearchTooManyRequests 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 saved search too many requests response has a 2xx status code -func (o *UpdateSavedSearchTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update saved search too many requests response has a 3xx status code -func (o *UpdateSavedSearchTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update saved search too many requests response has a 4xx status code -func (o *UpdateSavedSearchTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this update saved search too many requests response has a 5xx status code -func (o *UpdateSavedSearchTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this update saved search too many requests response a status code equal to that given -func (o *UpdateSavedSearchTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the update saved search too many requests response -func (o *UpdateSavedSearchTooManyRequests) Code() int { - return 429 -} - -func (o *UpdateSavedSearchTooManyRequests) Error() string { - return fmt.Sprintf("[PATCH /loggingapi/entities/saved-searches/v1][%d] updateSavedSearchTooManyRequests %+v", 429, o.Payload) -} - -func (o *UpdateSavedSearchTooManyRequests) String() string { - return fmt.Sprintf("[PATCH /loggingapi/entities/saved-searches/v1][%d] updateSavedSearchTooManyRequests %+v", 429, o.Payload) -} - -func (o *UpdateSavedSearchTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *UpdateSavedSearchTooManyRequests) 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/saved_searches/validate_parameters.go b/falcon/client/saved_searches/validate_parameters.go deleted file mode 100644 index b82cb6f7..00000000 --- a/falcon/client/saved_searches/validate_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package saved_searches - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/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" -) - -// NewValidateParams creates a new ValidateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewValidateParams() *ValidateParams { - return &ValidateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewValidateParamsWithTimeout creates a new ValidateParams object -// with the ability to set a timeout on a request. -func NewValidateParamsWithTimeout(timeout time.Duration) *ValidateParams { - return &ValidateParams{ - timeout: timeout, - } -} - -// NewValidateParamsWithContext creates a new ValidateParams object -// with the ability to set a context for a request. -func NewValidateParamsWithContext(ctx context.Context) *ValidateParams { - return &ValidateParams{ - Context: ctx, - } -} - -// NewValidateParamsWithHTTPClient creates a new ValidateParams object -// with the ability to set a custom HTTPClient for a request. -func NewValidateParamsWithHTTPClient(client *http.Client) *ValidateParams { - return &ValidateParams{ - HTTPClient: client, - } -} - -/* -ValidateParams contains all the parameters to send to the API endpoint - - for the validate operation. - - Typically these are written to a http.Request. -*/ -type ValidateParams struct { - - // Body. - Body *models.ApidomainQueryValidateRequestV1 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the validate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ValidateParams) WithDefaults() *ValidateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the validate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ValidateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the validate params -func (o *ValidateParams) WithTimeout(timeout time.Duration) *ValidateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the validate params -func (o *ValidateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the validate params -func (o *ValidateParams) WithContext(ctx context.Context) *ValidateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the validate params -func (o *ValidateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the validate params -func (o *ValidateParams) WithHTTPClient(client *http.Client) *ValidateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the validate params -func (o *ValidateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the validate params -func (o *ValidateParams) WithBody(body *models.ApidomainQueryValidateRequestV1) *ValidateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the validate params -func (o *ValidateParams) SetBody(body *models.ApidomainQueryValidateRequestV1) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ValidateParams) 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/snapshots_registration/register_parameters.go b/falcon/client/snapshots_registration/register_parameters.go new file mode 100644 index 00000000..6f4f0236 --- /dev/null +++ b/falcon/client/snapshots_registration/register_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package snapshots_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" +) + +// NewRegisterParams creates a new RegisterParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRegisterParams() *RegisterParams { + return &RegisterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRegisterParamsWithTimeout creates a new RegisterParams object +// with the ability to set a timeout on a request. +func NewRegisterParamsWithTimeout(timeout time.Duration) *RegisterParams { + return &RegisterParams{ + timeout: timeout, + } +} + +// NewRegisterParamsWithContext creates a new RegisterParams object +// with the ability to set a context for a request. +func NewRegisterParamsWithContext(ctx context.Context) *RegisterParams { + return &RegisterParams{ + Context: ctx, + } +} + +// NewRegisterParamsWithHTTPClient creates a new RegisterParams object +// with the ability to set a custom HTTPClient for a request. +func NewRegisterParamsWithHTTPClient(client *http.Client) *RegisterParams { + return &RegisterParams{ + HTTPClient: client, + } +} + +/* +RegisterParams contains all the parameters to send to the API endpoint + + for the register operation. + + Typically these are written to a http.Request. +*/ +type RegisterParams struct { + + // Body. + Body *models.ModelsAccountEntitiesInput + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the register params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegisterParams) WithDefaults() *RegisterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the register params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegisterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the register params +func (o *RegisterParams) WithTimeout(timeout time.Duration) *RegisterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the register params +func (o *RegisterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the register params +func (o *RegisterParams) WithContext(ctx context.Context) *RegisterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the register params +func (o *RegisterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the register params +func (o *RegisterParams) WithHTTPClient(client *http.Client) *RegisterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the register params +func (o *RegisterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the register params +func (o *RegisterParams) WithBody(body *models.ModelsAccountEntitiesInput) *RegisterParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the register params +func (o *RegisterParams) SetBody(body *models.ModelsAccountEntitiesInput) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *RegisterParams) 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/snapshots_registration/register_responses.go b/falcon/client/snapshots_registration/register_responses.go new file mode 100644 index 00000000..83cfd515 --- /dev/null +++ b/falcon/client/snapshots_registration/register_responses.go @@ -0,0 +1,626 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package snapshots_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" +) + +// RegisterReader is a Reader for the Register structure. +type RegisterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RegisterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRegisterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewRegisterBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewRegisterForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewRegisterTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewRegisterInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /snapshots/entities/accounts/v1] Register", response, response.Code()) + } +} + +// NewRegisterOK creates a RegisterOK with default headers values +func NewRegisterOK() *RegisterOK { + return &RegisterOK{} +} + +/* +RegisterOK describes a response with status code 200, with default header values. + +OK +*/ +type RegisterOK 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.ModelsAccountStatusResponse +} + +// IsSuccess returns true when this register o k response has a 2xx status code +func (o *RegisterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this register o k response has a 3xx status code +func (o *RegisterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register o k response has a 4xx status code +func (o *RegisterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this register o k response has a 5xx status code +func (o *RegisterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this register o k response a status code equal to that given +func (o *RegisterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the register o k response +func (o *RegisterOK) Code() int { + return 200 +} + +func (o *RegisterOK) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerOK %+v", 200, o.Payload) +} + +func (o *RegisterOK) String() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerOK %+v", 200, o.Payload) +} + +func (o *RegisterOK) GetPayload() *models.ModelsAccountStatusResponse { + return o.Payload +} + +func (o *RegisterOK) 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.ModelsAccountStatusResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRegisterBadRequest creates a RegisterBadRequest with default headers values +func NewRegisterBadRequest() *RegisterBadRequest { + return &RegisterBadRequest{} +} + +/* +RegisterBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type RegisterBadRequest 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 register bad request response has a 2xx status code +func (o *RegisterBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this register bad request response has a 3xx status code +func (o *RegisterBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register bad request response has a 4xx status code +func (o *RegisterBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this register bad request response has a 5xx status code +func (o *RegisterBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this register bad request response a status code equal to that given +func (o *RegisterBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the register bad request response +func (o *RegisterBadRequest) Code() int { + return 400 +} + +func (o *RegisterBadRequest) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerBadRequest %+v", 400, o.Payload) +} + +func (o *RegisterBadRequest) String() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerBadRequest %+v", 400, o.Payload) +} + +func (o *RegisterBadRequest) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *RegisterBadRequest) 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 +} + +// NewRegisterForbidden creates a RegisterForbidden with default headers values +func NewRegisterForbidden() *RegisterForbidden { + return &RegisterForbidden{} +} + +/* +RegisterForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type RegisterForbidden 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 register forbidden response has a 2xx status code +func (o *RegisterForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this register forbidden response has a 3xx status code +func (o *RegisterForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register forbidden response has a 4xx status code +func (o *RegisterForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this register forbidden response has a 5xx status code +func (o *RegisterForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this register forbidden response a status code equal to that given +func (o *RegisterForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the register forbidden response +func (o *RegisterForbidden) Code() int { + return 403 +} + +func (o *RegisterForbidden) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerForbidden %+v", 403, o.Payload) +} + +func (o *RegisterForbidden) String() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerForbidden %+v", 403, o.Payload) +} + +func (o *RegisterForbidden) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *RegisterForbidden) 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 +} + +// NewRegisterTooManyRequests creates a RegisterTooManyRequests with default headers values +func NewRegisterTooManyRequests() *RegisterTooManyRequests { + return &RegisterTooManyRequests{} +} + +/* +RegisterTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type RegisterTooManyRequests 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 register too many requests response has a 2xx status code +func (o *RegisterTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this register too many requests response has a 3xx status code +func (o *RegisterTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register too many requests response has a 4xx status code +func (o *RegisterTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this register too many requests response has a 5xx status code +func (o *RegisterTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this register too many requests response a status code equal to that given +func (o *RegisterTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the register too many requests response +func (o *RegisterTooManyRequests) Code() int { + return 429 +} + +func (o *RegisterTooManyRequests) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerTooManyRequests %+v", 429, o.Payload) +} + +func (o *RegisterTooManyRequests) String() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerTooManyRequests %+v", 429, o.Payload) +} + +func (o *RegisterTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *RegisterTooManyRequests) 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 +} + +// NewRegisterInternalServerError creates a RegisterInternalServerError with default headers values +func NewRegisterInternalServerError() *RegisterInternalServerError { + return &RegisterInternalServerError{} +} + +/* +RegisterInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type RegisterInternalServerError 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 register internal server error response has a 2xx status code +func (o *RegisterInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this register internal server error response has a 3xx status code +func (o *RegisterInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this register internal server error response has a 4xx status code +func (o *RegisterInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this register internal server error response has a 5xx status code +func (o *RegisterInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this register internal server error response a status code equal to that given +func (o *RegisterInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the register internal server error response +func (o *RegisterInternalServerError) Code() int { + return 500 +} + +func (o *RegisterInternalServerError) Error() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerInternalServerError %+v", 500, o.Payload) +} + +func (o *RegisterInternalServerError) String() string { + return fmt.Sprintf("[POST /snapshots/entities/accounts/v1][%d] registerInternalServerError %+v", 500, o.Payload) +} + +func (o *RegisterInternalServerError) GetPayload() *models.MsaspecResponseFields { + return o.Payload +} + +func (o *RegisterInternalServerError) 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/inventories/inventories_client.go b/falcon/client/snapshots_registration/snapshots_registration_client.go similarity index 67% rename from falcon/client/inventories/inventories_client.go rename to falcon/client/snapshots_registration/snapshots_registration_client.go index 8959c21f..5841ef1d 100644 --- a/falcon/client/inventories/inventories_client.go +++ b/falcon/client/snapshots_registration/snapshots_registration_client.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package inventories +package snapshots_registration // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -12,13 +12,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new inventories API client. +// New creates a new snapshots registration API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for inventories API +Client for snapshots registration API */ type Client struct { transport runtime.ClientTransport @@ -30,28 +30,28 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - CreateInventory(params *CreateInventoryParams, opts ...ClientOption) (*CreateInventoryOK, error) + Register(params *RegisterParams, opts ...ClientOption) (*RegisterOK, error) SetTransport(transport runtime.ClientTransport) } /* -CreateInventory creates inventory from data received from snapshot +Register registers customer cloud account for snapshot scanning */ -func (a *Client) CreateInventory(params *CreateInventoryParams, opts ...ClientOption) (*CreateInventoryOK, error) { +func (a *Client) Register(params *RegisterParams, opts ...ClientOption) (*RegisterOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewCreateInventoryParams() + params = NewRegisterParams() } op := &runtime.ClientOperation{ - ID: "CreateInventory", + ID: "Register", Method: "POST", - PathPattern: "/snapshots/entities/inventories/v1", + PathPattern: "/snapshots/entities/accounts/v1", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &CreateInventoryReader{formats: a.formats}, + Reader: &RegisterReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -63,13 +63,13 @@ func (a *Client) CreateInventory(params *CreateInventoryParams, opts ...ClientOp if err != nil { return nil, err } - success, ok := result.(*CreateInventoryOK) + success, ok := result.(*RegisterOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for CreateInventory: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for Register: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/falcon/client/vulnerabilities_evaluation_logic/combined_query_evaluation_logic_parameters.go b/falcon/client/spotlight_evaluation_logic/combined_query_evaluation_logic_parameters.go similarity index 99% rename from falcon/client/vulnerabilities_evaluation_logic/combined_query_evaluation_logic_parameters.go rename to falcon/client/spotlight_evaluation_logic/combined_query_evaluation_logic_parameters.go index 4fbbe4e4..2ec71ae3 100644 --- a/falcon/client/vulnerabilities_evaluation_logic/combined_query_evaluation_logic_parameters.go +++ b/falcon/client/spotlight_evaluation_logic/combined_query_evaluation_logic_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities_evaluation_logic +package spotlight_evaluation_logic // 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/vulnerabilities_evaluation_logic/combined_query_evaluation_logic_responses.go b/falcon/client/spotlight_evaluation_logic/combined_query_evaluation_logic_responses.go similarity index 99% rename from falcon/client/vulnerabilities_evaluation_logic/combined_query_evaluation_logic_responses.go rename to falcon/client/spotlight_evaluation_logic/combined_query_evaluation_logic_responses.go index 460a505b..7456e78f 100644 --- a/falcon/client/vulnerabilities_evaluation_logic/combined_query_evaluation_logic_responses.go +++ b/falcon/client/spotlight_evaluation_logic/combined_query_evaluation_logic_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities_evaluation_logic +package spotlight_evaluation_logic // 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/vulnerabilities_evaluation_logic/get_evaluation_logic_parameters.go b/falcon/client/spotlight_evaluation_logic/get_evaluation_logic_parameters.go similarity index 99% rename from falcon/client/vulnerabilities_evaluation_logic/get_evaluation_logic_parameters.go rename to falcon/client/spotlight_evaluation_logic/get_evaluation_logic_parameters.go index dbd99a00..aa49bff2 100644 --- a/falcon/client/vulnerabilities_evaluation_logic/get_evaluation_logic_parameters.go +++ b/falcon/client/spotlight_evaluation_logic/get_evaluation_logic_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities_evaluation_logic +package spotlight_evaluation_logic // 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/vulnerabilities_evaluation_logic/get_evaluation_logic_responses.go b/falcon/client/spotlight_evaluation_logic/get_evaluation_logic_responses.go similarity index 99% rename from falcon/client/vulnerabilities_evaluation_logic/get_evaluation_logic_responses.go rename to falcon/client/spotlight_evaluation_logic/get_evaluation_logic_responses.go index bac0cc63..893a32e3 100644 --- a/falcon/client/vulnerabilities_evaluation_logic/get_evaluation_logic_responses.go +++ b/falcon/client/spotlight_evaluation_logic/get_evaluation_logic_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities_evaluation_logic +package spotlight_evaluation_logic // 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/vulnerabilities_evaluation_logic/query_evaluation_logic_parameters.go b/falcon/client/spotlight_evaluation_logic/query_evaluation_logic_parameters.go similarity index 99% rename from falcon/client/vulnerabilities_evaluation_logic/query_evaluation_logic_parameters.go rename to falcon/client/spotlight_evaluation_logic/query_evaluation_logic_parameters.go index 6d428fac..43955c12 100644 --- a/falcon/client/vulnerabilities_evaluation_logic/query_evaluation_logic_parameters.go +++ b/falcon/client/spotlight_evaluation_logic/query_evaluation_logic_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities_evaluation_logic +package spotlight_evaluation_logic // 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/vulnerabilities_evaluation_logic/query_evaluation_logic_responses.go b/falcon/client/spotlight_evaluation_logic/query_evaluation_logic_responses.go similarity index 99% rename from falcon/client/vulnerabilities_evaluation_logic/query_evaluation_logic_responses.go rename to falcon/client/spotlight_evaluation_logic/query_evaluation_logic_responses.go index 782024eb..fb15cad1 100644 --- a/falcon/client/vulnerabilities_evaluation_logic/query_evaluation_logic_responses.go +++ b/falcon/client/spotlight_evaluation_logic/query_evaluation_logic_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities_evaluation_logic +package spotlight_evaluation_logic // 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/vulnerabilities_evaluation_logic/vulnerabilities_evaluation_logic_client.go b/falcon/client/spotlight_evaluation_logic/spotlight_evaluation_logic_client.go similarity index 97% rename from falcon/client/vulnerabilities_evaluation_logic/vulnerabilities_evaluation_logic_client.go rename to falcon/client/spotlight_evaluation_logic/spotlight_evaluation_logic_client.go index 8501788a..07fb6107 100644 --- a/falcon/client/vulnerabilities_evaluation_logic/vulnerabilities_evaluation_logic_client.go +++ b/falcon/client/spotlight_evaluation_logic/spotlight_evaluation_logic_client.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities_evaluation_logic +package spotlight_evaluation_logic // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -12,13 +12,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new vulnerabilities evaluation logic API client. +// New creates a new spotlight evaluation logic API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for vulnerabilities evaluation logic API +Client for spotlight evaluation logic API */ type Client struct { transport runtime.ClientTransport diff --git a/falcon/client/vulnerabilities/combined_query_vulnerabilities_parameters.go b/falcon/client/spotlight_vulnerabilities/combined_query_vulnerabilities_parameters.go similarity index 96% rename from falcon/client/vulnerabilities/combined_query_vulnerabilities_parameters.go rename to falcon/client/spotlight_vulnerabilities/combined_query_vulnerabilities_parameters.go index e7447fa3..9a2ed28d 100644 --- a/falcon/client/vulnerabilities/combined_query_vulnerabilities_parameters.go +++ b/falcon/client/spotlight_vulnerabilities/combined_query_vulnerabilities_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -80,7 +80,7 @@ type CombinedQueryVulnerabilitiesParams struct { Filter items using a query in Falcon Query Language (FQL). Wildcards * and empty filter values are unsupported. Available filter fields that supports match (~): N/A - Available filter fields that supports exact match: aid, cid, last_seen_within, status, cve.id, cve.is_cisa_kev, cve.remediation_level, cve.cps_rating, cve.exprt_rating, cve.exploit_status_to_include, cve.severity, host_info.asset_criticality, host_info.asset_roles, host_info.internet_exposure, host_info.tags, host_info.groups, host_info.product_type_desc, host_info.platform_name, suppression_info.is_suppressed, suppression_info.reason + Available filter fields that supports exact match: aid, cid, last_seen_within, status, cve.id, cve.is_cisa_kev, cve.remediation_level, cve.cps_rating, cve.exprt_rating, cve.exploit_status_to_include, cve.severity, cve.types, host_info.asset_criticality, host_info.asset_roles, host_info.internet_exposure, host_info.tags, host_info.groups, host_info.product_type_desc, host_info.platform_name, suppression_info.is_suppressed, suppression_info.reason Available filter fields that supports wildcard (*): N/A Available filter fields that supports range comparisons (>, <, >=, <=): created_timestamp, closed_timestamp, updated_timestamp diff --git a/falcon/client/vulnerabilities/combined_query_vulnerabilities_responses.go b/falcon/client/spotlight_vulnerabilities/combined_query_vulnerabilities_responses.go similarity index 99% rename from falcon/client/vulnerabilities/combined_query_vulnerabilities_responses.go rename to falcon/client/spotlight_vulnerabilities/combined_query_vulnerabilities_responses.go index 7f502b8e..857b7db6 100644 --- a/falcon/client/vulnerabilities/combined_query_vulnerabilities_responses.go +++ b/falcon/client/spotlight_vulnerabilities/combined_query_vulnerabilities_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // 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/vulnerabilities/get_remediations_v2_parameters.go b/falcon/client/spotlight_vulnerabilities/get_remediations_v2_parameters.go similarity index 99% rename from falcon/client/vulnerabilities/get_remediations_v2_parameters.go rename to falcon/client/spotlight_vulnerabilities/get_remediations_v2_parameters.go index cbc78874..c37c8fc9 100644 --- a/falcon/client/vulnerabilities/get_remediations_v2_parameters.go +++ b/falcon/client/spotlight_vulnerabilities/get_remediations_v2_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // 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/vulnerabilities/get_remediations_v2_responses.go b/falcon/client/spotlight_vulnerabilities/get_remediations_v2_responses.go similarity index 99% rename from falcon/client/vulnerabilities/get_remediations_v2_responses.go rename to falcon/client/spotlight_vulnerabilities/get_remediations_v2_responses.go index 788e28ca..03c196f5 100644 --- a/falcon/client/vulnerabilities/get_remediations_v2_responses.go +++ b/falcon/client/spotlight_vulnerabilities/get_remediations_v2_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // 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/vulnerabilities/get_vulnerabilities_parameters.go b/falcon/client/spotlight_vulnerabilities/get_vulnerabilities_parameters.go similarity index 99% rename from falcon/client/vulnerabilities/get_vulnerabilities_parameters.go rename to falcon/client/spotlight_vulnerabilities/get_vulnerabilities_parameters.go index c14f730d..0f9b7fbf 100644 --- a/falcon/client/vulnerabilities/get_vulnerabilities_parameters.go +++ b/falcon/client/spotlight_vulnerabilities/get_vulnerabilities_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // 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/vulnerabilities/get_vulnerabilities_responses.go b/falcon/client/spotlight_vulnerabilities/get_vulnerabilities_responses.go similarity index 99% rename from falcon/client/vulnerabilities/get_vulnerabilities_responses.go rename to falcon/client/spotlight_vulnerabilities/get_vulnerabilities_responses.go index be64d3df..53303786 100644 --- a/falcon/client/vulnerabilities/get_vulnerabilities_responses.go +++ b/falcon/client/spotlight_vulnerabilities/get_vulnerabilities_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // 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/vulnerabilities/query_vulnerabilities_parameters.go b/falcon/client/spotlight_vulnerabilities/query_vulnerabilities_parameters.go similarity index 96% rename from falcon/client/vulnerabilities/query_vulnerabilities_parameters.go rename to falcon/client/spotlight_vulnerabilities/query_vulnerabilities_parameters.go index 3ce0da47..dfc62829 100644 --- a/falcon/client/vulnerabilities/query_vulnerabilities_parameters.go +++ b/falcon/client/spotlight_vulnerabilities/query_vulnerabilities_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -72,7 +72,7 @@ type QueryVulnerabilitiesParams struct { Filter items using a query in Falcon Query Language (FQL). Wildcards * and empty filter values are unsupported. Available filter fields that supports match (~): N/A - Available filter fields that supports exact match: aid, cid, last_seen_within, status, cve.id, cve.is_cisa_kev, cve.remediation_level, cve.cps_rating, cve.exprt_rating, cve.exploit_status_to_include, cve.severity, host_info.asset_criticality, host_info.asset_roles, host_info.internet_exposure, host_info.tags, host_info.groups, host_info.product_type_desc, host_info.platform_name, suppression_info.is_suppressed, suppression_info.reason + Available filter fields that supports exact match: aid, cid, last_seen_within, status, cve.id, cve.is_cisa_kev, cve.remediation_level, cve.cps_rating, cve.exprt_rating, cve.exploit_status_to_include, cve.severity, cve.types, host_info.asset_criticality, host_info.asset_roles, host_info.internet_exposure, host_info.tags, host_info.groups, host_info.product_type_desc, host_info.platform_name, suppression_info.is_suppressed, suppression_info.reason Available filter fields that supports wildcard (*): N/A Available filter fields that supports range comparisons (>, <, >=, <=): created_timestamp, closed_timestamp, updated_timestamp diff --git a/falcon/client/vulnerabilities/query_vulnerabilities_responses.go b/falcon/client/spotlight_vulnerabilities/query_vulnerabilities_responses.go similarity index 99% rename from falcon/client/vulnerabilities/query_vulnerabilities_responses.go rename to falcon/client/spotlight_vulnerabilities/query_vulnerabilities_responses.go index 22d06064..b96d97e7 100644 --- a/falcon/client/vulnerabilities/query_vulnerabilities_responses.go +++ b/falcon/client/spotlight_vulnerabilities/query_vulnerabilities_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // 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/vulnerabilities/vulnerabilities_client.go b/falcon/client/spotlight_vulnerabilities/spotlight_vulnerabilities_client.go similarity index 98% rename from falcon/client/vulnerabilities/vulnerabilities_client.go rename to falcon/client/spotlight_vulnerabilities/spotlight_vulnerabilities_client.go index 09d8d2c7..e7f191ab 100644 --- a/falcon/client/vulnerabilities/vulnerabilities_client.go +++ b/falcon/client/spotlight_vulnerabilities/spotlight_vulnerabilities_client.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package vulnerabilities +package spotlight_vulnerabilities // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -12,13 +12,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new vulnerabilities API client. +// New creates a new spotlight vulnerabilities API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for vulnerabilities API +Client for spotlight vulnerabilities API */ type Client struct { transport runtime.ClientTransport diff --git a/falcon/client/unidentified_containers/count_by_date_range_parameters.go b/falcon/client/unidentified_containers/count_by_date_range_parameters.go new file mode 100644 index 00000000..c0c7c2af --- /dev/null +++ b/falcon/client/unidentified_containers/count_by_date_range_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package unidentified_containers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCountByDateRangeParams creates a new CountByDateRangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCountByDateRangeParams() *CountByDateRangeParams { + return &CountByDateRangeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCountByDateRangeParamsWithTimeout creates a new CountByDateRangeParams object +// with the ability to set a timeout on a request. +func NewCountByDateRangeParamsWithTimeout(timeout time.Duration) *CountByDateRangeParams { + return &CountByDateRangeParams{ + timeout: timeout, + } +} + +// NewCountByDateRangeParamsWithContext creates a new CountByDateRangeParams object +// with the ability to set a context for a request. +func NewCountByDateRangeParamsWithContext(ctx context.Context) *CountByDateRangeParams { + return &CountByDateRangeParams{ + Context: ctx, + } +} + +// NewCountByDateRangeParamsWithHTTPClient creates a new CountByDateRangeParams object +// with the ability to set a custom HTTPClient for a request. +func NewCountByDateRangeParamsWithHTTPClient(client *http.Client) *CountByDateRangeParams { + return &CountByDateRangeParams{ + HTTPClient: client, + } +} + +/* +CountByDateRangeParams contains all the parameters to send to the API endpoint + + for the count by date range operation. + + Typically these are written to a http.Request. +*/ +type CountByDateRangeParams struct { + + /* Filter. + + Filter Unidentified Containers using a query in Falcon Query Language (FQL). Supported filters: assessed_images_count,cid,cluster_name,containers_impacted_count,detections_count,image_assessment_detections_count,last_seen,namespace,node_name,severity,unassessed_images_count,visible_to_k8s + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the count by date range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CountByDateRangeParams) WithDefaults() *CountByDateRangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the count by date range params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CountByDateRangeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the count by date range params +func (o *CountByDateRangeParams) WithTimeout(timeout time.Duration) *CountByDateRangeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the count by date range params +func (o *CountByDateRangeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the count by date range params +func (o *CountByDateRangeParams) WithContext(ctx context.Context) *CountByDateRangeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the count by date range params +func (o *CountByDateRangeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the count by date range params +func (o *CountByDateRangeParams) WithHTTPClient(client *http.Client) *CountByDateRangeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the count by date range params +func (o *CountByDateRangeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the count by date range params +func (o *CountByDateRangeParams) WithFilter(filter *string) *CountByDateRangeParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the count by date range params +func (o *CountByDateRangeParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *CountByDateRangeParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/unidentified_containers/count_by_date_range_responses.go b/falcon/client/unidentified_containers/count_by_date_range_responses.go new file mode 100644 index 00000000..2b04e280 --- /dev/null +++ b/falcon/client/unidentified_containers/count_by_date_range_responses.go @@ -0,0 +1,510 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package unidentified_containers + +// This file was generated by 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" +) + +// CountByDateRangeReader is a Reader for the CountByDateRange structure. +type CountByDateRangeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CountByDateRangeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCountByDateRangeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewCountByDateRangeForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewCountByDateRangeTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCountByDateRangeInternalServerError() + 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/unidentified-containers/count-by-date/v1] CountByDateRange", response, response.Code()) + } +} + +// NewCountByDateRangeOK creates a CountByDateRangeOK with default headers values +func NewCountByDateRangeOK() *CountByDateRangeOK { + return &CountByDateRangeOK{} +} + +/* +CountByDateRangeOK describes a response with status code 200, with default header values. + +OK +*/ +type CountByDateRangeOK 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.ModelsAggregateValuesByFieldResponse +} + +// IsSuccess returns true when this count by date range o k response has a 2xx status code +func (o *CountByDateRangeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this count by date range o k response has a 3xx status code +func (o *CountByDateRangeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count by date range o k response has a 4xx status code +func (o *CountByDateRangeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this count by date range o k response has a 5xx status code +func (o *CountByDateRangeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this count by date range o k response a status code equal to that given +func (o *CountByDateRangeOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the count by date range o k response +func (o *CountByDateRangeOK) Code() int { + return 200 +} + +func (o *CountByDateRangeOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeOK %+v", 200, o.Payload) +} + +func (o *CountByDateRangeOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeOK %+v", 200, o.Payload) +} + +func (o *CountByDateRangeOK) GetPayload() *models.ModelsAggregateValuesByFieldResponse { + return o.Payload +} + +func (o *CountByDateRangeOK) 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.ModelsAggregateValuesByFieldResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCountByDateRangeForbidden creates a CountByDateRangeForbidden with default headers values +func NewCountByDateRangeForbidden() *CountByDateRangeForbidden { + return &CountByDateRangeForbidden{} +} + +/* +CountByDateRangeForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type CountByDateRangeForbidden 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 count by date range forbidden response has a 2xx status code +func (o *CountByDateRangeForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this count by date range forbidden response has a 3xx status code +func (o *CountByDateRangeForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count by date range forbidden response has a 4xx status code +func (o *CountByDateRangeForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this count by date range forbidden response has a 5xx status code +func (o *CountByDateRangeForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this count by date range forbidden response a status code equal to that given +func (o *CountByDateRangeForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the count by date range forbidden response +func (o *CountByDateRangeForbidden) Code() int { + return 403 +} + +func (o *CountByDateRangeForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeForbidden %+v", 403, o.Payload) +} + +func (o *CountByDateRangeForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeForbidden %+v", 403, o.Payload) +} + +func (o *CountByDateRangeForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *CountByDateRangeForbidden) 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 +} + +// NewCountByDateRangeTooManyRequests creates a CountByDateRangeTooManyRequests with default headers values +func NewCountByDateRangeTooManyRequests() *CountByDateRangeTooManyRequests { + return &CountByDateRangeTooManyRequests{} +} + +/* +CountByDateRangeTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type CountByDateRangeTooManyRequests 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 count by date range too many requests response has a 2xx status code +func (o *CountByDateRangeTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this count by date range too many requests response has a 3xx status code +func (o *CountByDateRangeTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count by date range too many requests response has a 4xx status code +func (o *CountByDateRangeTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this count by date range too many requests response has a 5xx status code +func (o *CountByDateRangeTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this count by date range too many requests response a status code equal to that given +func (o *CountByDateRangeTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the count by date range too many requests response +func (o *CountByDateRangeTooManyRequests) Code() int { + return 429 +} + +func (o *CountByDateRangeTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeTooManyRequests %+v", 429, o.Payload) +} + +func (o *CountByDateRangeTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeTooManyRequests %+v", 429, o.Payload) +} + +func (o *CountByDateRangeTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *CountByDateRangeTooManyRequests) 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 +} + +// NewCountByDateRangeInternalServerError creates a CountByDateRangeInternalServerError with default headers values +func NewCountByDateRangeInternalServerError() *CountByDateRangeInternalServerError { + return &CountByDateRangeInternalServerError{} +} + +/* +CountByDateRangeInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type CountByDateRangeInternalServerError 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 count by date range internal server error response has a 2xx status code +func (o *CountByDateRangeInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this count by date range internal server error response has a 3xx status code +func (o *CountByDateRangeInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count by date range internal server error response has a 4xx status code +func (o *CountByDateRangeInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this count by date range internal server error response has a 5xx status code +func (o *CountByDateRangeInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this count by date range internal server error response a status code equal to that given +func (o *CountByDateRangeInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the count by date range internal server error response +func (o *CountByDateRangeInternalServerError) Code() int { + return 500 +} + +func (o *CountByDateRangeInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeInternalServerError %+v", 500, o.Payload) +} + +func (o *CountByDateRangeInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count-by-date/v1][%d] countByDateRangeInternalServerError %+v", 500, o.Payload) +} + +func (o *CountByDateRangeInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *CountByDateRangeInternalServerError) 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/unidentified_containers/count_parameters.go b/falcon/client/unidentified_containers/count_parameters.go new file mode 100644 index 00000000..3772ae14 --- /dev/null +++ b/falcon/client/unidentified_containers/count_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package unidentified_containers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCountParams creates a new CountParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCountParams() *CountParams { + return &CountParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCountParamsWithTimeout creates a new CountParams object +// with the ability to set a timeout on a request. +func NewCountParamsWithTimeout(timeout time.Duration) *CountParams { + return &CountParams{ + timeout: timeout, + } +} + +// NewCountParamsWithContext creates a new CountParams object +// with the ability to set a context for a request. +func NewCountParamsWithContext(ctx context.Context) *CountParams { + return &CountParams{ + Context: ctx, + } +} + +// NewCountParamsWithHTTPClient creates a new CountParams object +// with the ability to set a custom HTTPClient for a request. +func NewCountParamsWithHTTPClient(client *http.Client) *CountParams { + return &CountParams{ + HTTPClient: client, + } +} + +/* +CountParams contains all the parameters to send to the API endpoint + + for the count operation. + + Typically these are written to a http.Request. +*/ +type CountParams struct { + + /* Filter. + + Filter Unidentified Containers using a query in Falcon Query Language (FQL). Supported filters: assessed_images_count,cid,cluster_name,containers_impacted_count,detections_count,image_assessment_detections_count,last_seen,namespace,node_name,severity,unassessed_images_count,visible_to_k8s + */ + Filter *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CountParams) WithDefaults() *CountParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the count params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CountParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the count params +func (o *CountParams) WithTimeout(timeout time.Duration) *CountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the count params +func (o *CountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the count params +func (o *CountParams) WithContext(ctx context.Context) *CountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the count params +func (o *CountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the count params +func (o *CountParams) WithHTTPClient(client *http.Client) *CountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the count params +func (o *CountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the count params +func (o *CountParams) WithFilter(filter *string) *CountParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the count params +func (o *CountParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WriteToRequest writes these params to a swagger request +func (o *CountParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/unidentified_containers/count_responses.go b/falcon/client/unidentified_containers/count_responses.go new file mode 100644 index 00000000..9885184c --- /dev/null +++ b/falcon/client/unidentified_containers/count_responses.go @@ -0,0 +1,510 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package unidentified_containers + +// This file was generated by 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" +) + +// CountReader is a Reader for the Count structure. +type CountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewCountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewCountTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCountInternalServerError() + 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/unidentified-containers/count/v1] Count", response, response.Code()) + } +} + +// NewCountOK creates a CountOK with default headers values +func NewCountOK() *CountOK { + return &CountOK{} +} + +/* +CountOK describes a response with status code 200, with default header values. + +OK +*/ +type CountOK 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.UnidentifiedcontainersUnidentifiedContainersCountValue +} + +// IsSuccess returns true when this count o k response has a 2xx status code +func (o *CountOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this count o k response has a 3xx status code +func (o *CountOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count o k response has a 4xx status code +func (o *CountOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this count o k response has a 5xx status code +func (o *CountOK) IsServerError() bool { + return false +} + +// IsCode returns true when this count o k response a status code equal to that given +func (o *CountOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the count o k response +func (o *CountOK) Code() int { + return 200 +} + +func (o *CountOK) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countOK %+v", 200, o.Payload) +} + +func (o *CountOK) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countOK %+v", 200, o.Payload) +} + +func (o *CountOK) GetPayload() *models.UnidentifiedcontainersUnidentifiedContainersCountValue { + return o.Payload +} + +func (o *CountOK) 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.UnidentifiedcontainersUnidentifiedContainersCountValue) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCountForbidden creates a CountForbidden with default headers values +func NewCountForbidden() *CountForbidden { + return &CountForbidden{} +} + +/* +CountForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type CountForbidden 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 count forbidden response has a 2xx status code +func (o *CountForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this count forbidden response has a 3xx status code +func (o *CountForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count forbidden response has a 4xx status code +func (o *CountForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this count forbidden response has a 5xx status code +func (o *CountForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this count forbidden response a status code equal to that given +func (o *CountForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the count forbidden response +func (o *CountForbidden) Code() int { + return 403 +} + +func (o *CountForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countForbidden %+v", 403, o.Payload) +} + +func (o *CountForbidden) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countForbidden %+v", 403, o.Payload) +} + +func (o *CountForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *CountForbidden) 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 +} + +// NewCountTooManyRequests creates a CountTooManyRequests with default headers values +func NewCountTooManyRequests() *CountTooManyRequests { + return &CountTooManyRequests{} +} + +/* +CountTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type CountTooManyRequests 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 count too many requests response has a 2xx status code +func (o *CountTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this count too many requests response has a 3xx status code +func (o *CountTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count too many requests response has a 4xx status code +func (o *CountTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this count too many requests response has a 5xx status code +func (o *CountTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this count too many requests response a status code equal to that given +func (o *CountTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the count too many requests response +func (o *CountTooManyRequests) Code() int { + return 429 +} + +func (o *CountTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countTooManyRequests %+v", 429, o.Payload) +} + +func (o *CountTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countTooManyRequests %+v", 429, o.Payload) +} + +func (o *CountTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *CountTooManyRequests) 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 +} + +// NewCountInternalServerError creates a CountInternalServerError with default headers values +func NewCountInternalServerError() *CountInternalServerError { + return &CountInternalServerError{} +} + +/* +CountInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type CountInternalServerError 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 count internal server error response has a 2xx status code +func (o *CountInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this count internal server error response has a 3xx status code +func (o *CountInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this count internal server error response has a 4xx status code +func (o *CountInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this count internal server error response has a 5xx status code +func (o *CountInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this count internal server error response a status code equal to that given +func (o *CountInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the count internal server error response +func (o *CountInternalServerError) Code() int { + return 500 +} + +func (o *CountInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countInternalServerError %+v", 500, o.Payload) +} + +func (o *CountInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/aggregates/unidentified-containers/count/v1][%d] countInternalServerError %+v", 500, o.Payload) +} + +func (o *CountInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *CountInternalServerError) 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/unidentified_containers/search_parameters.go b/falcon/client/unidentified_containers/search_parameters.go new file mode 100644 index 00000000..a3050e78 --- /dev/null +++ b/falcon/client/unidentified_containers/search_parameters.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package unidentified_containers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/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" +) + +// NewSearchParams creates a new SearchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSearchParams() *SearchParams { + return &SearchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSearchParamsWithTimeout creates a new SearchParams object +// with the ability to set a timeout on a request. +func NewSearchParamsWithTimeout(timeout time.Duration) *SearchParams { + return &SearchParams{ + timeout: timeout, + } +} + +// NewSearchParamsWithContext creates a new SearchParams object +// with the ability to set a context for a request. +func NewSearchParamsWithContext(ctx context.Context) *SearchParams { + return &SearchParams{ + Context: ctx, + } +} + +// NewSearchParamsWithHTTPClient creates a new SearchParams object +// with the ability to set a custom HTTPClient for a request. +func NewSearchParamsWithHTTPClient(client *http.Client) *SearchParams { + return &SearchParams{ + HTTPClient: client, + } +} + +/* +SearchParams contains all the parameters to send to the API endpoint + + for the search operation. + + Typically these are written to a http.Request. +*/ +type SearchParams struct { + + /* Filter. + + Search Unidentified Containers using a query in Falcon Query Language (FQL). Supported filters: assessed_images_count,cid,cluster_name,containers_impacted_count,detections_count,image_assessment_detections_count,last_seen,namespace,node_name,severity,unassessed_images_count,visible_to_k8s + */ + 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. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchParams) WithDefaults() *SearchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the search params +func (o *SearchParams) WithTimeout(timeout time.Duration) *SearchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the search params +func (o *SearchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the search params +func (o *SearchParams) WithContext(ctx context.Context) *SearchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the search params +func (o *SearchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the search params +func (o *SearchParams) WithHTTPClient(client *http.Client) *SearchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the search params +func (o *SearchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilter adds the filter to the search params +func (o *SearchParams) WithFilter(filter *string) *SearchParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the search params +func (o *SearchParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithLimit adds the limit to the search params +func (o *SearchParams) WithLimit(limit *int64) *SearchParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the search params +func (o *SearchParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the search params +func (o *SearchParams) WithOffset(offset *int64) *SearchParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the search params +func (o *SearchParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSort adds the sort to the search params +func (o *SearchParams) WithSort(sort *string) *SearchParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the search params +func (o *SearchParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *SearchParams) 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/unidentified_containers/search_responses.go b/falcon/client/unidentified_containers/search_responses.go new file mode 100644 index 00000000..dfb5cddd --- /dev/null +++ b/falcon/client/unidentified_containers/search_responses.go @@ -0,0 +1,510 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package unidentified_containers + +// This file was generated by 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" +) + +// SearchReader is a Reader for the Search structure. +type SearchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSearchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 403: + result := NewSearchForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewSearchTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewSearchInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /container-security/combined/unidentified-containers/v1] Search", response, response.Code()) + } +} + +// NewSearchOK creates a SearchOK with default headers values +func NewSearchOK() *SearchOK { + return &SearchOK{} +} + +/* +SearchOK describes a response with status code 200, with default header values. + +OK +*/ +type SearchOK 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.UnidentifiedcontainersUnidentifiedContainerAPIResponse +} + +// IsSuccess returns true when this search o k response has a 2xx status code +func (o *SearchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this search o k response has a 3xx status code +func (o *SearchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search o k response has a 4xx status code +func (o *SearchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this search o k response has a 5xx status code +func (o *SearchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this search o k response a status code equal to that given +func (o *SearchOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the search o k response +func (o *SearchOK) Code() int { + return 200 +} + +func (o *SearchOK) Error() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchOK %+v", 200, o.Payload) +} + +func (o *SearchOK) String() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchOK %+v", 200, o.Payload) +} + +func (o *SearchOK) GetPayload() *models.UnidentifiedcontainersUnidentifiedContainerAPIResponse { + return o.Payload +} + +func (o *SearchOK) 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.UnidentifiedcontainersUnidentifiedContainerAPIResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSearchForbidden creates a SearchForbidden with default headers values +func NewSearchForbidden() *SearchForbidden { + return &SearchForbidden{} +} + +/* +SearchForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type SearchForbidden 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 search forbidden response has a 2xx status code +func (o *SearchForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search forbidden response has a 3xx status code +func (o *SearchForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search forbidden response has a 4xx status code +func (o *SearchForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this search forbidden response has a 5xx status code +func (o *SearchForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this search forbidden response a status code equal to that given +func (o *SearchForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the search forbidden response +func (o *SearchForbidden) Code() int { + return 403 +} + +func (o *SearchForbidden) Error() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchForbidden %+v", 403, o.Payload) +} + +func (o *SearchForbidden) String() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchForbidden %+v", 403, o.Payload) +} + +func (o *SearchForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *SearchForbidden) 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 +} + +// NewSearchTooManyRequests creates a SearchTooManyRequests with default headers values +func NewSearchTooManyRequests() *SearchTooManyRequests { + return &SearchTooManyRequests{} +} + +/* +SearchTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type SearchTooManyRequests 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 search too many requests response has a 2xx status code +func (o *SearchTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search too many requests response has a 3xx status code +func (o *SearchTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search too many requests response has a 4xx status code +func (o *SearchTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this search too many requests response has a 5xx status code +func (o *SearchTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this search too many requests response a status code equal to that given +func (o *SearchTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the search too many requests response +func (o *SearchTooManyRequests) Code() int { + return 429 +} + +func (o *SearchTooManyRequests) Error() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchTooManyRequests %+v", 429, o.Payload) +} + +func (o *SearchTooManyRequests) String() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchTooManyRequests %+v", 429, o.Payload) +} + +func (o *SearchTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *SearchTooManyRequests) 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 +} + +// NewSearchInternalServerError creates a SearchInternalServerError with default headers values +func NewSearchInternalServerError() *SearchInternalServerError { + return &SearchInternalServerError{} +} + +/* +SearchInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type SearchInternalServerError 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 search internal server error response has a 2xx status code +func (o *SearchInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this search internal server error response has a 3xx status code +func (o *SearchInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search internal server error response has a 4xx status code +func (o *SearchInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this search internal server error response has a 5xx status code +func (o *SearchInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this search internal server error response a status code equal to that given +func (o *SearchInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the search internal server error response +func (o *SearchInternalServerError) Code() int { + return 500 +} + +func (o *SearchInternalServerError) Error() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchInternalServerError %+v", 500, o.Payload) +} + +func (o *SearchInternalServerError) String() string { + return fmt.Sprintf("[GET /container-security/combined/unidentified-containers/v1][%d] searchInternalServerError %+v", 500, o.Payload) +} + +func (o *SearchInternalServerError) GetPayload() *models.CoreEntitiesResponse { + return o.Payload +} + +func (o *SearchInternalServerError) 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/unidentified_containers/unidentified_containers_client.go b/falcon/client/unidentified_containers/unidentified_containers_client.go new file mode 100644 index 00000000..10adb47b --- /dev/null +++ b/falcon/client/unidentified_containers/unidentified_containers_client.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package unidentified_containers + +// 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 unidentified containers API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for unidentified containers 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 { + Count(params *CountParams, opts ...ClientOption) (*CountOK, error) + + CountByDateRange(params *CountByDateRangeParams, opts ...ClientOption) (*CountByDateRangeOK, error) + + Search(params *SearchParams, opts ...ClientOption) (*SearchOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +Count returns the total count of unidentified containers over a time period +*/ +func (a *Client) Count(params *CountParams, opts ...ClientOption) (*CountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCountParams() + } + op := &runtime.ClientOperation{ + ID: "Count", + Method: "GET", + PathPattern: "/container-security/aggregates/unidentified-containers/count/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CountReader{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.(*CountOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for Count: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CountByDateRange returns the count of unidentified containers over the last 7 days +*/ +func (a *Client) CountByDateRange(params *CountByDateRangeParams, opts ...ClientOption) (*CountByDateRangeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCountByDateRangeParams() + } + op := &runtime.ClientOperation{ + ID: "CountByDateRange", + Method: "GET", + PathPattern: "/container-security/aggregates/unidentified-containers/count-by-date/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CountByDateRangeReader{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.(*CountByDateRangeOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for CountByDateRange: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +Search searches unidentified containers by the provided search criteria +*/ +func (a *Client) Search(params *SearchParams, opts ...ClientOption) (*SearchOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSearchParams() + } + op := &runtime.ClientOperation{ + ID: "Search", + Method: "GET", + PathPattern: "/container-security/combined/unidentified-containers/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SearchReader{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.(*SearchOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for Search: 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/deprovision_parameters.go b/falcon/client/workflows/deprovision_parameters.go new file mode 100644 index 00000000..521f43e2 --- /dev/null +++ b/falcon/client/workflows/deprovision_parameters.go @@ -0,0 +1,150 @@ +// 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/crowdstrike/gofalcon/falcon/models" +) + +// NewDeprovisionParams creates a new DeprovisionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeprovisionParams() *DeprovisionParams { + return &DeprovisionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeprovisionParamsWithTimeout creates a new DeprovisionParams object +// with the ability to set a timeout on a request. +func NewDeprovisionParamsWithTimeout(timeout time.Duration) *DeprovisionParams { + return &DeprovisionParams{ + timeout: timeout, + } +} + +// NewDeprovisionParamsWithContext creates a new DeprovisionParams object +// with the ability to set a context for a request. +func NewDeprovisionParamsWithContext(ctx context.Context) *DeprovisionParams { + return &DeprovisionParams{ + Context: ctx, + } +} + +// NewDeprovisionParamsWithHTTPClient creates a new DeprovisionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeprovisionParamsWithHTTPClient(client *http.Client) *DeprovisionParams { + return &DeprovisionParams{ + HTTPClient: client, + } +} + +/* +DeprovisionParams contains all the parameters to send to the API endpoint + + for the deprovision operation. + + Typically these are written to a http.Request. +*/ +type DeprovisionParams struct { + + // Body. + Body *models.ClientSystemDefinitionDeProvisionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the deprovision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeprovisionParams) WithDefaults() *DeprovisionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the deprovision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeprovisionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the deprovision params +func (o *DeprovisionParams) WithTimeout(timeout time.Duration) *DeprovisionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the deprovision params +func (o *DeprovisionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the deprovision params +func (o *DeprovisionParams) WithContext(ctx context.Context) *DeprovisionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the deprovision params +func (o *DeprovisionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the deprovision params +func (o *DeprovisionParams) WithHTTPClient(client *http.Client) *DeprovisionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the deprovision params +func (o *DeprovisionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the deprovision params +func (o *DeprovisionParams) WithBody(body *models.ClientSystemDefinitionDeProvisionRequest) *DeprovisionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the deprovision params +func (o *DeprovisionParams) SetBody(body *models.ClientSystemDefinitionDeProvisionRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *DeprovisionParams) 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/workflows/deprovision_responses.go b/falcon/client/workflows/deprovision_responses.go new file mode 100644 index 00000000..a4ad58ab --- /dev/null +++ b/falcon/client/workflows/deprovision_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" +) + +// DeprovisionReader is a Reader for the Deprovision structure. +type DeprovisionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeprovisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeprovisionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeprovisionBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeprovisionForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeprovisionNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewDeprovisionTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeprovisionInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /workflows/system-definitions/deprovision/v1] Deprovision", response, response.Code()) + } +} + +// NewDeprovisionOK creates a DeprovisionOK with default headers values +func NewDeprovisionOK() *DeprovisionOK { + return &DeprovisionOK{} +} + +/* +DeprovisionOK describes a response with status code 200, with default header values. + +OK +*/ +type DeprovisionOK 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this deprovision o k response has a 2xx status code +func (o *DeprovisionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this deprovision o k response has a 3xx status code +func (o *DeprovisionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this deprovision o k response has a 4xx status code +func (o *DeprovisionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this deprovision o k response has a 5xx status code +func (o *DeprovisionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this deprovision o k response a status code equal to that given +func (o *DeprovisionOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the deprovision o k response +func (o *DeprovisionOK) Code() int { + return 200 +} + +func (o *DeprovisionOK) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionOK %+v", 200, o.Payload) +} + +func (o *DeprovisionOK) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionOK %+v", 200, o.Payload) +} + +func (o *DeprovisionOK) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *DeprovisionOK) 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.ClientSystemDefinitionCreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeprovisionBadRequest creates a DeprovisionBadRequest with default headers values +func NewDeprovisionBadRequest() *DeprovisionBadRequest { + return &DeprovisionBadRequest{} +} + +/* +DeprovisionBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type DeprovisionBadRequest 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this deprovision bad request response has a 2xx status code +func (o *DeprovisionBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this deprovision bad request response has a 3xx status code +func (o *DeprovisionBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this deprovision bad request response has a 4xx status code +func (o *DeprovisionBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this deprovision bad request response has a 5xx status code +func (o *DeprovisionBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this deprovision bad request response a status code equal to that given +func (o *DeprovisionBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the deprovision bad request response +func (o *DeprovisionBadRequest) Code() int { + return 400 +} + +func (o *DeprovisionBadRequest) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionBadRequest %+v", 400, o.Payload) +} + +func (o *DeprovisionBadRequest) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionBadRequest %+v", 400, o.Payload) +} + +func (o *DeprovisionBadRequest) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *DeprovisionBadRequest) 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.ClientSystemDefinitionCreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeprovisionForbidden creates a DeprovisionForbidden with default headers values +func NewDeprovisionForbidden() *DeprovisionForbidden { + return &DeprovisionForbidden{} +} + +/* +DeprovisionForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type DeprovisionForbidden 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 deprovision forbidden response has a 2xx status code +func (o *DeprovisionForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this deprovision forbidden response has a 3xx status code +func (o *DeprovisionForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this deprovision forbidden response has a 4xx status code +func (o *DeprovisionForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this deprovision forbidden response has a 5xx status code +func (o *DeprovisionForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this deprovision forbidden response a status code equal to that given +func (o *DeprovisionForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the deprovision forbidden response +func (o *DeprovisionForbidden) Code() int { + return 403 +} + +func (o *DeprovisionForbidden) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionForbidden %+v", 403, o.Payload) +} + +func (o *DeprovisionForbidden) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionForbidden %+v", 403, o.Payload) +} + +func (o *DeprovisionForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *DeprovisionForbidden) 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 +} + +// NewDeprovisionNotFound creates a DeprovisionNotFound with default headers values +func NewDeprovisionNotFound() *DeprovisionNotFound { + return &DeprovisionNotFound{} +} + +/* +DeprovisionNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type DeprovisionNotFound 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this deprovision not found response has a 2xx status code +func (o *DeprovisionNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this deprovision not found response has a 3xx status code +func (o *DeprovisionNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this deprovision not found response has a 4xx status code +func (o *DeprovisionNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this deprovision not found response has a 5xx status code +func (o *DeprovisionNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this deprovision not found response a status code equal to that given +func (o *DeprovisionNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the deprovision not found response +func (o *DeprovisionNotFound) Code() int { + return 404 +} + +func (o *DeprovisionNotFound) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionNotFound %+v", 404, o.Payload) +} + +func (o *DeprovisionNotFound) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionNotFound %+v", 404, o.Payload) +} + +func (o *DeprovisionNotFound) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *DeprovisionNotFound) 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.ClientSystemDefinitionCreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeprovisionTooManyRequests creates a DeprovisionTooManyRequests with default headers values +func NewDeprovisionTooManyRequests() *DeprovisionTooManyRequests { + return &DeprovisionTooManyRequests{} +} + +/* +DeprovisionTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type DeprovisionTooManyRequests 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 deprovision too many requests response has a 2xx status code +func (o *DeprovisionTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this deprovision too many requests response has a 3xx status code +func (o *DeprovisionTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this deprovision too many requests response has a 4xx status code +func (o *DeprovisionTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this deprovision too many requests response has a 5xx status code +func (o *DeprovisionTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this deprovision too many requests response a status code equal to that given +func (o *DeprovisionTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the deprovision too many requests response +func (o *DeprovisionTooManyRequests) Code() int { + return 429 +} + +func (o *DeprovisionTooManyRequests) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionTooManyRequests %+v", 429, o.Payload) +} + +func (o *DeprovisionTooManyRequests) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionTooManyRequests %+v", 429, o.Payload) +} + +func (o *DeprovisionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *DeprovisionTooManyRequests) 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 +} + +// NewDeprovisionInternalServerError creates a DeprovisionInternalServerError with default headers values +func NewDeprovisionInternalServerError() *DeprovisionInternalServerError { + return &DeprovisionInternalServerError{} +} + +/* +DeprovisionInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type DeprovisionInternalServerError 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this deprovision internal server error response has a 2xx status code +func (o *DeprovisionInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this deprovision internal server error response has a 3xx status code +func (o *DeprovisionInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this deprovision internal server error response has a 4xx status code +func (o *DeprovisionInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this deprovision internal server error response has a 5xx status code +func (o *DeprovisionInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this deprovision internal server error response a status code equal to that given +func (o *DeprovisionInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the deprovision internal server error response +func (o *DeprovisionInternalServerError) Code() int { + return 500 +} + +func (o *DeprovisionInternalServerError) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionInternalServerError %+v", 500, o.Payload) +} + +func (o *DeprovisionInternalServerError) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionInternalServerError %+v", 500, o.Payload) +} + +func (o *DeprovisionInternalServerError) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *DeprovisionInternalServerError) 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.ClientSystemDefinitionCreateResponse) + + // 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/deprovision_system_definition_parameters.go b/falcon/client/workflows/deprovision_system_definition_parameters.go deleted file mode 100644 index 92800c2c..00000000 --- a/falcon/client/workflows/deprovision_system_definition_parameters.go +++ /dev/null @@ -1,150 +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/crowdstrike/gofalcon/falcon/models" -) - -// NewDeprovisionSystemDefinitionParams creates a new DeprovisionSystemDefinitionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeprovisionSystemDefinitionParams() *DeprovisionSystemDefinitionParams { - return &DeprovisionSystemDefinitionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeprovisionSystemDefinitionParamsWithTimeout creates a new DeprovisionSystemDefinitionParams object -// with the ability to set a timeout on a request. -func NewDeprovisionSystemDefinitionParamsWithTimeout(timeout time.Duration) *DeprovisionSystemDefinitionParams { - return &DeprovisionSystemDefinitionParams{ - timeout: timeout, - } -} - -// NewDeprovisionSystemDefinitionParamsWithContext creates a new DeprovisionSystemDefinitionParams object -// with the ability to set a context for a request. -func NewDeprovisionSystemDefinitionParamsWithContext(ctx context.Context) *DeprovisionSystemDefinitionParams { - return &DeprovisionSystemDefinitionParams{ - Context: ctx, - } -} - -// NewDeprovisionSystemDefinitionParamsWithHTTPClient creates a new DeprovisionSystemDefinitionParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeprovisionSystemDefinitionParamsWithHTTPClient(client *http.Client) *DeprovisionSystemDefinitionParams { - return &DeprovisionSystemDefinitionParams{ - HTTPClient: client, - } -} - -/* -DeprovisionSystemDefinitionParams contains all the parameters to send to the API endpoint - - for the deprovision system definition operation. - - Typically these are written to a http.Request. -*/ -type DeprovisionSystemDefinitionParams struct { - - // Body. - Body *models.ClientSystemDefinitionDeProvisionRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the deprovision system definition params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeprovisionSystemDefinitionParams) WithDefaults() *DeprovisionSystemDefinitionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the deprovision system definition params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeprovisionSystemDefinitionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) WithTimeout(timeout time.Duration) *DeprovisionSystemDefinitionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) WithContext(ctx context.Context) *DeprovisionSystemDefinitionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) WithHTTPClient(client *http.Client) *DeprovisionSystemDefinitionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) WithBody(body *models.ClientSystemDefinitionDeProvisionRequest) *DeprovisionSystemDefinitionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the deprovision system definition params -func (o *DeprovisionSystemDefinitionParams) SetBody(body *models.ClientSystemDefinitionDeProvisionRequest) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *DeprovisionSystemDefinitionParams) 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/workflows/deprovision_system_definition_responses.go b/falcon/client/workflows/deprovision_system_definition_responses.go deleted file mode 100644 index 15990c8a..00000000 --- a/falcon/client/workflows/deprovision_system_definition_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" -) - -// DeprovisionSystemDefinitionReader is a Reader for the DeprovisionSystemDefinition structure. -type DeprovisionSystemDefinitionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeprovisionSystemDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeprovisionSystemDefinitionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeprovisionSystemDefinitionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeprovisionSystemDefinitionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeprovisionSystemDefinitionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewDeprovisionSystemDefinitionTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeprovisionSystemDefinitionInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /workflows/system-definitions/deprovision/v1] deprovision.system-definition", response, response.Code()) - } -} - -// NewDeprovisionSystemDefinitionOK creates a DeprovisionSystemDefinitionOK with default headers values -func NewDeprovisionSystemDefinitionOK() *DeprovisionSystemDefinitionOK { - return &DeprovisionSystemDefinitionOK{} -} - -/* -DeprovisionSystemDefinitionOK describes a response with status code 200, with default header values. - -OK -*/ -type DeprovisionSystemDefinitionOK 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this deprovision system definition o k response has a 2xx status code -func (o *DeprovisionSystemDefinitionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this deprovision system definition o k response has a 3xx status code -func (o *DeprovisionSystemDefinitionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deprovision system definition o k response has a 4xx status code -func (o *DeprovisionSystemDefinitionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this deprovision system definition o k response has a 5xx status code -func (o *DeprovisionSystemDefinitionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this deprovision system definition o k response a status code equal to that given -func (o *DeprovisionSystemDefinitionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the deprovision system definition o k response -func (o *DeprovisionSystemDefinitionOK) Code() int { - return 200 -} - -func (o *DeprovisionSystemDefinitionOK) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionOK %+v", 200, o.Payload) -} - -func (o *DeprovisionSystemDefinitionOK) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionOK %+v", 200, o.Payload) -} - -func (o *DeprovisionSystemDefinitionOK) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *DeprovisionSystemDefinitionOK) 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.ClientSystemDefinitionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeprovisionSystemDefinitionBadRequest creates a DeprovisionSystemDefinitionBadRequest with default headers values -func NewDeprovisionSystemDefinitionBadRequest() *DeprovisionSystemDefinitionBadRequest { - return &DeprovisionSystemDefinitionBadRequest{} -} - -/* -DeprovisionSystemDefinitionBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type DeprovisionSystemDefinitionBadRequest 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this deprovision system definition bad request response has a 2xx status code -func (o *DeprovisionSystemDefinitionBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deprovision system definition bad request response has a 3xx status code -func (o *DeprovisionSystemDefinitionBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deprovision system definition bad request response has a 4xx status code -func (o *DeprovisionSystemDefinitionBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this deprovision system definition bad request response has a 5xx status code -func (o *DeprovisionSystemDefinitionBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this deprovision system definition bad request response a status code equal to that given -func (o *DeprovisionSystemDefinitionBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the deprovision system definition bad request response -func (o *DeprovisionSystemDefinitionBadRequest) Code() int { - return 400 -} - -func (o *DeprovisionSystemDefinitionBadRequest) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionBadRequest %+v", 400, o.Payload) -} - -func (o *DeprovisionSystemDefinitionBadRequest) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionBadRequest %+v", 400, o.Payload) -} - -func (o *DeprovisionSystemDefinitionBadRequest) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *DeprovisionSystemDefinitionBadRequest) 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.ClientSystemDefinitionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeprovisionSystemDefinitionForbidden creates a DeprovisionSystemDefinitionForbidden with default headers values -func NewDeprovisionSystemDefinitionForbidden() *DeprovisionSystemDefinitionForbidden { - return &DeprovisionSystemDefinitionForbidden{} -} - -/* -DeprovisionSystemDefinitionForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type DeprovisionSystemDefinitionForbidden 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 deprovision system definition forbidden response has a 2xx status code -func (o *DeprovisionSystemDefinitionForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deprovision system definition forbidden response has a 3xx status code -func (o *DeprovisionSystemDefinitionForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deprovision system definition forbidden response has a 4xx status code -func (o *DeprovisionSystemDefinitionForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this deprovision system definition forbidden response has a 5xx status code -func (o *DeprovisionSystemDefinitionForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this deprovision system definition forbidden response a status code equal to that given -func (o *DeprovisionSystemDefinitionForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the deprovision system definition forbidden response -func (o *DeprovisionSystemDefinitionForbidden) Code() int { - return 403 -} - -func (o *DeprovisionSystemDefinitionForbidden) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionForbidden %+v", 403, o.Payload) -} - -func (o *DeprovisionSystemDefinitionForbidden) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionForbidden %+v", 403, o.Payload) -} - -func (o *DeprovisionSystemDefinitionForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeprovisionSystemDefinitionForbidden) 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 -} - -// NewDeprovisionSystemDefinitionNotFound creates a DeprovisionSystemDefinitionNotFound with default headers values -func NewDeprovisionSystemDefinitionNotFound() *DeprovisionSystemDefinitionNotFound { - return &DeprovisionSystemDefinitionNotFound{} -} - -/* -DeprovisionSystemDefinitionNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type DeprovisionSystemDefinitionNotFound 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this deprovision system definition not found response has a 2xx status code -func (o *DeprovisionSystemDefinitionNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deprovision system definition not found response has a 3xx status code -func (o *DeprovisionSystemDefinitionNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deprovision system definition not found response has a 4xx status code -func (o *DeprovisionSystemDefinitionNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this deprovision system definition not found response has a 5xx status code -func (o *DeprovisionSystemDefinitionNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this deprovision system definition not found response a status code equal to that given -func (o *DeprovisionSystemDefinitionNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the deprovision system definition not found response -func (o *DeprovisionSystemDefinitionNotFound) Code() int { - return 404 -} - -func (o *DeprovisionSystemDefinitionNotFound) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionNotFound %+v", 404, o.Payload) -} - -func (o *DeprovisionSystemDefinitionNotFound) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionNotFound %+v", 404, o.Payload) -} - -func (o *DeprovisionSystemDefinitionNotFound) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *DeprovisionSystemDefinitionNotFound) 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.ClientSystemDefinitionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeprovisionSystemDefinitionTooManyRequests creates a DeprovisionSystemDefinitionTooManyRequests with default headers values -func NewDeprovisionSystemDefinitionTooManyRequests() *DeprovisionSystemDefinitionTooManyRequests { - return &DeprovisionSystemDefinitionTooManyRequests{} -} - -/* -DeprovisionSystemDefinitionTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type DeprovisionSystemDefinitionTooManyRequests 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 deprovision system definition too many requests response has a 2xx status code -func (o *DeprovisionSystemDefinitionTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deprovision system definition too many requests response has a 3xx status code -func (o *DeprovisionSystemDefinitionTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deprovision system definition too many requests response has a 4xx status code -func (o *DeprovisionSystemDefinitionTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this deprovision system definition too many requests response has a 5xx status code -func (o *DeprovisionSystemDefinitionTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this deprovision system definition too many requests response a status code equal to that given -func (o *DeprovisionSystemDefinitionTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the deprovision system definition too many requests response -func (o *DeprovisionSystemDefinitionTooManyRequests) Code() int { - return 429 -} - -func (o *DeprovisionSystemDefinitionTooManyRequests) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeprovisionSystemDefinitionTooManyRequests) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionTooManyRequests %+v", 429, o.Payload) -} - -func (o *DeprovisionSystemDefinitionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *DeprovisionSystemDefinitionTooManyRequests) 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 -} - -// NewDeprovisionSystemDefinitionInternalServerError creates a DeprovisionSystemDefinitionInternalServerError with default headers values -func NewDeprovisionSystemDefinitionInternalServerError() *DeprovisionSystemDefinitionInternalServerError { - return &DeprovisionSystemDefinitionInternalServerError{} -} - -/* -DeprovisionSystemDefinitionInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type DeprovisionSystemDefinitionInternalServerError 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this deprovision system definition internal server error response has a 2xx status code -func (o *DeprovisionSystemDefinitionInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this deprovision system definition internal server error response has a 3xx status code -func (o *DeprovisionSystemDefinitionInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this deprovision system definition internal server error response has a 4xx status code -func (o *DeprovisionSystemDefinitionInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this deprovision system definition internal server error response has a 5xx status code -func (o *DeprovisionSystemDefinitionInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this deprovision system definition internal server error response a status code equal to that given -func (o *DeprovisionSystemDefinitionInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the deprovision system definition internal server error response -func (o *DeprovisionSystemDefinitionInternalServerError) Code() int { - return 500 -} - -func (o *DeprovisionSystemDefinitionInternalServerError) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionInternalServerError %+v", 500, o.Payload) -} - -func (o *DeprovisionSystemDefinitionInternalServerError) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/deprovision/v1][%d] deprovisionSystemDefinitionInternalServerError %+v", 500, o.Payload) -} - -func (o *DeprovisionSystemDefinitionInternalServerError) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *DeprovisionSystemDefinitionInternalServerError) 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.ClientSystemDefinitionCreateResponse) - - // 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/execute_parameters.go b/falcon/client/workflows/execute_parameters.go index 5c62d0d2..e146fd79 100644 --- a/falcon/client/workflows/execute_parameters.go +++ b/falcon/client/workflows/execute_parameters.go @@ -91,6 +91,12 @@ type ExecuteParams struct { */ 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 @@ -199,6 +205,17 @@ func (o *ExecuteParams) SetName(name *string) { o.Name = name } +// WithSourceEventURL adds the sourceEventURL to the execute params +func (o *ExecuteParams) WithSourceEventURL(sourceEventURL *string) *ExecuteParams { + o.SetSourceEventURL(sourceEventURL) + return o +} + +// SetSourceEventURL adds the sourceEventUrl to the execute params +func (o *ExecuteParams) SetSourceEventURL(sourceEventURL *string) { + o.SourceEventURL = sourceEventURL +} + // WriteToRequest writes these params to a swagger request func (o *ExecuteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -274,6 +291,23 @@ func (o *ExecuteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis } } + 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...) } diff --git a/falcon/client/workflows/execute_responses.go b/falcon/client/workflows/execute_responses.go index 92871175..671e1bf7 100644 --- a/falcon/client/workflows/execute_responses.go +++ b/falcon/client/workflows/execute_responses.go @@ -62,7 +62,7 @@ func (o *ExecuteReader) ReadResponse(response runtime.ClientResponse, consumer r } return nil, result default: - return nil, runtime.NewAPIError("[POST /workflows/entities/execute/v1] execute", response, response.Code()) + return nil, runtime.NewAPIError("[POST /workflows/entities/execute/v1] Execute", response, response.Code()) } } diff --git a/falcon/client/workflows/execution_action_parameters.go b/falcon/client/workflows/execution_action_parameters.go new file mode 100644 index 00000000..95e0847b --- /dev/null +++ b/falcon/client/workflows/execution_action_parameters.go @@ -0,0 +1,179 @@ +// 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/crowdstrike/gofalcon/falcon/models" +) + +// NewExecutionActionParams creates a new ExecutionActionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewExecutionActionParams() *ExecutionActionParams { + return &ExecutionActionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewExecutionActionParamsWithTimeout creates a new ExecutionActionParams object +// with the ability to set a timeout on a request. +func NewExecutionActionParamsWithTimeout(timeout time.Duration) *ExecutionActionParams { + return &ExecutionActionParams{ + timeout: timeout, + } +} + +// NewExecutionActionParamsWithContext creates a new ExecutionActionParams object +// with the ability to set a context for a request. +func NewExecutionActionParamsWithContext(ctx context.Context) *ExecutionActionParams { + return &ExecutionActionParams{ + Context: ctx, + } +} + +// NewExecutionActionParamsWithHTTPClient creates a new ExecutionActionParams object +// with the ability to set a custom HTTPClient for a request. +func NewExecutionActionParamsWithHTTPClient(client *http.Client) *ExecutionActionParams { + return &ExecutionActionParams{ + HTTPClient: client, + } +} + +/* +ExecutionActionParams contains all the parameters to send to the API endpoint + + for the execution action operation. + + Typically these are written to a http.Request. +*/ +type ExecutionActionParams struct { + + /* ActionName. + + Specify one of these actions: + + - `resume`: resume/retry the workflow execution(s) specified in ids + */ + ActionName string + + // Body. + Body *models.ClientActionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the execution action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExecutionActionParams) WithDefaults() *ExecutionActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the execution action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExecutionActionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the execution action params +func (o *ExecutionActionParams) WithTimeout(timeout time.Duration) *ExecutionActionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the execution action params +func (o *ExecutionActionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the execution action params +func (o *ExecutionActionParams) WithContext(ctx context.Context) *ExecutionActionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the execution action params +func (o *ExecutionActionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the execution action params +func (o *ExecutionActionParams) WithHTTPClient(client *http.Client) *ExecutionActionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the execution action params +func (o *ExecutionActionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActionName adds the actionName to the execution action params +func (o *ExecutionActionParams) WithActionName(actionName string) *ExecutionActionParams { + o.SetActionName(actionName) + return o +} + +// SetActionName adds the actionName to the execution action params +func (o *ExecutionActionParams) SetActionName(actionName string) { + o.ActionName = actionName +} + +// WithBody adds the body to the execution action params +func (o *ExecutionActionParams) WithBody(body *models.ClientActionRequest) *ExecutionActionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the execution action params +func (o *ExecutionActionParams) SetBody(body *models.ClientActionRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ExecutionActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param action_name + qrActionName := o.ActionName + qActionName := qrActionName + if qActionName != "" { + + if err := r.SetQueryParam("action_name", qActionName); err != nil { + return err + } + } + 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/workflows/executions_action_responses.go b/falcon/client/workflows/execution_action_responses.go similarity index 53% rename from falcon/client/workflows/executions_action_responses.go rename to falcon/client/workflows/execution_action_responses.go index c49394ee..785a96de 100644 --- a/falcon/client/workflows/executions_action_responses.go +++ b/falcon/client/workflows/execution_action_responses.go @@ -17,66 +17,66 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// ExecutionsActionReader is a Reader for the ExecutionsAction structure. -type ExecutionsActionReader struct { +// ExecutionActionReader is a Reader for the ExecutionAction structure. +type ExecutionActionReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *ExecutionsActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ExecutionActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewExecutionsActionOK() + result := NewExecutionActionOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: - result := NewExecutionsActionBadRequest() + result := NewExecutionActionBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: - result := NewExecutionsActionForbidden() + result := NewExecutionActionForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: - result := NewExecutionsActionNotFound() + result := NewExecutionActionNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewExecutionsActionTooManyRequests() + result := NewExecutionActionTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: - result := NewExecutionsActionInternalServerError() + result := NewExecutionActionInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[POST /workflows/entities/execution-actions/v1] executions.action", response, response.Code()) + return nil, runtime.NewAPIError("[POST /workflows/entities/execution-actions/v1] ExecutionAction", response, response.Code()) } } -// NewExecutionsActionOK creates a ExecutionsActionOK with default headers values -func NewExecutionsActionOK() *ExecutionsActionOK { - return &ExecutionsActionOK{} +// NewExecutionActionOK creates a ExecutionActionOK with default headers values +func NewExecutionActionOK() *ExecutionActionOK { + return &ExecutionActionOK{} } /* -ExecutionsActionOK describes a response with status code 200, with default header values. +ExecutionActionOK describes a response with status code 200, with default header values. OK */ -type ExecutionsActionOK struct { +type ExecutionActionOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -93,49 +93,49 @@ type ExecutionsActionOK struct { Payload *models.DefinitionsDefinitionEntitiesResponse } -// IsSuccess returns true when this executions action o k response has a 2xx status code -func (o *ExecutionsActionOK) IsSuccess() bool { +// IsSuccess returns true when this execution action o k response has a 2xx status code +func (o *ExecutionActionOK) IsSuccess() bool { return true } -// IsRedirect returns true when this executions action o k response has a 3xx status code -func (o *ExecutionsActionOK) IsRedirect() bool { +// IsRedirect returns true when this execution action o k response has a 3xx status code +func (o *ExecutionActionOK) IsRedirect() bool { return false } -// IsClientError returns true when this executions action o k response has a 4xx status code -func (o *ExecutionsActionOK) IsClientError() bool { +// IsClientError returns true when this execution action o k response has a 4xx status code +func (o *ExecutionActionOK) IsClientError() bool { return false } -// IsServerError returns true when this executions action o k response has a 5xx status code -func (o *ExecutionsActionOK) IsServerError() bool { +// IsServerError returns true when this execution action o k response has a 5xx status code +func (o *ExecutionActionOK) IsServerError() bool { return false } -// IsCode returns true when this executions action o k response a status code equal to that given -func (o *ExecutionsActionOK) IsCode(code int) bool { +// IsCode returns true when this execution action o k response a status code equal to that given +func (o *ExecutionActionOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the executions action o k response -func (o *ExecutionsActionOK) Code() int { +// Code gets the status code for the execution action o k response +func (o *ExecutionActionOK) Code() int { return 200 } -func (o *ExecutionsActionOK) Error() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionOK %+v", 200, o.Payload) +func (o *ExecutionActionOK) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionOK %+v", 200, o.Payload) } -func (o *ExecutionsActionOK) String() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionOK %+v", 200, o.Payload) +func (o *ExecutionActionOK) String() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionOK %+v", 200, o.Payload) } -func (o *ExecutionsActionOK) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { +func (o *ExecutionActionOK) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { return o.Payload } -func (o *ExecutionsActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -176,17 +176,17 @@ func (o *ExecutionsActionOK) readResponse(response runtime.ClientResponse, consu return nil } -// NewExecutionsActionBadRequest creates a ExecutionsActionBadRequest with default headers values -func NewExecutionsActionBadRequest() *ExecutionsActionBadRequest { - return &ExecutionsActionBadRequest{} +// NewExecutionActionBadRequest creates a ExecutionActionBadRequest with default headers values +func NewExecutionActionBadRequest() *ExecutionActionBadRequest { + return &ExecutionActionBadRequest{} } /* -ExecutionsActionBadRequest describes a response with status code 400, with default header values. +ExecutionActionBadRequest describes a response with status code 400, with default header values. Bad Request */ -type ExecutionsActionBadRequest struct { +type ExecutionActionBadRequest struct { /* Trace-ID: submit to support if resolving an issue */ @@ -203,49 +203,49 @@ type ExecutionsActionBadRequest struct { Payload *models.DefinitionsDefinitionEntitiesResponse } -// IsSuccess returns true when this executions action bad request response has a 2xx status code -func (o *ExecutionsActionBadRequest) IsSuccess() bool { +// IsSuccess returns true when this execution action bad request response has a 2xx status code +func (o *ExecutionActionBadRequest) IsSuccess() bool { return false } -// IsRedirect returns true when this executions action bad request response has a 3xx status code -func (o *ExecutionsActionBadRequest) IsRedirect() bool { +// IsRedirect returns true when this execution action bad request response has a 3xx status code +func (o *ExecutionActionBadRequest) IsRedirect() bool { return false } -// IsClientError returns true when this executions action bad request response has a 4xx status code -func (o *ExecutionsActionBadRequest) IsClientError() bool { +// IsClientError returns true when this execution action bad request response has a 4xx status code +func (o *ExecutionActionBadRequest) IsClientError() bool { return true } -// IsServerError returns true when this executions action bad request response has a 5xx status code -func (o *ExecutionsActionBadRequest) IsServerError() bool { +// IsServerError returns true when this execution action bad request response has a 5xx status code +func (o *ExecutionActionBadRequest) IsServerError() bool { return false } -// IsCode returns true when this executions action bad request response a status code equal to that given -func (o *ExecutionsActionBadRequest) IsCode(code int) bool { +// IsCode returns true when this execution action bad request response a status code equal to that given +func (o *ExecutionActionBadRequest) IsCode(code int) bool { return code == 400 } -// Code gets the status code for the executions action bad request response -func (o *ExecutionsActionBadRequest) Code() int { +// Code gets the status code for the execution action bad request response +func (o *ExecutionActionBadRequest) Code() int { return 400 } -func (o *ExecutionsActionBadRequest) Error() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionBadRequest %+v", 400, o.Payload) +func (o *ExecutionActionBadRequest) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionBadRequest %+v", 400, o.Payload) } -func (o *ExecutionsActionBadRequest) String() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionBadRequest %+v", 400, o.Payload) +func (o *ExecutionActionBadRequest) String() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionBadRequest %+v", 400, o.Payload) } -func (o *ExecutionsActionBadRequest) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { +func (o *ExecutionActionBadRequest) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { return o.Payload } -func (o *ExecutionsActionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionActionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -286,17 +286,17 @@ func (o *ExecutionsActionBadRequest) readResponse(response runtime.ClientRespons return nil } -// NewExecutionsActionForbidden creates a ExecutionsActionForbidden with default headers values -func NewExecutionsActionForbidden() *ExecutionsActionForbidden { - return &ExecutionsActionForbidden{} +// NewExecutionActionForbidden creates a ExecutionActionForbidden with default headers values +func NewExecutionActionForbidden() *ExecutionActionForbidden { + return &ExecutionActionForbidden{} } /* -ExecutionsActionForbidden describes a response with status code 403, with default header values. +ExecutionActionForbidden describes a response with status code 403, with default header values. Forbidden */ -type ExecutionsActionForbidden struct { +type ExecutionActionForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -313,49 +313,49 @@ type ExecutionsActionForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this executions action forbidden response has a 2xx status code -func (o *ExecutionsActionForbidden) IsSuccess() bool { +// IsSuccess returns true when this execution action forbidden response has a 2xx status code +func (o *ExecutionActionForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this executions action forbidden response has a 3xx status code -func (o *ExecutionsActionForbidden) IsRedirect() bool { +// IsRedirect returns true when this execution action forbidden response has a 3xx status code +func (o *ExecutionActionForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this executions action forbidden response has a 4xx status code -func (o *ExecutionsActionForbidden) IsClientError() bool { +// IsClientError returns true when this execution action forbidden response has a 4xx status code +func (o *ExecutionActionForbidden) IsClientError() bool { return true } -// IsServerError returns true when this executions action forbidden response has a 5xx status code -func (o *ExecutionsActionForbidden) IsServerError() bool { +// IsServerError returns true when this execution action forbidden response has a 5xx status code +func (o *ExecutionActionForbidden) IsServerError() bool { return false } -// IsCode returns true when this executions action forbidden response a status code equal to that given -func (o *ExecutionsActionForbidden) IsCode(code int) bool { +// IsCode returns true when this execution action forbidden response a status code equal to that given +func (o *ExecutionActionForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the executions action forbidden response -func (o *ExecutionsActionForbidden) Code() int { +// Code gets the status code for the execution action forbidden response +func (o *ExecutionActionForbidden) Code() int { return 403 } -func (o *ExecutionsActionForbidden) Error() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionForbidden %+v", 403, o.Payload) +func (o *ExecutionActionForbidden) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionForbidden %+v", 403, o.Payload) } -func (o *ExecutionsActionForbidden) String() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionForbidden %+v", 403, o.Payload) +func (o *ExecutionActionForbidden) String() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionForbidden %+v", 403, o.Payload) } -func (o *ExecutionsActionForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *ExecutionActionForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ExecutionsActionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionActionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -396,17 +396,17 @@ func (o *ExecutionsActionForbidden) readResponse(response runtime.ClientResponse return nil } -// NewExecutionsActionNotFound creates a ExecutionsActionNotFound with default headers values -func NewExecutionsActionNotFound() *ExecutionsActionNotFound { - return &ExecutionsActionNotFound{} +// NewExecutionActionNotFound creates a ExecutionActionNotFound with default headers values +func NewExecutionActionNotFound() *ExecutionActionNotFound { + return &ExecutionActionNotFound{} } /* -ExecutionsActionNotFound describes a response with status code 404, with default header values. +ExecutionActionNotFound describes a response with status code 404, with default header values. Not Found */ -type ExecutionsActionNotFound struct { +type ExecutionActionNotFound struct { /* Trace-ID: submit to support if resolving an issue */ @@ -423,49 +423,49 @@ type ExecutionsActionNotFound struct { Payload *models.DefinitionsDefinitionEntitiesResponse } -// IsSuccess returns true when this executions action not found response has a 2xx status code -func (o *ExecutionsActionNotFound) IsSuccess() bool { +// IsSuccess returns true when this execution action not found response has a 2xx status code +func (o *ExecutionActionNotFound) IsSuccess() bool { return false } -// IsRedirect returns true when this executions action not found response has a 3xx status code -func (o *ExecutionsActionNotFound) IsRedirect() bool { +// IsRedirect returns true when this execution action not found response has a 3xx status code +func (o *ExecutionActionNotFound) IsRedirect() bool { return false } -// IsClientError returns true when this executions action not found response has a 4xx status code -func (o *ExecutionsActionNotFound) IsClientError() bool { +// IsClientError returns true when this execution action not found response has a 4xx status code +func (o *ExecutionActionNotFound) IsClientError() bool { return true } -// IsServerError returns true when this executions action not found response has a 5xx status code -func (o *ExecutionsActionNotFound) IsServerError() bool { +// IsServerError returns true when this execution action not found response has a 5xx status code +func (o *ExecutionActionNotFound) IsServerError() bool { return false } -// IsCode returns true when this executions action not found response a status code equal to that given -func (o *ExecutionsActionNotFound) IsCode(code int) bool { +// IsCode returns true when this execution action not found response a status code equal to that given +func (o *ExecutionActionNotFound) IsCode(code int) bool { return code == 404 } -// Code gets the status code for the executions action not found response -func (o *ExecutionsActionNotFound) Code() int { +// Code gets the status code for the execution action not found response +func (o *ExecutionActionNotFound) Code() int { return 404 } -func (o *ExecutionsActionNotFound) Error() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionNotFound %+v", 404, o.Payload) +func (o *ExecutionActionNotFound) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionNotFound %+v", 404, o.Payload) } -func (o *ExecutionsActionNotFound) String() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionNotFound %+v", 404, o.Payload) +func (o *ExecutionActionNotFound) String() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionNotFound %+v", 404, o.Payload) } -func (o *ExecutionsActionNotFound) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { +func (o *ExecutionActionNotFound) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { return o.Payload } -func (o *ExecutionsActionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionActionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -506,17 +506,17 @@ func (o *ExecutionsActionNotFound) readResponse(response runtime.ClientResponse, return nil } -// NewExecutionsActionTooManyRequests creates a ExecutionsActionTooManyRequests with default headers values -func NewExecutionsActionTooManyRequests() *ExecutionsActionTooManyRequests { - return &ExecutionsActionTooManyRequests{} +// NewExecutionActionTooManyRequests creates a ExecutionActionTooManyRequests with default headers values +func NewExecutionActionTooManyRequests() *ExecutionActionTooManyRequests { + return &ExecutionActionTooManyRequests{} } /* -ExecutionsActionTooManyRequests describes a response with status code 429, with default header values. +ExecutionActionTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type ExecutionsActionTooManyRequests struct { +type ExecutionActionTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -537,49 +537,49 @@ type ExecutionsActionTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this executions action too many requests response has a 2xx status code -func (o *ExecutionsActionTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this execution action too many requests response has a 2xx status code +func (o *ExecutionActionTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this executions action too many requests response has a 3xx status code -func (o *ExecutionsActionTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this execution action too many requests response has a 3xx status code +func (o *ExecutionActionTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this executions action too many requests response has a 4xx status code -func (o *ExecutionsActionTooManyRequests) IsClientError() bool { +// IsClientError returns true when this execution action too many requests response has a 4xx status code +func (o *ExecutionActionTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this executions action too many requests response has a 5xx status code -func (o *ExecutionsActionTooManyRequests) IsServerError() bool { +// IsServerError returns true when this execution action too many requests response has a 5xx status code +func (o *ExecutionActionTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this executions action too many requests response a status code equal to that given -func (o *ExecutionsActionTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this execution action too many requests response a status code equal to that given +func (o *ExecutionActionTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the executions action too many requests response -func (o *ExecutionsActionTooManyRequests) Code() int { +// Code gets the status code for the execution action too many requests response +func (o *ExecutionActionTooManyRequests) Code() int { return 429 } -func (o *ExecutionsActionTooManyRequests) Error() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionTooManyRequests %+v", 429, o.Payload) +func (o *ExecutionActionTooManyRequests) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionTooManyRequests %+v", 429, o.Payload) } -func (o *ExecutionsActionTooManyRequests) String() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionTooManyRequests %+v", 429, o.Payload) +func (o *ExecutionActionTooManyRequests) String() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionTooManyRequests %+v", 429, o.Payload) } -func (o *ExecutionsActionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *ExecutionActionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ExecutionsActionTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionActionTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -631,17 +631,17 @@ func (o *ExecutionsActionTooManyRequests) readResponse(response runtime.ClientRe return nil } -// NewExecutionsActionInternalServerError creates a ExecutionsActionInternalServerError with default headers values -func NewExecutionsActionInternalServerError() *ExecutionsActionInternalServerError { - return &ExecutionsActionInternalServerError{} +// NewExecutionActionInternalServerError creates a ExecutionActionInternalServerError with default headers values +func NewExecutionActionInternalServerError() *ExecutionActionInternalServerError { + return &ExecutionActionInternalServerError{} } /* -ExecutionsActionInternalServerError describes a response with status code 500, with default header values. +ExecutionActionInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ -type ExecutionsActionInternalServerError struct { +type ExecutionActionInternalServerError struct { /* Trace-ID: submit to support if resolving an issue */ @@ -658,49 +658,49 @@ type ExecutionsActionInternalServerError struct { Payload *models.DefinitionsDefinitionEntitiesResponse } -// IsSuccess returns true when this executions action internal server error response has a 2xx status code -func (o *ExecutionsActionInternalServerError) IsSuccess() bool { +// IsSuccess returns true when this execution action internal server error response has a 2xx status code +func (o *ExecutionActionInternalServerError) IsSuccess() bool { return false } -// IsRedirect returns true when this executions action internal server error response has a 3xx status code -func (o *ExecutionsActionInternalServerError) IsRedirect() bool { +// IsRedirect returns true when this execution action internal server error response has a 3xx status code +func (o *ExecutionActionInternalServerError) IsRedirect() bool { return false } -// IsClientError returns true when this executions action internal server error response has a 4xx status code -func (o *ExecutionsActionInternalServerError) IsClientError() bool { +// IsClientError returns true when this execution action internal server error response has a 4xx status code +func (o *ExecutionActionInternalServerError) IsClientError() bool { return false } -// IsServerError returns true when this executions action internal server error response has a 5xx status code -func (o *ExecutionsActionInternalServerError) IsServerError() bool { +// IsServerError returns true when this execution action internal server error response has a 5xx status code +func (o *ExecutionActionInternalServerError) IsServerError() bool { return true } -// IsCode returns true when this executions action internal server error response a status code equal to that given -func (o *ExecutionsActionInternalServerError) IsCode(code int) bool { +// IsCode returns true when this execution action internal server error response a status code equal to that given +func (o *ExecutionActionInternalServerError) IsCode(code int) bool { return code == 500 } -// Code gets the status code for the executions action internal server error response -func (o *ExecutionsActionInternalServerError) Code() int { +// Code gets the status code for the execution action internal server error response +func (o *ExecutionActionInternalServerError) Code() int { return 500 } -func (o *ExecutionsActionInternalServerError) Error() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionInternalServerError %+v", 500, o.Payload) +func (o *ExecutionActionInternalServerError) Error() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionInternalServerError %+v", 500, o.Payload) } -func (o *ExecutionsActionInternalServerError) String() string { - return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionsActionInternalServerError %+v", 500, o.Payload) +func (o *ExecutionActionInternalServerError) String() string { + return fmt.Sprintf("[POST /workflows/entities/execution-actions/v1][%d] executionActionInternalServerError %+v", 500, o.Payload) } -func (o *ExecutionsActionInternalServerError) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { +func (o *ExecutionActionInternalServerError) GetPayload() *models.DefinitionsDefinitionEntitiesResponse { return o.Payload } -func (o *ExecutionsActionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionActionInternalServerError) 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/workflows/execution_results_parameters.go b/falcon/client/workflows/execution_results_parameters.go new file mode 100644 index 00000000..d8f85f64 --- /dev/null +++ b/falcon/client/workflows/execution_results_parameters.go @@ -0,0 +1,175 @@ +// 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" +) + +// NewExecutionResultsParams creates a new ExecutionResultsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewExecutionResultsParams() *ExecutionResultsParams { + return &ExecutionResultsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewExecutionResultsParamsWithTimeout creates a new ExecutionResultsParams object +// with the ability to set a timeout on a request. +func NewExecutionResultsParamsWithTimeout(timeout time.Duration) *ExecutionResultsParams { + return &ExecutionResultsParams{ + timeout: timeout, + } +} + +// NewExecutionResultsParamsWithContext creates a new ExecutionResultsParams object +// with the ability to set a context for a request. +func NewExecutionResultsParamsWithContext(ctx context.Context) *ExecutionResultsParams { + return &ExecutionResultsParams{ + Context: ctx, + } +} + +// NewExecutionResultsParamsWithHTTPClient creates a new ExecutionResultsParams object +// with the ability to set a custom HTTPClient for a request. +func NewExecutionResultsParamsWithHTTPClient(client *http.Client) *ExecutionResultsParams { + return &ExecutionResultsParams{ + HTTPClient: client, + } +} + +/* +ExecutionResultsParams contains all the parameters to send to the API endpoint + + for the execution results operation. + + Typically these are written to a http.Request. +*/ +type ExecutionResultsParams struct { + + /* Ids. + + workflow execution id to return results for. + */ + Ids []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the execution results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExecutionResultsParams) WithDefaults() *ExecutionResultsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the execution results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExecutionResultsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the execution results params +func (o *ExecutionResultsParams) WithTimeout(timeout time.Duration) *ExecutionResultsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the execution results params +func (o *ExecutionResultsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the execution results params +func (o *ExecutionResultsParams) WithContext(ctx context.Context) *ExecutionResultsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the execution results params +func (o *ExecutionResultsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the execution results params +func (o *ExecutionResultsParams) WithHTTPClient(client *http.Client) *ExecutionResultsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the execution results params +func (o *ExecutionResultsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIds adds the ids to the execution results params +func (o *ExecutionResultsParams) WithIds(ids []string) *ExecutionResultsParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the execution results params +func (o *ExecutionResultsParams) SetIds(ids []string) { + o.Ids = ids +} + +// WriteToRequest writes these params to a swagger request +func (o *ExecutionResultsParams) 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 +} + +// bindParamExecutionResults binds the parameter ids +func (o *ExecutionResultsParams) 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/workflows/executions_result_responses.go b/falcon/client/workflows/execution_results_responses.go similarity index 62% rename from falcon/client/workflows/executions_result_responses.go rename to falcon/client/workflows/execution_results_responses.go index d1da76d7..f403c987 100644 --- a/falcon/client/workflows/executions_result_responses.go +++ b/falcon/client/workflows/execution_results_responses.go @@ -17,66 +17,66 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// ExecutionsResultReader is a Reader for the ExecutionsResult structure. -type ExecutionsResultReader struct { +// ExecutionResultsReader is a Reader for the ExecutionResults structure. +type ExecutionResultsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *ExecutionsResultReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ExecutionResultsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewExecutionsResultOK() + result := NewExecutionResultsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: - result := NewExecutionsResultBadRequest() + result := NewExecutionResultsBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: - result := NewExecutionsResultForbidden() + result := NewExecutionResultsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: - result := NewExecutionsResultNotFound() + result := NewExecutionResultsNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewExecutionsResultTooManyRequests() + result := NewExecutionResultsTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: - result := NewExecutionsResultInternalServerError() + result := NewExecutionResultsInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[GET /workflows/entities/execution-results/v1] executions.result", response, response.Code()) + return nil, runtime.NewAPIError("[GET /workflows/entities/execution-results/v1] ExecutionResults", response, response.Code()) } } -// NewExecutionsResultOK creates a ExecutionsResultOK with default headers values -func NewExecutionsResultOK() *ExecutionsResultOK { - return &ExecutionsResultOK{} +// NewExecutionResultsOK creates a ExecutionResultsOK with default headers values +func NewExecutionResultsOK() *ExecutionResultsOK { + return &ExecutionResultsOK{} } /* -ExecutionsResultOK describes a response with status code 200, with default header values. +ExecutionResultsOK describes a response with status code 200, with default header values. OK */ -type ExecutionsResultOK struct { +type ExecutionResultsOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -93,49 +93,49 @@ type ExecutionsResultOK struct { Payload *models.APIExecutionResultsResponse } -// IsSuccess returns true when this executions result o k response has a 2xx status code -func (o *ExecutionsResultOK) IsSuccess() bool { +// IsSuccess returns true when this execution results o k response has a 2xx status code +func (o *ExecutionResultsOK) IsSuccess() bool { return true } -// IsRedirect returns true when this executions result o k response has a 3xx status code -func (o *ExecutionsResultOK) IsRedirect() bool { +// IsRedirect returns true when this execution results o k response has a 3xx status code +func (o *ExecutionResultsOK) IsRedirect() bool { return false } -// IsClientError returns true when this executions result o k response has a 4xx status code -func (o *ExecutionsResultOK) IsClientError() bool { +// IsClientError returns true when this execution results o k response has a 4xx status code +func (o *ExecutionResultsOK) IsClientError() bool { return false } -// IsServerError returns true when this executions result o k response has a 5xx status code -func (o *ExecutionsResultOK) IsServerError() bool { +// IsServerError returns true when this execution results o k response has a 5xx status code +func (o *ExecutionResultsOK) IsServerError() bool { return false } -// IsCode returns true when this executions result o k response a status code equal to that given -func (o *ExecutionsResultOK) IsCode(code int) bool { +// IsCode returns true when this execution results o k response a status code equal to that given +func (o *ExecutionResultsOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the executions result o k response -func (o *ExecutionsResultOK) Code() int { +// Code gets the status code for the execution results o k response +func (o *ExecutionResultsOK) Code() int { return 200 } -func (o *ExecutionsResultOK) Error() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultOK %+v", 200, o.Payload) +func (o *ExecutionResultsOK) Error() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsOK %+v", 200, o.Payload) } -func (o *ExecutionsResultOK) String() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultOK %+v", 200, o.Payload) +func (o *ExecutionResultsOK) String() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsOK %+v", 200, o.Payload) } -func (o *ExecutionsResultOK) GetPayload() *models.APIExecutionResultsResponse { +func (o *ExecutionResultsOK) GetPayload() *models.APIExecutionResultsResponse { return o.Payload } -func (o *ExecutionsResultOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionResultsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -176,17 +176,17 @@ func (o *ExecutionsResultOK) readResponse(response runtime.ClientResponse, consu return nil } -// NewExecutionsResultBadRequest creates a ExecutionsResultBadRequest with default headers values -func NewExecutionsResultBadRequest() *ExecutionsResultBadRequest { - return &ExecutionsResultBadRequest{} +// NewExecutionResultsBadRequest creates a ExecutionResultsBadRequest with default headers values +func NewExecutionResultsBadRequest() *ExecutionResultsBadRequest { + return &ExecutionResultsBadRequest{} } /* -ExecutionsResultBadRequest describes a response with status code 400, with default header values. +ExecutionResultsBadRequest describes a response with status code 400, with default header values. Bad Request */ -type ExecutionsResultBadRequest struct { +type ExecutionResultsBadRequest struct { /* Trace-ID: submit to support if resolving an issue */ @@ -203,49 +203,49 @@ type ExecutionsResultBadRequest struct { Payload *models.APIExecutionResultsResponse } -// IsSuccess returns true when this executions result bad request response has a 2xx status code -func (o *ExecutionsResultBadRequest) IsSuccess() bool { +// IsSuccess returns true when this execution results bad request response has a 2xx status code +func (o *ExecutionResultsBadRequest) IsSuccess() bool { return false } -// IsRedirect returns true when this executions result bad request response has a 3xx status code -func (o *ExecutionsResultBadRequest) IsRedirect() bool { +// IsRedirect returns true when this execution results bad request response has a 3xx status code +func (o *ExecutionResultsBadRequest) IsRedirect() bool { return false } -// IsClientError returns true when this executions result bad request response has a 4xx status code -func (o *ExecutionsResultBadRequest) IsClientError() bool { +// IsClientError returns true when this execution results bad request response has a 4xx status code +func (o *ExecutionResultsBadRequest) IsClientError() bool { return true } -// IsServerError returns true when this executions result bad request response has a 5xx status code -func (o *ExecutionsResultBadRequest) IsServerError() bool { +// IsServerError returns true when this execution results bad request response has a 5xx status code +func (o *ExecutionResultsBadRequest) IsServerError() bool { return false } -// IsCode returns true when this executions result bad request response a status code equal to that given -func (o *ExecutionsResultBadRequest) IsCode(code int) bool { +// IsCode returns true when this execution results bad request response a status code equal to that given +func (o *ExecutionResultsBadRequest) IsCode(code int) bool { return code == 400 } -// Code gets the status code for the executions result bad request response -func (o *ExecutionsResultBadRequest) Code() int { +// Code gets the status code for the execution results bad request response +func (o *ExecutionResultsBadRequest) Code() int { return 400 } -func (o *ExecutionsResultBadRequest) Error() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultBadRequest %+v", 400, o.Payload) +func (o *ExecutionResultsBadRequest) Error() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsBadRequest %+v", 400, o.Payload) } -func (o *ExecutionsResultBadRequest) String() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultBadRequest %+v", 400, o.Payload) +func (o *ExecutionResultsBadRequest) String() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsBadRequest %+v", 400, o.Payload) } -func (o *ExecutionsResultBadRequest) GetPayload() *models.APIExecutionResultsResponse { +func (o *ExecutionResultsBadRequest) GetPayload() *models.APIExecutionResultsResponse { return o.Payload } -func (o *ExecutionsResultBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionResultsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -286,17 +286,17 @@ func (o *ExecutionsResultBadRequest) readResponse(response runtime.ClientRespons return nil } -// NewExecutionsResultForbidden creates a ExecutionsResultForbidden with default headers values -func NewExecutionsResultForbidden() *ExecutionsResultForbidden { - return &ExecutionsResultForbidden{} +// NewExecutionResultsForbidden creates a ExecutionResultsForbidden with default headers values +func NewExecutionResultsForbidden() *ExecutionResultsForbidden { + return &ExecutionResultsForbidden{} } /* -ExecutionsResultForbidden describes a response with status code 403, with default header values. +ExecutionResultsForbidden describes a response with status code 403, with default header values. Forbidden */ -type ExecutionsResultForbidden struct { +type ExecutionResultsForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -313,49 +313,49 @@ type ExecutionsResultForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this executions result forbidden response has a 2xx status code -func (o *ExecutionsResultForbidden) IsSuccess() bool { +// IsSuccess returns true when this execution results forbidden response has a 2xx status code +func (o *ExecutionResultsForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this executions result forbidden response has a 3xx status code -func (o *ExecutionsResultForbidden) IsRedirect() bool { +// IsRedirect returns true when this execution results forbidden response has a 3xx status code +func (o *ExecutionResultsForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this executions result forbidden response has a 4xx status code -func (o *ExecutionsResultForbidden) IsClientError() bool { +// IsClientError returns true when this execution results forbidden response has a 4xx status code +func (o *ExecutionResultsForbidden) IsClientError() bool { return true } -// IsServerError returns true when this executions result forbidden response has a 5xx status code -func (o *ExecutionsResultForbidden) IsServerError() bool { +// IsServerError returns true when this execution results forbidden response has a 5xx status code +func (o *ExecutionResultsForbidden) IsServerError() bool { return false } -// IsCode returns true when this executions result forbidden response a status code equal to that given -func (o *ExecutionsResultForbidden) IsCode(code int) bool { +// IsCode returns true when this execution results forbidden response a status code equal to that given +func (o *ExecutionResultsForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the executions result forbidden response -func (o *ExecutionsResultForbidden) Code() int { +// Code gets the status code for the execution results forbidden response +func (o *ExecutionResultsForbidden) Code() int { return 403 } -func (o *ExecutionsResultForbidden) Error() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultForbidden %+v", 403, o.Payload) +func (o *ExecutionResultsForbidden) Error() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsForbidden %+v", 403, o.Payload) } -func (o *ExecutionsResultForbidden) String() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultForbidden %+v", 403, o.Payload) +func (o *ExecutionResultsForbidden) String() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsForbidden %+v", 403, o.Payload) } -func (o *ExecutionsResultForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *ExecutionResultsForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ExecutionsResultForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionResultsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -396,17 +396,17 @@ func (o *ExecutionsResultForbidden) readResponse(response runtime.ClientResponse return nil } -// NewExecutionsResultNotFound creates a ExecutionsResultNotFound with default headers values -func NewExecutionsResultNotFound() *ExecutionsResultNotFound { - return &ExecutionsResultNotFound{} +// NewExecutionResultsNotFound creates a ExecutionResultsNotFound with default headers values +func NewExecutionResultsNotFound() *ExecutionResultsNotFound { + return &ExecutionResultsNotFound{} } /* -ExecutionsResultNotFound describes a response with status code 404, with default header values. +ExecutionResultsNotFound describes a response with status code 404, with default header values. Not Found */ -type ExecutionsResultNotFound struct { +type ExecutionResultsNotFound struct { /* Trace-ID: submit to support if resolving an issue */ @@ -423,49 +423,49 @@ type ExecutionsResultNotFound struct { Payload *models.APIExecutionResultsResponse } -// IsSuccess returns true when this executions result not found response has a 2xx status code -func (o *ExecutionsResultNotFound) IsSuccess() bool { +// IsSuccess returns true when this execution results not found response has a 2xx status code +func (o *ExecutionResultsNotFound) IsSuccess() bool { return false } -// IsRedirect returns true when this executions result not found response has a 3xx status code -func (o *ExecutionsResultNotFound) IsRedirect() bool { +// IsRedirect returns true when this execution results not found response has a 3xx status code +func (o *ExecutionResultsNotFound) IsRedirect() bool { return false } -// IsClientError returns true when this executions result not found response has a 4xx status code -func (o *ExecutionsResultNotFound) IsClientError() bool { +// IsClientError returns true when this execution results not found response has a 4xx status code +func (o *ExecutionResultsNotFound) IsClientError() bool { return true } -// IsServerError returns true when this executions result not found response has a 5xx status code -func (o *ExecutionsResultNotFound) IsServerError() bool { +// IsServerError returns true when this execution results not found response has a 5xx status code +func (o *ExecutionResultsNotFound) IsServerError() bool { return false } -// IsCode returns true when this executions result not found response a status code equal to that given -func (o *ExecutionsResultNotFound) IsCode(code int) bool { +// IsCode returns true when this execution results not found response a status code equal to that given +func (o *ExecutionResultsNotFound) IsCode(code int) bool { return code == 404 } -// Code gets the status code for the executions result not found response -func (o *ExecutionsResultNotFound) Code() int { +// Code gets the status code for the execution results not found response +func (o *ExecutionResultsNotFound) Code() int { return 404 } -func (o *ExecutionsResultNotFound) Error() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultNotFound %+v", 404, o.Payload) +func (o *ExecutionResultsNotFound) Error() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsNotFound %+v", 404, o.Payload) } -func (o *ExecutionsResultNotFound) String() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultNotFound %+v", 404, o.Payload) +func (o *ExecutionResultsNotFound) String() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsNotFound %+v", 404, o.Payload) } -func (o *ExecutionsResultNotFound) GetPayload() *models.APIExecutionResultsResponse { +func (o *ExecutionResultsNotFound) GetPayload() *models.APIExecutionResultsResponse { return o.Payload } -func (o *ExecutionsResultNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionResultsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -506,17 +506,17 @@ func (o *ExecutionsResultNotFound) readResponse(response runtime.ClientResponse, return nil } -// NewExecutionsResultTooManyRequests creates a ExecutionsResultTooManyRequests with default headers values -func NewExecutionsResultTooManyRequests() *ExecutionsResultTooManyRequests { - return &ExecutionsResultTooManyRequests{} +// NewExecutionResultsTooManyRequests creates a ExecutionResultsTooManyRequests with default headers values +func NewExecutionResultsTooManyRequests() *ExecutionResultsTooManyRequests { + return &ExecutionResultsTooManyRequests{} } /* -ExecutionsResultTooManyRequests describes a response with status code 429, with default header values. +ExecutionResultsTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type ExecutionsResultTooManyRequests struct { +type ExecutionResultsTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -537,49 +537,49 @@ type ExecutionsResultTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this executions result too many requests response has a 2xx status code -func (o *ExecutionsResultTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this execution results too many requests response has a 2xx status code +func (o *ExecutionResultsTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this executions result too many requests response has a 3xx status code -func (o *ExecutionsResultTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this execution results too many requests response has a 3xx status code +func (o *ExecutionResultsTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this executions result too many requests response has a 4xx status code -func (o *ExecutionsResultTooManyRequests) IsClientError() bool { +// IsClientError returns true when this execution results too many requests response has a 4xx status code +func (o *ExecutionResultsTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this executions result too many requests response has a 5xx status code -func (o *ExecutionsResultTooManyRequests) IsServerError() bool { +// IsServerError returns true when this execution results too many requests response has a 5xx status code +func (o *ExecutionResultsTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this executions result too many requests response a status code equal to that given -func (o *ExecutionsResultTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this execution results too many requests response a status code equal to that given +func (o *ExecutionResultsTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the executions result too many requests response -func (o *ExecutionsResultTooManyRequests) Code() int { +// Code gets the status code for the execution results too many requests response +func (o *ExecutionResultsTooManyRequests) Code() int { return 429 } -func (o *ExecutionsResultTooManyRequests) Error() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultTooManyRequests %+v", 429, o.Payload) +func (o *ExecutionResultsTooManyRequests) Error() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsTooManyRequests %+v", 429, o.Payload) } -func (o *ExecutionsResultTooManyRequests) String() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultTooManyRequests %+v", 429, o.Payload) +func (o *ExecutionResultsTooManyRequests) String() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsTooManyRequests %+v", 429, o.Payload) } -func (o *ExecutionsResultTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *ExecutionResultsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *ExecutionsResultTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionResultsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -631,17 +631,17 @@ func (o *ExecutionsResultTooManyRequests) readResponse(response runtime.ClientRe return nil } -// NewExecutionsResultInternalServerError creates a ExecutionsResultInternalServerError with default headers values -func NewExecutionsResultInternalServerError() *ExecutionsResultInternalServerError { - return &ExecutionsResultInternalServerError{} +// NewExecutionResultsInternalServerError creates a ExecutionResultsInternalServerError with default headers values +func NewExecutionResultsInternalServerError() *ExecutionResultsInternalServerError { + return &ExecutionResultsInternalServerError{} } /* -ExecutionsResultInternalServerError describes a response with status code 500, with default header values. +ExecutionResultsInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ -type ExecutionsResultInternalServerError struct { +type ExecutionResultsInternalServerError struct { /* Trace-ID: submit to support if resolving an issue */ @@ -658,49 +658,49 @@ type ExecutionsResultInternalServerError struct { Payload *models.APIExecutionResultsResponse } -// IsSuccess returns true when this executions result internal server error response has a 2xx status code -func (o *ExecutionsResultInternalServerError) IsSuccess() bool { +// IsSuccess returns true when this execution results internal server error response has a 2xx status code +func (o *ExecutionResultsInternalServerError) IsSuccess() bool { return false } -// IsRedirect returns true when this executions result internal server error response has a 3xx status code -func (o *ExecutionsResultInternalServerError) IsRedirect() bool { +// IsRedirect returns true when this execution results internal server error response has a 3xx status code +func (o *ExecutionResultsInternalServerError) IsRedirect() bool { return false } -// IsClientError returns true when this executions result internal server error response has a 4xx status code -func (o *ExecutionsResultInternalServerError) IsClientError() bool { +// IsClientError returns true when this execution results internal server error response has a 4xx status code +func (o *ExecutionResultsInternalServerError) IsClientError() bool { return false } -// IsServerError returns true when this executions result internal server error response has a 5xx status code -func (o *ExecutionsResultInternalServerError) IsServerError() bool { +// IsServerError returns true when this execution results internal server error response has a 5xx status code +func (o *ExecutionResultsInternalServerError) IsServerError() bool { return true } -// IsCode returns true when this executions result internal server error response a status code equal to that given -func (o *ExecutionsResultInternalServerError) IsCode(code int) bool { +// IsCode returns true when this execution results internal server error response a status code equal to that given +func (o *ExecutionResultsInternalServerError) IsCode(code int) bool { return code == 500 } -// Code gets the status code for the executions result internal server error response -func (o *ExecutionsResultInternalServerError) Code() int { +// Code gets the status code for the execution results internal server error response +func (o *ExecutionResultsInternalServerError) Code() int { return 500 } -func (o *ExecutionsResultInternalServerError) Error() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultInternalServerError %+v", 500, o.Payload) +func (o *ExecutionResultsInternalServerError) Error() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsInternalServerError %+v", 500, o.Payload) } -func (o *ExecutionsResultInternalServerError) String() string { - return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionsResultInternalServerError %+v", 500, o.Payload) +func (o *ExecutionResultsInternalServerError) String() string { + return fmt.Sprintf("[GET /workflows/entities/execution-results/v1][%d] executionResultsInternalServerError %+v", 500, o.Payload) } -func (o *ExecutionsResultInternalServerError) GetPayload() *models.APIExecutionResultsResponse { +func (o *ExecutionResultsInternalServerError) GetPayload() *models.APIExecutionResultsResponse { return o.Payload } -func (o *ExecutionsResultInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExecutionResultsInternalServerError) 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/workflows/executions_action_parameters.go b/falcon/client/workflows/executions_action_parameters.go deleted file mode 100644 index 14c45acf..00000000 --- a/falcon/client/workflows/executions_action_parameters.go +++ /dev/null @@ -1,179 +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/crowdstrike/gofalcon/falcon/models" -) - -// NewExecutionsActionParams creates a new ExecutionsActionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExecutionsActionParams() *ExecutionsActionParams { - return &ExecutionsActionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExecutionsActionParamsWithTimeout creates a new ExecutionsActionParams object -// with the ability to set a timeout on a request. -func NewExecutionsActionParamsWithTimeout(timeout time.Duration) *ExecutionsActionParams { - return &ExecutionsActionParams{ - timeout: timeout, - } -} - -// NewExecutionsActionParamsWithContext creates a new ExecutionsActionParams object -// with the ability to set a context for a request. -func NewExecutionsActionParamsWithContext(ctx context.Context) *ExecutionsActionParams { - return &ExecutionsActionParams{ - Context: ctx, - } -} - -// NewExecutionsActionParamsWithHTTPClient creates a new ExecutionsActionParams object -// with the ability to set a custom HTTPClient for a request. -func NewExecutionsActionParamsWithHTTPClient(client *http.Client) *ExecutionsActionParams { - return &ExecutionsActionParams{ - HTTPClient: client, - } -} - -/* -ExecutionsActionParams contains all the parameters to send to the API endpoint - - for the executions action operation. - - Typically these are written to a http.Request. -*/ -type ExecutionsActionParams struct { - - /* ActionName. - - Specify one of these actions: - - - `resume`: resume/retry the workflow execution(s) specified in ids - */ - ActionName string - - // Body. - Body *models.MsaEntityActionRequestV2 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the executions action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExecutionsActionParams) WithDefaults() *ExecutionsActionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the executions action params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExecutionsActionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the executions action params -func (o *ExecutionsActionParams) WithTimeout(timeout time.Duration) *ExecutionsActionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the executions action params -func (o *ExecutionsActionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the executions action params -func (o *ExecutionsActionParams) WithContext(ctx context.Context) *ExecutionsActionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the executions action params -func (o *ExecutionsActionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the executions action params -func (o *ExecutionsActionParams) WithHTTPClient(client *http.Client) *ExecutionsActionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the executions action params -func (o *ExecutionsActionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithActionName adds the actionName to the executions action params -func (o *ExecutionsActionParams) WithActionName(actionName string) *ExecutionsActionParams { - o.SetActionName(actionName) - return o -} - -// SetActionName adds the actionName to the executions action params -func (o *ExecutionsActionParams) SetActionName(actionName string) { - o.ActionName = actionName -} - -// WithBody adds the body to the executions action params -func (o *ExecutionsActionParams) WithBody(body *models.MsaEntityActionRequestV2) *ExecutionsActionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the executions action params -func (o *ExecutionsActionParams) SetBody(body *models.MsaEntityActionRequestV2) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ExecutionsActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param action_name - qrActionName := o.ActionName - qActionName := qrActionName - if qActionName != "" { - - if err := r.SetQueryParam("action_name", qActionName); err != nil { - return err - } - } - 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/workflows/executions_result_parameters.go b/falcon/client/workflows/executions_result_parameters.go deleted file mode 100644 index c01540a3..00000000 --- a/falcon/client/workflows/executions_result_parameters.go +++ /dev/null @@ -1,175 +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" -) - -// NewExecutionsResultParams creates a new ExecutionsResultParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExecutionsResultParams() *ExecutionsResultParams { - return &ExecutionsResultParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExecutionsResultParamsWithTimeout creates a new ExecutionsResultParams object -// with the ability to set a timeout on a request. -func NewExecutionsResultParamsWithTimeout(timeout time.Duration) *ExecutionsResultParams { - return &ExecutionsResultParams{ - timeout: timeout, - } -} - -// NewExecutionsResultParamsWithContext creates a new ExecutionsResultParams object -// with the ability to set a context for a request. -func NewExecutionsResultParamsWithContext(ctx context.Context) *ExecutionsResultParams { - return &ExecutionsResultParams{ - Context: ctx, - } -} - -// NewExecutionsResultParamsWithHTTPClient creates a new ExecutionsResultParams object -// with the ability to set a custom HTTPClient for a request. -func NewExecutionsResultParamsWithHTTPClient(client *http.Client) *ExecutionsResultParams { - return &ExecutionsResultParams{ - HTTPClient: client, - } -} - -/* -ExecutionsResultParams contains all the parameters to send to the API endpoint - - for the executions result operation. - - Typically these are written to a http.Request. -*/ -type ExecutionsResultParams struct { - - /* Ids. - - workflow execution id to return results for. - */ - Ids []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the executions result params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExecutionsResultParams) WithDefaults() *ExecutionsResultParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the executions result params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExecutionsResultParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the executions result params -func (o *ExecutionsResultParams) WithTimeout(timeout time.Duration) *ExecutionsResultParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the executions result params -func (o *ExecutionsResultParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the executions result params -func (o *ExecutionsResultParams) WithContext(ctx context.Context) *ExecutionsResultParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the executions result params -func (o *ExecutionsResultParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the executions result params -func (o *ExecutionsResultParams) WithHTTPClient(client *http.Client) *ExecutionsResultParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the executions result params -func (o *ExecutionsResultParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIds adds the ids to the executions result params -func (o *ExecutionsResultParams) WithIds(ids []string) *ExecutionsResultParams { - o.SetIds(ids) - return o -} - -// SetIds adds the ids to the executions result params -func (o *ExecutionsResultParams) SetIds(ids []string) { - o.Ids = ids -} - -// WriteToRequest writes these params to a swagger request -func (o *ExecutionsResultParams) 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 -} - -// bindParamExecutionsResult binds the parameter ids -func (o *ExecutionsResultParams) 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/workflows/promote_parameters.go b/falcon/client/workflows/promote_parameters.go new file mode 100644 index 00000000..aa07304f --- /dev/null +++ b/falcon/client/workflows/promote_parameters.go @@ -0,0 +1,150 @@ +// 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/crowdstrike/gofalcon/falcon/models" +) + +// NewPromoteParams creates a new PromoteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPromoteParams() *PromoteParams { + return &PromoteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPromoteParamsWithTimeout creates a new PromoteParams object +// with the ability to set a timeout on a request. +func NewPromoteParamsWithTimeout(timeout time.Duration) *PromoteParams { + return &PromoteParams{ + timeout: timeout, + } +} + +// NewPromoteParamsWithContext creates a new PromoteParams object +// with the ability to set a context for a request. +func NewPromoteParamsWithContext(ctx context.Context) *PromoteParams { + return &PromoteParams{ + Context: ctx, + } +} + +// NewPromoteParamsWithHTTPClient creates a new PromoteParams object +// with the ability to set a custom HTTPClient for a request. +func NewPromoteParamsWithHTTPClient(client *http.Client) *PromoteParams { + return &PromoteParams{ + HTTPClient: client, + } +} + +/* +PromoteParams contains all the parameters to send to the API endpoint + + for the promote operation. + + Typically these are written to a http.Request. +*/ +type PromoteParams struct { + + // Body. + Body *models.ClientSystemDefinitionPromoteRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the promote params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PromoteParams) WithDefaults() *PromoteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the promote params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PromoteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the promote params +func (o *PromoteParams) WithTimeout(timeout time.Duration) *PromoteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the promote params +func (o *PromoteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the promote params +func (o *PromoteParams) WithContext(ctx context.Context) *PromoteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the promote params +func (o *PromoteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the promote params +func (o *PromoteParams) WithHTTPClient(client *http.Client) *PromoteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the promote params +func (o *PromoteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the promote params +func (o *PromoteParams) WithBody(body *models.ClientSystemDefinitionPromoteRequest) *PromoteParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the promote params +func (o *PromoteParams) SetBody(body *models.ClientSystemDefinitionPromoteRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *PromoteParams) 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/workflows/promote_system_definition_responses.go b/falcon/client/workflows/promote_responses.go similarity index 50% rename from falcon/client/workflows/promote_system_definition_responses.go rename to falcon/client/workflows/promote_responses.go index 667a2343..97d69892 100644 --- a/falcon/client/workflows/promote_system_definition_responses.go +++ b/falcon/client/workflows/promote_responses.go @@ -17,66 +17,66 @@ import ( "github.com/crowdstrike/gofalcon/falcon/models" ) -// PromoteSystemDefinitionReader is a Reader for the PromoteSystemDefinition structure. -type PromoteSystemDefinitionReader struct { +// PromoteReader is a Reader for the Promote structure. +type PromoteReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *PromoteSystemDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PromoteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewPromoteSystemDefinitionOK() + result := NewPromoteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: - result := NewPromoteSystemDefinitionBadRequest() + result := NewPromoteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: - result := NewPromoteSystemDefinitionForbidden() + result := NewPromoteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: - result := NewPromoteSystemDefinitionNotFound() + result := NewPromoteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 429: - result := NewPromoteSystemDefinitionTooManyRequests() + result := NewPromoteTooManyRequests() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: - result := NewPromoteSystemDefinitionInternalServerError() + result := NewPromoteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: - return nil, runtime.NewAPIError("[POST /workflows/system-definitions/promote/v1] promote.system-definition", response, response.Code()) + return nil, runtime.NewAPIError("[POST /workflows/system-definitions/promote/v1] Promote", response, response.Code()) } } -// NewPromoteSystemDefinitionOK creates a PromoteSystemDefinitionOK with default headers values -func NewPromoteSystemDefinitionOK() *PromoteSystemDefinitionOK { - return &PromoteSystemDefinitionOK{} +// NewPromoteOK creates a PromoteOK with default headers values +func NewPromoteOK() *PromoteOK { + return &PromoteOK{} } /* -PromoteSystemDefinitionOK describes a response with status code 200, with default header values. +PromoteOK describes a response with status code 200, with default header values. OK */ -type PromoteSystemDefinitionOK struct { +type PromoteOK struct { /* Trace-ID: submit to support if resolving an issue */ @@ -93,49 +93,49 @@ type PromoteSystemDefinitionOK struct { Payload *models.ClientSystemDefinitionCreateResponse } -// IsSuccess returns true when this promote system definition o k response has a 2xx status code -func (o *PromoteSystemDefinitionOK) IsSuccess() bool { +// IsSuccess returns true when this promote o k response has a 2xx status code +func (o *PromoteOK) IsSuccess() bool { return true } -// IsRedirect returns true when this promote system definition o k response has a 3xx status code -func (o *PromoteSystemDefinitionOK) IsRedirect() bool { +// IsRedirect returns true when this promote o k response has a 3xx status code +func (o *PromoteOK) IsRedirect() bool { return false } -// IsClientError returns true when this promote system definition o k response has a 4xx status code -func (o *PromoteSystemDefinitionOK) IsClientError() bool { +// IsClientError returns true when this promote o k response has a 4xx status code +func (o *PromoteOK) IsClientError() bool { return false } -// IsServerError returns true when this promote system definition o k response has a 5xx status code -func (o *PromoteSystemDefinitionOK) IsServerError() bool { +// IsServerError returns true when this promote o k response has a 5xx status code +func (o *PromoteOK) IsServerError() bool { return false } -// IsCode returns true when this promote system definition o k response a status code equal to that given -func (o *PromoteSystemDefinitionOK) IsCode(code int) bool { +// IsCode returns true when this promote o k response a status code equal to that given +func (o *PromoteOK) IsCode(code int) bool { return code == 200 } -// Code gets the status code for the promote system definition o k response -func (o *PromoteSystemDefinitionOK) Code() int { +// Code gets the status code for the promote o k response +func (o *PromoteOK) Code() int { return 200 } -func (o *PromoteSystemDefinitionOK) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionOK %+v", 200, o.Payload) +func (o *PromoteOK) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteOK %+v", 200, o.Payload) } -func (o *PromoteSystemDefinitionOK) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionOK %+v", 200, o.Payload) +func (o *PromoteOK) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteOK %+v", 200, o.Payload) } -func (o *PromoteSystemDefinitionOK) GetPayload() *models.ClientSystemDefinitionCreateResponse { +func (o *PromoteOK) GetPayload() *models.ClientSystemDefinitionCreateResponse { return o.Payload } -func (o *PromoteSystemDefinitionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PromoteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -176,17 +176,17 @@ func (o *PromoteSystemDefinitionOK) readResponse(response runtime.ClientResponse return nil } -// NewPromoteSystemDefinitionBadRequest creates a PromoteSystemDefinitionBadRequest with default headers values -func NewPromoteSystemDefinitionBadRequest() *PromoteSystemDefinitionBadRequest { - return &PromoteSystemDefinitionBadRequest{} +// NewPromoteBadRequest creates a PromoteBadRequest with default headers values +func NewPromoteBadRequest() *PromoteBadRequest { + return &PromoteBadRequest{} } /* -PromoteSystemDefinitionBadRequest describes a response with status code 400, with default header values. +PromoteBadRequest describes a response with status code 400, with default header values. Bad Request */ -type PromoteSystemDefinitionBadRequest struct { +type PromoteBadRequest struct { /* Trace-ID: submit to support if resolving an issue */ @@ -203,49 +203,49 @@ type PromoteSystemDefinitionBadRequest struct { Payload *models.ClientSystemDefinitionCreateResponse } -// IsSuccess returns true when this promote system definition bad request response has a 2xx status code -func (o *PromoteSystemDefinitionBadRequest) IsSuccess() bool { +// IsSuccess returns true when this promote bad request response has a 2xx status code +func (o *PromoteBadRequest) IsSuccess() bool { return false } -// IsRedirect returns true when this promote system definition bad request response has a 3xx status code -func (o *PromoteSystemDefinitionBadRequest) IsRedirect() bool { +// IsRedirect returns true when this promote bad request response has a 3xx status code +func (o *PromoteBadRequest) IsRedirect() bool { return false } -// IsClientError returns true when this promote system definition bad request response has a 4xx status code -func (o *PromoteSystemDefinitionBadRequest) IsClientError() bool { +// IsClientError returns true when this promote bad request response has a 4xx status code +func (o *PromoteBadRequest) IsClientError() bool { return true } -// IsServerError returns true when this promote system definition bad request response has a 5xx status code -func (o *PromoteSystemDefinitionBadRequest) IsServerError() bool { +// IsServerError returns true when this promote bad request response has a 5xx status code +func (o *PromoteBadRequest) IsServerError() bool { return false } -// IsCode returns true when this promote system definition bad request response a status code equal to that given -func (o *PromoteSystemDefinitionBadRequest) IsCode(code int) bool { +// IsCode returns true when this promote bad request response a status code equal to that given +func (o *PromoteBadRequest) IsCode(code int) bool { return code == 400 } -// Code gets the status code for the promote system definition bad request response -func (o *PromoteSystemDefinitionBadRequest) Code() int { +// Code gets the status code for the promote bad request response +func (o *PromoteBadRequest) Code() int { return 400 } -func (o *PromoteSystemDefinitionBadRequest) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionBadRequest %+v", 400, o.Payload) +func (o *PromoteBadRequest) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteBadRequest %+v", 400, o.Payload) } -func (o *PromoteSystemDefinitionBadRequest) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionBadRequest %+v", 400, o.Payload) +func (o *PromoteBadRequest) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteBadRequest %+v", 400, o.Payload) } -func (o *PromoteSystemDefinitionBadRequest) GetPayload() *models.ClientSystemDefinitionCreateResponse { +func (o *PromoteBadRequest) GetPayload() *models.ClientSystemDefinitionCreateResponse { return o.Payload } -func (o *PromoteSystemDefinitionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PromoteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -286,17 +286,17 @@ func (o *PromoteSystemDefinitionBadRequest) readResponse(response runtime.Client return nil } -// NewPromoteSystemDefinitionForbidden creates a PromoteSystemDefinitionForbidden with default headers values -func NewPromoteSystemDefinitionForbidden() *PromoteSystemDefinitionForbidden { - return &PromoteSystemDefinitionForbidden{} +// NewPromoteForbidden creates a PromoteForbidden with default headers values +func NewPromoteForbidden() *PromoteForbidden { + return &PromoteForbidden{} } /* -PromoteSystemDefinitionForbidden describes a response with status code 403, with default header values. +PromoteForbidden describes a response with status code 403, with default header values. Forbidden */ -type PromoteSystemDefinitionForbidden struct { +type PromoteForbidden struct { /* Trace-ID: submit to support if resolving an issue */ @@ -313,49 +313,49 @@ type PromoteSystemDefinitionForbidden struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this promote system definition forbidden response has a 2xx status code -func (o *PromoteSystemDefinitionForbidden) IsSuccess() bool { +// IsSuccess returns true when this promote forbidden response has a 2xx status code +func (o *PromoteForbidden) IsSuccess() bool { return false } -// IsRedirect returns true when this promote system definition forbidden response has a 3xx status code -func (o *PromoteSystemDefinitionForbidden) IsRedirect() bool { +// IsRedirect returns true when this promote forbidden response has a 3xx status code +func (o *PromoteForbidden) IsRedirect() bool { return false } -// IsClientError returns true when this promote system definition forbidden response has a 4xx status code -func (o *PromoteSystemDefinitionForbidden) IsClientError() bool { +// IsClientError returns true when this promote forbidden response has a 4xx status code +func (o *PromoteForbidden) IsClientError() bool { return true } -// IsServerError returns true when this promote system definition forbidden response has a 5xx status code -func (o *PromoteSystemDefinitionForbidden) IsServerError() bool { +// IsServerError returns true when this promote forbidden response has a 5xx status code +func (o *PromoteForbidden) IsServerError() bool { return false } -// IsCode returns true when this promote system definition forbidden response a status code equal to that given -func (o *PromoteSystemDefinitionForbidden) IsCode(code int) bool { +// IsCode returns true when this promote forbidden response a status code equal to that given +func (o *PromoteForbidden) IsCode(code int) bool { return code == 403 } -// Code gets the status code for the promote system definition forbidden response -func (o *PromoteSystemDefinitionForbidden) Code() int { +// Code gets the status code for the promote forbidden response +func (o *PromoteForbidden) Code() int { return 403 } -func (o *PromoteSystemDefinitionForbidden) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionForbidden %+v", 403, o.Payload) +func (o *PromoteForbidden) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteForbidden %+v", 403, o.Payload) } -func (o *PromoteSystemDefinitionForbidden) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionForbidden %+v", 403, o.Payload) +func (o *PromoteForbidden) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteForbidden %+v", 403, o.Payload) } -func (o *PromoteSystemDefinitionForbidden) GetPayload() *models.MsaReplyMetaOnly { +func (o *PromoteForbidden) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *PromoteSystemDefinitionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PromoteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -396,17 +396,17 @@ func (o *PromoteSystemDefinitionForbidden) readResponse(response runtime.ClientR return nil } -// NewPromoteSystemDefinitionNotFound creates a PromoteSystemDefinitionNotFound with default headers values -func NewPromoteSystemDefinitionNotFound() *PromoteSystemDefinitionNotFound { - return &PromoteSystemDefinitionNotFound{} +// NewPromoteNotFound creates a PromoteNotFound with default headers values +func NewPromoteNotFound() *PromoteNotFound { + return &PromoteNotFound{} } /* -PromoteSystemDefinitionNotFound describes a response with status code 404, with default header values. +PromoteNotFound describes a response with status code 404, with default header values. Not Found */ -type PromoteSystemDefinitionNotFound struct { +type PromoteNotFound struct { /* Trace-ID: submit to support if resolving an issue */ @@ -423,49 +423,49 @@ type PromoteSystemDefinitionNotFound struct { Payload *models.ClientSystemDefinitionCreateResponse } -// IsSuccess returns true when this promote system definition not found response has a 2xx status code -func (o *PromoteSystemDefinitionNotFound) IsSuccess() bool { +// IsSuccess returns true when this promote not found response has a 2xx status code +func (o *PromoteNotFound) IsSuccess() bool { return false } -// IsRedirect returns true when this promote system definition not found response has a 3xx status code -func (o *PromoteSystemDefinitionNotFound) IsRedirect() bool { +// IsRedirect returns true when this promote not found response has a 3xx status code +func (o *PromoteNotFound) IsRedirect() bool { return false } -// IsClientError returns true when this promote system definition not found response has a 4xx status code -func (o *PromoteSystemDefinitionNotFound) IsClientError() bool { +// IsClientError returns true when this promote not found response has a 4xx status code +func (o *PromoteNotFound) IsClientError() bool { return true } -// IsServerError returns true when this promote system definition not found response has a 5xx status code -func (o *PromoteSystemDefinitionNotFound) IsServerError() bool { +// IsServerError returns true when this promote not found response has a 5xx status code +func (o *PromoteNotFound) IsServerError() bool { return false } -// IsCode returns true when this promote system definition not found response a status code equal to that given -func (o *PromoteSystemDefinitionNotFound) IsCode(code int) bool { +// IsCode returns true when this promote not found response a status code equal to that given +func (o *PromoteNotFound) IsCode(code int) bool { return code == 404 } -// Code gets the status code for the promote system definition not found response -func (o *PromoteSystemDefinitionNotFound) Code() int { +// Code gets the status code for the promote not found response +func (o *PromoteNotFound) Code() int { return 404 } -func (o *PromoteSystemDefinitionNotFound) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionNotFound %+v", 404, o.Payload) +func (o *PromoteNotFound) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteNotFound %+v", 404, o.Payload) } -func (o *PromoteSystemDefinitionNotFound) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionNotFound %+v", 404, o.Payload) +func (o *PromoteNotFound) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteNotFound %+v", 404, o.Payload) } -func (o *PromoteSystemDefinitionNotFound) GetPayload() *models.ClientSystemDefinitionCreateResponse { +func (o *PromoteNotFound) GetPayload() *models.ClientSystemDefinitionCreateResponse { return o.Payload } -func (o *PromoteSystemDefinitionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PromoteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -506,17 +506,17 @@ func (o *PromoteSystemDefinitionNotFound) readResponse(response runtime.ClientRe return nil } -// NewPromoteSystemDefinitionTooManyRequests creates a PromoteSystemDefinitionTooManyRequests with default headers values -func NewPromoteSystemDefinitionTooManyRequests() *PromoteSystemDefinitionTooManyRequests { - return &PromoteSystemDefinitionTooManyRequests{} +// NewPromoteTooManyRequests creates a PromoteTooManyRequests with default headers values +func NewPromoteTooManyRequests() *PromoteTooManyRequests { + return &PromoteTooManyRequests{} } /* -PromoteSystemDefinitionTooManyRequests describes a response with status code 429, with default header values. +PromoteTooManyRequests describes a response with status code 429, with default header values. Too Many Requests */ -type PromoteSystemDefinitionTooManyRequests struct { +type PromoteTooManyRequests struct { /* Trace-ID: submit to support if resolving an issue */ @@ -537,49 +537,49 @@ type PromoteSystemDefinitionTooManyRequests struct { Payload *models.MsaReplyMetaOnly } -// IsSuccess returns true when this promote system definition too many requests response has a 2xx status code -func (o *PromoteSystemDefinitionTooManyRequests) IsSuccess() bool { +// IsSuccess returns true when this promote too many requests response has a 2xx status code +func (o *PromoteTooManyRequests) IsSuccess() bool { return false } -// IsRedirect returns true when this promote system definition too many requests response has a 3xx status code -func (o *PromoteSystemDefinitionTooManyRequests) IsRedirect() bool { +// IsRedirect returns true when this promote too many requests response has a 3xx status code +func (o *PromoteTooManyRequests) IsRedirect() bool { return false } -// IsClientError returns true when this promote system definition too many requests response has a 4xx status code -func (o *PromoteSystemDefinitionTooManyRequests) IsClientError() bool { +// IsClientError returns true when this promote too many requests response has a 4xx status code +func (o *PromoteTooManyRequests) IsClientError() bool { return true } -// IsServerError returns true when this promote system definition too many requests response has a 5xx status code -func (o *PromoteSystemDefinitionTooManyRequests) IsServerError() bool { +// IsServerError returns true when this promote too many requests response has a 5xx status code +func (o *PromoteTooManyRequests) IsServerError() bool { return false } -// IsCode returns true when this promote system definition too many requests response a status code equal to that given -func (o *PromoteSystemDefinitionTooManyRequests) IsCode(code int) bool { +// IsCode returns true when this promote too many requests response a status code equal to that given +func (o *PromoteTooManyRequests) IsCode(code int) bool { return code == 429 } -// Code gets the status code for the promote system definition too many requests response -func (o *PromoteSystemDefinitionTooManyRequests) Code() int { +// Code gets the status code for the promote too many requests response +func (o *PromoteTooManyRequests) Code() int { return 429 } -func (o *PromoteSystemDefinitionTooManyRequests) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionTooManyRequests %+v", 429, o.Payload) +func (o *PromoteTooManyRequests) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteTooManyRequests %+v", 429, o.Payload) } -func (o *PromoteSystemDefinitionTooManyRequests) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionTooManyRequests %+v", 429, o.Payload) +func (o *PromoteTooManyRequests) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteTooManyRequests %+v", 429, o.Payload) } -func (o *PromoteSystemDefinitionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { +func (o *PromoteTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { return o.Payload } -func (o *PromoteSystemDefinitionTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PromoteTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header X-CS-TRACEID hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") @@ -631,17 +631,17 @@ func (o *PromoteSystemDefinitionTooManyRequests) readResponse(response runtime.C return nil } -// NewPromoteSystemDefinitionInternalServerError creates a PromoteSystemDefinitionInternalServerError with default headers values -func NewPromoteSystemDefinitionInternalServerError() *PromoteSystemDefinitionInternalServerError { - return &PromoteSystemDefinitionInternalServerError{} +// NewPromoteInternalServerError creates a PromoteInternalServerError with default headers values +func NewPromoteInternalServerError() *PromoteInternalServerError { + return &PromoteInternalServerError{} } /* -PromoteSystemDefinitionInternalServerError describes a response with status code 500, with default header values. +PromoteInternalServerError describes a response with status code 500, with default header values. Internal Server Error */ -type PromoteSystemDefinitionInternalServerError struct { +type PromoteInternalServerError struct { /* Trace-ID: submit to support if resolving an issue */ @@ -658,49 +658,49 @@ type PromoteSystemDefinitionInternalServerError struct { Payload *models.ClientSystemDefinitionCreateResponse } -// IsSuccess returns true when this promote system definition internal server error response has a 2xx status code -func (o *PromoteSystemDefinitionInternalServerError) IsSuccess() bool { +// IsSuccess returns true when this promote internal server error response has a 2xx status code +func (o *PromoteInternalServerError) IsSuccess() bool { return false } -// IsRedirect returns true when this promote system definition internal server error response has a 3xx status code -func (o *PromoteSystemDefinitionInternalServerError) IsRedirect() bool { +// IsRedirect returns true when this promote internal server error response has a 3xx status code +func (o *PromoteInternalServerError) IsRedirect() bool { return false } -// IsClientError returns true when this promote system definition internal server error response has a 4xx status code -func (o *PromoteSystemDefinitionInternalServerError) IsClientError() bool { +// IsClientError returns true when this promote internal server error response has a 4xx status code +func (o *PromoteInternalServerError) IsClientError() bool { return false } -// IsServerError returns true when this promote system definition internal server error response has a 5xx status code -func (o *PromoteSystemDefinitionInternalServerError) IsServerError() bool { +// IsServerError returns true when this promote internal server error response has a 5xx status code +func (o *PromoteInternalServerError) IsServerError() bool { return true } -// IsCode returns true when this promote system definition internal server error response a status code equal to that given -func (o *PromoteSystemDefinitionInternalServerError) IsCode(code int) bool { +// IsCode returns true when this promote internal server error response a status code equal to that given +func (o *PromoteInternalServerError) IsCode(code int) bool { return code == 500 } -// Code gets the status code for the promote system definition internal server error response -func (o *PromoteSystemDefinitionInternalServerError) Code() int { +// Code gets the status code for the promote internal server error response +func (o *PromoteInternalServerError) Code() int { return 500 } -func (o *PromoteSystemDefinitionInternalServerError) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionInternalServerError %+v", 500, o.Payload) +func (o *PromoteInternalServerError) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteInternalServerError %+v", 500, o.Payload) } -func (o *PromoteSystemDefinitionInternalServerError) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteSystemDefinitionInternalServerError %+v", 500, o.Payload) +func (o *PromoteInternalServerError) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/promote/v1][%d] promoteInternalServerError %+v", 500, o.Payload) } -func (o *PromoteSystemDefinitionInternalServerError) GetPayload() *models.ClientSystemDefinitionCreateResponse { +func (o *PromoteInternalServerError) GetPayload() *models.ClientSystemDefinitionCreateResponse { return o.Payload } -func (o *PromoteSystemDefinitionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PromoteInternalServerError) 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/workflows/promote_system_definition_parameters.go b/falcon/client/workflows/promote_system_definition_parameters.go deleted file mode 100644 index 78195ac3..00000000 --- a/falcon/client/workflows/promote_system_definition_parameters.go +++ /dev/null @@ -1,150 +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/crowdstrike/gofalcon/falcon/models" -) - -// NewPromoteSystemDefinitionParams creates a new PromoteSystemDefinitionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPromoteSystemDefinitionParams() *PromoteSystemDefinitionParams { - return &PromoteSystemDefinitionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPromoteSystemDefinitionParamsWithTimeout creates a new PromoteSystemDefinitionParams object -// with the ability to set a timeout on a request. -func NewPromoteSystemDefinitionParamsWithTimeout(timeout time.Duration) *PromoteSystemDefinitionParams { - return &PromoteSystemDefinitionParams{ - timeout: timeout, - } -} - -// NewPromoteSystemDefinitionParamsWithContext creates a new PromoteSystemDefinitionParams object -// with the ability to set a context for a request. -func NewPromoteSystemDefinitionParamsWithContext(ctx context.Context) *PromoteSystemDefinitionParams { - return &PromoteSystemDefinitionParams{ - Context: ctx, - } -} - -// NewPromoteSystemDefinitionParamsWithHTTPClient creates a new PromoteSystemDefinitionParams object -// with the ability to set a custom HTTPClient for a request. -func NewPromoteSystemDefinitionParamsWithHTTPClient(client *http.Client) *PromoteSystemDefinitionParams { - return &PromoteSystemDefinitionParams{ - HTTPClient: client, - } -} - -/* -PromoteSystemDefinitionParams contains all the parameters to send to the API endpoint - - for the promote system definition operation. - - Typically these are written to a http.Request. -*/ -type PromoteSystemDefinitionParams struct { - - // Body. - Body *models.ClientSystemDefinitionPromoteRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the promote system definition params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PromoteSystemDefinitionParams) WithDefaults() *PromoteSystemDefinitionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the promote system definition params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PromoteSystemDefinitionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the promote system definition params -func (o *PromoteSystemDefinitionParams) WithTimeout(timeout time.Duration) *PromoteSystemDefinitionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the promote system definition params -func (o *PromoteSystemDefinitionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the promote system definition params -func (o *PromoteSystemDefinitionParams) WithContext(ctx context.Context) *PromoteSystemDefinitionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the promote system definition params -func (o *PromoteSystemDefinitionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the promote system definition params -func (o *PromoteSystemDefinitionParams) WithHTTPClient(client *http.Client) *PromoteSystemDefinitionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the promote system definition params -func (o *PromoteSystemDefinitionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the promote system definition params -func (o *PromoteSystemDefinitionParams) WithBody(body *models.ClientSystemDefinitionPromoteRequest) *PromoteSystemDefinitionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the promote system definition params -func (o *PromoteSystemDefinitionParams) SetBody(body *models.ClientSystemDefinitionPromoteRequest) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *PromoteSystemDefinitionParams) 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/workflows/provision_parameters.go b/falcon/client/workflows/provision_parameters.go new file mode 100644 index 00000000..f19c3728 --- /dev/null +++ b/falcon/client/workflows/provision_parameters.go @@ -0,0 +1,150 @@ +// 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/crowdstrike/gofalcon/falcon/models" +) + +// NewProvisionParams creates a new ProvisionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewProvisionParams() *ProvisionParams { + return &ProvisionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewProvisionParamsWithTimeout creates a new ProvisionParams object +// with the ability to set a timeout on a request. +func NewProvisionParamsWithTimeout(timeout time.Duration) *ProvisionParams { + return &ProvisionParams{ + timeout: timeout, + } +} + +// NewProvisionParamsWithContext creates a new ProvisionParams object +// with the ability to set a context for a request. +func NewProvisionParamsWithContext(ctx context.Context) *ProvisionParams { + return &ProvisionParams{ + Context: ctx, + } +} + +// NewProvisionParamsWithHTTPClient creates a new ProvisionParams object +// with the ability to set a custom HTTPClient for a request. +func NewProvisionParamsWithHTTPClient(client *http.Client) *ProvisionParams { + return &ProvisionParams{ + HTTPClient: client, + } +} + +/* +ProvisionParams contains all the parameters to send to the API endpoint + + for the provision operation. + + Typically these are written to a http.Request. +*/ +type ProvisionParams struct { + + // Body. + Body *models.ClientSystemDefinitionProvisionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the provision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProvisionParams) WithDefaults() *ProvisionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the provision params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProvisionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the provision params +func (o *ProvisionParams) WithTimeout(timeout time.Duration) *ProvisionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the provision params +func (o *ProvisionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the provision params +func (o *ProvisionParams) WithContext(ctx context.Context) *ProvisionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the provision params +func (o *ProvisionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the provision params +func (o *ProvisionParams) WithHTTPClient(client *http.Client) *ProvisionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the provision params +func (o *ProvisionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the provision params +func (o *ProvisionParams) WithBody(body *models.ClientSystemDefinitionProvisionRequest) *ProvisionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the provision params +func (o *ProvisionParams) SetBody(body *models.ClientSystemDefinitionProvisionRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ProvisionParams) 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/workflows/provision_responses.go b/falcon/client/workflows/provision_responses.go new file mode 100644 index 00000000..273c207e --- /dev/null +++ b/falcon/client/workflows/provision_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" +) + +// ProvisionReader is a Reader for the Provision structure. +type ProvisionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProvisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewProvisionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewProvisionBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewProvisionForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewProvisionNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewProvisionTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewProvisionInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /workflows/system-definitions/provision/v1] Provision", response, response.Code()) + } +} + +// NewProvisionOK creates a ProvisionOK with default headers values +func NewProvisionOK() *ProvisionOK { + return &ProvisionOK{} +} + +/* +ProvisionOK describes a response with status code 200, with default header values. + +OK +*/ +type ProvisionOK 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this provision o k response has a 2xx status code +func (o *ProvisionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this provision o k response has a 3xx status code +func (o *ProvisionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provision o k response has a 4xx status code +func (o *ProvisionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this provision o k response has a 5xx status code +func (o *ProvisionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this provision o k response a status code equal to that given +func (o *ProvisionOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the provision o k response +func (o *ProvisionOK) Code() int { + return 200 +} + +func (o *ProvisionOK) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionOK %+v", 200, o.Payload) +} + +func (o *ProvisionOK) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionOK %+v", 200, o.Payload) +} + +func (o *ProvisionOK) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *ProvisionOK) 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.ClientSystemDefinitionCreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProvisionBadRequest creates a ProvisionBadRequest with default headers values +func NewProvisionBadRequest() *ProvisionBadRequest { + return &ProvisionBadRequest{} +} + +/* +ProvisionBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ProvisionBadRequest 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this provision bad request response has a 2xx status code +func (o *ProvisionBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this provision bad request response has a 3xx status code +func (o *ProvisionBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provision bad request response has a 4xx status code +func (o *ProvisionBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this provision bad request response has a 5xx status code +func (o *ProvisionBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this provision bad request response a status code equal to that given +func (o *ProvisionBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the provision bad request response +func (o *ProvisionBadRequest) Code() int { + return 400 +} + +func (o *ProvisionBadRequest) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionBadRequest %+v", 400, o.Payload) +} + +func (o *ProvisionBadRequest) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionBadRequest %+v", 400, o.Payload) +} + +func (o *ProvisionBadRequest) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *ProvisionBadRequest) 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.ClientSystemDefinitionCreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProvisionForbidden creates a ProvisionForbidden with default headers values +func NewProvisionForbidden() *ProvisionForbidden { + return &ProvisionForbidden{} +} + +/* +ProvisionForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ProvisionForbidden 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 provision forbidden response has a 2xx status code +func (o *ProvisionForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this provision forbidden response has a 3xx status code +func (o *ProvisionForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provision forbidden response has a 4xx status code +func (o *ProvisionForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this provision forbidden response has a 5xx status code +func (o *ProvisionForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this provision forbidden response a status code equal to that given +func (o *ProvisionForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the provision forbidden response +func (o *ProvisionForbidden) Code() int { + return 403 +} + +func (o *ProvisionForbidden) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionForbidden %+v", 403, o.Payload) +} + +func (o *ProvisionForbidden) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionForbidden %+v", 403, o.Payload) +} + +func (o *ProvisionForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ProvisionForbidden) 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 +} + +// NewProvisionNotFound creates a ProvisionNotFound with default headers values +func NewProvisionNotFound() *ProvisionNotFound { + return &ProvisionNotFound{} +} + +/* +ProvisionNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ProvisionNotFound 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this provision not found response has a 2xx status code +func (o *ProvisionNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this provision not found response has a 3xx status code +func (o *ProvisionNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provision not found response has a 4xx status code +func (o *ProvisionNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this provision not found response has a 5xx status code +func (o *ProvisionNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this provision not found response a status code equal to that given +func (o *ProvisionNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the provision not found response +func (o *ProvisionNotFound) Code() int { + return 404 +} + +func (o *ProvisionNotFound) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionNotFound %+v", 404, o.Payload) +} + +func (o *ProvisionNotFound) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionNotFound %+v", 404, o.Payload) +} + +func (o *ProvisionNotFound) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *ProvisionNotFound) 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.ClientSystemDefinitionCreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProvisionTooManyRequests creates a ProvisionTooManyRequests with default headers values +func NewProvisionTooManyRequests() *ProvisionTooManyRequests { + return &ProvisionTooManyRequests{} +} + +/* +ProvisionTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ProvisionTooManyRequests 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 provision too many requests response has a 2xx status code +func (o *ProvisionTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this provision too many requests response has a 3xx status code +func (o *ProvisionTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provision too many requests response has a 4xx status code +func (o *ProvisionTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this provision too many requests response has a 5xx status code +func (o *ProvisionTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this provision too many requests response a status code equal to that given +func (o *ProvisionTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the provision too many requests response +func (o *ProvisionTooManyRequests) Code() int { + return 429 +} + +func (o *ProvisionTooManyRequests) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionTooManyRequests %+v", 429, o.Payload) +} + +func (o *ProvisionTooManyRequests) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionTooManyRequests %+v", 429, o.Payload) +} + +func (o *ProvisionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ProvisionTooManyRequests) 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 +} + +// NewProvisionInternalServerError creates a ProvisionInternalServerError with default headers values +func NewProvisionInternalServerError() *ProvisionInternalServerError { + return &ProvisionInternalServerError{} +} + +/* +ProvisionInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type ProvisionInternalServerError 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.ClientSystemDefinitionCreateResponse +} + +// IsSuccess returns true when this provision internal server error response has a 2xx status code +func (o *ProvisionInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this provision internal server error response has a 3xx status code +func (o *ProvisionInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provision internal server error response has a 4xx status code +func (o *ProvisionInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this provision internal server error response has a 5xx status code +func (o *ProvisionInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this provision internal server error response a status code equal to that given +func (o *ProvisionInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the provision internal server error response +func (o *ProvisionInternalServerError) Code() int { + return 500 +} + +func (o *ProvisionInternalServerError) Error() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionInternalServerError %+v", 500, o.Payload) +} + +func (o *ProvisionInternalServerError) String() string { + return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionInternalServerError %+v", 500, o.Payload) +} + +func (o *ProvisionInternalServerError) GetPayload() *models.ClientSystemDefinitionCreateResponse { + return o.Payload +} + +func (o *ProvisionInternalServerError) 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.ClientSystemDefinitionCreateResponse) + + // 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/provision_system_definition_parameters.go b/falcon/client/workflows/provision_system_definition_parameters.go deleted file mode 100644 index 98dbc42d..00000000 --- a/falcon/client/workflows/provision_system_definition_parameters.go +++ /dev/null @@ -1,150 +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/crowdstrike/gofalcon/falcon/models" -) - -// NewProvisionSystemDefinitionParams creates a new ProvisionSystemDefinitionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewProvisionSystemDefinitionParams() *ProvisionSystemDefinitionParams { - return &ProvisionSystemDefinitionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewProvisionSystemDefinitionParamsWithTimeout creates a new ProvisionSystemDefinitionParams object -// with the ability to set a timeout on a request. -func NewProvisionSystemDefinitionParamsWithTimeout(timeout time.Duration) *ProvisionSystemDefinitionParams { - return &ProvisionSystemDefinitionParams{ - timeout: timeout, - } -} - -// NewProvisionSystemDefinitionParamsWithContext creates a new ProvisionSystemDefinitionParams object -// with the ability to set a context for a request. -func NewProvisionSystemDefinitionParamsWithContext(ctx context.Context) *ProvisionSystemDefinitionParams { - return &ProvisionSystemDefinitionParams{ - Context: ctx, - } -} - -// NewProvisionSystemDefinitionParamsWithHTTPClient creates a new ProvisionSystemDefinitionParams object -// with the ability to set a custom HTTPClient for a request. -func NewProvisionSystemDefinitionParamsWithHTTPClient(client *http.Client) *ProvisionSystemDefinitionParams { - return &ProvisionSystemDefinitionParams{ - HTTPClient: client, - } -} - -/* -ProvisionSystemDefinitionParams contains all the parameters to send to the API endpoint - - for the provision system definition operation. - - Typically these are written to a http.Request. -*/ -type ProvisionSystemDefinitionParams struct { - - // Body. - Body *models.ClientSystemDefinitionProvisionRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the provision system definition params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ProvisionSystemDefinitionParams) WithDefaults() *ProvisionSystemDefinitionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the provision system definition params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ProvisionSystemDefinitionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the provision system definition params -func (o *ProvisionSystemDefinitionParams) WithTimeout(timeout time.Duration) *ProvisionSystemDefinitionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the provision system definition params -func (o *ProvisionSystemDefinitionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the provision system definition params -func (o *ProvisionSystemDefinitionParams) WithContext(ctx context.Context) *ProvisionSystemDefinitionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the provision system definition params -func (o *ProvisionSystemDefinitionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the provision system definition params -func (o *ProvisionSystemDefinitionParams) WithHTTPClient(client *http.Client) *ProvisionSystemDefinitionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the provision system definition params -func (o *ProvisionSystemDefinitionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the provision system definition params -func (o *ProvisionSystemDefinitionParams) WithBody(body *models.ClientSystemDefinitionProvisionRequest) *ProvisionSystemDefinitionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the provision system definition params -func (o *ProvisionSystemDefinitionParams) SetBody(body *models.ClientSystemDefinitionProvisionRequest) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ProvisionSystemDefinitionParams) 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/workflows/provision_system_definition_responses.go b/falcon/client/workflows/provision_system_definition_responses.go deleted file mode 100644 index 426e696a..00000000 --- a/falcon/client/workflows/provision_system_definition_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" -) - -// ProvisionSystemDefinitionReader is a Reader for the ProvisionSystemDefinition structure. -type ProvisionSystemDefinitionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ProvisionSystemDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewProvisionSystemDefinitionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewProvisionSystemDefinitionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewProvisionSystemDefinitionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewProvisionSystemDefinitionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewProvisionSystemDefinitionTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewProvisionSystemDefinitionInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /workflows/system-definitions/provision/v1] provision.system-definition", response, response.Code()) - } -} - -// NewProvisionSystemDefinitionOK creates a ProvisionSystemDefinitionOK with default headers values -func NewProvisionSystemDefinitionOK() *ProvisionSystemDefinitionOK { - return &ProvisionSystemDefinitionOK{} -} - -/* -ProvisionSystemDefinitionOK describes a response with status code 200, with default header values. - -OK -*/ -type ProvisionSystemDefinitionOK 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this provision system definition o k response has a 2xx status code -func (o *ProvisionSystemDefinitionOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this provision system definition o k response has a 3xx status code -func (o *ProvisionSystemDefinitionOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this provision system definition o k response has a 4xx status code -func (o *ProvisionSystemDefinitionOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this provision system definition o k response has a 5xx status code -func (o *ProvisionSystemDefinitionOK) IsServerError() bool { - return false -} - -// IsCode returns true when this provision system definition o k response a status code equal to that given -func (o *ProvisionSystemDefinitionOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the provision system definition o k response -func (o *ProvisionSystemDefinitionOK) Code() int { - return 200 -} - -func (o *ProvisionSystemDefinitionOK) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionOK %+v", 200, o.Payload) -} - -func (o *ProvisionSystemDefinitionOK) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionOK %+v", 200, o.Payload) -} - -func (o *ProvisionSystemDefinitionOK) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *ProvisionSystemDefinitionOK) 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.ClientSystemDefinitionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProvisionSystemDefinitionBadRequest creates a ProvisionSystemDefinitionBadRequest with default headers values -func NewProvisionSystemDefinitionBadRequest() *ProvisionSystemDefinitionBadRequest { - return &ProvisionSystemDefinitionBadRequest{} -} - -/* -ProvisionSystemDefinitionBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type ProvisionSystemDefinitionBadRequest 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this provision system definition bad request response has a 2xx status code -func (o *ProvisionSystemDefinitionBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this provision system definition bad request response has a 3xx status code -func (o *ProvisionSystemDefinitionBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this provision system definition bad request response has a 4xx status code -func (o *ProvisionSystemDefinitionBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this provision system definition bad request response has a 5xx status code -func (o *ProvisionSystemDefinitionBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this provision system definition bad request response a status code equal to that given -func (o *ProvisionSystemDefinitionBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the provision system definition bad request response -func (o *ProvisionSystemDefinitionBadRequest) Code() int { - return 400 -} - -func (o *ProvisionSystemDefinitionBadRequest) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionBadRequest %+v", 400, o.Payload) -} - -func (o *ProvisionSystemDefinitionBadRequest) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionBadRequest %+v", 400, o.Payload) -} - -func (o *ProvisionSystemDefinitionBadRequest) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *ProvisionSystemDefinitionBadRequest) 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.ClientSystemDefinitionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProvisionSystemDefinitionForbidden creates a ProvisionSystemDefinitionForbidden with default headers values -func NewProvisionSystemDefinitionForbidden() *ProvisionSystemDefinitionForbidden { - return &ProvisionSystemDefinitionForbidden{} -} - -/* -ProvisionSystemDefinitionForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type ProvisionSystemDefinitionForbidden 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 provision system definition forbidden response has a 2xx status code -func (o *ProvisionSystemDefinitionForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this provision system definition forbidden response has a 3xx status code -func (o *ProvisionSystemDefinitionForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this provision system definition forbidden response has a 4xx status code -func (o *ProvisionSystemDefinitionForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this provision system definition forbidden response has a 5xx status code -func (o *ProvisionSystemDefinitionForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this provision system definition forbidden response a status code equal to that given -func (o *ProvisionSystemDefinitionForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the provision system definition forbidden response -func (o *ProvisionSystemDefinitionForbidden) Code() int { - return 403 -} - -func (o *ProvisionSystemDefinitionForbidden) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionForbidden %+v", 403, o.Payload) -} - -func (o *ProvisionSystemDefinitionForbidden) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionForbidden %+v", 403, o.Payload) -} - -func (o *ProvisionSystemDefinitionForbidden) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *ProvisionSystemDefinitionForbidden) 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 -} - -// NewProvisionSystemDefinitionNotFound creates a ProvisionSystemDefinitionNotFound with default headers values -func NewProvisionSystemDefinitionNotFound() *ProvisionSystemDefinitionNotFound { - return &ProvisionSystemDefinitionNotFound{} -} - -/* -ProvisionSystemDefinitionNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type ProvisionSystemDefinitionNotFound 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this provision system definition not found response has a 2xx status code -func (o *ProvisionSystemDefinitionNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this provision system definition not found response has a 3xx status code -func (o *ProvisionSystemDefinitionNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this provision system definition not found response has a 4xx status code -func (o *ProvisionSystemDefinitionNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this provision system definition not found response has a 5xx status code -func (o *ProvisionSystemDefinitionNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this provision system definition not found response a status code equal to that given -func (o *ProvisionSystemDefinitionNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the provision system definition not found response -func (o *ProvisionSystemDefinitionNotFound) Code() int { - return 404 -} - -func (o *ProvisionSystemDefinitionNotFound) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionNotFound %+v", 404, o.Payload) -} - -func (o *ProvisionSystemDefinitionNotFound) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionNotFound %+v", 404, o.Payload) -} - -func (o *ProvisionSystemDefinitionNotFound) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *ProvisionSystemDefinitionNotFound) 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.ClientSystemDefinitionCreateResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProvisionSystemDefinitionTooManyRequests creates a ProvisionSystemDefinitionTooManyRequests with default headers values -func NewProvisionSystemDefinitionTooManyRequests() *ProvisionSystemDefinitionTooManyRequests { - return &ProvisionSystemDefinitionTooManyRequests{} -} - -/* -ProvisionSystemDefinitionTooManyRequests describes a response with status code 429, with default header values. - -Too Many Requests -*/ -type ProvisionSystemDefinitionTooManyRequests 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 provision system definition too many requests response has a 2xx status code -func (o *ProvisionSystemDefinitionTooManyRequests) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this provision system definition too many requests response has a 3xx status code -func (o *ProvisionSystemDefinitionTooManyRequests) IsRedirect() bool { - return false -} - -// IsClientError returns true when this provision system definition too many requests response has a 4xx status code -func (o *ProvisionSystemDefinitionTooManyRequests) IsClientError() bool { - return true -} - -// IsServerError returns true when this provision system definition too many requests response has a 5xx status code -func (o *ProvisionSystemDefinitionTooManyRequests) IsServerError() bool { - return false -} - -// IsCode returns true when this provision system definition too many requests response a status code equal to that given -func (o *ProvisionSystemDefinitionTooManyRequests) IsCode(code int) bool { - return code == 429 -} - -// Code gets the status code for the provision system definition too many requests response -func (o *ProvisionSystemDefinitionTooManyRequests) Code() int { - return 429 -} - -func (o *ProvisionSystemDefinitionTooManyRequests) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionTooManyRequests %+v", 429, o.Payload) -} - -func (o *ProvisionSystemDefinitionTooManyRequests) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionTooManyRequests %+v", 429, o.Payload) -} - -func (o *ProvisionSystemDefinitionTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { - return o.Payload -} - -func (o *ProvisionSystemDefinitionTooManyRequests) 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 -} - -// NewProvisionSystemDefinitionInternalServerError creates a ProvisionSystemDefinitionInternalServerError with default headers values -func NewProvisionSystemDefinitionInternalServerError() *ProvisionSystemDefinitionInternalServerError { - return &ProvisionSystemDefinitionInternalServerError{} -} - -/* -ProvisionSystemDefinitionInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type ProvisionSystemDefinitionInternalServerError 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.ClientSystemDefinitionCreateResponse -} - -// IsSuccess returns true when this provision system definition internal server error response has a 2xx status code -func (o *ProvisionSystemDefinitionInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this provision system definition internal server error response has a 3xx status code -func (o *ProvisionSystemDefinitionInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this provision system definition internal server error response has a 4xx status code -func (o *ProvisionSystemDefinitionInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this provision system definition internal server error response has a 5xx status code -func (o *ProvisionSystemDefinitionInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this provision system definition internal server error response a status code equal to that given -func (o *ProvisionSystemDefinitionInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the provision system definition internal server error response -func (o *ProvisionSystemDefinitionInternalServerError) Code() int { - return 500 -} - -func (o *ProvisionSystemDefinitionInternalServerError) Error() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionInternalServerError %+v", 500, o.Payload) -} - -func (o *ProvisionSystemDefinitionInternalServerError) String() string { - return fmt.Sprintf("[POST /workflows/system-definitions/provision/v1][%d] provisionSystemDefinitionInternalServerError %+v", 500, o.Payload) -} - -func (o *ProvisionSystemDefinitionInternalServerError) GetPayload() *models.ClientSystemDefinitionCreateResponse { - return o.Payload -} - -func (o *ProvisionSystemDefinitionInternalServerError) 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.ClientSystemDefinitionCreateResponse) - - // 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 fab955b0..2afb20c5 100644 --- a/falcon/client/workflows/workflows_client.go +++ b/falcon/client/workflows/workflows_client.go @@ -30,38 +30,38 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeprovisionSystemDefinition(params *DeprovisionSystemDefinitionParams, opts ...ClientOption) (*DeprovisionSystemDefinitionOK, error) + Deprovision(params *DeprovisionParams, opts ...ClientOption) (*DeprovisionOK, error) Execute(params *ExecuteParams, opts ...ClientOption) (*ExecuteOK, error) - ExecutionsAction(params *ExecutionsActionParams, opts ...ClientOption) (*ExecutionsActionOK, error) + ExecutionAction(params *ExecutionActionParams, opts ...ClientOption) (*ExecutionActionOK, error) - ExecutionsResult(params *ExecutionsResultParams, opts ...ClientOption) (*ExecutionsResultOK, error) + ExecutionResults(params *ExecutionResultsParams, opts ...ClientOption) (*ExecutionResultsOK, error) - PromoteSystemDefinition(params *PromoteSystemDefinitionParams, opts ...ClientOption) (*PromoteSystemDefinitionOK, error) + Promote(params *PromoteParams, opts ...ClientOption) (*PromoteOK, error) - ProvisionSystemDefinition(params *ProvisionSystemDefinitionParams, opts ...ClientOption) (*ProvisionSystemDefinitionOK, error) + Provision(params *ProvisionParams, opts ...ClientOption) (*ProvisionOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeprovisionSystemDefinition deprovisions a system definition that was previously provisioned on the target c ID +Deprovision deprovisions a system definition that was previously provisioned on the target c ID */ -func (a *Client) DeprovisionSystemDefinition(params *DeprovisionSystemDefinitionParams, opts ...ClientOption) (*DeprovisionSystemDefinitionOK, error) { +func (a *Client) Deprovision(params *DeprovisionParams, opts ...ClientOption) (*DeprovisionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeprovisionSystemDefinitionParams() + params = NewDeprovisionParams() } op := &runtime.ClientOperation{ - ID: "deprovision.system-definition", + ID: "Deprovision", Method: "POST", PathPattern: "/workflows/system-definitions/deprovision/v1", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeprovisionSystemDefinitionReader{formats: a.formats}, + Reader: &DeprovisionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -73,13 +73,13 @@ func (a *Client) DeprovisionSystemDefinition(params *DeprovisionSystemDefinition if err != nil { return nil, err } - success, ok := result.(*DeprovisionSystemDefinitionOK) + success, ok := result.(*DeprovisionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deprovision.system-definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for Deprovision: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -92,7 +92,7 @@ func (a *Client) Execute(params *ExecuteParams, opts ...ClientOption) (*ExecuteO params = NewExecuteParams() } op := &runtime.ClientOperation{ - ID: "execute", + ID: "Execute", Method: "POST", PathPattern: "/workflows/entities/execute/v1", ProducesMediaTypes: []string{"application/json"}, @@ -117,27 +117,27 @@ func (a *Client) Execute(params *ExecuteParams, opts ...ClientOption) (*ExecuteO } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for execute: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for Execute: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -ExecutionsAction allows a user to resume retry a failed workflow execution +ExecutionAction allows a user to resume retry a failed workflow execution */ -func (a *Client) ExecutionsAction(params *ExecutionsActionParams, opts ...ClientOption) (*ExecutionsActionOK, error) { +func (a *Client) ExecutionAction(params *ExecutionActionParams, opts ...ClientOption) (*ExecutionActionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewExecutionsActionParams() + params = NewExecutionActionParams() } op := &runtime.ClientOperation{ - ID: "executions.action", + ID: "ExecutionAction", Method: "POST", PathPattern: "/workflows/entities/execution-actions/v1", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &ExecutionsActionReader{formats: a.formats}, + Reader: &ExecutionActionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -149,33 +149,33 @@ func (a *Client) ExecutionsAction(params *ExecutionsActionParams, opts ...Client if err != nil { return nil, err } - success, ok := result.(*ExecutionsActionOK) + success, ok := result.(*ExecutionActionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for executions.action: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ExecutionAction: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -ExecutionsResult gets execution result of a given execution +ExecutionResults gets execution result of a given execution */ -func (a *Client) ExecutionsResult(params *ExecutionsResultParams, opts ...ClientOption) (*ExecutionsResultOK, error) { +func (a *Client) ExecutionResults(params *ExecutionResultsParams, opts ...ClientOption) (*ExecutionResultsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewExecutionsResultParams() + params = NewExecutionResultsParams() } op := &runtime.ClientOperation{ - ID: "executions.result", + ID: "ExecutionResults", Method: "GET", PathPattern: "/workflows/entities/execution-results/v1", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &ExecutionsResultReader{formats: a.formats}, + Reader: &ExecutionResultsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -187,33 +187,33 @@ func (a *Client) ExecutionsResult(params *ExecutionsResultParams, opts ...Client if err != nil { return nil, err } - success, ok := result.(*ExecutionsResultOK) + success, ok := result.(*ExecutionResultsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for executions.result: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ExecutionResults: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PromoteSystemDefinition promotes a version of a system definition on a customer the customer must already have been provisioned this allows the callerto apply an updated template version to a specific cid and expects all parameters to be supplied if the template supports multi instancethe customer scope definition ID must be supplied to determine which customer workflow should be updated +Promote promotes a version of a system definition for a customer the customer must already have been provisioned this allows the caller to apply an updated template version to a specific cid and expects all parameters to be supplied if the template supports multi instance the customer scope definition ID must be supplied to determine which customer workflow should be updated */ -func (a *Client) PromoteSystemDefinition(params *PromoteSystemDefinitionParams, opts ...ClientOption) (*PromoteSystemDefinitionOK, error) { +func (a *Client) Promote(params *PromoteParams, opts ...ClientOption) (*PromoteOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPromoteSystemDefinitionParams() + params = NewPromoteParams() } op := &runtime.ClientOperation{ - ID: "promote.system-definition", + ID: "Promote", Method: "POST", PathPattern: "/workflows/system-definitions/promote/v1", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PromoteSystemDefinitionReader{formats: a.formats}, + Reader: &PromoteReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -225,33 +225,33 @@ func (a *Client) PromoteSystemDefinition(params *PromoteSystemDefinitionParams, if err != nil { return nil, err } - success, ok := result.(*PromoteSystemDefinitionOK) + success, ok := result.(*PromoteOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for promote.system-definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for Promote: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -ProvisionSystemDefinition provisions a system definition onto the target c ID by using the template and provided parameters +Provision provisions a system definition onto the target c ID by using the template and provided parameters */ -func (a *Client) ProvisionSystemDefinition(params *ProvisionSystemDefinitionParams, opts ...ClientOption) (*ProvisionSystemDefinitionOK, error) { +func (a *Client) Provision(params *ProvisionParams, opts ...ClientOption) (*ProvisionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewProvisionSystemDefinitionParams() + params = NewProvisionParams() } op := &runtime.ClientOperation{ - ID: "provision.system-definition", + ID: "Provision", Method: "POST", PathPattern: "/workflows/system-definitions/provision/v1", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &ProvisionSystemDefinitionReader{formats: a.formats}, + Reader: &ProvisionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -263,13 +263,13 @@ func (a *Client) ProvisionSystemDefinition(params *ProvisionSystemDefinitionPara if err != nil { return nil, err } - success, ok := result.(*ProvisionSystemDefinitionOK) + success, ok := result.(*ProvisionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for provision.system-definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for Provision: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/falcon/models/alerts_container_alerts_count_value.go b/falcon/models/alerts_container_alerts_count_value.go new file mode 100644 index 00000000..fa74070f --- /dev/null +++ b/falcon/models/alerts_container_alerts_count_value.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" +) + +// AlertsContainerAlertsCountValue alerts container alerts count value +// +// swagger:model alerts.containerAlertsCountValue +type AlertsContainerAlertsCountValue struct { + + // resources + // Required: true + Resources []*CommonCountAsResource `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this alerts container alerts count value +func (m *AlertsContainerAlertsCountValue) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AlertsContainerAlertsCountValue) 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 +} + +func (m *AlertsContainerAlertsCountValue) 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 *AlertsContainerAlertsCountValue) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this alerts container alerts count value based on the context it is used +func (m *AlertsContainerAlertsCountValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *AlertsContainerAlertsCountValue) 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 +} + +func (m *AlertsContainerAlertsCountValue) 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 *AlertsContainerAlertsCountValue) 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 *AlertsContainerAlertsCountValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AlertsContainerAlertsCountValue) UnmarshalBinary(b []byte) error { + var res AlertsContainerAlertsCountValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/alerts_container_alerts_entity_response.go b/falcon/models/alerts_container_alerts_entity_response.go new file mode 100644 index 00000000..037dba8c --- /dev/null +++ b/falcon/models/alerts_container_alerts_entity_response.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" +) + +// AlertsContainerAlertsEntityResponse alerts container alerts entity response +// +// swagger:model alerts.ContainerAlertsEntityResponse +type AlertsContainerAlertsEntityResponse struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIContainerAlert `json:"resources"` +} + +// Validate validates this alerts container alerts entity response +func (m *AlertsContainerAlertsEntityResponse) 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 *AlertsContainerAlertsEntityResponse) 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 *AlertsContainerAlertsEntityResponse) 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 *AlertsContainerAlertsEntityResponse) 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 alerts container alerts entity response based on the context it is used +func (m *AlertsContainerAlertsEntityResponse) 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 *AlertsContainerAlertsEntityResponse) 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 *AlertsContainerAlertsEntityResponse) 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 *AlertsContainerAlertsEntityResponse) 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 *AlertsContainerAlertsEntityResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AlertsContainerAlertsEntityResponse) UnmarshalBinary(b []byte) error { + var res AlertsContainerAlertsEntityResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_detects_query_meta.go b/falcon/models/api_detects_query_meta.go new file mode 100644 index 00000000..7a87c3bc --- /dev/null +++ b/falcon/models/api_detects_query_meta.go @@ -0,0 +1,147 @@ +// 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" +) + +// APIDetectsQueryMeta api detects query meta +// +// swagger:model api.DetectsQueryMeta +type APIDetectsQueryMeta struct { + + // pagination + Pagination *APIDetectsQueryPaging `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"` +} + +// Validate validates this api detects query meta +func (m *APIDetectsQueryMeta) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIDetectsQueryMeta) 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 *APIDetectsQueryMeta) validateQueryTime(formats strfmt.Registry) error { + + if err := validate.Required("query_time", "body", m.QueryTime); err != nil { + return err + } + + return nil +} + +func (m *APIDetectsQueryMeta) validateTraceID(formats strfmt.Registry) error { + + if err := validate.Required("trace_id", "body", m.TraceID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this api detects query meta based on the context it is used +func (m *APIDetectsQueryMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePagination(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIDetectsQueryMeta) 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 +} + +// MarshalBinary interface implementation +func (m *APIDetectsQueryMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIDetectsQueryMeta) UnmarshalBinary(b []byte) error { + var res APIDetectsQueryMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_detects_query_paging.go b/falcon/models/api_detects_query_paging.go new file mode 100644 index 00000000..968d133f --- /dev/null +++ b/falcon/models/api_detects_query_paging.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" +) + +// APIDetectsQueryPaging api detects query paging +// +// swagger:model api.DetectsQueryPaging +type APIDetectsQueryPaging struct { + + // after + After string `json:"after,omitempty"` + + // limit + // Required: true + Limit *int32 `json:"limit"` + + // offset + Offset string `json:"offset,omitempty"` +} + +// Validate validates this api detects query paging +func (m *APIDetectsQueryPaging) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLimit(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIDetectsQueryPaging) validateLimit(formats strfmt.Registry) error { + + if err := validate.Required("limit", "body", m.Limit); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this api detects query paging based on context it is used +func (m *APIDetectsQueryPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *APIDetectsQueryPaging) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIDetectsQueryPaging) UnmarshalBinary(b []byte) error { + var res APIDetectsQueryPaging + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_device_count_resp_v1.go b/falcon/models/api_device_count_resp_v1.go new file mode 100644 index 00000000..39a31b30 --- /dev/null +++ b/falcon/models/api_device_count_resp_v1.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" +) + +// APIDeviceCountRespV1 api device count resp v1 +// +// swagger:model api.DeviceCountRespV1 +type APIDeviceCountRespV1 struct { + + // errors + // Required: true + Errors []*MsaAPIError `json:"Errors"` + + // msa meta info + // Required: true + MsaMetaInfo *MsaMetaInfo `json:"MsaMetaInfo"` + + // resources + // Required: true + Resources []*APIDeviceCountV1 `json:"resources"` +} + +// Validate validates this api device count resp v1 +func (m *APIDeviceCountRespV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMsaMetaInfo(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 *APIDeviceCountRespV1) 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 *APIDeviceCountRespV1) validateMsaMetaInfo(formats strfmt.Registry) error { + + if err := validate.Required("MsaMetaInfo", "body", m.MsaMetaInfo); err != nil { + return err + } + + if m.MsaMetaInfo != nil { + if err := m.MsaMetaInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("MsaMetaInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("MsaMetaInfo") + } + return err + } + } + + return nil +} + +func (m *APIDeviceCountRespV1) 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 api device count resp v1 based on the context it is used +func (m *APIDeviceCountRespV1) 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.contextValidateMsaMetaInfo(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 *APIDeviceCountRespV1) 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 *APIDeviceCountRespV1) contextValidateMsaMetaInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.MsaMetaInfo != nil { + + if err := m.MsaMetaInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("MsaMetaInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("MsaMetaInfo") + } + return err + } + } + + return nil +} + +func (m *APIDeviceCountRespV1) 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 *APIDeviceCountRespV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIDeviceCountRespV1) UnmarshalBinary(b []byte) error { + var res APIDeviceCountRespV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_device_count_v1.go b/falcon/models/api_device_count_v1.go new file mode 100644 index 00000000..6e381b36 --- /dev/null +++ b/falcon/models/api_device_count_v1.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" +) + +// APIDeviceCountV1 api device count v1 +// +// swagger:model api.DeviceCountV1 +type APIDeviceCountV1 struct { + + // device count + DeviceCount int32 `json:"device_count,omitempty"` + + // limit exceeded + LimitExceeded bool `json:"limit_exceeded,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // value + Value string `json:"value,omitempty"` +} + +// Validate validates this api device count v1 +func (m *APIDeviceCountV1) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this api device count v1 based on context it is used +func (m *APIDeviceCountV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *APIDeviceCountV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIDeviceCountV1) UnmarshalBinary(b []byte) error { + var res APIDeviceCountV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_devices_ran_on_resp_v1.go b/falcon/models/api_devices_ran_on_resp_v1.go index 8b8dbd82..48deee52 100644 --- a/falcon/models/api_devices_ran_on_resp_v1.go +++ b/falcon/models/api_devices_ran_on_resp_v1.go @@ -26,7 +26,7 @@ type APIDevicesRanOnRespV1 struct { // msa meta info // Required: true - MsaMetaInfo *APIIndicatorsQueryMeta `json:"MsaMetaInfo"` + MsaMetaInfo *APIDetectsQueryMeta `json:"MsaMetaInfo"` // resources // Required: true diff --git a/falcon/models/csrestful_entities_response.go b/falcon/models/api_entities_response.go similarity index 74% rename from falcon/models/csrestful_entities_response.go rename to falcon/models/api_entities_response.go index 3f5b55be..be252925 100644 --- a/falcon/models/csrestful_entities_response.go +++ b/falcon/models/api_entities_response.go @@ -15,10 +15,10 @@ import ( "github.com/go-openapi/validate" ) -// CsrestfulEntitiesResponse csrestful entities response +// APIEntitiesResponse api entities response // -// swagger:model csrestful.EntitiesResponse -type CsrestfulEntitiesResponse struct { +// swagger:model api.EntitiesResponse +type APIEntitiesResponse struct { // errors Errors []*MsaAPIError `json:"errors"` @@ -29,11 +29,11 @@ type CsrestfulEntitiesResponse struct { // resources // Required: true - Resources CsrestfulEntitiesResponseResources `json:"resources"` + Resources APIEntitiesResponseResources `json:"resources"` } -// Validate validates this csrestful entities response -func (m *CsrestfulEntitiesResponse) Validate(formats strfmt.Registry) error { +// Validate validates this api entities response +func (m *APIEntitiesResponse) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -54,7 +54,7 @@ func (m *CsrestfulEntitiesResponse) Validate(formats strfmt.Registry) error { return nil } -func (m *CsrestfulEntitiesResponse) validateErrors(formats strfmt.Registry) error { +func (m *APIEntitiesResponse) validateErrors(formats strfmt.Registry) error { if swag.IsZero(m.Errors) { // not required return nil } @@ -80,7 +80,7 @@ func (m *CsrestfulEntitiesResponse) validateErrors(formats strfmt.Registry) erro return nil } -func (m *CsrestfulEntitiesResponse) validateMeta(formats strfmt.Registry) error { +func (m *APIEntitiesResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -100,7 +100,7 @@ func (m *CsrestfulEntitiesResponse) validateMeta(formats strfmt.Registry) error return nil } -func (m *CsrestfulEntitiesResponse) validateResources(formats strfmt.Registry) error { +func (m *APIEntitiesResponse) validateResources(formats strfmt.Registry) error { if m.Resources == nil { return errors.Required("resources", "body", nil) @@ -109,8 +109,8 @@ func (m *CsrestfulEntitiesResponse) validateResources(formats strfmt.Registry) e return nil } -// ContextValidate validate this csrestful entities response based on the context it is used -func (m *CsrestfulEntitiesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this api entities response based on the context it is used +func (m *APIEntitiesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -127,7 +127,7 @@ func (m *CsrestfulEntitiesResponse) ContextValidate(ctx context.Context, formats return nil } -func (m *CsrestfulEntitiesResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *APIEntitiesResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -152,7 +152,7 @@ func (m *CsrestfulEntitiesResponse) contextValidateErrors(ctx context.Context, f return nil } -func (m *CsrestfulEntitiesResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *APIEntitiesResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -170,7 +170,7 @@ func (m *CsrestfulEntitiesResponse) contextValidateMeta(ctx context.Context, for } // MarshalBinary interface implementation -func (m *CsrestfulEntitiesResponse) MarshalBinary() ([]byte, error) { +func (m *APIEntitiesResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -178,8 +178,8 @@ func (m *CsrestfulEntitiesResponse) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *CsrestfulEntitiesResponse) UnmarshalBinary(b []byte) error { - var res CsrestfulEntitiesResponse +func (m *APIEntitiesResponse) UnmarshalBinary(b []byte) error { + var res APIEntitiesResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/common_entities_response_resources.go b/falcon/models/api_entities_response_resources.go similarity index 54% rename from falcon/models/common_entities_response_resources.go rename to falcon/models/api_entities_response_resources.go index 12f4f6d3..4b36ed09 100644 --- a/falcon/models/common_entities_response_resources.go +++ b/falcon/models/api_entities_response_resources.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 -// CommonEntitiesResponseResources common entities response resources +// APIEntitiesResponseResources api entities response resources // -// swagger:model common.EntitiesResponse.resources -type CommonEntitiesResponseResources interface{} +// swagger:model api.EntitiesResponse.resources +type APIEntitiesResponseResources interface{} diff --git a/falcon/models/api_exposed_data_record_bot_v1.go b/falcon/models/api_exposed_data_record_bot_v1.go index 2dd5e4a3..a22c2c80 100644 --- a/falcon/models/api_exposed_data_record_bot_v1.go +++ b/falcon/models/api_exposed_data_record_bot_v1.go @@ -11,6 +11,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // APIExposedDataRecordBotV1 api exposed data record bot v1 @@ -28,7 +29,8 @@ type APIExposedDataRecordBotV1 struct { InfectionBuildID string `json:"infection_build_id,omitempty"` // infection date - InfectionDate string `json:"infection_date,omitempty"` + // Format: date-time + InfectionDate strfmt.DateTime `json:"infection_date,omitempty"` // infection path InfectionPath string `json:"infection_path,omitempty"` @@ -47,6 +49,10 @@ type APIExposedDataRecordBotV1 struct { func (m *APIExposedDataRecordBotV1) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateInfectionDate(formats); err != nil { + res = append(res, err) + } + if err := m.validateLocation(formats); err != nil { res = append(res, err) } @@ -61,6 +67,18 @@ func (m *APIExposedDataRecordBotV1) Validate(formats strfmt.Registry) error { return nil } +func (m *APIExposedDataRecordBotV1) validateInfectionDate(formats strfmt.Registry) error { + if swag.IsZero(m.InfectionDate) { // not required + return nil + } + + if err := validate.FormatOf("infection_date", "body", "date-time", m.InfectionDate.String(), formats); err != nil { + return err + } + + return nil +} + func (m *APIExposedDataRecordBotV1) validateLocation(formats strfmt.Registry) error { if swag.IsZero(m.Location) { // not required return nil diff --git a/falcon/models/api_exposed_data_record_financial_v1.go b/falcon/models/api_exposed_data_record_financial_v1.go index 6d247b62..99c71de7 100644 --- a/falcon/models/api_exposed_data_record_financial_v1.go +++ b/falcon/models/api_exposed_data_record_financial_v1.go @@ -17,13 +17,13 @@ import ( // swagger:model api.ExposedDataRecordFinancialV1 type APIExposedDataRecordFinancialV1 struct { - // bank account + // Bank Account information BankAccount string `json:"bank_account,omitempty"` - // credit card + // Credit Card information CreditCard string `json:"credit_card,omitempty"` - // crypto currency addresses + // A list of Crypto Currency addresses CryptoCurrencyAddresses []string `json:"crypto_currency_addresses"` } diff --git a/falcon/models/api_exposed_data_record_location_v1.go b/falcon/models/api_exposed_data_record_location_v1.go index 17a198fe..b195dc23 100644 --- a/falcon/models/api_exposed_data_record_location_v1.go +++ b/falcon/models/api_exposed_data_record_location_v1.go @@ -17,22 +17,22 @@ import ( // swagger:model api.ExposedDataRecordLocationV1 type APIExposedDataRecordLocationV1 struct { - // city + // City name City string `json:"city,omitempty"` - // country code + // The country code CountryCode string `json:"country_code,omitempty"` - // federal admin region + // Federal Administrative Region FederalAdminRegion string `json:"federal_admin_region,omitempty"` - // federal district + // Federal District FederalDistrict string `json:"federal_district,omitempty"` - // postal code + // The postal code PostalCode string `json:"postal_code,omitempty"` - // state + // State name State string `json:"state,omitempty"` } diff --git a/falcon/models/api_exposed_data_record_social_v1.go b/falcon/models/api_exposed_data_record_social_v1.go index eb02d90c..81ef9a11 100644 --- a/falcon/models/api_exposed_data_record_social_v1.go +++ b/falcon/models/api_exposed_data_record_social_v1.go @@ -17,31 +17,31 @@ import ( // swagger:model api.ExposedDataRecordSocialV1 type APIExposedDataRecordSocialV1 struct { - // aim id + // AIM ID of the affected user AimID string `json:"aim_id,omitempty"` - // facebook id + // Facebook ID of the affected user FacebookID string `json:"facebook_id,omitempty"` - // icq id + // ICQ ID of the affected user IcqID string `json:"icq_id,omitempty"` - // instagram id + // Instagram ID of the affected user InstagramID string `json:"instagram_id,omitempty"` - // msn id + // MSN ID of the affected user MsnID string `json:"msn_id,omitempty"` - // skype id + // Skype ID of the affected user SkypeID string `json:"skype_id,omitempty"` - // twitter id + // Twitter ID of the affected user TwitterID string `json:"twitter_id,omitempty"` - // vk id + // VK ID of the affected user VkID string `json:"vk_id,omitempty"` - // vk token + // VK Access Token of the affected user VkToken string `json:"vk_token,omitempty"` } diff --git a/falcon/models/api_meta_info.go b/falcon/models/api_meta_info.go new file mode 100644 index 00000000..8eab0afc --- /dev/null +++ b/falcon/models/api_meta_info.go @@ -0,0 +1,147 @@ +// 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" +) + +// APIMetaInfo api meta info +// +// swagger:model api.MetaInfo +type APIMetaInfo struct { + + // Pagination-related metadata + Pagination *APIResponsePagination `json:"pagination,omitempty"` + + // The alias of the service which handled the request + PoweredBy string `json:"powered_by,omitempty"` + + // The duration (in seconds) that the service took to handle the request + // Required: true + QueryTime *float64 `json:"query_time"` + + // Identifier used to debug the request + // Required: true + TraceID *string `json:"trace_id"` +} + +// Validate validates this api meta info +func (m *APIMetaInfo) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIMetaInfo) 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 *APIMetaInfo) validateQueryTime(formats strfmt.Registry) error { + + if err := validate.Required("query_time", "body", m.QueryTime); err != nil { + return err + } + + return nil +} + +func (m *APIMetaInfo) validateTraceID(formats strfmt.Registry) error { + + if err := validate.Required("trace_id", "body", m.TraceID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this api meta info based on the context it is used +func (m *APIMetaInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePagination(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIMetaInfo) 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 +} + +// MarshalBinary interface implementation +func (m *APIMetaInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIMetaInfo) UnmarshalBinary(b []byte) error { + var res APIMetaInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_processes_ran_on_resp_v1.go b/falcon/models/api_processes_ran_on_resp_v1.go index a15f0193..12413cdd 100644 --- a/falcon/models/api_processes_ran_on_resp_v1.go +++ b/falcon/models/api_processes_ran_on_resp_v1.go @@ -26,7 +26,7 @@ type APIProcessesRanOnRespV1 struct { // msa meta info // Required: true - MsaMetaInfo *APIIndicatorsQueryMeta `json:"MsaMetaInfo"` + MsaMetaInfo *APIDetectsQueryMeta `json:"MsaMetaInfo"` // resources // Required: true diff --git a/falcon/models/api_response_pagination.go b/falcon/models/api_response_pagination.go new file mode 100644 index 00000000..015cbf7b --- /dev/null +++ b/falcon/models/api_response_pagination.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" +) + +// APIResponsePagination api response pagination +// +// swagger:model api.ResponsePagination +type APIResponsePagination struct { + + // Encoded state used for pagination + Offset APIResponsePaginationOffset `json:"offset,omitempty"` + + // The total number of elements + // Required: true + Total *int64 `json:"total"` +} + +// Validate validates this api response pagination +func (m *APIResponsePagination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIResponsePagination) validateTotal(formats strfmt.Registry) error { + + if err := validate.Required("total", "body", m.Total); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this api response pagination based on context it is used +func (m *APIResponsePagination) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *APIResponsePagination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIResponsePagination) UnmarshalBinary(b []byte) error { + var res APIResponsePagination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/csrestful_entities_response_resources.go b/falcon/models/api_response_pagination_offset.go similarity index 52% rename from falcon/models/csrestful_entities_response_resources.go rename to falcon/models/api_response_pagination_offset.go index ecd20130..19f5ffca 100644 --- a/falcon/models/csrestful_entities_response_resources.go +++ b/falcon/models/api_response_pagination_offset.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 -// CsrestfulEntitiesResponseResources csrestful entities response resources +// APIResponsePaginationOffset api response pagination offset // -// swagger:model csrestful.EntitiesResponse.resources -type CsrestfulEntitiesResponseResources interface{} +// swagger:model api.ResponsePagination.offset +type APIResponsePaginationOffset interface{} diff --git a/falcon/models/api_role.go b/falcon/models/api_role.go deleted file mode 100644 index 513ba858..00000000 --- a/falcon/models/api_role.go +++ /dev/null @@ -1,173 +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" -) - -// APIRole api role -// -// swagger:model api.Role -type APIRole struct { - - // color - // Required: true - Color *string `json:"Color"` - - // description - // Required: true - Description *string `json:"Description"` - - // display name - // Required: true - DisplayName *string `json:"DisplayName"` - - // ID - // Required: true - ID *string `json:"ID"` - - // org permissions - // Required: true - OrgPermissions []string `json:"OrgPermissions"` - - // system permissions - // Required: true - SystemPermissions []string `json:"SystemPermissions"` - - // view permissions - // Required: true - ViewPermissions []string `json:"ViewPermissions"` -} - -// Validate validates this api role -func (m *APIRole) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateColor(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisplayName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrgPermissions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSystemPermissions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViewPermissions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIRole) validateColor(formats strfmt.Registry) error { - - if err := validate.Required("Color", "body", m.Color); err != nil { - return err - } - - return nil -} - -func (m *APIRole) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("Description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *APIRole) validateDisplayName(formats strfmt.Registry) error { - - if err := validate.Required("DisplayName", "body", m.DisplayName); err != nil { - return err - } - - return nil -} - -func (m *APIRole) validateID(formats strfmt.Registry) error { - - if err := validate.Required("ID", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *APIRole) validateOrgPermissions(formats strfmt.Registry) error { - - if err := validate.Required("OrgPermissions", "body", m.OrgPermissions); err != nil { - return err - } - - return nil -} - -func (m *APIRole) validateSystemPermissions(formats strfmt.Registry) error { - - if err := validate.Required("SystemPermissions", "body", m.SystemPermissions); err != nil { - return err - } - - return nil -} - -func (m *APIRole) validateViewPermissions(formats strfmt.Registry) error { - - if err := validate.Required("ViewPermissions", "body", m.ViewPermissions); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this api role based on context it is used -func (m *APIRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *APIRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIRole) UnmarshalBinary(b []byte) error { - var res APIRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/apidomain_initialize_response_v1.go b/falcon/models/apidomain_initialize_response_v1.go deleted file mode 100644 index d7857622..00000000 --- a/falcon/models/apidomain_initialize_response_v1.go +++ /dev/null @@ -1,127 +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" -) - -// ApidomainInitializeResponseV1 apidomain initialize response v1 -// -// swagger:model apidomain.InitializeResponseV1 -type ApidomainInitializeResponseV1 struct { - - // group - Group *HumioGroup `json:"group,omitempty"` - - // initialized - // Required: true - Initialized *bool `json:"initialized"` -} - -// Validate validates this apidomain initialize response v1 -func (m *ApidomainInitializeResponseV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGroup(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInitialized(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainInitializeResponseV1) 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 *ApidomainInitializeResponseV1) validateInitialized(formats strfmt.Registry) error { - - if err := validate.Required("initialized", "body", m.Initialized); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this apidomain initialize response v1 based on the context it is used -func (m *ApidomainInitializeResponseV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGroup(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainInitializeResponseV1) 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 -} - -// MarshalBinary interface implementation -func (m *ApidomainInitializeResponseV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApidomainInitializeResponseV1) UnmarshalBinary(b []byte) error { - var res ApidomainInitializeResponseV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/apidomain_query_args.go b/falcon/models/apidomain_query_args.go deleted file mode 100644 index d69289d5..00000000 --- a/falcon/models/apidomain_query_args.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" -) - -// ApidomainQueryArgs apidomain query args -// -// swagger:model apidomain.QueryArgs -type ApidomainQueryArgs map[string]string - -// Validate validates this apidomain query args -func (m ApidomainQueryArgs) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this apidomain query args based on context it is used -func (m ApidomainQueryArgs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/falcon/models/apidomain_query_response_v1.go b/falcon/models/apidomain_query_response_v1.go index 69176f17..4fe55df3 100644 --- a/falcon/models/apidomain_query_response_v1.go +++ b/falcon/models/apidomain_query_response_v1.go @@ -25,6 +25,7 @@ type ApidomainQueryResponseV1 struct { EventCount *int32 `json:"event_count"` // events + // Required: true Events []ApidomainQueryResponseV1Events `json:"events"` // fields @@ -48,6 +49,10 @@ func (m *ApidomainQueryResponseV1) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateEvents(formats); err != nil { + res = append(res, err) + } + if err := m.validateFields(formats); err != nil { res = append(res, err) } @@ -79,6 +84,15 @@ func (m *ApidomainQueryResponseV1) validateEventCount(formats strfmt.Registry) e return nil } +func (m *ApidomainQueryResponseV1) validateEvents(formats strfmt.Registry) error { + + if err := validate.Required("events", "body", m.Events); err != nil { + return err + } + + return nil +} + func (m *ApidomainQueryResponseV1) validateFields(formats strfmt.Registry) error { if swag.IsZero(m.Fields) { // not required return nil diff --git a/falcon/models/apidomain_query_validate_request_v1.go b/falcon/models/apidomain_query_validate_request_v1.go deleted file mode 100644 index 4cb4d4a1..00000000 --- a/falcon/models/apidomain_query_validate_request_v1.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" -) - -// ApidomainQueryValidateRequestV1 apidomain query validate request v1 -// -// swagger:model apidomain.QueryValidateRequestV1 -type ApidomainQueryValidateRequestV1 struct { - - // arguments - // Required: true - Arguments map[string]string `json:"arguments"` - - // query string - // Required: true - QueryString *string `json:"query_string"` -} - -// Validate validates this apidomain query validate request v1 -func (m *ApidomainQueryValidateRequestV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateArguments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateQueryString(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainQueryValidateRequestV1) validateArguments(formats strfmt.Registry) error { - - if err := validate.Required("arguments", "body", m.Arguments); err != nil { - return err - } - - return nil -} - -func (m *ApidomainQueryValidateRequestV1) validateQueryString(formats strfmt.Registry) error { - - if err := validate.Required("query_string", "body", m.QueryString); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this apidomain query validate request v1 based on context it is used -func (m *ApidomainQueryValidateRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ApidomainQueryValidateRequestV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApidomainQueryValidateRequestV1) UnmarshalBinary(b []byte) error { - var res ApidomainQueryValidateRequestV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/apidomain_repo_view_list_item_v1.go b/falcon/models/apidomain_repo_view_list_item_v1.go index 1ca4a646..9c8fec2c 100644 --- a/falcon/models/apidomain_repo_view_list_item_v1.go +++ b/falcon/models/apidomain_repo_view_list_item_v1.go @@ -43,6 +43,10 @@ type ApidomainRepoViewListItemV1 struct { // Required: true Name *string `json:"name"` + // name contracted + // Required: true + NameContracted *string `json:"name_contracted"` + // size Size int64 `json:"size,omitempty"` @@ -79,6 +83,10 @@ func (m *ApidomainRepoViewListItemV1) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateNameContracted(formats); err != nil { + res = append(res, err) + } + if err := m.validateTypeName(formats); err != nil { res = append(res, err) } @@ -160,6 +168,15 @@ func (m *ApidomainRepoViewListItemV1) validateName(formats strfmt.Registry) erro return nil } +func (m *ApidomainRepoViewListItemV1) validateNameContracted(formats strfmt.Registry) error { + + if err := validate.Required("name_contracted", "body", m.NameContracted); err != nil { + return err + } + + return nil +} + func (m *ApidomainRepoViewListItemV1) validateTypeName(formats strfmt.Registry) error { if err := validate.Required("type_name", "body", m.TypeName); err != nil { diff --git a/falcon/models/apidomain_saved_search_create_request_v1.go b/falcon/models/apidomain_saved_search_create_request_v1.go deleted file mode 100644 index 4fb94711..00000000 --- a/falcon/models/apidomain_saved_search_create_request_v1.go +++ /dev/null @@ -1,267 +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" -) - -// ApidomainSavedSearchCreateRequestV1 apidomain saved search create request v1 -// -// swagger:model apidomain.SavedSearchCreateRequestV1 -type ApidomainSavedSearchCreateRequestV1 struct { - - // description - // Required: true - Description *string `json:"description"` - - // end - End string `json:"end,omitempty"` - - // id - // Required: true - ID *string `json:"id"` - - // permissions - // Required: true - Permissions *string `json:"permissions"` - - // repo or view - // Required: true - RepoOrView *string `json:"repo_or_view"` - - // request schema - // Required: true - RequestSchema *string `json:"request_schema"` - - // response schema - // Required: true - ResponseSchema *string `json:"response_schema"` - - // search name - // Required: true - SearchName *string `json:"search_name"` - - // search query - // Required: true - SearchQuery *string `json:"search_query"` - - // search query args - // Required: true - SearchQueryArgs map[string]string `json:"search_query_args"` - - // start - Start string `json:"start,omitempty"` - - // workflow meta - // Required: true - WorkflowMeta *ApidomainWorkflowMetadataV1 `json:"workflow_meta"` -} - -// Validate validates this apidomain saved search create request v1 -func (m *ApidomainSavedSearchCreateRequestV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePermissions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepoOrView(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestSchema(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResponseSchema(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSearchName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSearchQuery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSearchQueryArgs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWorkflowMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validatePermissions(formats strfmt.Registry) error { - - if err := validate.Required("permissions", "body", m.Permissions); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateRepoOrView(formats strfmt.Registry) error { - - if err := validate.Required("repo_or_view", "body", m.RepoOrView); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateRequestSchema(formats strfmt.Registry) error { - - if err := validate.Required("request_schema", "body", m.RequestSchema); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateResponseSchema(formats strfmt.Registry) error { - - if err := validate.Required("response_schema", "body", m.ResponseSchema); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateSearchName(formats strfmt.Registry) error { - - if err := validate.Required("search_name", "body", m.SearchName); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateSearchQuery(formats strfmt.Registry) error { - - if err := validate.Required("search_query", "body", m.SearchQuery); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateSearchQueryArgs(formats strfmt.Registry) error { - - if err := validate.Required("search_query_args", "body", m.SearchQueryArgs); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) validateWorkflowMeta(formats strfmt.Registry) error { - - if err := validate.Required("workflow_meta", "body", m.WorkflowMeta); err != nil { - return err - } - - if m.WorkflowMeta != nil { - if err := m.WorkflowMeta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workflow_meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workflow_meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this apidomain saved search create request v1 based on the context it is used -func (m *ApidomainSavedSearchCreateRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateWorkflowMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainSavedSearchCreateRequestV1) contextValidateWorkflowMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.WorkflowMeta != nil { - - if err := m.WorkflowMeta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workflow_meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workflow_meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ApidomainSavedSearchCreateRequestV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApidomainSavedSearchCreateRequestV1) UnmarshalBinary(b []byte) error { - var res ApidomainSavedSearchCreateRequestV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/apidomain_saved_search_update_request_v1.go b/falcon/models/apidomain_saved_search_update_request_v1.go deleted file mode 100644 index 6648915f..00000000 --- a/falcon/models/apidomain_saved_search_update_request_v1.go +++ /dev/null @@ -1,225 +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" -) - -// ApidomainSavedSearchUpdateRequestV1 apidomain saved search update request v1 -// -// swagger:model apidomain.SavedSearchUpdateRequestV1 -type ApidomainSavedSearchUpdateRequestV1 struct { - - // description - Description string `json:"description,omitempty"` - - // end - // Required: true - End *string `json:"end"` - - // id - ID string `json:"id,omitempty"` - - // permissions - Permissions string `json:"permissions,omitempty"` - - // repo or view - RepoOrView string `json:"repo_or_view,omitempty"` - - // request schema - RequestSchema string `json:"request_schema,omitempty"` - - // response schema - ResponseSchema string `json:"response_schema,omitempty"` - - // search name - SearchName string `json:"search_name,omitempty"` - - // search query - SearchQuery string `json:"search_query,omitempty"` - - // search query args - SearchQueryArgs ApidomainQueryArgs `json:"search_query_args,omitempty"` - - // start - Start string `json:"start,omitempty"` - - // status - // Required: true - Status *string `json:"status"` - - // version - Version string `json:"version,omitempty"` - - // version numeric - VersionNumeric int32 `json:"version_numeric,omitempty"` - - // workflow meta - WorkflowMeta *ApidomainWorkflowMetadataV1 `json:"workflow_meta,omitempty"` -} - -// Validate validates this apidomain saved search update request v1 -func (m *ApidomainSavedSearchUpdateRequestV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEnd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSearchQueryArgs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWorkflowMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainSavedSearchUpdateRequestV1) validateEnd(formats strfmt.Registry) error { - - if err := validate.Required("end", "body", m.End); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchUpdateRequestV1) validateSearchQueryArgs(formats strfmt.Registry) error { - if swag.IsZero(m.SearchQueryArgs) { // not required - return nil - } - - if m.SearchQueryArgs != nil { - if err := m.SearchQueryArgs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("search_query_args") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("search_query_args") - } - return err - } - } - - return nil -} - -func (m *ApidomainSavedSearchUpdateRequestV1) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *ApidomainSavedSearchUpdateRequestV1) validateWorkflowMeta(formats strfmt.Registry) error { - if swag.IsZero(m.WorkflowMeta) { // not required - return nil - } - - if m.WorkflowMeta != nil { - if err := m.WorkflowMeta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workflow_meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workflow_meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this apidomain saved search update request v1 based on the context it is used -func (m *ApidomainSavedSearchUpdateRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSearchQueryArgs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWorkflowMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainSavedSearchUpdateRequestV1) contextValidateSearchQueryArgs(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SearchQueryArgs) { // not required - return nil - } - - if err := m.SearchQueryArgs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("search_query_args") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("search_query_args") - } - return err - } - - return nil -} - -func (m *ApidomainSavedSearchUpdateRequestV1) contextValidateWorkflowMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.WorkflowMeta != nil { - - if swag.IsZero(m.WorkflowMeta) { // not required - return nil - } - - if err := m.WorkflowMeta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workflow_meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workflow_meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ApidomainSavedSearchUpdateRequestV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApidomainSavedSearchUpdateRequestV1) UnmarshalBinary(b []byte) error { - var res ApidomainSavedSearchUpdateRequestV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/apidomain_validation_response_v1.go b/falcon/models/apidomain_validation_response_v1.go deleted file mode 100644 index 6a9180e7..00000000 --- a/falcon/models/apidomain_validation_response_v1.go +++ /dev/null @@ -1,105 +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" -) - -// ApidomainValidationResponseV1 apidomain validation response v1 -// -// swagger:model apidomain.ValidationResponseV1 -type ApidomainValidationResponseV1 struct { - - // arguments - // Required: true - Arguments map[string]string `json:"arguments"` - - // query string - // Required: true - QueryString *string `json:"query_string"` - - // valid - // Required: true - Valid *bool `json:"valid"` -} - -// Validate validates this apidomain validation response v1 -func (m *ApidomainValidationResponseV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateArguments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateQueryString(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValid(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ApidomainValidationResponseV1) validateArguments(formats strfmt.Registry) error { - - if err := validate.Required("arguments", "body", m.Arguments); err != nil { - return err - } - - return nil -} - -func (m *ApidomainValidationResponseV1) validateQueryString(formats strfmt.Registry) error { - - if err := validate.Required("query_string", "body", m.QueryString); err != nil { - return err - } - - return nil -} - -func (m *ApidomainValidationResponseV1) validateValid(formats strfmt.Registry) error { - - if err := validate.Required("valid", "body", m.Valid); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this apidomain validation response v1 based on context it is used -func (m *ApidomainValidationResponseV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ApidomainValidationResponseV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApidomainValidationResponseV1) UnmarshalBinary(b []byte) error { - var res ApidomainValidationResponseV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/apidomain_workflow_metadata_v1.go b/falcon/models/apidomain_workflow_metadata_v1.go deleted file mode 100644 index 7db883eb..00000000 --- a/falcon/models/apidomain_workflow_metadata_v1.go +++ /dev/null @@ -1,59 +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" -) - -// ApidomainWorkflowMetadataV1 apidomain workflow metadata v1 -// -// swagger:model apidomain.WorkflowMetadataV1 -type ApidomainWorkflowMetadataV1 struct { - - // is system - IsSystem bool `json:"is_system,omitempty"` - - // polling interval - PollingInterval int32 `json:"polling_interval,omitempty"` - - // polling timeout - PollingTimeout int32 `json:"polling_timeout,omitempty"` - - // tag ids - TagIds []string `json:"tag_ids"` -} - -// Validate validates this apidomain workflow metadata v1 -func (m *ApidomainWorkflowMetadataV1) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this apidomain workflow metadata v1 based on context it is used -func (m *ApidomainWorkflowMetadataV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ApidomainWorkflowMetadataV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ApidomainWorkflowMetadataV1) UnmarshalBinary(b []byte) error { - var res ApidomainWorkflowMetadataV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/apidomain_saved_search_deploy_request_v1.go b/falcon/models/client_action_request.go similarity index 52% rename from falcon/models/apidomain_saved_search_deploy_request_v1.go rename to falcon/models/client_action_request.go index 966279f7..70ec87f2 100644 --- a/falcon/models/apidomain_saved_search_deploy_request_v1.go +++ b/falcon/models/client_action_request.go @@ -14,18 +14,18 @@ import ( "github.com/go-openapi/validate" ) -// ApidomainSavedSearchDeployRequestV1 apidomain saved search deploy request v1 +// ClientActionRequest client action request // -// swagger:model apidomain.SavedSearchDeployRequestV1 -type ApidomainSavedSearchDeployRequestV1 struct { +// swagger:model client.ActionRequest +type ClientActionRequest struct { - // ids + // Execution IDs to perform an action // Required: true Ids []string `json:"ids"` } -// Validate validates this apidomain saved search deploy request v1 -func (m *ApidomainSavedSearchDeployRequestV1) Validate(formats strfmt.Registry) error { +// Validate validates this client action request +func (m *ClientActionRequest) Validate(formats strfmt.Registry) error { var res []error if err := m.validateIds(formats); err != nil { @@ -38,7 +38,7 @@ func (m *ApidomainSavedSearchDeployRequestV1) Validate(formats strfmt.Registry) return nil } -func (m *ApidomainSavedSearchDeployRequestV1) validateIds(formats strfmt.Registry) error { +func (m *ClientActionRequest) validateIds(formats strfmt.Registry) error { if err := validate.Required("ids", "body", m.Ids); err != nil { return err @@ -47,13 +47,13 @@ func (m *ApidomainSavedSearchDeployRequestV1) validateIds(formats strfmt.Registr return nil } -// ContextValidate validates this apidomain saved search deploy request v1 based on context it is used -func (m *ApidomainSavedSearchDeployRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this client action request based on context it is used +func (m *ClientActionRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *ApidomainSavedSearchDeployRequestV1) MarshalBinary() ([]byte, error) { +func (m *ClientActionRequest) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -61,8 +61,8 @@ func (m *ApidomainSavedSearchDeployRequestV1) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *ApidomainSavedSearchDeployRequestV1) UnmarshalBinary(b []byte) error { - var res ApidomainSavedSearchDeployRequestV1 +func (m *ClientActionRequest) UnmarshalBinary(b []byte) error { + var res ClientActionRequest if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/apidomain_data_ingest_response_v1.go b/falcon/models/client_data_ingest_response_v1.go similarity index 66% rename from falcon/models/apidomain_data_ingest_response_v1.go rename to falcon/models/client_data_ingest_response_v1.go index daa673cc..3afd1f82 100644 --- a/falcon/models/apidomain_data_ingest_response_v1.go +++ b/falcon/models/client_data_ingest_response_v1.go @@ -14,10 +14,10 @@ import ( "github.com/go-openapi/validate" ) -// ApidomainDataIngestResponseV1 apidomain data ingest response v1 +// ClientDataIngestResponseV1 client data ingest response v1 // -// swagger:model apidomain.DataIngestResponseV1 -type ApidomainDataIngestResponseV1 struct { +// swagger:model client.DataIngestResponseV1 +type ClientDataIngestResponseV1 struct { // repo // Required: true @@ -28,8 +28,8 @@ type ApidomainDataIngestResponseV1 struct { RowsWritten *int32 `json:"rows_written"` } -// Validate validates this apidomain data ingest response v1 -func (m *ApidomainDataIngestResponseV1) Validate(formats strfmt.Registry) error { +// Validate validates this client data ingest response v1 +func (m *ClientDataIngestResponseV1) Validate(formats strfmt.Registry) error { var res []error if err := m.validateRepo(formats); err != nil { @@ -46,7 +46,7 @@ func (m *ApidomainDataIngestResponseV1) Validate(formats strfmt.Registry) error return nil } -func (m *ApidomainDataIngestResponseV1) validateRepo(formats strfmt.Registry) error { +func (m *ClientDataIngestResponseV1) validateRepo(formats strfmt.Registry) error { if err := validate.Required("repo", "body", m.Repo); err != nil { return err @@ -66,7 +66,7 @@ func (m *ApidomainDataIngestResponseV1) validateRepo(formats strfmt.Registry) er return nil } -func (m *ApidomainDataIngestResponseV1) validateRowsWritten(formats strfmt.Registry) error { +func (m *ClientDataIngestResponseV1) validateRowsWritten(formats strfmt.Registry) error { if err := validate.Required("rows_written", "body", m.RowsWritten); err != nil { return err @@ -75,8 +75,8 @@ func (m *ApidomainDataIngestResponseV1) validateRowsWritten(formats strfmt.Regis return nil } -// ContextValidate validate this apidomain data ingest response v1 based on the context it is used -func (m *ApidomainDataIngestResponseV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this client data ingest response v1 based on the context it is used +func (m *ClientDataIngestResponseV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateRepo(ctx, formats); err != nil { @@ -89,7 +89,7 @@ func (m *ApidomainDataIngestResponseV1) ContextValidate(ctx context.Context, for return nil } -func (m *ApidomainDataIngestResponseV1) contextValidateRepo(ctx context.Context, formats strfmt.Registry) error { +func (m *ClientDataIngestResponseV1) contextValidateRepo(ctx context.Context, formats strfmt.Registry) error { if m.Repo != nil { @@ -107,7 +107,7 @@ func (m *ApidomainDataIngestResponseV1) contextValidateRepo(ctx context.Context, } // MarshalBinary interface implementation -func (m *ApidomainDataIngestResponseV1) MarshalBinary() ([]byte, error) { +func (m *ClientDataIngestResponseV1) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -115,8 +115,8 @@ func (m *ApidomainDataIngestResponseV1) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *ApidomainDataIngestResponseV1) UnmarshalBinary(b []byte) error { - var res ApidomainDataIngestResponseV1 +func (m *ClientDataIngestResponseV1) UnmarshalBinary(b []byte) error { + var res ClientDataIngestResponseV1 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/client_data_ingest_response_wrapper_v1.go b/falcon/models/client_data_ingest_response_wrapper_v1.go new file mode 100644 index 00000000..5cba5b24 --- /dev/null +++ b/falcon/models/client_data_ingest_response_wrapper_v1.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" +) + +// ClientDataIngestResponseWrapperV1 client data ingest response wrapper v1 +// +// swagger:model client.DataIngestResponseWrapperV1 +type ClientDataIngestResponseWrapperV1 struct { + + // errors + // Required: true + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ClientDataIngestResponseV1 `json:"resources"` +} + +// Validate validates this client data ingest response wrapper v1 +func (m *ClientDataIngestResponseWrapperV1) 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 *ClientDataIngestResponseWrapperV1) 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 *ClientDataIngestResponseWrapperV1) 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 *ClientDataIngestResponseWrapperV1) 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 client data ingest response wrapper v1 based on the context it is used +func (m *ClientDataIngestResponseWrapperV1) 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 *ClientDataIngestResponseWrapperV1) 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 *ClientDataIngestResponseWrapperV1) 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 *ClientDataIngestResponseWrapperV1) 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 *ClientDataIngestResponseWrapperV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClientDataIngestResponseWrapperV1) UnmarshalBinary(b []byte) error { + var res ClientDataIngestResponseWrapperV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/client_job_status.go b/falcon/models/client_job_status.go index 8c93631f..c67e1d56 100644 --- a/falcon/models/client_job_status.go +++ b/falcon/models/client_job_status.go @@ -19,9 +19,21 @@ import ( // swagger:model client.JobStatus type ClientJobStatus struct { + // content length + ContentLength int32 `json:"content_length,omitempty"` + + // digest algo + DigestAlgo string `json:"digest_algo,omitempty"` + + // digest hex + DigestHex string `json:"digest_hex,omitempty"` + // event count EventCount int64 `json:"event_count,omitempty"` + // file link + FileLink string `json:"file_link,omitempty"` + // job id // Required: true JobID *string `json:"job_id"` diff --git a/falcon/models/common_count_as_resource.go b/falcon/models/common_count_as_resource.go new file mode 100644 index 00000000..6a70597e --- /dev/null +++ b/falcon/models/common_count_as_resource.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" +) + +// CommonCountAsResource common count as resource +// +// swagger:model common.CountAsResource +type CommonCountAsResource struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // label + // Required: true + Label *string `json:"label"` +} + +// Validate validates this common count as resource +func (m *CommonCountAsResource) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CommonCountAsResource) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CommonCountAsResource) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this common count as resource based on context it is used +func (m *CommonCountAsResource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CommonCountAsResource) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CommonCountAsResource) UnmarshalBinary(b []byte) error { + var res CommonCountAsResource + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/common_count_response.go b/falcon/models/common_count_response.go new file mode 100644 index 00000000..5015f6bb --- /dev/null +++ b/falcon/models/common_count_response.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" +) + +// CommonCountResponse common count response +// +// swagger:model common.CountResponse +type CommonCountResponse struct { + + // resources + // Required: true + Resources []*CommonCountAsResource `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this common count response +func (m *CommonCountResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CommonCountResponse) 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 +} + +func (m *CommonCountResponse) 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 *CommonCountResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this common count response based on the context it is used +func (m *CommonCountResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *CommonCountResponse) 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 +} + +func (m *CommonCountResponse) 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 *CommonCountResponse) 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 *CommonCountResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CommonCountResponse) UnmarshalBinary(b []byte) error { + var res CommonCountResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/common_entities_response.go b/falcon/models/common_entities_response.go deleted file mode 100644 index 0673797a..00000000 --- a/falcon/models/common_entities_response.go +++ /dev/null @@ -1,190 +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" -) - -// CommonEntitiesResponse common entities response -// -// swagger:model common.EntitiesResponse -type CommonEntitiesResponse struct { - - // errors - // Required: true - Errors []*MsaAPIError `json:"errors"` - - // meta - // Required: true - Meta *MsaMetaInfo `json:"meta"` - - // resources - // Required: true - Resources CommonEntitiesResponseResources `json:"resources"` -} - -// Validate validates this common entities response -func (m *CommonEntitiesResponse) 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 *CommonEntitiesResponse) 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 *CommonEntitiesResponse) 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 *CommonEntitiesResponse) validateResources(formats strfmt.Registry) error { - - if m.Resources == nil { - return errors.Required("resources", "body", nil) - } - - return nil -} - -// ContextValidate validate this common entities response based on the context it is used -func (m *CommonEntitiesResponse) 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 *CommonEntitiesResponse) 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 *CommonEntitiesResponse) 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 *CommonEntitiesResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CommonEntitiesResponse) UnmarshalBinary(b []byte) error { - var res CommonEntitiesResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/string_wrapper.go b/falcon/models/common_generic_entity_response_string.go similarity index 71% rename from falcon/models/string_wrapper.go rename to falcon/models/common_generic_entity_response_string.go index 7f070a45..0bc15997 100644 --- a/falcon/models/string_wrapper.go +++ b/falcon/models/common_generic_entity_response_string.go @@ -15,10 +15,10 @@ import ( "github.com/go-openapi/validate" ) -// StringWrapper string wrapper +// CommonGenericEntityResponseString common generic entity response string // -// swagger:model stringWrapper -type StringWrapper struct { +// swagger:model common.GenericEntityResponse[string] +type CommonGenericEntityResponseString struct { // errors Errors []*MsaAPIError `json:"errors"` @@ -32,8 +32,8 @@ type StringWrapper struct { Resources []string `json:"resources"` } -// Validate validates this string wrapper -func (m *StringWrapper) Validate(formats strfmt.Registry) error { +// Validate validates this common generic entity response string +func (m *CommonGenericEntityResponseString) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -54,7 +54,7 @@ func (m *StringWrapper) Validate(formats strfmt.Registry) error { return nil } -func (m *StringWrapper) validateErrors(formats strfmt.Registry) error { +func (m *CommonGenericEntityResponseString) validateErrors(formats strfmt.Registry) error { if swag.IsZero(m.Errors) { // not required return nil } @@ -80,7 +80,7 @@ func (m *StringWrapper) validateErrors(formats strfmt.Registry) error { return nil } -func (m *StringWrapper) validateMeta(formats strfmt.Registry) error { +func (m *CommonGenericEntityResponseString) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -100,7 +100,7 @@ func (m *StringWrapper) validateMeta(formats strfmt.Registry) error { return nil } -func (m *StringWrapper) validateResources(formats strfmt.Registry) error { +func (m *CommonGenericEntityResponseString) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err @@ -109,8 +109,8 @@ func (m *StringWrapper) validateResources(formats strfmt.Registry) error { return nil } -// ContextValidate validate this string wrapper based on the context it is used -func (m *StringWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this common generic entity response string based on the context it is used +func (m *CommonGenericEntityResponseString) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -127,7 +127,7 @@ func (m *StringWrapper) ContextValidate(ctx context.Context, formats strfmt.Regi return nil } -func (m *StringWrapper) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *CommonGenericEntityResponseString) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -152,7 +152,7 @@ func (m *StringWrapper) contextValidateErrors(ctx context.Context, formats strfm return nil } -func (m *StringWrapper) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *CommonGenericEntityResponseString) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -170,7 +170,7 @@ func (m *StringWrapper) contextValidateMeta(ctx context.Context, formats strfmt. } // MarshalBinary interface implementation -func (m *StringWrapper) MarshalBinary() ([]byte, error) { +func (m *CommonGenericEntityResponseString) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -178,8 +178,8 @@ func (m *StringWrapper) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *StringWrapper) UnmarshalBinary(b []byte) error { - var res StringWrapper +func (m *CommonGenericEntityResponseString) UnmarshalBinary(b []byte) error { + var res CommonGenericEntityResponseString if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/custom_type3747358178.go b/falcon/models/custom_storage_object_keys.go similarity index 74% rename from falcon/models/custom_type3747358178.go rename to falcon/models/custom_storage_object_keys.go index 30683ab8..ff9abd5a 100644 --- a/falcon/models/custom_type3747358178.go +++ b/falcon/models/custom_storage_object_keys.go @@ -15,10 +15,10 @@ import ( "github.com/go-openapi/validate" ) -// CustomType3747358178 custom type 3747358178 +// CustomStorageObjectKeys custom storage object keys // -// swagger:model CustomType_3747358178 -type CustomType3747358178 struct { +// swagger:model CustomStorageObjectKeys +type CustomStorageObjectKeys struct { // errors // Required: true @@ -26,15 +26,15 @@ type CustomType3747358178 struct { // meta // Required: true - Meta *MsaMetaInfo `json:"meta"` + Meta *APIMetaInfo `json:"meta"` // resources // Required: true Resources []string `json:"resources"` } -// Validate validates this custom type 3747358178 -func (m *CustomType3747358178) Validate(formats strfmt.Registry) error { +// Validate validates this custom storage object keys +func (m *CustomStorageObjectKeys) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,7 +55,7 @@ func (m *CustomType3747358178) Validate(formats strfmt.Registry) error { return nil } -func (m *CustomType3747358178) validateErrors(formats strfmt.Registry) error { +func (m *CustomStorageObjectKeys) validateErrors(formats strfmt.Registry) error { if err := validate.Required("errors", "body", m.Errors); err != nil { return err @@ -82,7 +82,7 @@ func (m *CustomType3747358178) validateErrors(formats strfmt.Registry) error { return nil } -func (m *CustomType3747358178) validateMeta(formats strfmt.Registry) error { +func (m *CustomStorageObjectKeys) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,7 +102,7 @@ func (m *CustomType3747358178) validateMeta(formats strfmt.Registry) error { return nil } -func (m *CustomType3747358178) validateResources(formats strfmt.Registry) error { +func (m *CustomStorageObjectKeys) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err @@ -111,8 +111,8 @@ func (m *CustomType3747358178) validateResources(formats strfmt.Registry) error return nil } -// ContextValidate validate this custom type 3747358178 based on the context it is used -func (m *CustomType3747358178) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this custom storage object keys based on the context it is used +func (m *CustomStorageObjectKeys) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -129,7 +129,7 @@ func (m *CustomType3747358178) ContextValidate(ctx context.Context, formats strf return nil } -func (m *CustomType3747358178) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *CustomStorageObjectKeys) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -154,7 +154,7 @@ func (m *CustomType3747358178) contextValidateErrors(ctx context.Context, format return nil } -func (m *CustomType3747358178) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *CustomStorageObjectKeys) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -172,7 +172,7 @@ func (m *CustomType3747358178) contextValidateMeta(ctx context.Context, formats } // MarshalBinary interface implementation -func (m *CustomType3747358178) MarshalBinary() ([]byte, error) { +func (m *CustomStorageObjectKeys) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -180,8 +180,8 @@ func (m *CustomType3747358178) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *CustomType3747358178) UnmarshalBinary(b []byte) error { - var res CustomType3747358178 +func (m *CustomStorageObjectKeys) UnmarshalBinary(b []byte) error { + var res CustomStorageObjectKeys if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/humio_view_wrapper.go b/falcon/models/custom_storage_response.go similarity index 61% rename from falcon/models/humio_view_wrapper.go rename to falcon/models/custom_storage_response.go index 06991c99..0edf136e 100644 --- a/falcon/models/humio_view_wrapper.go +++ b/falcon/models/custom_storage_response.go @@ -15,10 +15,10 @@ import ( "github.com/go-openapi/validate" ) -// HumioViewWrapper humio view wrapper +// CustomStorageResponse custom storage response // -// swagger:model humio.ViewWrapper -type HumioViewWrapper struct { +// swagger:model CustomStorageResponse +type CustomStorageResponse struct { // errors // Required: true @@ -26,15 +26,15 @@ type HumioViewWrapper struct { // meta // Required: true - Meta *MsaMetaInfo `json:"meta"` + Meta *APIMetaInfo `json:"meta"` // resources // Required: true - Resources *HumioView `json:"resources"` + Resources []*APIObjectMetadata `json:"resources"` } -// Validate validates this humio view wrapper -func (m *HumioViewWrapper) Validate(formats strfmt.Registry) error { +// Validate validates this custom storage response +func (m *CustomStorageResponse) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,7 +55,7 @@ func (m *HumioViewWrapper) Validate(formats strfmt.Registry) error { return nil } -func (m *HumioViewWrapper) validateErrors(formats strfmt.Registry) error { +func (m *CustomStorageResponse) validateErrors(formats strfmt.Registry) error { if err := validate.Required("errors", "body", m.Errors); err != nil { return err @@ -82,7 +82,7 @@ func (m *HumioViewWrapper) validateErrors(formats strfmt.Registry) error { return nil } -func (m *HumioViewWrapper) validateMeta(formats strfmt.Registry) error { +func (m *CustomStorageResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,28 +102,35 @@ func (m *HumioViewWrapper) validateMeta(formats strfmt.Registry) error { return nil } -func (m *HumioViewWrapper) validateResources(formats strfmt.Registry) error { +func (m *CustomStorageResponse) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err } - if m.Resources != nil { - if err := m.Resources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } -// ContextValidate validate this humio view wrapper based on the context it is used -func (m *HumioViewWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this custom storage response based on the context it is used +func (m *CustomStorageResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -144,7 +151,7 @@ func (m *HumioViewWrapper) ContextValidate(ctx context.Context, formats strfmt.R return nil } -func (m *HumioViewWrapper) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *CustomStorageResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -169,7 +176,7 @@ func (m *HumioViewWrapper) contextValidateErrors(ctx context.Context, formats st return nil } -func (m *HumioViewWrapper) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *CustomStorageResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -186,25 +193,33 @@ func (m *HumioViewWrapper) contextValidateMeta(ctx context.Context, formats strf return nil } -func (m *HumioViewWrapper) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *CustomStorageResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { - if m.Resources != nil { + for i := 0; i < len(m.Resources); i++ { - if err := m.Resources.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } // MarshalBinary interface implementation -func (m *HumioViewWrapper) MarshalBinary() ([]byte, error) { +func (m *CustomStorageResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -212,8 +227,8 @@ func (m *HumioViewWrapper) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HumioViewWrapper) UnmarshalBinary(b []byte) error { - var res HumioViewWrapper +func (m *CustomStorageResponse) UnmarshalBinary(b []byte) error { + var res CustomStorageResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/detections_api_assessment_detections.go b/falcon/models/detections_api_assessment_detections.go new file mode 100644 index 00000000..4010dd8a --- /dev/null +++ b/falcon/models/detections_api_assessment_detections.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" +) + +// DetectionsAPIAssessmentDetections detections api assessment detections +// +// swagger:model detections.apiAssessmentDetections +type DetectionsAPIAssessmentDetections struct { + + // resources + // Required: true + Resources []*ModelsAPIAssessmentDetections `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this detections api assessment detections +func (m *DetectionsAPIAssessmentDetections) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DetectionsAPIAssessmentDetections) 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 +} + +func (m *DetectionsAPIAssessmentDetections) 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 *DetectionsAPIAssessmentDetections) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this detections api assessment detections based on the context it is used +func (m *DetectionsAPIAssessmentDetections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *DetectionsAPIAssessmentDetections) 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 +} + +func (m *DetectionsAPIAssessmentDetections) 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 *DetectionsAPIAssessmentDetections) 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 *DetectionsAPIAssessmentDetections) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectionsAPIAssessmentDetections) UnmarshalBinary(b []byte) error { + var res DetectionsAPIAssessmentDetections + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/detections_api_combined_detections.go b/falcon/models/detections_api_combined_detections.go new file mode 100644 index 00000000..0bfdcc1e --- /dev/null +++ b/falcon/models/detections_api_combined_detections.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" +) + +// DetectionsAPICombinedDetections detections api combined detections +// +// swagger:model detections.apiCombinedDetections +type DetectionsAPICombinedDetections struct { + + // resources + // Required: true + Resources []*ModelsAPICombinedDetections `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this detections api combined detections +func (m *DetectionsAPICombinedDetections) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DetectionsAPICombinedDetections) 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 +} + +func (m *DetectionsAPICombinedDetections) 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 *DetectionsAPICombinedDetections) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this detections api combined detections based on the context it is used +func (m *DetectionsAPICombinedDetections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *DetectionsAPICombinedDetections) 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 +} + +func (m *DetectionsAPICombinedDetections) 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 *DetectionsAPICombinedDetections) 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 *DetectionsAPICombinedDetections) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectionsAPICombinedDetections) UnmarshalBinary(b []byte) error { + var res DetectionsAPICombinedDetections + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/detections_api_detections_by_severity.go b/falcon/models/detections_api_detections_by_severity.go new file mode 100644 index 00000000..0170bbf4 --- /dev/null +++ b/falcon/models/detections_api_detections_by_severity.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" +) + +// DetectionsAPIDetectionsBySeverity detections api detections by severity +// +// swagger:model detections.apiDetectionsBySeverity +type DetectionsAPIDetectionsBySeverity struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"resources"` +} + +// Validate validates this detections api detections by severity +func (m *DetectionsAPIDetectionsBySeverity) 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 *DetectionsAPIDetectionsBySeverity) 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 *DetectionsAPIDetectionsBySeverity) 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 *DetectionsAPIDetectionsBySeverity) 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 detections api detections by severity based on the context it is used +func (m *DetectionsAPIDetectionsBySeverity) 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 *DetectionsAPIDetectionsBySeverity) 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 *DetectionsAPIDetectionsBySeverity) 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 *DetectionsAPIDetectionsBySeverity) 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 *DetectionsAPIDetectionsBySeverity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectionsAPIDetectionsBySeverity) UnmarshalBinary(b []byte) error { + var res DetectionsAPIDetectionsBySeverity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/detections_api_detections_by_type.go b/falcon/models/detections_api_detections_by_type.go new file mode 100644 index 00000000..74b3534f --- /dev/null +++ b/falcon/models/detections_api_detections_by_type.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" +) + +// DetectionsAPIDetectionsByType detections api detections by type +// +// swagger:model detections.apiDetectionsByType +type DetectionsAPIDetectionsByType struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"resources"` +} + +// Validate validates this detections api detections by type +func (m *DetectionsAPIDetectionsByType) 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 *DetectionsAPIDetectionsByType) 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 *DetectionsAPIDetectionsByType) 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 *DetectionsAPIDetectionsByType) 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 detections api detections by type based on the context it is used +func (m *DetectionsAPIDetectionsByType) 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 *DetectionsAPIDetectionsByType) 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 *DetectionsAPIDetectionsByType) 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 *DetectionsAPIDetectionsByType) 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 *DetectionsAPIDetectionsByType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectionsAPIDetectionsByType) UnmarshalBinary(b []byte) error { + var res DetectionsAPIDetectionsByType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/detections_api_detections_count.go b/falcon/models/detections_api_detections_count.go new file mode 100644 index 00000000..edddde67 --- /dev/null +++ b/falcon/models/detections_api_detections_count.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" +) + +// DetectionsAPIDetectionsCount detections api detections count +// +// swagger:model detections.apiDetectionsCount +type DetectionsAPIDetectionsCount struct { + + // resources + // Required: true + Resources []*ModelsAPIDetectionCount `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this detections api detections count +func (m *DetectionsAPIDetectionsCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DetectionsAPIDetectionsCount) 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 +} + +func (m *DetectionsAPIDetectionsCount) 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 *DetectionsAPIDetectionsCount) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this detections api detections count based on the context it is used +func (m *DetectionsAPIDetectionsCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *DetectionsAPIDetectionsCount) 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 +} + +func (m *DetectionsAPIDetectionsCount) 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 *DetectionsAPIDetectionsCount) 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 *DetectionsAPIDetectionsCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectionsAPIDetectionsCount) UnmarshalBinary(b []byte) error { + var res DetectionsAPIDetectionsCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/detects_alert.go b/falcon/models/detects_alert.go index 13118f26..251ea42f 100644 --- a/falcon/models/detects_alert.go +++ b/falcon/models/detects_alert.go @@ -82,8 +82,7 @@ type DetectsAlert struct { External bool `json:"external,omitempty"` // Vertex key which triggers the formation of the Alert - // Required: true - ID *string `json:"id"` + ID string `json:"id,omitempty"` // Pattern Name coming either from Taxonomy or directly from the ingested Alert Name string `json:"name,omitempty"` @@ -161,10 +160,6 @@ func (m *DetectsAlert) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - if err := m.validateTimestamp(formats); err != nil { res = append(res, err) } @@ -207,15 +202,6 @@ func (m *DetectsAlert) validateCreatedTimestamp(formats strfmt.Registry) error { return nil } -func (m *DetectsAlert) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); 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/detectsapi_patch_entities_alerts_v3_request.go b/falcon/models/detectsapi_patch_entities_alerts_v3_request.go new file mode 100644 index 00000000..8d085344 --- /dev/null +++ b/falcon/models/detectsapi_patch_entities_alerts_v3_request.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" + "github.com/go-openapi/validate" +) + +// DetectsapiPatchEntitiesAlertsV3Request detectsapi patch entities alerts v3 request +// +// swagger:model detectsapi.PatchEntitiesAlertsV3Request +type DetectsapiPatchEntitiesAlertsV3Request struct { + + // action parameters + ActionParameters []*MsaspecActionParameter `json:"action_parameters"` + + // composite ids + // Required: true + CompositeIds []string `json:"composite_ids"` +} + +// Validate validates this detectsapi patch entities alerts v3 request +func (m *DetectsapiPatchEntitiesAlertsV3Request) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActionParameters(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCompositeIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DetectsapiPatchEntitiesAlertsV3Request) validateActionParameters(formats strfmt.Registry) error { + if swag.IsZero(m.ActionParameters) { // not required + return nil + } + + for i := 0; i < len(m.ActionParameters); i++ { + if swag.IsZero(m.ActionParameters[i]) { // not required + continue + } + + if m.ActionParameters[i] != nil { + if err := m.ActionParameters[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("action_parameters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("action_parameters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DetectsapiPatchEntitiesAlertsV3Request) validateCompositeIds(formats strfmt.Registry) error { + + if err := validate.Required("composite_ids", "body", m.CompositeIds); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this detectsapi patch entities alerts v3 request based on the context it is used +func (m *DetectsapiPatchEntitiesAlertsV3Request) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateActionParameters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DetectsapiPatchEntitiesAlertsV3Request) contextValidateActionParameters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ActionParameters); i++ { + + if m.ActionParameters[i] != nil { + + if swag.IsZero(m.ActionParameters[i]) { // not required + return nil + } + + if err := m.ActionParameters[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("action_parameters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("action_parameters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DetectsapiPatchEntitiesAlertsV3Request) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectsapiPatchEntitiesAlertsV3Request) UnmarshalBinary(b []byte) error { + var res DetectsapiPatchEntitiesAlertsV3Request + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/detectsapi_post_entities_alerts_v2_request.go b/falcon/models/detectsapi_post_entities_alerts_v2_request.go new file mode 100644 index 00000000..821a76f3 --- /dev/null +++ b/falcon/models/detectsapi_post_entities_alerts_v2_request.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" +) + +// DetectsapiPostEntitiesAlertsV2Request detectsapi post entities alerts v2 request +// +// swagger:model detectsapi.PostEntitiesAlertsV2Request +type DetectsapiPostEntitiesAlertsV2Request struct { + + // CompositeIDs represent the slice of Alert CompositeIDs that would be looked up + // Required: true + CompositeIds []string `json:"composite_ids"` +} + +// Validate validates this detectsapi post entities alerts v2 request +func (m *DetectsapiPostEntitiesAlertsV2Request) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompositeIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DetectsapiPostEntitiesAlertsV2Request) validateCompositeIds(formats strfmt.Registry) error { + + if err := validate.Required("composite_ids", "body", m.CompositeIds); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this detectsapi post entities alerts v2 request based on context it is used +func (m *DetectsapiPostEntitiesAlertsV2Request) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DetectsapiPostEntitiesAlertsV2Request) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectsapiPostEntitiesAlertsV2Request) UnmarshalBinary(b []byte) error { + var res DetectsapiPostEntitiesAlertsV2Request + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/detectsapi_post_entities_alerts_v2_response.go b/falcon/models/detectsapi_post_entities_alerts_v2_response.go new file mode 100644 index 00000000..9aefa26a --- /dev/null +++ b/falcon/models/detectsapi_post_entities_alerts_v2_response.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" +) + +// DetectsapiPostEntitiesAlertsV2Response detectsapi post entities alerts v2 response +// +// swagger:model detectsapi.PostEntitiesAlertsV2Response +type DetectsapiPostEntitiesAlertsV2Response struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // Resources represent the slice of Alerts that were retrieved for the given Alert IDs + // Required: true + Resources []*DetectsAlert `json:"resources"` +} + +// Validate validates this detectsapi post entities alerts v2 response +func (m *DetectsapiPostEntitiesAlertsV2Response) 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 *DetectsapiPostEntitiesAlertsV2Response) 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 *DetectsapiPostEntitiesAlertsV2Response) 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 *DetectsapiPostEntitiesAlertsV2Response) 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 detectsapi post entities alerts v2 response based on the context it is used +func (m *DetectsapiPostEntitiesAlertsV2Response) 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 *DetectsapiPostEntitiesAlertsV2Response) 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 *DetectsapiPostEntitiesAlertsV2Response) 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 *DetectsapiPostEntitiesAlertsV2Response) 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 *DetectsapiPostEntitiesAlertsV2Response) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DetectsapiPostEntitiesAlertsV2Response) UnmarshalBinary(b []byte) error { + var res DetectsapiPostEntitiesAlertsV2Response + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/device_mapped_device_policies.go b/falcon/models/device_mapped_device_policies.go index 1c84c08c..489c9837 100644 --- a/falcon/models/device_mapped_device_policies.go +++ b/falcon/models/device_mapped_device_policies.go @@ -42,6 +42,9 @@ type DeviceMappedDevicePolicies struct { // global config GlobalConfig *DeviceDevicePolicy `json:"global_config,omitempty"` + // host retention + HostRetention *DeviceDevicePolicy `json:"host-retention,omitempty"` + // identity protection IdentityProtection *DeviceDevicePolicy `json:"identity-protection,omitempty"` @@ -112,6 +115,10 @@ func (m *DeviceMappedDevicePolicies) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateHostRetention(formats); err != nil { + res = append(res, err) + } + if err := m.validateIdentityProtection(formats); err != nil { res = append(res, err) } @@ -314,6 +321,25 @@ func (m *DeviceMappedDevicePolicies) validateGlobalConfig(formats strfmt.Registr return nil } +func (m *DeviceMappedDevicePolicies) validateHostRetention(formats strfmt.Registry) error { + if swag.IsZero(m.HostRetention) { // not required + return nil + } + + if m.HostRetention != nil { + if err := m.HostRetention.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("host-retention") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("host-retention") + } + return err + } + } + + return nil +} + func (m *DeviceMappedDevicePolicies) validateIdentityProtection(formats strfmt.Registry) error { if swag.IsZero(m.IdentityProtection) { // not required return nil @@ -559,6 +585,10 @@ func (m *DeviceMappedDevicePolicies) ContextValidate(ctx context.Context, format res = append(res, err) } + if err := m.contextValidateHostRetention(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateIdentityProtection(ctx, formats); err != nil { res = append(res, err) } @@ -777,6 +807,27 @@ func (m *DeviceMappedDevicePolicies) contextValidateGlobalConfig(ctx context.Con return nil } +func (m *DeviceMappedDevicePolicies) contextValidateHostRetention(ctx context.Context, formats strfmt.Registry) error { + + if m.HostRetention != nil { + + if swag.IsZero(m.HostRetention) { // not required + return nil + } + + if err := m.HostRetention.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("host-retention") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("host-retention") + } + return err + } + } + + return nil +} + func (m *DeviceMappedDevicePolicies) contextValidateIdentityProtection(ctx context.Context, formats strfmt.Registry) error { if m.IdentityProtection != nil { diff --git a/falcon/models/deviceapi_device_swagger.go b/falcon/models/deviceapi_device_swagger.go index 23836fde..fe2b2853 100644 --- a/falcon/models/deviceapi_device_swagger.go +++ b/falcon/models/deviceapi_device_swagger.go @@ -130,6 +130,9 @@ type DeviceapiDeviceSwagger struct { // last login timestamp LastLoginTimestamp string `json:"last_login_timestamp,omitempty"` + // last login user + LastLoginUser string `json:"last_login_user,omitempty"` + // last reboot LastReboot string `json:"last_reboot,omitempty"` diff --git a/falcon/models/domain_actor_document.go b/falcon/models/domain_actor_document.go index f6e865fb..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 @@ -41,18 +41,39 @@ type DomainActorDocument struct { // Actor's text description, partially containing structured data from other fields Description string `json:"description,omitempty"` + // description length + DescriptionLength int64 `json:"description_length,omitempty"` + + // develops threats + DevelopsThreats []*DomainThreatEntity `json:"develops_threats"` + + // develops threats count + DevelopsThreatsCount int64 `json:"develops_threats_count,omitempty"` + // Multi-field property describing eCrime actor's kill chain 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"` + + // has subgroup actors count + HasSubgroupActorsCount int64 `json:"has_subgroup_actors_count,omitempty"` + + // has successor + HasSuccessor []*DomainActorEntity `json:"has_successor"` + + // has successor actors count + HasSuccessorActorsCount int64 `json:"has_successor_actors_count,omitempty"` // Numerical ID for the Actor // Required: true @@ -61,6 +82,30 @@ type DomainActorDocument struct { // Image used in UI Image *DomainImage `json:"image,omitempty"` + // in reports + InReports []*DomainActorNewsDocument `json:"in_reports"` + + // in reports count + InReportsCount int64 `json:"in_reports_count,omitempty"` + + // is subgroup of + IsSubgroupOf []*DomainActorEntity `json:"is_subgroup_of"` + + // is subgroup of actors count + IsSubgroupOfActorsCount int64 `json:"is_subgroup_of_actors_count,omitempty"` + + // is successor of + IsSuccessorOf []*DomainActorEntity `json:"is_successor_of"` + + // is successor of actors count + IsSuccessorOfActorsCount int64 `json:"is_successor_of_actors_count,omitempty"` + + // is supported by + IsSupportedBy []*DomainActorEntity `json:"is_supported_by"` + + // is supported by actors count + IsSupportedByActorsCount int64 `json:"is_supported_by_actors_count,omitempty"` + // Multi-field property describing actor's kill chain KillChain *DomainKillChain `json:"kill_chain,omitempty"` @@ -78,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"` @@ -89,21 +134,27 @@ 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"` + // sells threats + SellsThreats []*DomainThreatEntity `json:"sells_threats"` + + // sells threats count + SellsThreatsCount int64 `json:"sells_threats_count,omitempty"` + // Short version of the description field // Required: true ShortDescription *string `json:"short_description"` @@ -115,23 +166,53 @@ type DomainActorDocument struct { // Required: true Status *string `json:"status"` + // supports + Supports []*DomainActorEntity `json:"supports"` + + // supports actors count + SupportsActorsCount int64 `json:"supports_actors_count,omitempty"` + // 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"` // URL at which actor profile can be accessed URL string `json:"url,omitempty"` + + // uses indicators count + UsesIndicatorsCount int64 `json:"uses_indicators_count,omitempty"` + + // uses mitre attacks count + UsesMitreAttacksCount int64 `json:"uses_mitre_attacks_count,omitempty"` + + // uses mitre tactics count + UsesMitreTacticsCount int64 `json:"uses_mitre_tactics_count,omitempty"` + + // uses mitre techniques count + UsesMitreTechniquesCount int64 `json:"uses_mitre_techniques_count,omitempty"` + + // uses threats + UsesThreats []*DomainThreatEntity `json:"uses_threats"` + + // uses threats count + UsesThreatsCount int64 `json:"uses_threats_count,omitempty"` + + // Comma separated values of vulnerabilities by CVE codes that are exploited by actor + UsesVulnerabilities []string `json:"uses_vulnerabilities"` + + // vulnerabilities count + VulnerabilitiesCount int64 `json:"vulnerabilities_count,omitempty"` } // Validate validates this domain actor document @@ -146,11 +227,11 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateCapability(formats); err != nil { + if err := m.validateCreatedDate(formats); err != nil { res = append(res, err) } - if err := m.validateCreatedDate(formats); err != nil { + if err := m.validateDevelopsThreats(formats); err != nil { res = append(res, err) } @@ -158,15 +239,15 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateEntitlements(formats); err != nil { + if err := m.validateFirstActivityDate(formats); err != nil { res = append(res, err) } - if err := m.validateFirstActivityDate(formats); err != nil { + if err := m.validateHasSubgroup(formats); err != nil { res = append(res, err) } - if err := m.validateGroup(formats); err != nil { + if err := m.validateHasSuccessor(formats); err != nil { res = append(res, err) } @@ -178,6 +259,22 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateInReports(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsSubgroupOf(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsSuccessorOf(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsSupportedBy(formats); err != nil { + res = append(res, err) + } + if err := m.validateKillChain(formats); err != nil { res = append(res, err) } @@ -210,7 +307,7 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateRegion(formats); err != nil { + if err := m.validateSellsThreats(formats); err != nil { res = append(res, err) } @@ -222,6 +319,10 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateSupports(formats); err != nil { + res = append(res, err) + } + if err := m.validateTargetCountries(formats); err != nil { res = append(res, err) } @@ -238,6 +339,10 @@ func (m *DomainActorDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUsesThreats(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -259,17 +364,34 @@ 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 + return nil +} + +func (m *DomainActorDocument) validateCreatedDate(formats strfmt.Registry) error { + + if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { + return err + } + + return nil +} + +func (m *DomainActorDocument) validateDevelopsThreats(formats strfmt.Registry) error { + if swag.IsZero(m.DevelopsThreats) { // not required + return nil + } + + for i := 0; i < len(m.DevelopsThreats); i++ { + if swag.IsZero(m.DevelopsThreats[i]) { // not required continue } - if m.Capabilities[i] != nil { - if err := m.Capabilities[i].Validate(formats); err != nil { + if m.DevelopsThreats[i] != nil { + if err := m.DevelopsThreats[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities" + "." + strconv.Itoa(i)) + return ve.ValidateName("develops_threats" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities" + "." + strconv.Itoa(i)) + return ce.ValidateName("develops_threats" + "." + strconv.Itoa(i)) } return err } @@ -280,17 +402,17 @@ func (m *DomainActorDocument) validateCapabilities(formats strfmt.Registry) erro return nil } -func (m *DomainActorDocument) validateCapability(formats strfmt.Registry) error { - if swag.IsZero(m.Capability) { // not required +func (m *DomainActorDocument) validateEcrimeKillChain(formats strfmt.Registry) error { + if swag.IsZero(m.EcrimeKillChain) { // not required return nil } - if m.Capability != nil { - if err := m.Capability.Validate(formats); err != nil { + if m.EcrimeKillChain != nil { + if err := m.EcrimeKillChain.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capability") + return ve.ValidateName("ecrime_kill_chain") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capability") + return ce.ValidateName("ecrime_kill_chain") } return err } @@ -299,50 +421,57 @@ func (m *DomainActorDocument) validateCapability(formats strfmt.Registry) error return nil } -func (m *DomainActorDocument) validateCreatedDate(formats strfmt.Registry) error { +func (m *DomainActorDocument) validateFirstActivityDate(formats strfmt.Registry) error { - if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { + if err := validate.Required("first_activity_date", "body", m.FirstActivityDate); err != nil { return err } return nil } -func (m *DomainActorDocument) validateEcrimeKillChain(formats strfmt.Registry) error { - if swag.IsZero(m.EcrimeKillChain) { // not required +func (m *DomainActorDocument) validateHasSubgroup(formats strfmt.Registry) error { + if swag.IsZero(m.HasSubgroup) { // not required return nil } - if m.EcrimeKillChain != nil { - if err := m.EcrimeKillChain.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ecrime_kill_chain") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ecrime_kill_chain") + for i := 0; i < len(m.HasSubgroup); i++ { + if swag.IsZero(m.HasSubgroup[i]) { // not required + continue + } + + if m.HasSubgroup[i] != nil { + if err := m.HasSubgroup[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("has_subgroup" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("has_subgroup" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil } -func (m *DomainActorDocument) validateEntitlements(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlements) { // not required +func (m *DomainActorDocument) validateHasSuccessor(formats strfmt.Registry) error { + if swag.IsZero(m.HasSuccessor) { // not required return nil } - for i := 0; i < len(m.Entitlements); i++ { - if swag.IsZero(m.Entitlements[i]) { // not required + for i := 0; i < len(m.HasSuccessor); i++ { + if swag.IsZero(m.HasSuccessor[i]) { // not required continue } - if m.Entitlements[i] != nil { - if err := m.Entitlements[i].Validate(formats); err != nil { + if m.HasSuccessor[i] != nil { + if err := m.HasSuccessor[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) + return ve.ValidateName("has_successor" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) + return ce.ValidateName("has_successor" + "." + strconv.Itoa(i)) } return err } @@ -353,26 +482,26 @@ func (m *DomainActorDocument) validateEntitlements(formats strfmt.Registry) erro return nil } -func (m *DomainActorDocument) validateFirstActivityDate(formats strfmt.Registry) error { +func (m *DomainActorDocument) validateID(formats strfmt.Registry) error { - if err := validate.Required("first_activity_date", "body", m.FirstActivityDate); err != nil { + if err := validate.Required("id", "body", m.ID); err != nil { return err } return nil } -func (m *DomainActorDocument) validateGroup(formats strfmt.Registry) error { - if swag.IsZero(m.Group) { // not required +func (m *DomainActorDocument) validateImage(formats strfmt.Registry) error { + if swag.IsZero(m.Image) { // not required return nil } - if m.Group != nil { - if err := m.Group.Validate(formats); err != nil { + if m.Image != nil { + if err := m.Image.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("group") + return ve.ValidateName("image") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("group") + return ce.ValidateName("image") } return err } @@ -381,29 +510,105 @@ func (m *DomainActorDocument) validateGroup(formats strfmt.Registry) error { return nil } -func (m *DomainActorDocument) validateID(formats strfmt.Registry) error { +func (m *DomainActorDocument) validateInReports(formats strfmt.Registry) error { + if swag.IsZero(m.InReports) { // not required + return nil + } + + for i := 0; i < len(m.InReports); i++ { + if swag.IsZero(m.InReports[i]) { // not required + continue + } + + if m.InReports[i] != nil { + if err := m.InReports[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("in_reports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("in_reports" + "." + strconv.Itoa(i)) + } + return err + } + } - if err := validate.Required("id", "body", m.ID); err != nil { - return err } return nil } -func (m *DomainActorDocument) validateImage(formats strfmt.Registry) error { - if swag.IsZero(m.Image) { // not required +func (m *DomainActorDocument) validateIsSubgroupOf(formats strfmt.Registry) error { + if swag.IsZero(m.IsSubgroupOf) { // not required return nil } - if m.Image != nil { - if err := m.Image.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("image") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("image") + for i := 0; i < len(m.IsSubgroupOf); i++ { + if swag.IsZero(m.IsSubgroupOf[i]) { // not required + continue + } + + if m.IsSubgroupOf[i] != nil { + if err := m.IsSubgroupOf[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("is_subgroup_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("is_subgroup_of" + "." + strconv.Itoa(i)) + } + return err } - return err } + + } + + return nil +} + +func (m *DomainActorDocument) validateIsSuccessorOf(formats strfmt.Registry) error { + if swag.IsZero(m.IsSuccessorOf) { // not required + return nil + } + + for i := 0; i < len(m.IsSuccessorOf); i++ { + if swag.IsZero(m.IsSuccessorOf[i]) { // not required + continue + } + + if m.IsSuccessorOf[i] != nil { + if err := m.IsSuccessorOf[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("is_successor_of" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("is_successor_of" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainActorDocument) validateIsSupportedBy(formats strfmt.Registry) error { + if swag.IsZero(m.IsSupportedBy) { // not required + return nil + } + + for i := 0; i < len(m.IsSupportedBy); i++ { + if swag.IsZero(m.IsSupportedBy[i]) { // not required + continue + } + + if m.IsSupportedBy[i] != nil { + if err := m.IsSupportedBy[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("is_supported_by" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("is_supported_by" + "." + strconv.Itoa(i)) + } + return err + } + } + } return nil @@ -461,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 } @@ -497,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 } @@ -524,17 +693,25 @@ 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 + return nil +} + +func (m *DomainActorDocument) validateSellsThreats(formats strfmt.Registry) error { + if swag.IsZero(m.SellsThreats) { // not required + return nil + } + + for i := 0; i < len(m.SellsThreats); i++ { + if swag.IsZero(m.SellsThreats[i]) { // not required continue } - if m.Origins[i] != nil { - if err := m.Origins[i].Validate(formats); err != nil { + if m.SellsThreats[i] != nil { + if err := m.SellsThreats[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origins" + "." + strconv.Itoa(i)) + return ve.ValidateName("sells_threats" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origins" + "." + strconv.Itoa(i)) + return ce.ValidateName("sells_threats" + "." + strconv.Itoa(i)) } return err } @@ -545,25 +722,6 @@ func (m *DomainActorDocument) validateOrigins(formats strfmt.Registry) error { 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 -} - func (m *DomainActorDocument) validateShortDescription(formats strfmt.Registry) error { if err := validate.Required("short_description", "body", m.ShortDescription); err != nil { @@ -582,23 +740,22 @@ func (m *DomainActorDocument) validateStatus(formats strfmt.Registry) error { return nil } -func (m *DomainActorDocument) validateTargetCountries(formats strfmt.Registry) error { - - if err := validate.Required("target_countries", "body", m.TargetCountries); err != nil { - return err +func (m *DomainActorDocument) validateSupports(formats strfmt.Registry) error { + if swag.IsZero(m.Supports) { // not required + return nil } - for i := 0; i < len(m.TargetCountries); i++ { - if swag.IsZero(m.TargetCountries[i]) { // not required + for i := 0; i < len(m.Supports); i++ { + if swag.IsZero(m.Supports[i]) { // not required continue } - if m.TargetCountries[i] != nil { - if err := m.TargetCountries[i].Validate(formats); err != nil { + if m.Supports[i] != nil { + if err := m.Supports[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) + return ve.ValidateName("supports" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) + return ce.ValidateName("supports" + "." + strconv.Itoa(i)) } return err } @@ -609,28 +766,19 @@ func (m *DomainActorDocument) validateTargetCountries(formats strfmt.Registry) e return nil } -func (m *DomainActorDocument) validateTargetIndustries(formats strfmt.Registry) error { +func (m *DomainActorDocument) validateTargetCountries(formats strfmt.Registry) error { - if err := validate.Required("target_industries", "body", m.TargetIndustries); err != nil { + if err := validate.Required("target_countries", "body", m.TargetCountries); err != nil { return err } - for i := 0; i < len(m.TargetIndustries); i++ { - if swag.IsZero(m.TargetIndustries[i]) { // not required - continue - } + return nil +} - 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 - } - } +func (m *DomainActorDocument) validateTargetIndustries(formats strfmt.Registry) error { + if err := validate.Required("target_industries", "body", m.TargetIndustries); err != nil { + return err } return nil @@ -642,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 } @@ -682,15 +812,37 @@ func (m *DomainActorDocument) validateThumbnail(formats strfmt.Registry) error { return nil } +func (m *DomainActorDocument) validateUsesThreats(formats strfmt.Registry) error { + if swag.IsZero(m.UsesThreats) { // not required + return nil + } + + for i := 0; i < len(m.UsesThreats); i++ { + if swag.IsZero(m.UsesThreats[i]) { // not required + continue + } + + if m.UsesThreats[i] != nil { + if err := m.UsesThreats[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uses_threats" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uses_threats" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // ContextValidate validate this domain actor document based on the context it is used 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 { + if err := m.contextValidateDevelopsThreats(ctx, formats); err != nil { res = append(res, err) } @@ -698,11 +850,11 @@ func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } - if err := m.contextValidateEntitlements(ctx, formats); err != nil { + if err := m.contextValidateHasSubgroup(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateGroup(ctx, formats); err != nil { + if err := m.contextValidateHasSuccessor(ctx, formats); err != nil { res = append(res, err) } @@ -710,39 +862,39 @@ func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } - if err := m.contextValidateKillChain(ctx, formats); err != nil { + if err := m.contextValidateInReports(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateMotivations(ctx, formats); err != nil { + if err := m.contextValidateIsSubgroupOf(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateObjectives(ctx, formats); err != nil { + if err := m.contextValidateIsSuccessorOf(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateOrigins(ctx, formats); err != nil { + if err := m.contextValidateIsSupportedBy(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateRegion(ctx, formats); err != nil { + if err := m.contextValidateKillChain(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateTargetCountries(ctx, formats); err != nil { + if err := m.contextValidateSellsThreats(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateTargetIndustries(ctx, formats); err != nil { + if err := m.contextValidateSupports(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateTargetRegions(ctx, formats); err != nil { + if err := m.contextValidateThumbnail(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateThumbnail(ctx, formats); err != nil { + if err := m.contextValidateUsesThreats(ctx, formats); err != nil { res = append(res, err) } @@ -752,21 +904,21 @@ func (m *DomainActorDocument) ContextValidate(ctx context.Context, formats strfm return nil } -func (m *DomainActorDocument) contextValidateCapabilities(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateDevelopsThreats(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.Capabilities); i++ { + for i := 0; i < len(m.DevelopsThreats); i++ { - if m.Capabilities[i] != nil { + if m.DevelopsThreats[i] != nil { - if swag.IsZero(m.Capabilities[i]) { // not required + if swag.IsZero(m.DevelopsThreats[i]) { // not required return nil } - if err := m.Capabilities[i].ContextValidate(ctx, formats); err != nil { + if err := m.DevelopsThreats[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilities" + "." + strconv.Itoa(i)) + return ve.ValidateName("develops_threats" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilities" + "." + strconv.Itoa(i)) + return ce.ValidateName("develops_threats" + "." + strconv.Itoa(i)) } return err } @@ -777,27 +929,6 @@ func (m *DomainActorDocument) contextValidateCapabilities(ctx context.Context, f 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) contextValidateEcrimeKillChain(ctx context.Context, formats strfmt.Registry) error { if m.EcrimeKillChain != nil { @@ -819,21 +950,21 @@ func (m *DomainActorDocument) contextValidateEcrimeKillChain(ctx context.Context return nil } -func (m *DomainActorDocument) contextValidateEntitlements(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateHasSubgroup(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.Entitlements); i++ { + for i := 0; i < len(m.HasSubgroup); i++ { - if m.Entitlements[i] != nil { + if m.HasSubgroup[i] != nil { - if swag.IsZero(m.Entitlements[i]) { // not required + if swag.IsZero(m.HasSubgroup[i]) { // not required return nil } - if err := m.Entitlements[i].ContextValidate(ctx, formats); err != nil { + if err := m.HasSubgroup[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements" + "." + strconv.Itoa(i)) + return ve.ValidateName("has_subgroup" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements" + "." + strconv.Itoa(i)) + return ce.ValidateName("has_subgroup" + "." + strconv.Itoa(i)) } return err } @@ -844,22 +975,26 @@ func (m *DomainActorDocument) contextValidateEntitlements(ctx context.Context, f return nil } -func (m *DomainActorDocument) contextValidateGroup(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateHasSuccessor(ctx context.Context, formats strfmt.Registry) error { - if m.Group != nil { + for i := 0; i < len(m.HasSuccessor); i++ { - if swag.IsZero(m.Group) { // not required - return nil - } + if m.HasSuccessor[i] != 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") + if swag.IsZero(m.HasSuccessor[i]) { // not required + return nil + } + + if err := m.HasSuccessor[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("has_successor" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("has_successor" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil @@ -886,42 +1021,46 @@ func (m *DomainActorDocument) contextValidateImage(ctx context.Context, formats return nil } -func (m *DomainActorDocument) contextValidateKillChain(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateInReports(ctx context.Context, formats strfmt.Registry) error { - if m.KillChain != nil { + for i := 0; i < len(m.InReports); i++ { - if swag.IsZero(m.KillChain) { // not required - return nil - } + if m.InReports[i] != nil { - if err := m.KillChain.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("kill_chain") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("kill_chain") + if swag.IsZero(m.InReports[i]) { // not required + return nil + } + + if err := m.InReports[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("in_reports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("in_reports" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil } -func (m *DomainActorDocument) contextValidateMotivations(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateIsSubgroupOf(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.Motivations); i++ { + for i := 0; i < len(m.IsSubgroupOf); i++ { - if m.Motivations[i] != nil { + if m.IsSubgroupOf[i] != nil { - if swag.IsZero(m.Motivations[i]) { // not required + if swag.IsZero(m.IsSubgroupOf[i]) { // not required return nil } - if err := m.Motivations[i].ContextValidate(ctx, formats); err != nil { + if err := m.IsSubgroupOf[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("motivations" + "." + strconv.Itoa(i)) + return ve.ValidateName("is_subgroup_of" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("motivations" + "." + strconv.Itoa(i)) + return ce.ValidateName("is_subgroup_of" + "." + strconv.Itoa(i)) } return err } @@ -932,21 +1071,21 @@ func (m *DomainActorDocument) contextValidateMotivations(ctx context.Context, fo return nil } -func (m *DomainActorDocument) contextValidateObjectives(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateIsSuccessorOf(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.Objectives); i++ { + for i := 0; i < len(m.IsSuccessorOf); i++ { - if m.Objectives[i] != nil { + if m.IsSuccessorOf[i] != nil { - if swag.IsZero(m.Objectives[i]) { // not required + if swag.IsZero(m.IsSuccessorOf[i]) { // not required return nil } - if err := m.Objectives[i].ContextValidate(ctx, formats); err != nil { + if err := m.IsSuccessorOf[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("objectives" + "." + strconv.Itoa(i)) + return ve.ValidateName("is_successor_of" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("objectives" + "." + strconv.Itoa(i)) + return ce.ValidateName("is_successor_of" + "." + strconv.Itoa(i)) } return err } @@ -957,21 +1096,21 @@ func (m *DomainActorDocument) contextValidateObjectives(ctx context.Context, for return nil } -func (m *DomainActorDocument) contextValidateOrigins(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateIsSupportedBy(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.Origins); i++ { + for i := 0; i < len(m.IsSupportedBy); i++ { - if m.Origins[i] != nil { + if m.IsSupportedBy[i] != nil { - if swag.IsZero(m.Origins[i]) { // not required + if swag.IsZero(m.IsSupportedBy[i]) { // not required return nil } - if err := m.Origins[i].ContextValidate(ctx, formats); err != nil { + if err := m.IsSupportedBy[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origins" + "." + strconv.Itoa(i)) + return ve.ValidateName("is_supported_by" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origins" + "." + strconv.Itoa(i)) + return ce.ValidateName("is_supported_by" + "." + strconv.Itoa(i)) } return err } @@ -982,19 +1121,19 @@ func (m *DomainActorDocument) contextValidateOrigins(ctx context.Context, format return nil } -func (m *DomainActorDocument) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateKillChain(ctx context.Context, formats strfmt.Registry) error { - if m.Region != nil { + if m.KillChain != nil { - if swag.IsZero(m.Region) { // not required + if swag.IsZero(m.KillChain) { // not required return nil } - if err := m.Region.ContextValidate(ctx, formats); err != nil { + if err := m.KillChain.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("region") + return ve.ValidateName("kill_chain") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("region") + return ce.ValidateName("kill_chain") } return err } @@ -1003,21 +1142,21 @@ func (m *DomainActorDocument) contextValidateRegion(ctx context.Context, formats return nil } -func (m *DomainActorDocument) contextValidateTargetCountries(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateSellsThreats(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.TargetCountries); i++ { + for i := 0; i < len(m.SellsThreats); i++ { - if m.TargetCountries[i] != nil { + if m.SellsThreats[i] != nil { - if swag.IsZero(m.TargetCountries[i]) { // not required + if swag.IsZero(m.SellsThreats[i]) { // not required return nil } - if err := m.TargetCountries[i].ContextValidate(ctx, formats); err != nil { + if err := m.SellsThreats[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_countries" + "." + strconv.Itoa(i)) + return ve.ValidateName("sells_threats" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_countries" + "." + strconv.Itoa(i)) + return ce.ValidateName("sells_threats" + "." + strconv.Itoa(i)) } return err } @@ -1028,46 +1167,21 @@ func (m *DomainActorDocument) contextValidateTargetCountries(ctx context.Context return nil } -func (m *DomainActorDocument) contextValidateTargetIndustries(ctx context.Context, formats strfmt.Registry) error { +func (m *DomainActorDocument) contextValidateSupports(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.TargetIndustries); i++ { + for i := 0; i < len(m.Supports); i++ { - if m.TargetIndustries[i] != nil { + if m.Supports[i] != nil { - if swag.IsZero(m.TargetIndustries[i]) { // not required + if swag.IsZero(m.Supports[i]) { // not required return nil } - if err := m.TargetIndustries[i].ContextValidate(ctx, formats); err != nil { + if err := m.Supports[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) + return ve.ValidateName("supports" + "." + 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 ce.ValidateName("supports" + "." + strconv.Itoa(i)) } return err } @@ -1099,6 +1213,31 @@ func (m *DomainActorDocument) contextValidateThumbnail(ctx context.Context, form return nil } +func (m *DomainActorDocument) contextValidateUsesThreats(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.UsesThreats); i++ { + + if m.UsesThreats[i] != nil { + + if swag.IsZero(m.UsesThreats[i]) { // not required + return nil + } + + if err := m.UsesThreats[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uses_threats" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uses_threats" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *DomainActorDocument) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/domain_actor_entity.go b/falcon/models/domain_actor_entity.go new file mode 100644 index 00000000..54cae4d3 --- /dev/null +++ b/falcon/models/domain_actor_entity.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" +) + +// DomainActorEntity domain actor entity +// +// swagger:model domain.ActorEntity +type DomainActorEntity struct { + + // id of the actor + ID string `json:"id,omitempty"` + + // name of the actor + Name string `json:"name,omitempty"` + + // set of publish flags + PublishFlags []string `json:"publish_flags"` +} + +// Validate validates this domain actor entity +func (m *DomainActorEntity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain actor entity based on context it is used +func (m *DomainActorEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainActorEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainActorEntity) UnmarshalBinary(b []byte) error { + var res DomainActorEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_actor_news_document.go b/falcon/models/domain_actor_news_document.go new file mode 100644 index 00000000..3174f495 --- /dev/null +++ b/falcon/models/domain_actor_news_document.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" +) + +// DomainActorNewsDocument domain actor news document +// +// swagger:model domain.ActorNewsDocument +type DomainActorNewsDocument struct { + + // Date of the news document creation, unix timestamp + // Required: true + CreatedDate *int64 `json:"created_date"` + + // Integer ID of the News document + // Required: true + ID *int64 `json:"id"` + + // News title + // Required: true + Name *string `json:"name"` + + // News title in a url friendly way, which is title in lowercase and special characters including space replaced with dash + // Required: true + Slug *string `json:"slug"` +} + +// Validate validates this domain actor news document +func (m *DomainActorNewsDocument) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedDate(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.validateSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainActorNewsDocument) validateCreatedDate(formats strfmt.Registry) error { + + if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { + return err + } + + return nil +} + +func (m *DomainActorNewsDocument) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainActorNewsDocument) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *DomainActorNewsDocument) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain actor news document based on context it is used +func (m *DomainActorNewsDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainActorNewsDocument) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainActorNewsDocument) UnmarshalBinary(b []byte) error { + var res DomainActorNewsDocument + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return 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_rule_details_response_v1.go b/falcon/models/domain_api_rule_details_response_v1.go new file mode 100644 index 00000000..f1fabee9 --- /dev/null +++ b/falcon/models/domain_api_rule_details_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" +) + +// DomainAPIRuleDetailsResponseV1 domain API rule details response v1 +// +// swagger:model domain.APIRuleDetailsResponseV1 +type DomainAPIRuleDetailsResponseV1 struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*DomainAPIRuleDetailsV1 `json:"resources"` +} + +// Validate validates this domain API rule details response v1 +func (m *DomainAPIRuleDetailsResponseV1) 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 *DomainAPIRuleDetailsResponseV1) 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 *DomainAPIRuleDetailsResponseV1) 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 *DomainAPIRuleDetailsResponseV1) 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 API rule details response v1 based on the context it is used +func (m *DomainAPIRuleDetailsResponseV1) 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 *DomainAPIRuleDetailsResponseV1) 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 *DomainAPIRuleDetailsResponseV1) 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 *DomainAPIRuleDetailsResponseV1) 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 *DomainAPIRuleDetailsResponseV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainAPIRuleDetailsResponseV1) UnmarshalBinary(b []byte) error { + var res DomainAPIRuleDetailsResponseV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_api_rule_details_v1.go b/falcon/models/domain_api_rule_details_v1.go new file mode 100644 index 00000000..91baa835 --- /dev/null +++ b/falcon/models/domain_api_rule_details_v1.go @@ -0,0 +1,295 @@ +// 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" +) + +// DomainAPIRuleDetailsV1 domain API rule details v1 +// +// swagger:model domain.APIRuleDetailsV1 +type DomainAPIRuleDetailsV1 struct { + + // additional information + // Required: true + AdditionalInformation *string `json:"additional_information"` + + // applicable profiles + // Required: true + ApplicableProfiles []string `json:"applicable_profiles"` + + // assessment status + // Required: true + AssessmentStatus *string `json:"assessment_status"` + + // audit procedure + // Required: true + AuditProcedure *string `json:"audit_procedure"` + + // authority + // Required: true + Authority *string `json:"authority"` + + // benchmark title + // Required: true + BenchmarkTitle *string `json:"benchmark_title"` + + // description + // Required: true + Description *string `json:"description"` + + // id + // Required: true + ID *string `json:"id"` + + // impact statement + // Required: true + ImpactStatement *string `json:"impact_statement"` + + // platform + // Required: true + Platform *string `json:"platform"` + + // rationale statement + // Required: true + RationaleStatement *string `json:"rationale_statement"` + + // recommendation id + // Required: true + RecommendationID *string `json:"recommendation_id"` + + // references + References []string `json:"references"` + + // remediation procedure + // Required: true + RemediationProcedure *string `json:"remediation_procedure"` + + // title + // Required: true + Title *string `json:"title"` +} + +// Validate validates this domain API rule details v1 +func (m *DomainAPIRuleDetailsV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdditionalInformation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApplicableProfiles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssessmentStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuditProcedure(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthority(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBenchmarkTitle(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImpactStatement(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlatform(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRationaleStatement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecommendationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediationProcedure(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 *DomainAPIRuleDetailsV1) validateAdditionalInformation(formats strfmt.Registry) error { + + if err := validate.Required("additional_information", "body", m.AdditionalInformation); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateApplicableProfiles(formats strfmt.Registry) error { + + if err := validate.Required("applicable_profiles", "body", m.ApplicableProfiles); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateAssessmentStatus(formats strfmt.Registry) error { + + if err := validate.Required("assessment_status", "body", m.AssessmentStatus); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateAuditProcedure(formats strfmt.Registry) error { + + if err := validate.Required("audit_procedure", "body", m.AuditProcedure); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateAuthority(formats strfmt.Registry) error { + + if err := validate.Required("authority", "body", m.Authority); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateBenchmarkTitle(formats strfmt.Registry) error { + + if err := validate.Required("benchmark_title", "body", m.BenchmarkTitle); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateImpactStatement(formats strfmt.Registry) error { + + if err := validate.Required("impact_statement", "body", m.ImpactStatement); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validatePlatform(formats strfmt.Registry) error { + + if err := validate.Required("platform", "body", m.Platform); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateRationaleStatement(formats strfmt.Registry) error { + + if err := validate.Required("rationale_statement", "body", m.RationaleStatement); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateRecommendationID(formats strfmt.Registry) error { + + if err := validate.Required("recommendation_id", "body", m.RecommendationID); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateRemediationProcedure(formats strfmt.Registry) error { + + if err := validate.Required("remediation_procedure", "body", m.RemediationProcedure); err != nil { + return err + } + + return nil +} + +func (m *DomainAPIRuleDetailsV1) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain API rule details v1 based on context it is used +func (m *DomainAPIRuleDetailsV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainAPIRuleDetailsV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainAPIRuleDetailsV1) UnmarshalBinary(b []byte) error { + var res DomainAPIRuleDetailsV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} 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 fc184402..693bf171 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 @@ -65,6 +65,9 @@ type DomainAPIVulnerabilityCVEDetailsFacetV2 struct { // Corresponds to a point in time when Spotlight offered support for detecting a specific vulnerability SpotlightPublishedDate string `json:"spotlight_published_date,omitempty"` + // The types of vulnerability. Can be of: Vulnerability, Misconfiguration, and Unsupported software + Types []string `json:"types"` + // Refers to the vector of attack or the specific method or path through which an attacker can exploit a vulnerability Vector string `json:"vector,omitempty"` diff --git a/falcon/models/domain_attachment.go b/falcon/models/domain_attachment.go new file mode 100644 index 00000000..5dd02ccd --- /dev/null +++ b/falcon/models/domain_attachment.go @@ -0,0 +1,120 @@ +// 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" +) + +// DomainAttachment domain attachment +// +// swagger:model domain.Attachment +type DomainAttachment struct { + + // date + // Format: date-time + Date strfmt.DateTime `json:"date,omitempty"` + + // file name + FileName string `json:"file_name,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // link + // Required: true + Link *string `json:"link"` + + // mime type + // Required: true + MimeType *string `json:"mime_type"` + + // sha256 + Sha256 string `json:"sha256,omitempty"` + + // source url + SourceURL string `json:"source_url,omitempty"` +} + +// Validate validates this domain attachment +func (m *DomainAttachment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLink(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMimeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainAttachment) validateDate(formats strfmt.Registry) error { + if swag.IsZero(m.Date) { // not required + return nil + } + + if err := validate.FormatOf("date", "body", "date-time", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainAttachment) validateLink(formats strfmt.Registry) error { + + if err := validate.Required("link", "body", m.Link); err != nil { + return err + } + + return nil +} + +func (m *DomainAttachment) validateMimeType(formats strfmt.Registry) error { + + if err := validate.Required("mime_type", "body", m.MimeType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain attachment based on context it is used +func (m *DomainAttachment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainAttachment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainAttachment) UnmarshalBinary(b []byte) error { + var res DomainAttachment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_breached_item_v1.go b/falcon/models/domain_breached_item_v1.go index 53111b37..af15539d 100644 --- a/falcon/models/domain_breached_item_v1.go +++ b/falcon/models/domain_breached_item_v1.go @@ -19,25 +19,25 @@ import ( // swagger:model domain.BreachedItemV1 type DomainBreachedItemV1 struct { - // bot + // The stealer log bot information Bot *DomainExposedDataRecordBotV1 `json:"bot,omitempty"` - // company + // The company of the user Company string `json:"company,omitempty"` // The status set after deduplication. Possible values: 'newly_detected', 'previously_reported', 'other' CredentialStatus string `json:"credential_status,omitempty"` - // credentials domain + // The domain where the credentials are valid CredentialsDomain string `json:"credentials_domain,omitempty"` - // credentials ip + // The IP where the credentials are valid CredentialsIP string `json:"credentials_ip,omitempty"` - // credentials url + // The URL where the credentials are valid CredentialsURL string `json:"credentials_url,omitempty"` - // display name + // The nickname of the user on the impacted site DisplayName string `json:"display_name,omitempty"` // The domain associated with the breached account. @@ -48,24 +48,24 @@ type DomainBreachedItemV1 struct { // Required: true Email *string `json:"email"` - // financial + // User financial information Financial *DomainExposedDataRecordFinancialV1 `json:"financial,omitempty"` // The original hashing algorithm applied to the breached password. Possible values: 'plain', 'unknown', 'base64', 'md5', 'sha1', 'bcrypt', etc. The value 'plain' means that the password was originally found as plaintext. // Required: true HashType *string `json:"hash_type"` - // job position + // The user's job at the company JobPosition string `json:"job_position,omitempty"` - // location + // User location information Location *DomainExposedDataRecordLocationV1 `json:"location,omitempty"` // The username of the breached account. // Required: true LoginID *string `json:"login_id"` - // malware family + // The stealer log bot malware family MalwareFamily string `json:"malware_family,omitempty"` // The name of the person associated with the breached account. @@ -76,23 +76,23 @@ type DomainBreachedItemV1 struct { // Required: true Password *string `json:"password"` - // password hash + // The password hash PasswordHash string `json:"password_hash,omitempty"` - // password salt + // The password salt PasswordSalt string `json:"password_salt,omitempty"` // The phone number of the person associated with the breached account. // Required: true Phone *string `json:"phone"` - // social + // User social media information Social *DomainExposedDataRecordSocialV1 `json:"social,omitempty"` - // user id + // The ID of the user on the impacted site UserID string `json:"user_id,omitempty"` - // user ip + // The IP of the user on the impacted site UserIP string `json:"user_ip,omitempty"` } diff --git a/falcon/models/domain_c_id_group.go b/falcon/models/domain_c_id_group.go index d94c8f73..345713f0 100644 --- a/falcon/models/domain_c_id_group.go +++ b/falcon/models/domain_c_id_group.go @@ -23,11 +23,14 @@ type DomainCIDGroup struct { Cid string `json:"cid,omitempty"` // cid group id - CidGroupID string `json:"cid_group_id,omitempty"` + // Required: true + CidGroupID *string `json:"cid_group_id"` // description - // Required: true - Description *string `json:"description"` + Description string `json:"description,omitempty"` + + // is default + IsDefault bool `json:"is_default,omitempty"` // name // Required: true @@ -38,7 +41,7 @@ type DomainCIDGroup struct { func (m *DomainCIDGroup) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDescription(formats); err != nil { + if err := m.validateCidGroupID(formats); err != nil { res = append(res, err) } @@ -52,9 +55,9 @@ func (m *DomainCIDGroup) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainCIDGroup) validateDescription(formats strfmt.Registry) error { +func (m *DomainCIDGroup) validateCidGroupID(formats strfmt.Registry) error { - if err := validate.Required("description", "body", m.Description); err != nil { + if err := validate.Required("cid_group_id", "body", m.CidGroupID); err != nil { return err } diff --git a/falcon/models/domain_card.go b/falcon/models/domain_card.go new file mode 100644 index 00000000..9bd9c862 --- /dev/null +++ b/falcon/models/domain_card.go @@ -0,0 +1,92 @@ +// 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" +) + +// DomainCard domain card +// +// swagger:model domain.Card +type DomainCard struct { + + // bin code + BinCode string `json:"bin_code,omitempty"` + + // cardholder name + CardholderName string `json:"cardholder_name,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // expiration + Expiration string `json:"expiration,omitempty"` + + // issuing bank + IssuingBank string `json:"issuing_bank,omitempty"` + + // last transaction at + // Format: date-time + LastTransactionAt strfmt.DateTime `json:"last_transaction_at,omitempty"` + + // servicecode + Servicecode string `json:"servicecode,omitempty"` +} + +// Validate validates this domain card +func (m *DomainCard) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLastTransactionAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainCard) validateLastTransactionAt(formats strfmt.Registry) error { + if swag.IsZero(m.LastTransactionAt) { // not required + return nil + } + + if err := validate.FormatOf("last_transaction_at", "body", "date-time", m.LastTransactionAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain card based on context it is used +func (m *DomainCard) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainCard) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainCard) UnmarshalBinary(b []byte) error { + var res DomainCard + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_credentials.go b/falcon/models/domain_credentials.go index 00f1b8bb..dc9bb09b 100644 --- a/falcon/models/domain_credentials.go +++ b/falcon/models/domain_credentials.go @@ -8,10 +8,8 @@ package models import ( "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // DomainCredentials domain credentials @@ -19,31 +17,18 @@ import ( // swagger:model domain.Credentials type DomainCredentials struct { - // token - // Required: true - Token *string `json:"token"` -} + // sites all + SitesAll []string `json:"sites_all"` -// Validate validates this domain credentials -func (m *DomainCredentials) Validate(formats strfmt.Registry) error { - var res []error + // sites with cookie only + SitesWithCookieOnly []string `json:"sites_with_cookie_only"` - if err := m.validateToken(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil + // sites with password + SitesWithPassword []string `json:"sites_with_password"` } -func (m *DomainCredentials) validateToken(formats strfmt.Registry) error { - - if err := validate.Required("token", "body", m.Token); err != nil { - return err - } - +// Validate validates this domain credentials +func (m *DomainCredentials) Validate(formats strfmt.Registry) error { return nil } diff --git a/falcon/models/domain_detailed_notification_v1.go b/falcon/models/domain_detailed_notification_v1.go index 9d08242a..eda1027f 100644 --- a/falcon/models/domain_detailed_notification_v1.go +++ b/falcon/models/domain_detailed_notification_v1.go @@ -23,7 +23,7 @@ type DomainDetailedNotificationV1 struct { BreachDetails *DomainBreachDetailsV1 `json:"breach_details,omitempty"` // details - Details *DomainNotificationDetailsV1 `json:"details,omitempty"` + Details *DomainItemDetailsV1 `json:"details,omitempty"` // id // Required: true diff --git a/falcon/models/domain_discover_api_host.go b/falcon/models/domain_discover_api_host.go index 8c2fef7e..84ec49ea 100644 --- a/falcon/models/domain_discover_api_host.go +++ b/falcon/models/domain_discover_api_host.go @@ -141,6 +141,9 @@ type DomainDiscoverAPIHost struct { // The last seen local IPv4 address of the asset. CurrentLocalIP string `json:"current_local_ip,omitempty"` + // 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"` @@ -387,6 +390,12 @@ type DomainDiscoverAPIHost struct { // What the asset is used for, such as production, staging, or QA. UsedFor string `json:"used_for,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"` } // Validate validates this domain discover API host diff --git a/falcon/models/domain_discover_api_io_t_host.go b/falcon/models/domain_discover_api_io_t_host.go index 09e7b594..227f7b84 100644 --- a/falcon/models/domain_discover_api_io_t_host.go +++ b/falcon/models/domain_discover_api_io_t_host.go @@ -211,6 +211,14 @@ type DomainDiscoverAPIIoTHost struct { // 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 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). Ou string `json:"ou,omitempty"` @@ -331,6 +339,14 @@ func (m *DomainDiscoverAPIIoTHost) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateOtInformationSources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOtSerialNumbers(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -485,6 +501,24 @@ func (m *DomainDiscoverAPIIoTHost) validateNetworkInterfaces(formats strfmt.Regi return nil } +func (m *DomainDiscoverAPIIoTHost) validateOtInformationSources(formats strfmt.Registry) error { + + if err := validate.Required("ot_information_sources", "body", m.OtInformationSources); err != nil { + return err + } + + return nil +} + +func (m *DomainDiscoverAPIIoTHost) validateOtSerialNumbers(formats strfmt.Registry) error { + + if err := validate.Required("ot_serial_numbers", "body", m.OtSerialNumbers); err != nil { + return err + } + + return nil +} + // ContextValidate validate this domain discover API io t host based on the context it is used func (m *DomainDiscoverAPIIoTHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error 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 ad6ded4b..09478d10 100644 --- a/falcon/models/domain_event.go +++ b/falcon/models/domain_event.go @@ -19,14 +19,6 @@ import ( // swagger:model domain.Event type DomainEvent struct { - // associated event i ds - // Required: true - AssociatedEventIDs *string `json:"AssociatedEventIDs"` - - // associated events - // Required: true - AssociatedEvents map[string]DomainRawEvent `json:"AssociatedEvents"` - // attributes // Required: true Attributes map[string]string `json:"Attributes"` @@ -59,6 +51,14 @@ type DomainEvent struct { // Required: true Metadata *DomainEventMetadata `json:"Metadata"` + // parent incident i ds + // Required: true + ParentIncidentIDs []string `json:"ParentIncidentIDs"` + + // parent indicator i ds + // Required: true + ParentIndicatorIDs []string `json:"ParentIndicatorIDs"` + // product // Required: true Product *string `json:"Product"` @@ -101,14 +101,6 @@ type DomainEvent struct { func (m *DomainEvent) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateAssociatedEventIDs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAssociatedEvents(formats); err != nil { - res = append(res, err) - } - if err := m.validateAttributes(formats); err != nil { res = append(res, err) } @@ -141,6 +133,14 @@ func (m *DomainEvent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateParentIncidentIDs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParentIndicatorIDs(formats); err != nil { + res = append(res, err) + } + if err := m.validateProduct(formats); err != nil { res = append(res, err) } @@ -183,42 +183,6 @@ func (m *DomainEvent) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainEvent) validateAssociatedEventIDs(formats strfmt.Registry) error { - - if err := validate.Required("AssociatedEventIDs", "body", m.AssociatedEventIDs); err != nil { - return err - } - - return nil -} - -func (m *DomainEvent) validateAssociatedEvents(formats strfmt.Registry) error { - - if err := validate.Required("AssociatedEvents", "body", m.AssociatedEvents); err != nil { - return err - } - - for k := range m.AssociatedEvents { - - if err := validate.Required("AssociatedEvents"+"."+k, "body", m.AssociatedEvents[k]); err != nil { - return err - } - if val, ok := m.AssociatedEvents[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("AssociatedEvents" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("AssociatedEvents" + "." + k) - } - return err - } - } - - } - - return nil -} - func (m *DomainEvent) validateAttributes(formats strfmt.Registry) error { if err := validate.Required("Attributes", "body", m.Attributes); err != nil { @@ -302,6 +266,24 @@ func (m *DomainEvent) validateMetadata(formats strfmt.Registry) error { return nil } +func (m *DomainEvent) validateParentIncidentIDs(formats strfmt.Registry) error { + + if err := validate.Required("ParentIncidentIDs", "body", m.ParentIncidentIDs); err != nil { + return err + } + + return nil +} + +func (m *DomainEvent) validateParentIndicatorIDs(formats strfmt.Registry) error { + + if err := validate.Required("ParentIndicatorIDs", "body", m.ParentIndicatorIDs); err != nil { + return err + } + + return nil +} + func (m *DomainEvent) validateProduct(formats strfmt.Registry) error { if err := validate.Required("Product", "body", m.Product); err != nil { @@ -402,10 +384,6 @@ func (m *DomainEvent) validateSourceEvent(formats strfmt.Registry) error { func (m *DomainEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateAssociatedEvents(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateMetadata(ctx, formats); err != nil { res = append(res, err) } @@ -420,25 +398,6 @@ func (m *DomainEvent) ContextValidate(ctx context.Context, formats strfmt.Regist return nil } -func (m *DomainEvent) contextValidateAssociatedEvents(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("AssociatedEvents", "body", m.AssociatedEvents); err != nil { - return err - } - - for k := range m.AssociatedEvents { - - if val, ok := m.AssociatedEvents[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - func (m *DomainEvent) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { if m.Metadata != nil { diff --git a/falcon/models/domain_exposed_data_record_bot_v1.go b/falcon/models/domain_exposed_data_record_bot_v1.go index bf4538ba..c8d83c29 100644 --- a/falcon/models/domain_exposed_data_record_bot_v1.go +++ b/falcon/models/domain_exposed_data_record_bot_v1.go @@ -33,7 +33,8 @@ type DomainExposedDataRecordBotV1 struct { // infection date // Required: true - InfectionDate *string `json:"infection_date"` + // Format: date-time + InfectionDate *strfmt.DateTime `json:"infection_date"` // infection path // Required: true @@ -122,6 +123,10 @@ func (m *DomainExposedDataRecordBotV1) validateInfectionDate(formats strfmt.Regi return err } + if err := validate.FormatOf("infection_date", "body", "date-time", m.InfectionDate.String(), formats); err != nil { + return err + } + return nil } diff --git a/falcon/models/domain_exposed_data_record_social_v1.go b/falcon/models/domain_exposed_data_record_social_v1.go index 236c2849..35333ba0 100644 --- a/falcon/models/domain_exposed_data_record_social_v1.go +++ b/falcon/models/domain_exposed_data_record_social_v1.go @@ -50,6 +50,10 @@ type DomainExposedDataRecordSocialV1 struct { // vk id // Required: true VkID *string `json:"vk_id"` + + // vk token + // Required: true + VkToken *string `json:"vk_token"` } // Validate validates this domain exposed data record social v1 @@ -88,6 +92,10 @@ func (m *DomainExposedDataRecordSocialV1) Validate(formats strfmt.Registry) erro res = append(res, err) } + if err := m.validateVkToken(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -166,6 +174,15 @@ func (m *DomainExposedDataRecordSocialV1) validateVkID(formats strfmt.Registry) return nil } +func (m *DomainExposedDataRecordSocialV1) validateVkToken(formats strfmt.Registry) error { + + if err := validate.Required("vk_token", "body", m.VkToken); err != nil { + return err + } + + return nil +} + // ContextValidate validates this domain exposed data record social v1 based on context it is used func (m *DomainExposedDataRecordSocialV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/falcon/models/domain_file_count_v2.go b/falcon/models/domain_file_count_v2.go new file mode 100644 index 00000000..6b9911cf --- /dev/null +++ b/falcon/models/domain_file_count_v2.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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DomainFileCountV2 domain file count v2 +// +// swagger:model domain.FileCountV2 +type DomainFileCountV2 struct { + + // malicious + // Required: true + Malicious *int32 `json:"malicious"` + + // quarantined + // Required: true + Quarantined *int32 `json:"quarantined"` + + // scanned + // Required: true + Scanned *int32 `json:"scanned"` + + // skipped + // Required: true + Skipped *int32 `json:"skipped"` + + // traversed + // Required: true + Traversed *int32 `json:"traversed"` +} + +// Validate validates this domain file count v2 +func (m *DomainFileCountV2) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMalicious(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuarantined(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScanned(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSkipped(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTraversed(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainFileCountV2) validateMalicious(formats strfmt.Registry) error { + + if err := validate.Required("malicious", "body", m.Malicious); err != nil { + return err + } + + return nil +} + +func (m *DomainFileCountV2) validateQuarantined(formats strfmt.Registry) error { + + if err := validate.Required("quarantined", "body", m.Quarantined); err != nil { + return err + } + + return nil +} + +func (m *DomainFileCountV2) validateScanned(formats strfmt.Registry) error { + + if err := validate.Required("scanned", "body", m.Scanned); err != nil { + return err + } + + return nil +} + +func (m *DomainFileCountV2) validateSkipped(formats strfmt.Registry) error { + + if err := validate.Required("skipped", "body", m.Skipped); err != nil { + return err + } + + return nil +} + +func (m *DomainFileCountV2) validateTraversed(formats strfmt.Registry) error { + + if err := validate.Required("traversed", "body", m.Traversed); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain file count v2 based on context it is used +func (m *DomainFileCountV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainFileCountV2) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainFileCountV2) UnmarshalBinary(b []byte) error { + var res DomainFileCountV2 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_fragment_info.go b/falcon/models/domain_fragment_info.go new file mode 100644 index 00000000..3206e5bc --- /dev/null +++ b/falcon/models/domain_fragment_info.go @@ -0,0 +1,68 @@ +// 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" +) + +// DomainFragmentInfo domain fragment info +// +// swagger:model domain.FragmentInfo +type DomainFragmentInfo struct { + + // Offset of the content field from the start of data, in characters + ContentOffset int64 `json:"content_offset,omitempty"` + + // Total number of fragments for this group + Count int64 `json:"count,omitempty"` + + // List of fields that have been split, such as: content, iocs, translated_content, ... + FragmentedFields []string `json:"fragmented_fields"` + + // HEX string, similar to stream_id, ties all fragments together + GroupID string `json:"group_id,omitempty"` + + // Zero-based index of fragment in the group + Index int64 `json:"index,omitempty"` + + // Offset of the translated_content field from the start of data, in characters + TranslatedContentOffset int64 `json:"translated_content_offset,omitempty"` + + // List of fields that have been truncated or deleted + TruncatedFields []string `json:"truncated_fields"` +} + +// Validate validates this domain fragment info +func (m *DomainFragmentInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain fragment info based on context it is used +func (m *DomainFragmentInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainFragmentInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainFragmentInfo) UnmarshalBinary(b []byte) error { + var res DomainFragmentInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_host.go b/falcon/models/domain_host.go new file mode 100644 index 00000000..db8269b6 --- /dev/null +++ b/falcon/models/domain_host.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" +) + +// DomainHost domain host +// +// swagger:model domain.Host +type DomainHost struct { + + // admin available + AdminAvailable bool `json:"admin_available,omitempty"` + + // bandwidth mbps + BandwidthMbps float64 `json:"bandwidth_mbps,omitempty"` + + // behind nat + BehindNat bool `json:"behind_nat,omitempty"` + + // ip + IP string `json:"ip,omitempty"` + + // ip parsed + IPParsed string `json:"ip_parsed,omitempty"` + + // isp + Isp string `json:"isp,omitempty"` + + // os banner + OsBanner string `json:"os_banner,omitempty"` + + // ping ms + PingMs int64 `json:"ping_ms,omitempty"` + + // processor banner + ProcessorBanner string `json:"processor_banner,omitempty"` + + // ram gigs + RAMGigs float64 `json:"ram_gigs,omitempty"` + + // ssl available + SslAvailable bool `json:"ssl_available,omitempty"` + + // tld + Tld string `json:"tld,omitempty"` + + // uptime hours + UptimeHours int64 `json:"uptime_hours,omitempty"` +} + +// Validate validates this domain host +func (m *DomainHost) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain host based on context it is used +func (m *DomainHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainHost) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainHost) UnmarshalBinary(b []byte) error { + var res DomainHost + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_i_o_c.go b/falcon/models/domain_i_o_c.go new file mode 100644 index 00000000..fd941d95 --- /dev/null +++ b/falcon/models/domain_i_o_c.go @@ -0,0 +1,155 @@ +// 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" +) + +// DomainIOC domain i o c +// +// swagger:model domain.IOC +type DomainIOC struct { + + // at accounts + AtAccounts []string `json:"at_accounts"` + + // aws clis + AwsClis []string `json:"aws_clis"` + + // aws ids + AwsIds []string `json:"aws_ids"` + + // aws secrets + AwsSecrets []string `json:"aws_secrets"` + + // bitcoin address + BitcoinAddress []string `json:"bitcoin_address"` + + // cves + Cves []string `json:"cves"` + + // discord urls + DiscordUrls []string `json:"discord_urls"` + + // domains + Domains []string `json:"domains"` + + // email domains + EmailDomains []string `json:"email_domains"` + + // emails + Emails []string `json:"emails"` + + // emails local part + EmailsLocalPart []string `json:"emails_local_part"` + + // ethereum addresses + EthereumAddresses []string `json:"ethereum_addresses"` + + // generic apis + GenericApis []string `json:"generic_apis"` + + // github apis + GithubApis []string `json:"github_apis"` + + // google apis + GoogleApis []string `json:"google_apis"` + + // hashtags + Hashtags []string `json:"hashtags"` + + // i2p urls + I2pUrls []string `json:"i2p_urls"` + + // icq urls + IcqUrls []string `json:"icq_urls"` + + // ips + Ips []string `json:"ips"` + + // magnet urls + MagnetUrls []string `json:"magnet_urls"` + + // md5s + Md5s []string `json:"md5s"` + + // monero addresses + MoneroAddresses []string `json:"monero_addresses"` + + // onion urls + OnionUrls []string `json:"onion_urls"` + + // paste urls + PasteUrls []string `json:"paste_urls"` + + // phone numbers + PhoneNumbers []string `json:"phone_numbers"` + + // s3 buckets + S3Buckets []string `json:"s3_buckets"` + + // sha1s + Sha1s []string `json:"sha1s"` + + // sha256s + Sha256s []string `json:"sha256s"` + + // sha512s + Sha512s []string `json:"sha512s"` + + // skype urls + SkypeUrls []string `json:"skype_urls"` + + // slack apis + SlackApis []string `json:"slack_apis"` + + // sqs queues + SqsQueues []string `json:"sqs_queues"` + + // telegram urls + TelegramUrls []string `json:"telegram_urls"` + + // torrent urls + TorrentUrls []string `json:"torrent_urls"` + + // urls + Urls []string `json:"urls"` + + // whatsapp urls + WhatsappUrls []string `json:"whatsapp_urls"` +} + +// Validate validates this domain i o c +func (m *DomainIOC) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain i o c based on context it is used +func (m *DomainIOC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainIOC) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainIOC) UnmarshalBinary(b []byte) error { + var res DomainIOC + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_item_details_v1.go b/falcon/models/domain_item_details_v1.go new file mode 100644 index 00000000..347068ed --- /dev/null +++ b/falcon/models/domain_item_details_v1.go @@ -0,0 +1,503 @@ +// 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" +) + +// DomainItemDetailsV1 domain item details v1 +// +// swagger:model domain.ItemDetailsV1 +type DomainItemDetailsV1 struct { + + // Threat actor associated with the raw intelligence item, if available + ActorSlug string `json:"actor_slug,omitempty"` + + // Pointers to attachments items linked to this item + Attachments []*DomainAttachment `json:"attachments"` + + // The raw intelligence item author username + Author string `json:"author,omitempty"` + + // The raw intelligence item author identifier in our system + AuthorID string `json:"author_id,omitempty"` + + // Category of the source where the item was found + // Required: true + Category *string `json:"category"` + + // The date when the raw intelligence item was scraped from the original source + // Format: date-time + CollectionDate strfmt.DateTime `json:"collection_date,omitempty"` + + // Highlighted content based on the rule that generated the notifications. Highlights are surrounded with a `` tag + // Required: true + Content *string `json:"content"` + + // The date when the raw intelligence item was created + // Required: true + // Format: date-time + CreatedDate *strfmt.DateTime `json:"created_date"` + + // Mime type of the file for file type items + FileType string `json:"file_type,omitempty"` + + // Indicates this is a fragment item, and holds all information about the fragmentation + FragmentInfo *DomainFragmentInfo `json:"fragment_info,omitempty"` + + // IOC types available in the raw intelligence item. List of keys populated in the iocs field + IocTypes []string `json:"ioc_types"` + + // Information about IOCs found in item. + Iocs *DomainIOC `json:"iocs,omitempty"` + + // The raw intelligence item labels. These contain hints around what is actually included in the item (malware, IPs, emails, etc). + Labels []string `json:"labels"` + + // The raw intelligence item language + Language string `json:"language,omitempty"` + + // Information about marketplace items (cards, hosts, credentials) + MarketplaceProduct *DomainMarketplaceProduct `json:"marketplace_product,omitempty"` + + // Mime type of the file for file type items + MimeType string `json:"mime_type,omitempty"` + + // SHA256 of the file contents for file type items + Sha256 string `json:"sha256,omitempty"` + + // The site where the raw intelligence item was found + Site string `json:"site,omitempty"` + + // The ID of the site where the raw intelligence item was found + // Required: true + SiteID *string `json:"site_id"` + + // Size of the item's content in bytes, if available + Size int64 `json:"size,omitempty"` + + // Telegram extra information + TelegramInfo *DomainTelegramInfo `json:"telegram_info,omitempty"` + + // Identifier that groups all raw intelligence items belonging to the same 'conversation stream', i.e. chatroom, forum thread, etc. + ThreadID string `json:"thread_id,omitempty"` + + // The raw intelligence item title + Title string `json:"title,omitempty"` + + // The type of the raw intelligence item + // Required: true + Type *string `json:"type"` + + // The date when the raw intelligence item was updated + // Required: true + // Format: date-time + UpdatedDate *strfmt.DateTime `json:"updated_date"` + + // The raw intelligence item URL + URL string `json:"url,omitempty"` + + // The raw intelligence item author identifier in the original site + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this domain item details v1 +func (m *DomainItemDetailsV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttachments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCategory(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCollectionDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFragmentInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIocs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarketplaceProduct(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSiteID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelegramInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainItemDetailsV1) validateAttachments(formats strfmt.Registry) error { + if swag.IsZero(m.Attachments) { // not required + return nil + } + + for i := 0; i < len(m.Attachments); i++ { + if swag.IsZero(m.Attachments[i]) { // not required + continue + } + + if m.Attachments[i] != nil { + if err := m.Attachments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainItemDetailsV1) validateCategory(formats strfmt.Registry) error { + + if err := validate.Required("category", "body", m.Category); err != nil { + return err + } + + return nil +} + +func (m *DomainItemDetailsV1) validateCollectionDate(formats strfmt.Registry) error { + if swag.IsZero(m.CollectionDate) { // not required + return nil + } + + if err := validate.FormatOf("collection_date", "body", "date-time", m.CollectionDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainItemDetailsV1) validateContent(formats strfmt.Registry) error { + + if err := validate.Required("content", "body", m.Content); err != nil { + return err + } + + return nil +} + +func (m *DomainItemDetailsV1) validateCreatedDate(formats strfmt.Registry) error { + + if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { + return err + } + + if err := validate.FormatOf("created_date", "body", "date-time", m.CreatedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DomainItemDetailsV1) validateFragmentInfo(formats strfmt.Registry) error { + if swag.IsZero(m.FragmentInfo) { // not required + return nil + } + + if m.FragmentInfo != nil { + if err := m.FragmentInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fragment_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fragment_info") + } + return err + } + } + + return nil +} + +func (m *DomainItemDetailsV1) validateIocs(formats strfmt.Registry) error { + if swag.IsZero(m.Iocs) { // not required + return nil + } + + if m.Iocs != nil { + if err := m.Iocs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("iocs") + } + return err + } + } + + return nil +} + +func (m *DomainItemDetailsV1) validateMarketplaceProduct(formats strfmt.Registry) error { + if swag.IsZero(m.MarketplaceProduct) { // not required + return nil + } + + if m.MarketplaceProduct != nil { + if err := m.MarketplaceProduct.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("marketplace_product") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("marketplace_product") + } + return err + } + } + + return nil +} + +func (m *DomainItemDetailsV1) validateSiteID(formats strfmt.Registry) error { + + if err := validate.Required("site_id", "body", m.SiteID); err != nil { + return err + } + + return nil +} + +func (m *DomainItemDetailsV1) validateTelegramInfo(formats strfmt.Registry) error { + if swag.IsZero(m.TelegramInfo) { // not required + return nil + } + + if m.TelegramInfo != nil { + if err := m.TelegramInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("telegram_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("telegram_info") + } + return err + } + } + + return nil +} + +func (m *DomainItemDetailsV1) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *DomainItemDetailsV1) validateUpdatedDate(formats strfmt.Registry) error { + + if err := validate.Required("updated_date", "body", m.UpdatedDate); err != nil { + return err + } + + if err := validate.FormatOf("updated_date", "body", "date-time", m.UpdatedDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this domain item details v1 based on the context it is used +func (m *DomainItemDetailsV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAttachments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFragmentInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIocs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMarketplaceProduct(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTelegramInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainItemDetailsV1) contextValidateAttachments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Attachments); i++ { + + if m.Attachments[i] != nil { + + if swag.IsZero(m.Attachments[i]) { // not required + return nil + } + + if err := m.Attachments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DomainItemDetailsV1) contextValidateFragmentInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.FragmentInfo != nil { + + if swag.IsZero(m.FragmentInfo) { // not required + return nil + } + + if err := m.FragmentInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fragment_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fragment_info") + } + return err + } + } + + return nil +} + +func (m *DomainItemDetailsV1) contextValidateIocs(ctx context.Context, formats strfmt.Registry) error { + + if m.Iocs != nil { + + if swag.IsZero(m.Iocs) { // not required + return nil + } + + if err := m.Iocs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("iocs") + } + return err + } + } + + return nil +} + +func (m *DomainItemDetailsV1) contextValidateMarketplaceProduct(ctx context.Context, formats strfmt.Registry) error { + + if m.MarketplaceProduct != nil { + + if swag.IsZero(m.MarketplaceProduct) { // not required + return nil + } + + if err := m.MarketplaceProduct.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("marketplace_product") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("marketplace_product") + } + return err + } + } + + return nil +} + +func (m *DomainItemDetailsV1) contextValidateTelegramInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.TelegramInfo != nil { + + if swag.IsZero(m.TelegramInfo) { // not required + return nil + } + + if err := m.TelegramInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("telegram_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("telegram_info") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainItemDetailsV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainItemDetailsV1) UnmarshalBinary(b []byte) error { + var res DomainItemDetailsV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_launch_export_job_request_v1.go b/falcon/models/domain_launch_export_job_request_v1.go index 6b786196..a0d6b565 100644 --- a/falcon/models/domain_launch_export_job_request_v1.go +++ b/falcon/models/domain_launch_export_job_request_v1.go @@ -19,7 +19,7 @@ import ( // swagger:model domain.LaunchExportJobRequestV1 type DomainLaunchExportJobRequestV1 struct { - // The entity type. This can be one of: [`notification-exposed-data-record`] + // The entity type. This can be one of: [`notification-exposed-data-record`, `historical-search-exposed-data-record`] // Required: true Entity *string `json:"entity"` diff --git a/falcon/models/domain_malicious_file.go b/falcon/models/domain_malicious_file.go index 753eed6e..7d36bcd8 100644 --- a/falcon/models/domain_malicious_file.go +++ b/falcon/models/domain_malicious_file.go @@ -56,6 +56,12 @@ type DomainMaliciousFile struct { // severity Severity int64 `json:"severity,omitempty"` + + // tactic + Tactic string `json:"tactic,omitempty"` + + // technique + Technique string `json:"technique,omitempty"` } // Validate validates this domain malicious file diff --git a/falcon/models/domain_marketplace_product.go b/falcon/models/domain_marketplace_product.go new file mode 100644 index 00000000..e8e550ba --- /dev/null +++ b/falcon/models/domain_marketplace_product.go @@ -0,0 +1,223 @@ +// 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" +) + +// DomainMarketplaceProduct domain marketplace product +// +// swagger:model domain.MarketplaceProduct +type DomainMarketplaceProduct struct { + + // card + Card *DomainCard `json:"card,omitempty"` + + // country code + CountryCode string `json:"country_code,omitempty"` + + // credentials + Credentials *DomainCredentials `json:"credentials,omitempty"` + + // host + Host *DomainHost `json:"host,omitempty"` + + // location + Location string `json:"location,omitempty"` + + // price + Price string `json:"price,omitempty"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this domain marketplace product +func (m *DomainMarketplaceProduct) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCard(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCredentials(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHost(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainMarketplaceProduct) validateCard(formats strfmt.Registry) error { + if swag.IsZero(m.Card) { // not required + return nil + } + + if m.Card != nil { + if err := m.Card.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("card") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("card") + } + return err + } + } + + return nil +} + +func (m *DomainMarketplaceProduct) validateCredentials(formats strfmt.Registry) error { + if swag.IsZero(m.Credentials) { // not required + return nil + } + + if m.Credentials != nil { + if err := m.Credentials.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credentials") + } + return err + } + } + + return nil +} + +func (m *DomainMarketplaceProduct) validateHost(formats strfmt.Registry) error { + if swag.IsZero(m.Host) { // not required + return nil + } + + if m.Host != nil { + if err := m.Host.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("host") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("host") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain marketplace product based on the context it is used +func (m *DomainMarketplaceProduct) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCard(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCredentials(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHost(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainMarketplaceProduct) contextValidateCard(ctx context.Context, formats strfmt.Registry) error { + + if m.Card != nil { + + if swag.IsZero(m.Card) { // not required + return nil + } + + if err := m.Card.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("card") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("card") + } + return err + } + } + + return nil +} + +func (m *DomainMarketplaceProduct) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error { + + if m.Credentials != nil { + + if swag.IsZero(m.Credentials) { // not required + return nil + } + + if err := m.Credentials.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credentials") + } + return err + } + } + + return nil +} + +func (m *DomainMarketplaceProduct) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { + + if m.Host != nil { + + if swag.IsZero(m.Host) { // not required + return nil + } + + if err := m.Host.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("host") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("host") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainMarketplaceProduct) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainMarketplaceProduct) UnmarshalBinary(b []byte) error { + var res DomainMarketplaceProduct + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_msa_meta_info.go b/falcon/models/domain_msa_meta_info.go index d58f1106..54cb5658 100644 --- a/falcon/models/domain_msa_meta_info.go +++ b/falcon/models/domain_msa_meta_info.go @@ -11,7 +11,6 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // DomainMsaMetaInfo domain msa meta info @@ -21,10 +20,6 @@ type DomainMsaMetaInfo struct { // pagination Pagination *MsaPaging `json:"pagination,omitempty"` - - // query time - // Required: true - QueryTime *float64 `json:"queryTime"` } // Validate validates this domain msa meta info @@ -35,10 +30,6 @@ func (m *DomainMsaMetaInfo) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateQueryTime(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -64,15 +55,6 @@ func (m *DomainMsaMetaInfo) validatePagination(formats strfmt.Registry) error { return nil } -func (m *DomainMsaMetaInfo) validateQueryTime(formats strfmt.Registry) error { - - if err := validate.Required("queryTime", "body", m.QueryTime); err != nil { - return err - } - - return nil -} - // ContextValidate validate this domain msa meta info based on the context it is used func (m *DomainMsaMetaInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error diff --git a/falcon/models/domain_news_document.go b/falcon/models/domain_news_document.go index f95d5927..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 @@ -51,9 +51,12 @@ type DomainNewsDocument struct { // Required: true LastModifiedDate *int64 `json:"last_modified_date"` + // Malware mentioned, related or referenced in the news/report + Malware []*DomainReportMalware `json:"malware"` + // 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 @@ -73,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"` @@ -117,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) } @@ -133,19 +132,19 @@ func (m *DomainNewsDocument) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateMotivations(formats); err != nil { + if err := m.validateMalware(formats); err != nil { res = append(res, err) } - if err := m.validateName(formats); err != nil { + if err := m.validateMotivations(formats); err != nil { res = append(res, err) } - if err := m.validateSlug(formats); err != nil { + if err := m.validateName(formats); err != nil { res = append(res, err) } - if err := m.validateSubType(formats); err != nil { + if err := m.validateSlug(formats); err != nil { res = append(res, err) } @@ -165,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...) } @@ -241,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 { @@ -304,23 +269,22 @@ func (m *DomainNewsDocument) validateLastModifiedDate(formats strfmt.Registry) e return nil } -func (m *DomainNewsDocument) validateMotivations(formats strfmt.Registry) error { - - if err := validate.Required("motivations", "body", m.Motivations); err != nil { - return err +func (m *DomainNewsDocument) validateMalware(formats strfmt.Registry) error { + if swag.IsZero(m.Malware) { // not required + return nil } - for i := 0; i < len(m.Motivations); i++ { - if swag.IsZero(m.Motivations[i]) { // not required + for i := 0; i < len(m.Malware); i++ { + if swag.IsZero(m.Malware[i]) { // not required continue } - if m.Motivations[i] != nil { - if err := m.Motivations[i].Validate(formats); err != nil { + if m.Malware[i] != nil { + if err := m.Malware[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("motivations" + "." + strconv.Itoa(i)) + return ve.ValidateName("malware" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("motivations" + "." + strconv.Itoa(i)) + return ce.ValidateName("malware" + "." + strconv.Itoa(i)) } return err } @@ -331,38 +295,28 @@ func (m *DomainNewsDocument) validateMotivations(formats strfmt.Registry) error return nil } -func (m *DomainNewsDocument) validateName(formats strfmt.Registry) error { +func (m *DomainNewsDocument) validateMotivations(formats strfmt.Registry) error { - if err := validate.Required("name", "body", m.Name); err != nil { + if err := validate.Required("motivations", "body", m.Motivations); err != nil { return err } return nil } -func (m *DomainNewsDocument) validateSlug(formats strfmt.Registry) error { +func (m *DomainNewsDocument) validateName(formats strfmt.Registry) error { - if err := validate.Required("slug", "body", m.Slug); err != nil { + if err := validate.Required("name", "body", m.Name); err != nil { return err } return nil } -func (m *DomainNewsDocument) validateSubType(formats strfmt.Registry) error { - if swag.IsZero(m.SubType) { // not required - return nil - } +func (m *DomainNewsDocument) validateSlug(formats strfmt.Registry) error { - 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 - } + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err } return nil @@ -374,24 +328,6 @@ func (m *DomainNewsDocument) validateTags(formats strfmt.Registry) error { 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 } @@ -401,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 } @@ -428,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 } @@ -469,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 @@ -519,31 +381,11 @@ 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) } - 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 { + if err := m.contextValidateMalware(ctx, formats); err != nil { res = append(res, err) } @@ -551,14 +393,6 @@ func (m *DomainNewsDocument) ContextValidate(ctx context.Context, formats strfmt 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...) } @@ -615,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 { @@ -661,117 +470,21 @@ func (m *DomainNewsDocument) contextValidateImage(ctx context.Context, formats s 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 { +func (m *DomainNewsDocument) contextValidateMalware(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.TargetIndustries); i++ { + for i := 0; i < len(m.Malware); i++ { - if m.TargetIndustries[i] != nil { + if m.Malware[i] != nil { - if swag.IsZero(m.TargetIndustries[i]) { // not required + if swag.IsZero(m.Malware[i]) { // not required return nil } - if err := m.TargetIndustries[i].ContextValidate(ctx, formats); err != nil { + if err := m.Malware[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("target_industries" + "." + strconv.Itoa(i)) + return ve.ValidateName("malware" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("target_industries" + "." + strconv.Itoa(i)) + return ce.ValidateName("malware" + "." + strconv.Itoa(i)) } return err } @@ -799,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_details_v1.go b/falcon/models/domain_notification_details_v1.go deleted file mode 100644 index bb18b96c..00000000 --- a/falcon/models/domain_notification_details_v1.go +++ /dev/null @@ -1,150 +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" -) - -// DomainNotificationDetailsV1 domain notification details v1 -// -// swagger:model domain.NotificationDetailsV1 -type DomainNotificationDetailsV1 struct { - - // The raw intelligence item author username - Author string `json:"author,omitempty"` - - // Highlighted content based on the rule that generated the notifications. Highlights are surrounded with a `` tag - // Required: true - Content *string `json:"content"` - - // The date when the raw intelligence item was created - // Required: true - // Format: date-time - CreatedDate *strfmt.DateTime `json:"created_date"` - - // The raw intelligence item labels. These contain hints around what is actually included in the item (malware, IPs, emails, etc). - Labels []string `json:"labels"` - - // The raw intelligence item language - Language string `json:"language,omitempty"` - - // The site where the raw intelligence item was found - Site string `json:"site,omitempty"` - - // The raw intelligence item title - Title string `json:"title,omitempty"` - - // The type of the raw intelligence item - // Required: true - Type *string `json:"type"` - - // The date when the raw intelligence item was updated - // Required: true - // Format: date-time - UpdatedDate *strfmt.DateTime `json:"updated_date"` - - // The raw intelligence item URL - URL string `json:"url,omitempty"` -} - -// Validate validates this domain notification details v1 -func (m *DomainNotificationDetailsV1) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContent(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainNotificationDetailsV1) validateContent(formats strfmt.Registry) error { - - if err := validate.Required("content", "body", m.Content); err != nil { - return err - } - - return nil -} - -func (m *DomainNotificationDetailsV1) validateCreatedDate(formats strfmt.Registry) error { - - if err := validate.Required("created_date", "body", m.CreatedDate); err != nil { - return err - } - - if err := validate.FormatOf("created_date", "body", "date-time", m.CreatedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DomainNotificationDetailsV1) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -func (m *DomainNotificationDetailsV1) validateUpdatedDate(formats strfmt.Registry) error { - - if err := validate.Required("updated_date", "body", m.UpdatedDate); err != nil { - return err - } - - if err := validate.FormatOf("updated_date", "body", "date-time", m.UpdatedDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this domain notification details v1 based on context it is used -func (m *DomainNotificationDetailsV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainNotificationDetailsV1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainNotificationDetailsV1) UnmarshalBinary(b []byte) error { - var res DomainNotificationDetailsV1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_policy_info.go b/falcon/models/domain_policy_info.go index 4580bfb9..f756dfcb 100644 --- a/falcon/models/domain_policy_info.go +++ b/falcon/models/domain_policy_info.go @@ -108,6 +108,12 @@ type DomainPolicyInfo struct { // fql policy FqlPolicy string `json:"fql_policy,omitempty"` + // hipaa benchmark ids + HipaaBenchmarkIds []int64 `json:"hipaa_benchmark_ids"` + + // hitrust benchmark ids + HitrustBenchmarkIds []int64 `json:"hitrust_benchmark_ids"` + // internal only InternalOnly bool `json:"internal_only,omitempty"` diff --git a/falcon/models/domain_query_response.go b/falcon/models/domain_query_response.go index 1bf1d2dc..1015e68a 100644 --- a/falcon/models/domain_query_response.go +++ b/falcon/models/domain_query_response.go @@ -21,11 +21,12 @@ import ( type DomainQueryResponse struct { // errors - Errors []*MsaAPIError `json:"errors"` + // Required: true + Errors []*DomainReconAPIError `json:"errors"` // meta // Required: true - Meta *DomainMsaMetaInfo `json:"meta"` + Meta *MsaMetaInfo `json:"meta"` // resources // Required: true @@ -55,8 +56,9 @@ func (m *DomainQueryResponse) Validate(formats strfmt.Registry) error { } func (m *DomainQueryResponse) validateErrors(formats strfmt.Registry) error { - if swag.IsZero(m.Errors) { // not required - return nil + + if err := validate.Required("errors", "body", m.Errors); err != nil { + return err } for i := 0; i < len(m.Errors); i++ { diff --git a/falcon/models/domain_raw_event.go b/falcon/models/domain_raw_event.go index b174389a..fac312c1 100644 --- a/falcon/models/domain_raw_event.go +++ b/falcon/models/domain_raw_event.go @@ -20,14 +20,6 @@ import ( // swagger:model domain.RawEvent type DomainRawEvent struct { - // associated event i ds - // Required: true - AssociatedEventIDs *string `json:"AssociatedEventIDs"` - - // associated events - // Required: true - AssociatedEvents map[string]DomainRawEvent `json:"AssociatedEvents"` - // c ID // Required: true CID *string `json:"CID"` @@ -86,14 +78,6 @@ type DomainRawEvent struct { func (m *DomainRawEvent) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateAssociatedEventIDs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAssociatedEvents(formats); err != nil { - res = append(res, err) - } - if err := m.validateCID(formats); err != nil { res = append(res, err) } @@ -152,42 +136,6 @@ func (m *DomainRawEvent) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainRawEvent) validateAssociatedEventIDs(formats strfmt.Registry) error { - - if err := validate.Required("AssociatedEventIDs", "body", m.AssociatedEventIDs); err != nil { - return err - } - - return nil -} - -func (m *DomainRawEvent) validateAssociatedEvents(formats strfmt.Registry) error { - - if err := validate.Required("AssociatedEvents", "body", m.AssociatedEvents); err != nil { - return err - } - - for k := range m.AssociatedEvents { - - if err := validate.Required("AssociatedEvents"+"."+k, "body", m.AssociatedEvents[k]); err != nil { - return err - } - if val, ok := m.AssociatedEvents[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("AssociatedEvents" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("AssociatedEvents" + "." + k) - } - return err - } - } - - } - - return nil -} - func (m *DomainRawEvent) validateCID(formats strfmt.Registry) error { if err := validate.Required("CID", "body", m.CID); err != nil { @@ -350,10 +298,6 @@ func (m *DomainRawEvent) validateSourceEvent(formats strfmt.Registry) error { func (m *DomainRawEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateAssociatedEvents(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateMetadata(ctx, formats); err != nil { res = append(res, err) } @@ -372,25 +316,6 @@ func (m *DomainRawEvent) ContextValidate(ctx context.Context, formats strfmt.Reg return nil } -func (m *DomainRawEvent) contextValidateAssociatedEvents(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("AssociatedEvents", "body", m.AssociatedEvents); err != nil { - return err - } - - for k := range m.AssociatedEvents { - - if val, ok := m.AssociatedEvents[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - func (m *DomainRawEvent) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { if m.Metadata != nil { diff --git a/falcon/models/domain_report_malware.go b/falcon/models/domain_report_malware.go new file mode 100644 index 00000000..9a8fd67d --- /dev/null +++ b/falcon/models/domain_report_malware.go @@ -0,0 +1,91 @@ +// 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" +) + +// DomainReportMalware domain report malware +// +// swagger:model domain.ReportMalware +type DomainReportMalware struct { + + // community identifiers + CommunityIdentifiers []string `json:"community_identifiers"` + + // family name + // Required: true + FamilyName *string `json:"family_name"` + + // slug + // Required: true + Slug *string `json:"slug"` +} + +// Validate validates this domain report malware +func (m *DomainReportMalware) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFamilyName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainReportMalware) validateFamilyName(formats strfmt.Registry) error { + + if err := validate.Required("family_name", "body", m.FamilyName); err != nil { + return err + } + + return nil +} + +func (m *DomainReportMalware) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this domain report malware based on context it is used +func (m *DomainReportMalware) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainReportMalware) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainReportMalware) UnmarshalBinary(b []byte) error { + var res DomainReportMalware + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_saved_search.go b/falcon/models/domain_saved_search.go deleted file mode 100644 index 13841d5d..00000000 --- a/falcon/models/domain_saved_search.go +++ /dev/null @@ -1,338 +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" -) - -// DomainSavedSearch domain saved search -// -// swagger:model domain.SavedSearch -type DomainSavedSearch struct { - - // cid - Cid string `json:"cid,omitempty"` - - // created by - // Required: true - CreatedBy *string `json:"created_by"` - - // created timestamp - // Required: true - // Format: date-time - CreatedTimestamp *strfmt.DateTime `json:"created_timestamp"` - - // description - // Required: true - Description *string `json:"description"` - - // end - End string `json:"end,omitempty"` - - // id of saved search - // Required: true - ID *string `json:"id"` - - // last modified by - LastModifiedBy string `json:"last_modified_by,omitempty"` - - // last modified timestamp - // Format: date-time - LastModifiedTimestamp strfmt.DateTime `json:"last_modified_timestamp,omitempty"` - - // owner id - OwnerID string `json:"owner_id,omitempty"` - - // owner kind - OwnerKind string `json:"owner_kind,omitempty"` - - // permissions - Permissions []string `json:"permissions"` - - // repo or view - // Required: true - RepoOrView *string `json:"repo_or_view"` - - // request schema - RequestSchema string `json:"request_schema,omitempty"` - - // response schema - ResponseSchema string `json:"response_schema,omitempty"` - - // search name - // Required: true - SearchName *string `json:"search_name"` - - // search query - // Required: true - SearchQuery *string `json:"search_query"` - - // search query args - SearchQueryArgs map[string]string `json:"search_query_args,omitempty"` - - // start - Start string `json:"start,omitempty"` - - // status - // Required: true - Status *string `json:"status"` - - // version - // Required: true - Version *string `json:"version"` - - // version numeric - // Required: true - VersionNumeric *int32 `json:"version_numeric"` - - // workflow id - WorkflowID string `json:"workflow_id,omitempty"` - - // workflow meta - WorkflowMeta *DomainWorkflowMetadata `json:"workflow_meta,omitempty"` -} - -// Validate validates this domain saved search -func (m *DomainSavedSearch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedTimestamp(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastModifiedTimestamp(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepoOrView(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSearchName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSearchQuery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersionNumeric(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWorkflowMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainSavedSearch) validateCreatedBy(formats strfmt.Registry) error { - - if err := validate.Required("created_by", "body", m.CreatedBy); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateCreatedTimestamp(formats strfmt.Registry) error { - - if err := validate.Required("created_timestamp", "body", m.CreatedTimestamp); err != nil { - return err - } - - if err := validate.FormatOf("created_timestamp", "body", "date-time", m.CreatedTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateLastModifiedTimestamp(formats strfmt.Registry) error { - if swag.IsZero(m.LastModifiedTimestamp) { // not required - return nil - } - - if err := validate.FormatOf("last_modified_timestamp", "body", "date-time", m.LastModifiedTimestamp.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateRepoOrView(formats strfmt.Registry) error { - - if err := validate.Required("repo_or_view", "body", m.RepoOrView); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateSearchName(formats strfmt.Registry) error { - - if err := validate.Required("search_name", "body", m.SearchName); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateSearchQuery(formats strfmt.Registry) error { - - if err := validate.Required("search_query", "body", m.SearchQuery); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateVersionNumeric(formats strfmt.Registry) error { - - if err := validate.Required("version_numeric", "body", m.VersionNumeric); err != nil { - return err - } - - return nil -} - -func (m *DomainSavedSearch) validateWorkflowMeta(formats strfmt.Registry) error { - if swag.IsZero(m.WorkflowMeta) { // not required - return nil - } - - if m.WorkflowMeta != nil { - if err := m.WorkflowMeta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workflow_meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workflow_meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this domain saved search based on the context it is used -func (m *DomainSavedSearch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateWorkflowMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DomainSavedSearch) contextValidateWorkflowMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.WorkflowMeta != nil { - - if swag.IsZero(m.WorkflowMeta) { // not required - return nil - } - - if err := m.WorkflowMeta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workflow_meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workflow_meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DomainSavedSearch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainSavedSearch) UnmarshalBinary(b []byte) error { - var res DomainSavedSearch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/domain_scan_v2.go b/falcon/models/domain_scan_v2.go index 4a50507c..6d66f8ef 100644 --- a/falcon/models/domain_scan_v2.go +++ b/falcon/models/domain_scan_v2.go @@ -20,7 +20,8 @@ import ( type DomainScanV2 struct { // affected hosts count - AffectedHostsCount int32 `json:"affected_hosts_count,omitempty"` + // Required: true + AffectedHostsCount *int32 `json:"affected_hosts_count"` // cid Cid string `json:"cid,omitempty"` @@ -32,7 +33,8 @@ type DomainScanV2 struct { CloudMlLevelPrevention int32 `json:"cloud_ml_level_prevention,omitempty"` // completed host count - CompletedHostCount int32 `json:"completed_host_count,omitempty"` + // Required: true + CompletedHostCount *int32 `json:"completed_host_count"` // cpu priority CPUPriority int32 `json:"cpu_priority,omitempty"` @@ -54,7 +56,7 @@ type DomainScanV2 struct { FilePaths []string `json:"file_paths"` // filecount - Filecount *DomainFileCount `json:"filecount,omitempty"` + Filecount *DomainFileCountV2 `json:"filecount,omitempty"` // host groups HostGroups []string `json:"host_groups"` @@ -67,7 +69,8 @@ type DomainScanV2 struct { ID *string `json:"id"` // incomplete host count - IncompleteHostCount int32 `json:"incomplete_host_count,omitempty"` + // Required: true + IncompleteHostCount *int32 `json:"incomplete_host_count"` // initiated from InitiatedFrom string `json:"initiated_from,omitempty"` @@ -86,10 +89,12 @@ type DomainScanV2 struct { Metadata []string `json:"metadata"` // missing host count - MissingHostCount int32 `json:"missing_host_count,omitempty"` + // Required: true + MissingHostCount *int32 `json:"missing_host_count"` // not started host count - NotStartedHostCount int32 `json:"not_started_host_count,omitempty"` + // Required: true + NotStartedHostCount *int32 `json:"not_started_host_count"` // pause duration PauseDuration int32 `json:"pause_duration,omitempty"` @@ -130,19 +135,29 @@ type DomainScanV2 struct { Severity int64 `json:"severity,omitempty"` // started host count - StartedHostCount int32 `json:"started_host_count,omitempty"` + // Required: true + StartedHostCount *int32 `json:"started_host_count"` // status Status string `json:"status,omitempty"` // targeted host count - TargetedHostCount int32 `json:"targeted_host_count,omitempty"` + // Required: true + TargetedHostCount *int32 `json:"targeted_host_count"` } // Validate validates this domain scan v2 func (m *DomainScanV2) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAffectedHostsCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCompletedHostCount(formats); err != nil { + res = append(res, err) + } + if err := m.validateCreatedOn(formats); err != nil { res = append(res, err) } @@ -155,10 +170,22 @@ func (m *DomainScanV2) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateIncompleteHostCount(formats); err != nil { + res = append(res, err) + } + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } + if err := m.validateMissingHostCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotStartedHostCount(formats); err != nil { + res = append(res, err) + } + if err := m.validateScanCompletedOn(formats); err != nil { res = append(res, err) } @@ -167,12 +194,38 @@ func (m *DomainScanV2) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStartedHostCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetedHostCount(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +func (m *DomainScanV2) validateAffectedHostsCount(formats strfmt.Registry) error { + + if err := validate.Required("affected_hosts_count", "body", m.AffectedHostsCount); err != nil { + return err + } + + return nil +} + +func (m *DomainScanV2) validateCompletedHostCount(formats strfmt.Registry) error { + + if err := validate.Required("completed_host_count", "body", m.CompletedHostCount); err != nil { + return err + } + + return nil +} + func (m *DomainScanV2) validateCreatedOn(formats strfmt.Registry) error { if swag.IsZero(m.CreatedOn) { // not required return nil @@ -213,6 +266,15 @@ func (m *DomainScanV2) validateID(formats strfmt.Registry) error { return nil } +func (m *DomainScanV2) validateIncompleteHostCount(formats strfmt.Registry) error { + + if err := validate.Required("incomplete_host_count", "body", m.IncompleteHostCount); err != nil { + return err + } + + return nil +} + func (m *DomainScanV2) validateLastUpdated(formats strfmt.Registry) error { if swag.IsZero(m.LastUpdated) { // not required return nil @@ -225,6 +287,24 @@ func (m *DomainScanV2) validateLastUpdated(formats strfmt.Registry) error { return nil } +func (m *DomainScanV2) validateMissingHostCount(formats strfmt.Registry) error { + + if err := validate.Required("missing_host_count", "body", m.MissingHostCount); err != nil { + return err + } + + return nil +} + +func (m *DomainScanV2) validateNotStartedHostCount(formats strfmt.Registry) error { + + if err := validate.Required("not_started_host_count", "body", m.NotStartedHostCount); err != nil { + return err + } + + return nil +} + func (m *DomainScanV2) validateScanCompletedOn(formats strfmt.Registry) error { if swag.IsZero(m.ScanCompletedOn) { // not required return nil @@ -249,6 +329,24 @@ func (m *DomainScanV2) validateScanStartedOn(formats strfmt.Registry) error { return nil } +func (m *DomainScanV2) validateStartedHostCount(formats strfmt.Registry) error { + + if err := validate.Required("started_host_count", "body", m.StartedHostCount); err != nil { + return err + } + + return nil +} + +func (m *DomainScanV2) validateTargetedHostCount(formats strfmt.Registry) error { + + if err := validate.Required("targeted_host_count", "body", m.TargetedHostCount); err != nil { + return err + } + + return nil +} + // ContextValidate validate this domain scan v2 based on the context it is used func (m *DomainScanV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error 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_telegram_channel_info.go b/falcon/models/domain_telegram_channel_info.go new file mode 100644 index 00000000..0488c9d1 --- /dev/null +++ b/falcon/models/domain_telegram_channel_info.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" +) + +// DomainTelegramChannelInfo domain telegram channel info +// +// swagger:model domain.TelegramChannelInfo +type DomainTelegramChannelInfo struct { + + // title + Title string `json:"title,omitempty"` + + // url + URL string `json:"url,omitempty"` +} + +// Validate validates this domain telegram channel info +func (m *DomainTelegramChannelInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain telegram channel info based on context it is used +func (m *DomainTelegramChannelInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainTelegramChannelInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainTelegramChannelInfo) UnmarshalBinary(b []byte) error { + var res DomainTelegramChannelInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_telegram_info.go b/falcon/models/domain_telegram_info.go new file mode 100644 index 00000000..0475f692 --- /dev/null +++ b/falcon/models/domain_telegram_info.go @@ -0,0 +1,211 @@ +// 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" +) + +// DomainTelegramInfo domain telegram info +// +// swagger:model domain.TelegramInfo +type DomainTelegramInfo struct { + + // channel info + ChannelInfo *DomainTelegramChannelInfo `json:"channel_info,omitempty"` + + // recipient info + RecipientInfo *DomainTelegramRecipientInfo `json:"recipient_info,omitempty"` + + // sender info + SenderInfo *DomainTelegramSenderInfo `json:"sender_info,omitempty"` +} + +// Validate validates this domain telegram info +func (m *DomainTelegramInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannelInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecipientInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSenderInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainTelegramInfo) validateChannelInfo(formats strfmt.Registry) error { + if swag.IsZero(m.ChannelInfo) { // not required + return nil + } + + if m.ChannelInfo != nil { + if err := m.ChannelInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channel_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("channel_info") + } + return err + } + } + + return nil +} + +func (m *DomainTelegramInfo) validateRecipientInfo(formats strfmt.Registry) error { + if swag.IsZero(m.RecipientInfo) { // not required + return nil + } + + if m.RecipientInfo != nil { + if err := m.RecipientInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("recipient_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("recipient_info") + } + return err + } + } + + return nil +} + +func (m *DomainTelegramInfo) validateSenderInfo(formats strfmt.Registry) error { + if swag.IsZero(m.SenderInfo) { // not required + return nil + } + + if m.SenderInfo != nil { + if err := m.SenderInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sender_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sender_info") + } + return err + } + } + + return nil +} + +// ContextValidate validate this domain telegram info based on the context it is used +func (m *DomainTelegramInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateChannelInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecipientInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSenderInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DomainTelegramInfo) contextValidateChannelInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.ChannelInfo != nil { + + if swag.IsZero(m.ChannelInfo) { // not required + return nil + } + + if err := m.ChannelInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channel_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("channel_info") + } + return err + } + } + + return nil +} + +func (m *DomainTelegramInfo) contextValidateRecipientInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.RecipientInfo != nil { + + if swag.IsZero(m.RecipientInfo) { // not required + return nil + } + + if err := m.RecipientInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("recipient_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("recipient_info") + } + return err + } + } + + return nil +} + +func (m *DomainTelegramInfo) contextValidateSenderInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.SenderInfo != nil { + + if swag.IsZero(m.SenderInfo) { // not required + return nil + } + + if err := m.SenderInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sender_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sender_info") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DomainTelegramInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainTelegramInfo) UnmarshalBinary(b []byte) error { + var res DomainTelegramInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_telegram_recipient_info.go b/falcon/models/domain_telegram_recipient_info.go new file mode 100644 index 00000000..650a7022 --- /dev/null +++ b/falcon/models/domain_telegram_recipient_info.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" +) + +// DomainTelegramRecipientInfo domain telegram recipient info +// +// swagger:model domain.TelegramRecipientInfo +type DomainTelegramRecipientInfo struct { + + // first name + FirstName string `json:"first_name,omitempty"` + + // id + ID int64 `json:"id,omitempty"` + + // last name + LastName string `json:"last_name,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // username + Username string `json:"username,omitempty"` +} + +// Validate validates this domain telegram recipient info +func (m *DomainTelegramRecipientInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain telegram recipient info based on context it is used +func (m *DomainTelegramRecipientInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainTelegramRecipientInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainTelegramRecipientInfo) UnmarshalBinary(b []byte) error { + var res DomainTelegramRecipientInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_telegram_sender_info.go b/falcon/models/domain_telegram_sender_info.go new file mode 100644 index 00000000..52989c56 --- /dev/null +++ b/falcon/models/domain_telegram_sender_info.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" +) + +// DomainTelegramSenderInfo domain telegram sender info +// +// swagger:model domain.TelegramSenderInfo +type DomainTelegramSenderInfo struct { + + // first name + FirstName string `json:"first_name,omitempty"` + + // id + ID int64 `json:"id,omitempty"` + + // last name + LastName string `json:"last_name,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // username + Username string `json:"username,omitempty"` +} + +// Validate validates this domain telegram sender info +func (m *DomainTelegramSenderInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain telegram sender info based on context it is used +func (m *DomainTelegramSenderInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainTelegramSenderInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainTelegramSenderInfo) UnmarshalBinary(b []byte) error { + var res DomainTelegramSenderInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_threat_entity.go b/falcon/models/domain_threat_entity.go new file mode 100644 index 00000000..d177085a --- /dev/null +++ b/falcon/models/domain_threat_entity.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" +) + +// DomainThreatEntity domain threat entity +// +// swagger:model domain.ThreatEntity +type DomainThreatEntity struct { + + // family name of the threat + FamilyName string `json:"family_name,omitempty"` +} + +// Validate validates this domain threat entity +func (m *DomainThreatEntity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this domain threat entity based on context it is used +func (m *DomainThreatEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DomainThreatEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainThreatEntity) UnmarshalBinary(b []byte) error { + var res DomainThreatEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/domain_user.go b/falcon/models/domain_user.go index 5f86e208..0b7f8363 100644 --- a/falcon/models/domain_user.go +++ b/falcon/models/domain_user.go @@ -8,10 +8,8 @@ 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 @@ -22,22 +20,14 @@ type DomainUser struct { // cid Cid string `json:"cid,omitempty"` - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + // email + Email string `json:"email,omitempty"` // first name - FirstName string `json:"first_name,omitempty"` - - // last login at - // Format: date-time - LastLoginAt strfmt.DateTime `json:"last_login_at,omitempty"` + FirstName string `json:"firstName,omitempty"` // last name - LastName string `json:"last_name,omitempty"` - - // uid - UID string `json:"uid,omitempty"` + LastName string `json:"lastName,omitempty"` // uuid UUID string `json:"uuid,omitempty"` @@ -45,43 +35,6 @@ 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 9fb3b5a0..c2663a0f 100644 --- a/falcon/models/domain_user_action.go +++ b/falcon/models/domain_user_action.go @@ -21,8 +21,9 @@ import ( type DomainUserAction struct { // Action name + // Required: true // Enum: [reset_password reset_2fa] - ActionName string `json:"action_name,omitempty"` + ActionName *string `json:"action_name"` // Value for action, if any ActionValue string `json:"action_value,omitempty"` @@ -72,12 +73,13 @@ func (m *DomainUserAction) validateActionNameEnum(path, location string, value s } func (m *DomainUserAction) validateActionName(formats strfmt.Registry) error { - if swag.IsZero(m.ActionName) { // not required - return nil + + if err := validate.Required("action_name", "body", m.ActionName); err != nil { + return err } // 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 6ebc8eb7..7c229e08 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 are to applied to +// DomainUserActionRequest ID(s) of users the action(s) are to applied to // // swagger:model domain.UserActionRequest type DomainUserActionRequest struct { diff --git a/falcon/models/domain_user_grants.go b/falcon/models/domain_user_grants.go index 945cb5c3..cf116364 100644 --- a/falcon/models/domain_user_grants.go +++ b/falcon/models/domain_user_grants.go @@ -20,8 +20,7 @@ import ( type DomainUserGrants struct { // cid - // Required: true - Cid *string `json:"cid"` + Cid string `json:"cid,omitempty"` // cid group id CidGroupID string `json:"cid_group_id,omitempty"` @@ -30,8 +29,7 @@ type DomainUserGrants struct { CidGroupName string `json:"cid_group_name,omitempty"` // grant type - // Required: true - GrantType *string `json:"grant_type"` + GrantType string `json:"grant_type,omitempty"` // parent cid ParentCid string `json:"parent_cid,omitempty"` @@ -41,8 +39,7 @@ type DomainUserGrants struct { RoleID *string `json:"role_id"` // role name - // Required: true - RoleName *string `json:"role_name"` + RoleName string `json:"role_name,omitempty"` // user group id UserGroupID string `json:"user_group_id,omitempty"` @@ -51,58 +48,23 @@ type DomainUserGrants struct { UserGroupName string `json:"user_group_name,omitempty"` // uuid - // Required: true - UUID *string `json:"uuid"` + UUID string `json:"uuid,omitempty"` } // Validate validates this domain user grants func (m *DomainUserGrants) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateCid(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrantType(formats); err != nil { - res = append(res, err) - } - if err := m.validateRoleID(formats); err != nil { res = append(res, err) } - if err := m.validateRoleName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUUID(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } -func (m *DomainUserGrants) validateCid(formats strfmt.Registry) error { - - if err := validate.Required("cid", "body", m.Cid); err != nil { - return err - } - - return nil -} - -func (m *DomainUserGrants) validateGrantType(formats strfmt.Registry) error { - - if err := validate.Required("grant_type", "body", m.GrantType); err != nil { - return err - } - - return nil -} - func (m *DomainUserGrants) validateRoleID(formats strfmt.Registry) error { if err := validate.Required("role_id", "body", m.RoleID); err != nil { @@ -112,24 +74,6 @@ func (m *DomainUserGrants) validateRoleID(formats strfmt.Registry) error { return nil } -func (m *DomainUserGrants) validateRoleName(formats strfmt.Registry) error { - - if err := validate.Required("role_name", "body", m.RoleName); err != nil { - return err - } - - return nil -} - -func (m *DomainUserGrants) validateUUID(formats strfmt.Registry) error { - - if err := validate.Required("uuid", "body", m.UUID); err != nil { - return err - } - - return nil -} - // ContextValidate validates this domain user grants based on context it is used func (m *DomainUserGrants) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/falcon/models/domain_vulnerability.go b/falcon/models/domain_vulnerability.go index 9d2cd545..66f640a4 100644 --- a/falcon/models/domain_vulnerability.go +++ b/falcon/models/domain_vulnerability.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -19,40 +20,71 @@ import ( // swagger:model domain.Vulnerability type DomainVulnerability struct { - // evaluated affected assets count - // Required: true - EvaluatedAffectedAssetsCount *float64 `json:"evaluatedAffectedAssetsCount"` + // List of products affected by vulnerability, specifying product and vendor + AffectedProducts []*DomainVulnerabilityAffectedProduct `json:"affected_products"` - // exploit status - // Required: true - ExploitStatus *float64 `json:"exploitStatus"` + // Vulnerability community identifiers, which is usually populated for the most popular vulnerabilities + CommunityIdentifiers []string `json:"community_identifiers"` - // exprt rating + // 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 - ExprtRating *string `json:"exprt_rating"` + Cve *string `json:"cve"` - // total affected assets - // Required: true - TotalAffectedAssets *float64 `json:"totalAffectedAssets"` + // 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"` + + // 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"` + + // Severity of the vulnerability, can be empty or one of: LOW, MEDIUM, HIGH, CRITICAL + Severity string `json:"severity,omitempty"` + + // Date when the vulnerability was last time updated in the CrowdStrike's database + UpdatedTimestamp string `json:"updated_timestamp,omitempty"` } // Validate validates this domain vulnerability func (m *DomainVulnerability) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateEvaluatedAffectedAssetsCount(formats); err != nil { + if err := m.validateAffectedProducts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCve(formats); err != nil { res = append(res, err) } - if err := m.validateExploitStatus(formats); err != nil { + if err := m.validateRelatedActors(formats); err != nil { res = append(res, err) } - if err := m.validateExprtRating(formats); err != nil { + if err := m.validateRelatedReports(formats); err != nil { res = append(res, err) } - if err := m.validateTotalAffectedAssets(formats); err != nil { + if err := m.validateRelatedThreats(formats); err != nil { res = append(res, err) } @@ -62,44 +94,242 @@ func (m *DomainVulnerability) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainVulnerability) validateEvaluatedAffectedAssetsCount(formats strfmt.Registry) error { +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 + } + } - if err := validate.Required("evaluatedAffectedAssetsCount", "body", m.EvaluatedAffectedAssetsCount); err != nil { - return err } return nil } -func (m *DomainVulnerability) validateExploitStatus(formats strfmt.Registry) error { +func (m *DomainVulnerability) validateCve(formats strfmt.Registry) error { - if err := validate.Required("exploitStatus", "body", m.ExploitStatus); err != nil { + if err := validate.Required("cve", "body", m.Cve); err != nil { return err } return nil } -func (m *DomainVulnerability) validateExprtRating(formats strfmt.Registry) error { +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 + } + } - if err := validate.Required("exprt_rating", "body", m.ExprtRating); err != nil { - return err } return nil } -func (m *DomainVulnerability) validateTotalAffectedAssets(formats strfmt.Registry) error { +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 + } + } - if err := validate.Required("totalAffectedAssets", "body", m.TotalAffectedAssets); err != nil { - return err } return nil } -// ContextValidate validates this domain vulnerability based on context it is used +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 + } + } + + } + + return nil +} + +// ContextValidate validate this domain vulnerability based on the 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 new file mode 100644 index 00000000..d342ba65 --- /dev/null +++ b/falcon/models/domain_vulnerability_actor.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" +) + +// 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 new file mode 100644 index 00000000..59770de8 --- /dev/null +++ b/falcon/models/domain_vulnerability_affected_product.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" +) + +// 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 new file mode 100644 index 00000000..596461d0 --- /dev/null +++ b/falcon/models/domain_vulnerability_related_threat.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" +) + +// 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 new file mode 100644 index 00000000..adfbe4f4 --- /dev/null +++ b/falcon/models/domain_vulnerability_report.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" +) + +// 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/domain_workflow_metadata.go b/falcon/models/domain_workflow_metadata.go deleted file mode 100644 index f9f086ed..00000000 --- a/falcon/models/domain_workflow_metadata.go +++ /dev/null @@ -1,59 +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" -) - -// DomainWorkflowMetadata domain workflow metadata -// -// swagger:model domain.WorkflowMetadata -type DomainWorkflowMetadata struct { - - // is system - IsSystem bool `json:"is_system,omitempty"` - - // polling interval - PollingInterval int32 `json:"polling_interval,omitempty"` - - // polling timeout - PollingTimeout int32 `json:"polling_timeout,omitempty"` - - // tag ids - TagIds []string `json:"tag_ids"` -} - -// Validate validates this domain workflow metadata -func (m *DomainWorkflowMetadata) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this domain workflow metadata based on context it is used -func (m *DomainWorkflowMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DomainWorkflowMetadata) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DomainWorkflowMetadata) UnmarshalBinary(b []byte) error { - var res DomainWorkflowMetadata - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/driftindicators_drift_entity_response.go b/falcon/models/driftindicators_drift_entity_response.go new file mode 100644 index 00000000..fafd2fd4 --- /dev/null +++ b/falcon/models/driftindicators_drift_entity_response.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" +) + +// DriftindicatorsDriftEntityResponse driftindicators drift entity response +// +// swagger:model driftindicators.DriftEntityResponse +type DriftindicatorsDriftEntityResponse struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIDriftIndicators `json:"resources"` +} + +// Validate validates this driftindicators drift entity response +func (m *DriftindicatorsDriftEntityResponse) 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 *DriftindicatorsDriftEntityResponse) 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 *DriftindicatorsDriftEntityResponse) 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 *DriftindicatorsDriftEntityResponse) 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 driftindicators drift entity response based on the context it is used +func (m *DriftindicatorsDriftEntityResponse) 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 *DriftindicatorsDriftEntityResponse) 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 *DriftindicatorsDriftEntityResponse) 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 *DriftindicatorsDriftEntityResponse) 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 *DriftindicatorsDriftEntityResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DriftindicatorsDriftEntityResponse) UnmarshalBinary(b []byte) error { + var res DriftindicatorsDriftEntityResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/driftindicators_drift_indicators_count_value.go b/falcon/models/driftindicators_drift_indicators_count_value.go new file mode 100644 index 00000000..06f37f0f --- /dev/null +++ b/falcon/models/driftindicators_drift_indicators_count_value.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" +) + +// DriftindicatorsDriftIndicatorsCountValue driftindicators drift indicators count value +// +// swagger:model driftindicators.driftIndicatorsCountValue +type DriftindicatorsDriftIndicatorsCountValue struct { + + // resources + // Required: true + Resources []*CommonCountAsResource `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this driftindicators drift indicators count value +func (m *DriftindicatorsDriftIndicatorsCountValue) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DriftindicatorsDriftIndicatorsCountValue) 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 +} + +func (m *DriftindicatorsDriftIndicatorsCountValue) 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 *DriftindicatorsDriftIndicatorsCountValue) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this driftindicators drift indicators count value based on the context it is used +func (m *DriftindicatorsDriftIndicatorsCountValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *DriftindicatorsDriftIndicatorsCountValue) 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 +} + +func (m *DriftindicatorsDriftIndicatorsCountValue) 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 *DriftindicatorsDriftIndicatorsCountValue) 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 *DriftindicatorsDriftIndicatorsCountValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DriftindicatorsDriftIndicatorsCountValue) UnmarshalBinary(b []byte) error { + var res DriftindicatorsDriftIndicatorsCountValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/driftindicators_drift_indicators_field_value.go b/falcon/models/driftindicators_drift_indicators_field_value.go new file mode 100644 index 00000000..fa161942 --- /dev/null +++ b/falcon/models/driftindicators_drift_indicators_field_value.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" +) + +// DriftindicatorsDriftIndicatorsFieldValue driftindicators drift indicators field value +// +// swagger:model driftindicators.driftIndicatorsFieldValue +type DriftindicatorsDriftIndicatorsFieldValue struct { + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this driftindicators drift indicators field value +func (m *DriftindicatorsDriftIndicatorsFieldValue) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DriftindicatorsDriftIndicatorsFieldValue) 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 +} + +func (m *DriftindicatorsDriftIndicatorsFieldValue) 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 *DriftindicatorsDriftIndicatorsFieldValue) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this driftindicators drift indicators field value based on the context it is used +func (m *DriftindicatorsDriftIndicatorsFieldValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *DriftindicatorsDriftIndicatorsFieldValue) 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 +} + +func (m *DriftindicatorsDriftIndicatorsFieldValue) 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 *DriftindicatorsDriftIndicatorsFieldValue) 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 *DriftindicatorsDriftIndicatorsFieldValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DriftindicatorsDriftIndicatorsFieldValue) UnmarshalBinary(b []byte) error { + var res DriftindicatorsDriftIndicatorsFieldValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/executions_execution_result.go b/falcon/models/executions_execution_result.go index fae1d052..81e8d874 100644 --- a/falcon/models/executions_execution_result.go +++ b/falcon/models/executions_execution_result.go @@ -60,6 +60,10 @@ type ExecutionsExecutionResult struct { // Overall status for the execution. // Required: true Status *string `json:"status"` + + // Details for the result of the trigger node + // Required: true + Trigger *ExecutionsTriggerResult `json:"trigger"` } // Validate validates this executions execution result @@ -106,6 +110,10 @@ func (m *ExecutionsExecutionResult) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTrigger(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -263,6 +271,26 @@ func (m *ExecutionsExecutionResult) validateStatus(formats strfmt.Registry) erro return nil } +func (m *ExecutionsExecutionResult) 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 +} + // ContextValidate validate this executions execution result based on the context it is used func (m *ExecutionsExecutionResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -279,6 +307,10 @@ func (m *ExecutionsExecutionResult) ContextValidate(ctx context.Context, formats res = append(res, err) } + if err := m.contextValidateTrigger(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -360,6 +392,23 @@ func (m *ExecutionsExecutionResult) contextValidateLoops(ctx context.Context, fo return nil } +func (m *ExecutionsExecutionResult) 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 *ExecutionsExecutionResult) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/executions_trigger_result.go b/falcon/models/executions_trigger_result.go new file mode 100644 index 00000000..592c766e --- /dev/null +++ b/falcon/models/executions_trigger_result.go @@ -0,0 +1,80 @@ +// 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" +) + +// ExecutionsTriggerResult executions trigger result +// +// swagger:model executions.TriggerResult +type ExecutionsTriggerResult struct { + + // Unique identifier for the selected trigger as provided by the triggers API + ID string `json:"id,omitempty"` + + // Whether this node's result is mocked + Mocked bool `json:"mocked,omitempty"` + + // Display name of the trigger + // Required: true + Name *string `json:"name"` + + // Opaque blob for result of trigger. Structured according to the trigger's JSON schema'. + Result string `json:"result,omitempty"` +} + +// Validate validates this executions trigger result +func (m *ExecutionsTriggerResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExecutionsTriggerResult) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this executions trigger result based on context it is used +func (m *ExecutionsTriggerResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ExecutionsTriggerResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExecutionsTriggerResult) UnmarshalBinary(b []byte) error { + var res ExecutionsTriggerResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/falconx_submission_v1.go b/falcon/models/falconx_submission_v1.go index 35205b6a..dc0ee841 100644 --- a/falcon/models/falconx_submission_v1.go +++ b/falcon/models/falconx_submission_v1.go @@ -25,6 +25,15 @@ type FalconxSubmissionV1 struct { // created timestamp CreatedTimestamp string `json:"created_timestamp,omitempty"` + // error message + ErrorMessage string `json:"error_message,omitempty"` + + // error origin + ErrorOrigin string `json:"error_origin,omitempty"` + + // error type + ErrorType string `json:"error_type,omitempty"` + // id ID string `json:"id,omitempty"` diff --git a/falcon/models/fwmgr_msa_aggregation_result.go b/falcon/models/fwmgr_msa_aggregation_result.go index 4b8bf6e2..f3372fbe 100644 --- a/falcon/models/fwmgr_msa_aggregation_result.go +++ b/falcon/models/fwmgr_msa_aggregation_result.go @@ -24,6 +24,9 @@ type FwmgrMsaAggregationResult struct { // Required: true Buckets []*FwmgrMsaAggregationResultItem `json:"buckets"` + // doc count error upper bound + DocCountErrorUpperBound int64 `json:"doc_count_error_upper_bound,omitempty"` + // name // Required: true Name *string `json:"name"` diff --git a/falcon/models/humio_group.go b/falcon/models/humio_group.go deleted file mode 100644 index ada2d273..00000000 --- a/falcon/models/humio_group.go +++ /dev/null @@ -1,156 +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" -) - -// HumioGroup humio group -// -// swagger:model humio.Group -type HumioGroup struct { - - // id - // Required: true - ID *string `json:"id"` - - // name - // Required: true - Name *string `json:"name"` - - // roles - Roles []*HumioSearchDomainRole `json:"roles"` -} - -// Validate validates this humio group -func (m *HumioGroup) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HumioGroup) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *HumioGroup) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *HumioGroup) validateRoles(formats strfmt.Registry) error { - if swag.IsZero(m.Roles) { // not required - return nil - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this humio group based on the context it is used -func (m *HumioGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HumioGroup) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HumioGroup) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HumioGroup) UnmarshalBinary(b []byte) error { - var res HumioGroup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/humio_search_domain_role.go b/falcon/models/humio_search_domain_role.go deleted file mode 100644 index d6714c73..00000000 --- a/falcon/models/humio_search_domain_role.go +++ /dev/null @@ -1,157 +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" -) - -// HumioSearchDomainRole humio search domain role -// -// swagger:model humio.SearchDomainRole -type HumioSearchDomainRole struct { - - // role - // Required: true - Role *APIRole `json:"role"` - - // search domain - // Required: true - SearchDomain *HumioSearchDomain `json:"searchDomain"` -} - -// Validate validates this humio search domain role -func (m *HumioSearchDomainRole) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRole(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSearchDomain(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HumioSearchDomainRole) validateRole(formats strfmt.Registry) error { - - if err := validate.Required("role", "body", m.Role); err != nil { - return err - } - - if m.Role != nil { - if err := m.Role.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("role") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("role") - } - return err - } - } - - return nil -} - -func (m *HumioSearchDomainRole) validateSearchDomain(formats strfmt.Registry) error { - - if err := validate.Required("searchDomain", "body", m.SearchDomain); err != nil { - return err - } - - if m.SearchDomain != nil { - if err := m.SearchDomain.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("searchDomain") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("searchDomain") - } - return err - } - } - - return nil -} - -// ContextValidate validate this humio search domain role based on the context it is used -func (m *HumioSearchDomainRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRole(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSearchDomain(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HumioSearchDomainRole) contextValidateRole(ctx context.Context, formats strfmt.Registry) error { - - if m.Role != nil { - - if err := m.Role.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("role") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("role") - } - return err - } - } - - return nil -} - -func (m *HumioSearchDomainRole) contextValidateSearchDomain(ctx context.Context, formats strfmt.Registry) error { - - if m.SearchDomain != nil { - - if err := m.SearchDomain.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("searchDomain") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("searchDomain") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HumioSearchDomainRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HumioSearchDomainRole) UnmarshalBinary(b []byte) error { - var res HumioSearchDomainRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/humio_view.go b/falcon/models/humio_view.go deleted file mode 100644 index a75075ec..00000000 --- a/falcon/models/humio_view.go +++ /dev/null @@ -1,175 +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" -) - -// HumioView humio view -// -// swagger:model humio.View -type HumioView struct { - - // connections - // Required: true - Connections []*HumioViewConnection `json:"Connections"` - - // description - // Required: true - Description *string `json:"Description"` - - // ID - // Required: true - ID *string `json:"ID"` - - // name - // Required: true - Name *string `json:"Name"` -} - -// Validate validates this humio view -func (m *HumioView) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConnections(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(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 len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HumioView) validateConnections(formats strfmt.Registry) error { - - if err := validate.Required("Connections", "body", m.Connections); err != nil { - return err - } - - for i := 0; i < len(m.Connections); i++ { - if swag.IsZero(m.Connections[i]) { // not required - continue - } - - if m.Connections[i] != nil { - if err := m.Connections[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Connections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Connections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *HumioView) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("Description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *HumioView) validateID(formats strfmt.Registry) error { - - if err := validate.Required("ID", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *HumioView) validateName(formats strfmt.Registry) error { - - if err := validate.Required("Name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this humio view based on the context it is used -func (m *HumioView) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConnections(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HumioView) contextValidateConnections(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Connections); i++ { - - if m.Connections[i] != nil { - - if swag.IsZero(m.Connections[i]) { // not required - return nil - } - - if err := m.Connections[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Connections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Connections" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *HumioView) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HumioView) UnmarshalBinary(b []byte) error { - var res HumioView - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/humio_view_connection.go b/falcon/models/humio_view_connection.go deleted file mode 100644 index 68cf7d19..00000000 --- a/falcon/models/humio_view_connection.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" -) - -// HumioViewConnection humio view connection -// -// swagger:model humio.ViewConnection -type HumioViewConnection struct { - - // filter - // Required: true - Filter *string `json:"filter"` - - // repo name - // Required: true - RepoName *string `json:"repo_name"` -} - -// Validate validates this humio view connection -func (m *HumioViewConnection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFilter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRepoName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *HumioViewConnection) validateFilter(formats strfmt.Registry) error { - - if err := validate.Required("filter", "body", m.Filter); err != nil { - return err - } - - return nil -} - -func (m *HumioViewConnection) validateRepoName(formats strfmt.Registry) error { - - if err := validate.Required("repo_name", "body", m.RepoName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this humio view connection based on context it is used -func (m *HumioViewConnection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HumioViewConnection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HumioViewConnection) UnmarshalBinary(b []byte) error { - var res HumioViewConnection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/custom_storage_response_payload.go b/falcon/models/images_api_combined_image_export.go similarity index 80% rename from falcon/models/custom_storage_response_payload.go rename to falcon/models/images_api_combined_image_export.go index 0869571b..d2445423 100644 --- a/falcon/models/custom_storage_response_payload.go +++ b/falcon/models/images_api_combined_image_export.go @@ -15,13 +15,12 @@ import ( "github.com/go-openapi/validate" ) -// CustomStorageResponsePayload custom type 4078359637 +// ImagesAPICombinedImageExport images api combined image export // -// swagger:model CustomStorageResponsePayload -type CustomStorageResponsePayload struct { +// swagger:model images.apiCombinedImageExport +type ImagesAPICombinedImageExport struct { // errors - // Required: true Errors []*MsaAPIError `json:"errors"` // meta @@ -30,11 +29,11 @@ type CustomStorageResponsePayload struct { // resources // Required: true - Resources []*APIObjectMetadata `json:"resources"` + Resources []*ModelsAPIImageCombinedExport `json:"resources"` } -// Validate validates this custom type 4078359637 -func (m *CustomStorageResponsePayload) Validate(formats strfmt.Registry) error { +// Validate validates this images api combined image export +func (m *ImagesAPICombinedImageExport) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,10 +54,9 @@ func (m *CustomStorageResponsePayload) Validate(formats strfmt.Registry) error { return nil } -func (m *CustomStorageResponsePayload) validateErrors(formats strfmt.Registry) error { - - if err := validate.Required("errors", "body", m.Errors); err != nil { - return err +func (m *ImagesAPICombinedImageExport) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil } for i := 0; i < len(m.Errors); i++ { @@ -82,7 +80,7 @@ func (m *CustomStorageResponsePayload) validateErrors(formats strfmt.Registry) e return nil } -func (m *CustomStorageResponsePayload) validateMeta(formats strfmt.Registry) error { +func (m *ImagesAPICombinedImageExport) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,7 +100,7 @@ func (m *CustomStorageResponsePayload) validateMeta(formats strfmt.Registry) err return nil } -func (m *CustomStorageResponsePayload) validateResources(formats strfmt.Registry) error { +func (m *ImagesAPICombinedImageExport) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err @@ -129,8 +127,8 @@ func (m *CustomStorageResponsePayload) validateResources(formats strfmt.Registry return nil } -// ContextValidate validate this custom type 4078359637 based on the context it is used -func (m *CustomStorageResponsePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this images api combined image export based on the context it is used +func (m *ImagesAPICombinedImageExport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -151,7 +149,7 @@ func (m *CustomStorageResponsePayload) ContextValidate(ctx context.Context, form return nil } -func (m *CustomStorageResponsePayload) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *ImagesAPICombinedImageExport) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -176,7 +174,7 @@ func (m *CustomStorageResponsePayload) contextValidateErrors(ctx context.Context return nil } -func (m *CustomStorageResponsePayload) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *ImagesAPICombinedImageExport) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -193,7 +191,7 @@ func (m *CustomStorageResponsePayload) contextValidateMeta(ctx context.Context, return nil } -func (m *CustomStorageResponsePayload) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *ImagesAPICombinedImageExport) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Resources); i++ { @@ -219,7 +217,7 @@ func (m *CustomStorageResponsePayload) contextValidateResources(ctx context.Cont } // MarshalBinary interface implementation -func (m *CustomStorageResponsePayload) MarshalBinary() ([]byte, error) { +func (m *ImagesAPICombinedImageExport) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -227,8 +225,8 @@ func (m *CustomStorageResponsePayload) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *CustomStorageResponsePayload) UnmarshalBinary(b []byte) error { - var res CustomStorageResponsePayload +func (m *ImagesAPICombinedImageExport) UnmarshalBinary(b []byte) error { + var res ImagesAPICombinedImageExport if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/images_api_customer_and_image.go b/falcon/models/images_api_customer_and_image.go new file mode 100644 index 00000000..b8c7ce7f --- /dev/null +++ b/falcon/models/images_api_customer_and_image.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" +) + +// ImagesAPICustomerAndImage images api customer and image +// +// swagger:model images.apiCustomerAndImage +type ImagesAPICustomerAndImage struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPICustomerAndImage `json:"resources"` +} + +// Validate validates this images api customer and image +func (m *ImagesAPICustomerAndImage) 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 *ImagesAPICustomerAndImage) 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 *ImagesAPICustomerAndImage) 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 *ImagesAPICustomerAndImage) 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 images api customer and image based on the context it is used +func (m *ImagesAPICustomerAndImage) 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 *ImagesAPICustomerAndImage) 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 *ImagesAPICustomerAndImage) 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 *ImagesAPICustomerAndImage) 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 *ImagesAPICustomerAndImage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImagesAPICustomerAndImage) UnmarshalBinary(b []byte) error { + var res ImagesAPICustomerAndImage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/images_api_image_assessment_history.go b/falcon/models/images_api_image_assessment_history.go new file mode 100644 index 00000000..6bfe977a --- /dev/null +++ b/falcon/models/images_api_image_assessment_history.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" +) + +// ImagesAPIImageAssessmentHistory images api image assessment history +// +// swagger:model images.apiImageAssessmentHistory +type ImagesAPIImageAssessmentHistory struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIImageAssessmentHistory `json:"resources"` +} + +// Validate validates this images api image assessment history +func (m *ImagesAPIImageAssessmentHistory) 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 *ImagesAPIImageAssessmentHistory) 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 *ImagesAPIImageAssessmentHistory) 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 *ImagesAPIImageAssessmentHistory) 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 images api image assessment history based on the context it is used +func (m *ImagesAPIImageAssessmentHistory) 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 *ImagesAPIImageAssessmentHistory) 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 *ImagesAPIImageAssessmentHistory) 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 *ImagesAPIImageAssessmentHistory) 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 *ImagesAPIImageAssessmentHistory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImagesAPIImageAssessmentHistory) UnmarshalBinary(b []byte) error { + var res ImagesAPIImageAssessmentHistory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/images_api_image_by_vulnerability_count.go b/falcon/models/images_api_image_by_vulnerability_count.go new file mode 100644 index 00000000..1947c094 --- /dev/null +++ b/falcon/models/images_api_image_by_vulnerability_count.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" +) + +// ImagesAPIImageByVulnerabilityCount images api image by vulnerability count +// +// swagger:model images.apiImageByVulnerabilityCount +type ImagesAPIImageByVulnerabilityCount struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIImageByVulnerabilityCount `json:"resources"` +} + +// Validate validates this images api image by vulnerability count +func (m *ImagesAPIImageByVulnerabilityCount) 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 *ImagesAPIImageByVulnerabilityCount) 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 *ImagesAPIImageByVulnerabilityCount) 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 *ImagesAPIImageByVulnerabilityCount) 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 images api image by vulnerability count based on the context it is used +func (m *ImagesAPIImageByVulnerabilityCount) 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 *ImagesAPIImageByVulnerabilityCount) 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 *ImagesAPIImageByVulnerabilityCount) 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 *ImagesAPIImageByVulnerabilityCount) 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 *ImagesAPIImageByVulnerabilityCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImagesAPIImageByVulnerabilityCount) UnmarshalBinary(b []byte) error { + var res ImagesAPIImageByVulnerabilityCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/images_api_image_count.go b/falcon/models/images_api_image_count.go new file mode 100644 index 00000000..195d93e2 --- /dev/null +++ b/falcon/models/images_api_image_count.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" +) + +// ImagesAPIImageCount images api image count +// +// swagger:model images.apiImageCount +type ImagesAPIImageCount struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIImageCount `json:"resources"` +} + +// Validate validates this images api image count +func (m *ImagesAPIImageCount) 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 *ImagesAPIImageCount) 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 *ImagesAPIImageCount) 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 *ImagesAPIImageCount) 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 images api image count based on the context it is used +func (m *ImagesAPIImageCount) 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 *ImagesAPIImageCount) 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 *ImagesAPIImageCount) 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 *ImagesAPIImageCount) 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 *ImagesAPIImageCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImagesAPIImageCount) UnmarshalBinary(b []byte) error { + var res ImagesAPIImageCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/images_api_image_count_by_base_o_s.go b/falcon/models/images_api_image_count_by_base_o_s.go new file mode 100644 index 00000000..dd2bceb7 --- /dev/null +++ b/falcon/models/images_api_image_count_by_base_o_s.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" +) + +// ImagesAPIImageCountByBaseOS images api image count by base o s +// +// swagger:model images.apiImageCountByBaseOS +type ImagesAPIImageCountByBaseOS struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"resources"` +} + +// Validate validates this images api image count by base o s +func (m *ImagesAPIImageCountByBaseOS) 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 *ImagesAPIImageCountByBaseOS) 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 *ImagesAPIImageCountByBaseOS) 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 *ImagesAPIImageCountByBaseOS) 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 images api image count by base o s based on the context it is used +func (m *ImagesAPIImageCountByBaseOS) 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 *ImagesAPIImageCountByBaseOS) 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 *ImagesAPIImageCountByBaseOS) 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 *ImagesAPIImageCountByBaseOS) 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 *ImagesAPIImageCountByBaseOS) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImagesAPIImageCountByBaseOS) UnmarshalBinary(b []byte) error { + var res ImagesAPIImageCountByBaseOS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/images_api_image_count_by_state.go b/falcon/models/images_api_image_count_by_state.go new file mode 100644 index 00000000..205d092e --- /dev/null +++ b/falcon/models/images_api_image_count_by_state.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" +) + +// ImagesAPIImageCountByState images api image count by state +// +// swagger:model images.apiImageCountByState +type ImagesAPIImageCountByState struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"resources"` +} + +// Validate validates this images api image count by state +func (m *ImagesAPIImageCountByState) 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 *ImagesAPIImageCountByState) 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 *ImagesAPIImageCountByState) 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 *ImagesAPIImageCountByState) 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 images api image count by state based on the context it is used +func (m *ImagesAPIImageCountByState) 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 *ImagesAPIImageCountByState) 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 *ImagesAPIImageCountByState) 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 *ImagesAPIImageCountByState) 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 *ImagesAPIImageCountByState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImagesAPIImageCountByState) UnmarshalBinary(b []byte) error { + var res ImagesAPIImageCountByState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/images_api_image_issues_summary.go b/falcon/models/images_api_image_issues_summary.go new file mode 100644 index 00000000..4ca92e7c --- /dev/null +++ b/falcon/models/images_api_image_issues_summary.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" +) + +// ImagesAPIImageIssuesSummary images api image issues summary +// +// swagger:model images.apiImageIssuesSummary +type ImagesAPIImageIssuesSummary struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIImageIssuesSummary `json:"resources"` +} + +// Validate validates this images api image issues summary +func (m *ImagesAPIImageIssuesSummary) 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 *ImagesAPIImageIssuesSummary) 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 *ImagesAPIImageIssuesSummary) 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 *ImagesAPIImageIssuesSummary) 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 images api image issues summary based on the context it is used +func (m *ImagesAPIImageIssuesSummary) 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 *ImagesAPIImageIssuesSummary) 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 *ImagesAPIImageIssuesSummary) 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 *ImagesAPIImageIssuesSummary) 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 *ImagesAPIImageIssuesSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImagesAPIImageIssuesSummary) UnmarshalBinary(b []byte) error { + var res ImagesAPIImageIssuesSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/apidomain_initialize_response_wrapper_v1.go b/falcon/models/images_api_image_vulnerabilities_summary.go similarity index 63% rename from falcon/models/apidomain_initialize_response_wrapper_v1.go rename to falcon/models/images_api_image_vulnerabilities_summary.go index 16c4c868..98daa4d4 100644 --- a/falcon/models/apidomain_initialize_response_wrapper_v1.go +++ b/falcon/models/images_api_image_vulnerabilities_summary.go @@ -15,13 +15,12 @@ import ( "github.com/go-openapi/validate" ) -// ApidomainInitializeResponseWrapperV1 apidomain initialize response wrapper v1 +// ImagesAPIImageVulnerabilitiesSummary images api image vulnerabilities summary // -// swagger:model apidomain.InitializeResponseWrapperV1 -type ApidomainInitializeResponseWrapperV1 struct { +// swagger:model images.apiImageVulnerabilitiesSummary +type ImagesAPIImageVulnerabilitiesSummary struct { // errors - // Required: true Errors []*MsaAPIError `json:"errors"` // meta @@ -30,11 +29,11 @@ type ApidomainInitializeResponseWrapperV1 struct { // resources // Required: true - Resources *ApidomainInitializeResponseV1 `json:"resources"` + Resources []*ModelsAPIImageVulnerabilitiesSummary `json:"resources"` } -// Validate validates this apidomain initialize response wrapper v1 -func (m *ApidomainInitializeResponseWrapperV1) Validate(formats strfmt.Registry) error { +// Validate validates this images api image vulnerabilities summary +func (m *ImagesAPIImageVulnerabilitiesSummary) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,10 +54,9 @@ func (m *ApidomainInitializeResponseWrapperV1) Validate(formats strfmt.Registry) return nil } -func (m *ApidomainInitializeResponseWrapperV1) validateErrors(formats strfmt.Registry) error { - - if err := validate.Required("errors", "body", m.Errors); err != nil { - return err +func (m *ImagesAPIImageVulnerabilitiesSummary) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil } for i := 0; i < len(m.Errors); i++ { @@ -82,7 +80,7 @@ func (m *ApidomainInitializeResponseWrapperV1) validateErrors(formats strfmt.Reg return nil } -func (m *ApidomainInitializeResponseWrapperV1) validateMeta(formats strfmt.Registry) error { +func (m *ImagesAPIImageVulnerabilitiesSummary) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,28 +100,35 @@ func (m *ApidomainInitializeResponseWrapperV1) validateMeta(formats strfmt.Regis return nil } -func (m *ApidomainInitializeResponseWrapperV1) validateResources(formats strfmt.Registry) error { +func (m *ImagesAPIImageVulnerabilitiesSummary) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err } - if m.Resources != nil { - if err := m.Resources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } -// ContextValidate validate this apidomain initialize response wrapper v1 based on the context it is used -func (m *ApidomainInitializeResponseWrapperV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this images api image vulnerabilities summary based on the context it is used +func (m *ImagesAPIImageVulnerabilitiesSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -144,7 +149,7 @@ func (m *ApidomainInitializeResponseWrapperV1) ContextValidate(ctx context.Conte return nil } -func (m *ApidomainInitializeResponseWrapperV1) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *ImagesAPIImageVulnerabilitiesSummary) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -169,7 +174,7 @@ func (m *ApidomainInitializeResponseWrapperV1) contextValidateErrors(ctx context return nil } -func (m *ApidomainInitializeResponseWrapperV1) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *ImagesAPIImageVulnerabilitiesSummary) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -186,25 +191,33 @@ func (m *ApidomainInitializeResponseWrapperV1) contextValidateMeta(ctx context.C return nil } -func (m *ApidomainInitializeResponseWrapperV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *ImagesAPIImageVulnerabilitiesSummary) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { - if m.Resources != nil { + for i := 0; i < len(m.Resources); i++ { - if err := m.Resources.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } // MarshalBinary interface implementation -func (m *ApidomainInitializeResponseWrapperV1) MarshalBinary() ([]byte, error) { +func (m *ImagesAPIImageVulnerabilitiesSummary) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -212,8 +225,8 @@ func (m *ApidomainInitializeResponseWrapperV1) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *ApidomainInitializeResponseWrapperV1) UnmarshalBinary(b []byte) error { - var res ApidomainInitializeResponseWrapperV1 +func (m *ImagesAPIImageVulnerabilitiesSummary) UnmarshalBinary(b []byte) error { + var res ImagesAPIImageVulnerabilitiesSummary if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/internal_sensor_status.go b/falcon/models/internal_sensor_status.go index e83054af..457f9660 100644 --- a/falcon/models/internal_sensor_status.go +++ b/falcon/models/internal_sensor_status.go @@ -39,15 +39,33 @@ type InternalSensorStatus struct { // idp policy name IdpPolicyName string `json:"idp_policy_name,omitempty"` + // kerberos config + KerberosConfig string `json:"kerberos_config,omitempty"` + + // ldap config + LdapConfig string `json:"ldap_config,omitempty"` + + // ldaps config + LdapsConfig string `json:"ldaps_config,omitempty"` + // local ip LocalIP string `json:"local_ip,omitempty"` // machine domain MachineDomain string `json:"machine_domain,omitempty"` + // ntlm config + NtlmConfig string `json:"ntlm_config,omitempty"` + // os version OsVersion string `json:"os_version,omitempty"` + // rdp to dc config + RdpToDcConfig string `json:"rdp_to_dc_config,omitempty"` + + // smb to dc config + SmbToDcConfig string `json:"smb_to_dc_config,omitempty"` + // status Status string `json:"status,omitempty"` diff --git a/falcon/models/k8sassets_cluster_enrichment_data.go b/falcon/models/k8sassets_cluster_enrichment_data.go new file mode 100644 index 00000000..b6fd0403 --- /dev/null +++ b/falcon/models/k8sassets_cluster_enrichment_data.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" +) + +// K8sassetsClusterEnrichmentData k8sassets cluster enrichment data +// +// swagger:model k8sassets.ClusterEnrichmentData +type K8sassetsClusterEnrichmentData struct { + + // container count + // Required: true + ContainerCount *int64 `json:"container_count"` + + // node count + // Required: true + NodeCount *int64 `json:"node_count"` + + // pod count + // Required: true + PodCount *int64 `json:"pod_count"` +} + +// Validate validates this k8sassets cluster enrichment data +func (m *K8sassetsClusterEnrichmentData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContainerCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *K8sassetsClusterEnrichmentData) validateContainerCount(formats strfmt.Registry) error { + + if err := validate.Required("container_count", "body", m.ContainerCount); 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 { + return err + } + + return nil +} + +func (m *K8sassetsClusterEnrichmentData) validatePodCount(formats strfmt.Registry) error { + + if err := validate.Required("pod_count", "body", m.PodCount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this k8sassets cluster enrichment data based on context it is used +func (m *K8sassetsClusterEnrichmentData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *K8sassetsClusterEnrichmentData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsClusterEnrichmentData) UnmarshalBinary(b []byte) error { + var res K8sassetsClusterEnrichmentData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_cluster_enrichment_entry.go b/falcon/models/k8sassets_cluster_enrichment_entry.go new file mode 100644 index 00000000..4a3f9051 --- /dev/null +++ b/falcon/models/k8sassets_cluster_enrichment_entry.go @@ -0,0 +1,125 @@ +// 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" +) + +// K8sassetsClusterEnrichmentEntry k8sassets cluster enrichment entry +// +// swagger:model k8sassets.ClusterEnrichmentEntry +type K8sassetsClusterEnrichmentEntry struct { + + // cluster id + // Required: true + ClusterID *string `json:"cluster_id"` + + // enrichment data + // Required: true + EnrichmentData *K8sassetsClusterEnrichmentData `json:"enrichment_data"` +} + +// Validate validates this k8sassets cluster enrichment entry +func (m *K8sassetsClusterEnrichmentEntry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterID(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 *K8sassetsClusterEnrichmentEntry) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("cluster_id", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *K8sassetsClusterEnrichmentEntry) 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 cluster enrichment entry based on the context it is used +func (m *K8sassetsClusterEnrichmentEntry) 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 *K8sassetsClusterEnrichmentEntry) 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 *K8sassetsClusterEnrichmentEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsClusterEnrichmentEntry) UnmarshalBinary(b []byte) error { + var res K8sassetsClusterEnrichmentEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_cluster_enrichment_response.go b/falcon/models/k8sassets_cluster_enrichment_response.go new file mode 100644 index 00000000..2edec77e --- /dev/null +++ b/falcon/models/k8sassets_cluster_enrichment_response.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" +) + +// K8sassetsClusterEnrichmentResponse k8sassets cluster enrichment response +// +// swagger:model k8sassets.ClusterEnrichmentResponse +type K8sassetsClusterEnrichmentResponse struct { + + // enrichment data + // Required: true + EnrichmentData []*K8sassetsClusterEnrichmentEntry `json:"EnrichmentData"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this k8sassets cluster enrichment response +func (m *K8sassetsClusterEnrichmentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnrichmentData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *K8sassetsClusterEnrichmentResponse) 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 *K8sassetsClusterEnrichmentResponse) 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 *K8sassetsClusterEnrichmentResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this k8sassets cluster enrichment response based on the context it is used +func (m *K8sassetsClusterEnrichmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *K8sassetsClusterEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EnrichmentData); i++ { + + if m.EnrichmentData[i] != nil { + + if swag.IsZero(m.EnrichmentData[i]) { // not required + return nil + } + + 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 + } + } + + } + + return nil +} + +func (m *K8sassetsClusterEnrichmentResponse) 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 *K8sassetsClusterEnrichmentResponse) 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 *K8sassetsClusterEnrichmentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsClusterEnrichmentResponse) UnmarshalBinary(b []byte) error { + var res K8sassetsClusterEnrichmentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_container_enrichment_data.go b/falcon/models/k8sassets_container_enrichment_data.go new file mode 100644 index 00000000..c83e5e80 --- /dev/null +++ b/falcon/models/k8sassets_container_enrichment_data.go @@ -0,0 +1,118 @@ +// 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 new file mode 100644 index 00000000..151471aa --- /dev/null +++ b/falcon/models/k8sassets_container_enrichment_data_agents.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" +) + +// 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 new file mode 100644 index 00000000..decd703b --- /dev/null +++ b/falcon/models/k8sassets_container_enrichment_entry.go @@ -0,0 +1,125 @@ +// 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_container_enrichment_response.go b/falcon/models/k8sassets_container_enrichment_response.go new file mode 100644 index 00000000..60a63e69 --- /dev/null +++ b/falcon/models/k8sassets_container_enrichment_response.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" +) + +// K8sassetsContainerEnrichmentResponse k8sassets container enrichment response +// +// swagger:model k8sassets.ContainerEnrichmentResponse +type K8sassetsContainerEnrichmentResponse struct { + + // enrichment data + // Required: true + EnrichmentData []*K8sassetsContainerEnrichmentEntry `json:"EnrichmentData"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this k8sassets container enrichment response +func (m *K8sassetsContainerEnrichmentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnrichmentData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *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 { + 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 *K8sassetsContainerEnrichmentResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this 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 + + if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *K8sassetsContainerEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EnrichmentData); i++ { + + if m.EnrichmentData[i] != nil { + + if swag.IsZero(m.EnrichmentData[i]) { // not required + return nil + } + + 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 + } + } + + } + + return nil +} + +func (m *K8sassetsContainerEnrichmentResponse) 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 *K8sassetsContainerEnrichmentResponse) 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 *K8sassetsContainerEnrichmentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsContainerEnrichmentResponse) UnmarshalBinary(b []byte) error { + var res K8sassetsContainerEnrichmentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/humio_search_domain.go b/falcon/models/k8sassets_container_info.go similarity index 60% rename from falcon/models/humio_search_domain.go rename to falcon/models/k8sassets_container_info.go index 2aa68211..6aa78ee7 100644 --- a/falcon/models/humio_search_domain.go +++ b/falcon/models/k8sassets_container_info.go @@ -14,10 +14,10 @@ import ( "github.com/go-openapi/validate" ) -// HumioSearchDomain humio search domain +// K8sassetsContainerInfo k8sassets container info // -// swagger:model humio.SearchDomain -type HumioSearchDomain struct { +// swagger:model k8sassets.ContainerInfo +type K8sassetsContainerInfo struct { // id // Required: true @@ -28,8 +28,8 @@ type HumioSearchDomain struct { Name *string `json:"name"` } -// Validate validates this humio search domain -func (m *HumioSearchDomain) Validate(formats strfmt.Registry) error { +// Validate validates this k8sassets container info +func (m *K8sassetsContainerInfo) Validate(formats strfmt.Registry) error { var res []error if err := m.validateID(formats); err != nil { @@ -46,7 +46,7 @@ func (m *HumioSearchDomain) Validate(formats strfmt.Registry) error { return nil } -func (m *HumioSearchDomain) validateID(formats strfmt.Registry) error { +func (m *K8sassetsContainerInfo) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { return err @@ -55,7 +55,7 @@ func (m *HumioSearchDomain) validateID(formats strfmt.Registry) error { return nil } -func (m *HumioSearchDomain) validateName(formats strfmt.Registry) error { +func (m *K8sassetsContainerInfo) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -64,13 +64,13 @@ func (m *HumioSearchDomain) validateName(formats strfmt.Registry) error { return nil } -// ContextValidate validates this humio search domain based on context it is used -func (m *HumioSearchDomain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this k8sassets container info based on context it is used +func (m *K8sassetsContainerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *HumioSearchDomain) MarshalBinary() ([]byte, error) { +func (m *K8sassetsContainerInfo) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -78,8 +78,8 @@ func (m *HumioSearchDomain) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HumioSearchDomain) UnmarshalBinary(b []byte) error { - var res HumioSearchDomain +func (m *K8sassetsContainerInfo) UnmarshalBinary(b []byte) error { + var res K8sassetsContainerInfo if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/k8sassets_deployment_enrichment_data.go b/falcon/models/k8sassets_deployment_enrichment_data.go new file mode 100644 index 00000000..c8183322 --- /dev/null +++ b/falcon/models/k8sassets_deployment_enrichment_data.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" +) + +// 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 new file mode 100644 index 00000000..a84b9feb --- /dev/null +++ b/falcon/models/k8sassets_deployment_enrichment_entry.go @@ -0,0 +1,125 @@ +// 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_deployment_enrichment_response.go b/falcon/models/k8sassets_deployment_enrichment_response.go new file mode 100644 index 00000000..2d6f9bd1 --- /dev/null +++ b/falcon/models/k8sassets_deployment_enrichment_response.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" +) + +// K8sassetsDeploymentEnrichmentResponse k8sassets deployment enrichment response +// +// swagger:model k8sassets.DeploymentEnrichmentResponse +type K8sassetsDeploymentEnrichmentResponse struct { + + // enrichment data + // Required: true + EnrichmentData []*K8sassetsDeploymentEnrichmentEntry `json:"EnrichmentData"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this k8sassets deployment enrichment response +func (m *K8sassetsDeploymentEnrichmentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnrichmentData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *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 { + 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 *K8sassetsDeploymentEnrichmentResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this 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 + + if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *K8sassetsDeploymentEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EnrichmentData); i++ { + + if m.EnrichmentData[i] != nil { + + if swag.IsZero(m.EnrichmentData[i]) { // not required + return nil + } + + 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 + } + } + + } + + return nil +} + +func (m *K8sassetsDeploymentEnrichmentResponse) 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 *K8sassetsDeploymentEnrichmentResponse) 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 *K8sassetsDeploymentEnrichmentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsDeploymentEnrichmentResponse) UnmarshalBinary(b []byte) error { + var res K8sassetsDeploymentEnrichmentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_node_enrichment_data.go b/falcon/models/k8sassets_node_enrichment_data.go new file mode 100644 index 00000000..886bd618 --- /dev/null +++ b/falcon/models/k8sassets_node_enrichment_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" +) + +// K8sassetsNodeEnrichmentData k8sassets node enrichment data +// +// swagger:model k8sassets.NodeEnrichmentData +type K8sassetsNodeEnrichmentData struct { + + // container count + // Required: true + ContainerCount *int64 `json:"container_count"` + + // pod count + // Required: true + PodCount *int64 `json:"pod_count"` +} + +// Validate validates this k8sassets node enrichment data +func (m *K8sassetsNodeEnrichmentData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContainerCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *K8sassetsNodeEnrichmentData) validateContainerCount(formats strfmt.Registry) error { + + if err := validate.Required("container_count", "body", m.ContainerCount); err != nil { + return err + } + + return nil +} + +func (m *K8sassetsNodeEnrichmentData) validatePodCount(formats strfmt.Registry) error { + + if err := validate.Required("pod_count", "body", m.PodCount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this k8sassets node enrichment data based on context it is used +func (m *K8sassetsNodeEnrichmentData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *K8sassetsNodeEnrichmentData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsNodeEnrichmentData) UnmarshalBinary(b []byte) error { + var res K8sassetsNodeEnrichmentData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_node_enrichment_entry.go b/falcon/models/k8sassets_node_enrichment_entry.go new file mode 100644 index 00000000..a2a3f45f --- /dev/null +++ b/falcon/models/k8sassets_node_enrichment_entry.go @@ -0,0 +1,125 @@ +// 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" +) + +// K8sassetsNodeEnrichmentEntry k8sassets node enrichment entry +// +// swagger:model k8sassets.NodeEnrichmentEntry +type K8sassetsNodeEnrichmentEntry struct { + + // enrichment data + // Required: true + EnrichmentData *K8sassetsNodeEnrichmentData `json:"enrichment_data"` + + // node name + // Required: true + NodeName *string `json:"node_name"` +} + +// Validate validates this k8sassets node enrichment entry +func (m *K8sassetsNodeEnrichmentEntry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnrichmentData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *K8sassetsNodeEnrichmentEntry) 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 *K8sassetsNodeEnrichmentEntry) validateNodeName(formats strfmt.Registry) error { + + if err := validate.Required("node_name", "body", m.NodeName); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this k8sassets node enrichment entry based on the context it is used +func (m *K8sassetsNodeEnrichmentEntry) 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 *K8sassetsNodeEnrichmentEntry) 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 *K8sassetsNodeEnrichmentEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsNodeEnrichmentEntry) UnmarshalBinary(b []byte) error { + var res K8sassetsNodeEnrichmentEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sassets_node_enrichment_response.go b/falcon/models/k8sassets_node_enrichment_response.go new file mode 100644 index 00000000..8724bbdd --- /dev/null +++ b/falcon/models/k8sassets_node_enrichment_response.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" +) + +// K8sassetsNodeEnrichmentResponse k8sassets node enrichment response +// +// swagger:model k8sassets.NodeEnrichmentResponse +type K8sassetsNodeEnrichmentResponse struct { + + // enrichment data + // Required: true + EnrichmentData []*K8sassetsNodeEnrichmentEntry `json:"EnrichmentData"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this k8sassets node enrichment response +func (m *K8sassetsNodeEnrichmentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnrichmentData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *K8sassetsNodeEnrichmentResponse) 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 *K8sassetsNodeEnrichmentResponse) 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 *K8sassetsNodeEnrichmentResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this k8sassets node enrichment response based on the context it is used +func (m *K8sassetsNodeEnrichmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *K8sassetsNodeEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EnrichmentData); i++ { + + if m.EnrichmentData[i] != nil { + + if swag.IsZero(m.EnrichmentData[i]) { // not required + return nil + } + + 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 + } + } + + } + + return nil +} + +func (m *K8sassetsNodeEnrichmentResponse) 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 *K8sassetsNodeEnrichmentResponse) 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 *K8sassetsNodeEnrichmentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsNodeEnrichmentResponse) UnmarshalBinary(b []byte) error { + var res K8sassetsNodeEnrichmentResponse + 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 new file mode 100644 index 00000000..920d7b4c --- /dev/null +++ b/falcon/models/k8sassets_pod_enrichment_data.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" +) + +// 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"` +} + +// 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 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 +} + +// 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 new file mode 100644 index 00000000..96875a3e --- /dev/null +++ b/falcon/models/k8sassets_pod_enrichment_entry.go @@ -0,0 +1,125 @@ +// 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/k8sassets_pod_enrichment_response.go b/falcon/models/k8sassets_pod_enrichment_response.go new file mode 100644 index 00000000..da3fd04a --- /dev/null +++ b/falcon/models/k8sassets_pod_enrichment_response.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" +) + +// K8sassetsPodEnrichmentResponse k8sassets pod enrichment response +// +// swagger:model k8sassets.PodEnrichmentResponse +type K8sassetsPodEnrichmentResponse struct { + + // enrichment data + // Required: true + EnrichmentData []*K8sassetsPodEnrichmentEntry `json:"EnrichmentData"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this k8sassets pod enrichment response +func (m *K8sassetsPodEnrichmentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnrichmentData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *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 { + 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 *K8sassetsPodEnrichmentResponse) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this 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 + + if err := m.contextValidateEnrichmentData(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *K8sassetsPodEnrichmentResponse) contextValidateEnrichmentData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.EnrichmentData); i++ { + + if m.EnrichmentData[i] != nil { + + if swag.IsZero(m.EnrichmentData[i]) { // not required + return nil + } + + 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 + } + } + + } + + return nil +} + +func (m *K8sassetsPodEnrichmentResponse) 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 *K8sassetsPodEnrichmentResponse) 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 *K8sassetsPodEnrichmentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8sassetsPodEnrichmentResponse) UnmarshalBinary(b []byte) error { + var res K8sassetsPodEnrichmentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sioms_kubernetes_i_o_m_count_value.go b/falcon/models/k8sioms_kubernetes_i_o_m_count_value.go new file mode 100644 index 00000000..a459f7dd --- /dev/null +++ b/falcon/models/k8sioms_kubernetes_i_o_m_count_value.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" +) + +// K8siomsKubernetesIOMCountValue k8sioms kubernetes i o m count value +// +// swagger:model k8sioms.kubernetesIOMCountValue +type K8siomsKubernetesIOMCountValue struct { + + // resources + // Required: true + Resources []*CommonCountAsResource `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this k8sioms kubernetes i o m count value +func (m *K8siomsKubernetesIOMCountValue) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *K8siomsKubernetesIOMCountValue) 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 +} + +func (m *K8siomsKubernetesIOMCountValue) 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 *K8siomsKubernetesIOMCountValue) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this k8sioms kubernetes i o m count value based on the context it is used +func (m *K8siomsKubernetesIOMCountValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *K8siomsKubernetesIOMCountValue) 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 +} + +func (m *K8siomsKubernetesIOMCountValue) 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 *K8siomsKubernetesIOMCountValue) 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 *K8siomsKubernetesIOMCountValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8siomsKubernetesIOMCountValue) UnmarshalBinary(b []byte) error { + var res K8siomsKubernetesIOMCountValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sioms_kubernetes_i_o_m_entity_response.go b/falcon/models/k8sioms_kubernetes_i_o_m_entity_response.go new file mode 100644 index 00000000..678d85b7 --- /dev/null +++ b/falcon/models/k8sioms_kubernetes_i_o_m_entity_response.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" +) + +// K8siomsKubernetesIOMEntityResponse k8sioms kubernetes i o m entity response +// +// swagger:model k8sioms.KubernetesIOMEntityResponse +type K8siomsKubernetesIOMEntityResponse struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIKubernetesIOM `json:"resources"` +} + +// Validate validates this k8sioms kubernetes i o m entity response +func (m *K8siomsKubernetesIOMEntityResponse) 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 *K8siomsKubernetesIOMEntityResponse) 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 *K8siomsKubernetesIOMEntityResponse) 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 *K8siomsKubernetesIOMEntityResponse) 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 k8sioms kubernetes i o m entity response based on the context it is used +func (m *K8siomsKubernetesIOMEntityResponse) 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 *K8siomsKubernetesIOMEntityResponse) 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 *K8siomsKubernetesIOMEntityResponse) 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 *K8siomsKubernetesIOMEntityResponse) 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 *K8siomsKubernetesIOMEntityResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8siomsKubernetesIOMEntityResponse) UnmarshalBinary(b []byte) error { + var res K8siomsKubernetesIOMEntityResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/k8sioms_kubernetes_i_o_m_field_value.go b/falcon/models/k8sioms_kubernetes_i_o_m_field_value.go new file mode 100644 index 00000000..58dd70f4 --- /dev/null +++ b/falcon/models/k8sioms_kubernetes_i_o_m_field_value.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" +) + +// K8siomsKubernetesIOMFieldValue k8sioms kubernetes i o m field value +// +// swagger:model k8sioms.kubernetesIOMFieldValue +type K8siomsKubernetesIOMFieldValue struct { + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this k8sioms kubernetes i o m field value +func (m *K8siomsKubernetesIOMFieldValue) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *K8siomsKubernetesIOMFieldValue) 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 +} + +func (m *K8siomsKubernetesIOMFieldValue) 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 *K8siomsKubernetesIOMFieldValue) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this k8sioms kubernetes i o m field value based on the context it is used +func (m *K8siomsKubernetesIOMFieldValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *K8siomsKubernetesIOMFieldValue) 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 +} + +func (m *K8siomsKubernetesIOMFieldValue) 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 *K8siomsKubernetesIOMFieldValue) 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 *K8siomsKubernetesIOMFieldValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *K8siomsKubernetesIOMFieldValue) UnmarshalBinary(b []byte) error { + var res K8siomsKubernetesIOMFieldValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/apidomain_validation_response_wrapper_v1.go b/falcon/models/models_aggregate_values_by_field_response.go similarity index 63% rename from falcon/models/apidomain_validation_response_wrapper_v1.go rename to falcon/models/models_aggregate_values_by_field_response.go index 38d2c0b1..e679cb7b 100644 --- a/falcon/models/apidomain_validation_response_wrapper_v1.go +++ b/falcon/models/models_aggregate_values_by_field_response.go @@ -15,13 +15,12 @@ import ( "github.com/go-openapi/validate" ) -// ApidomainValidationResponseWrapperV1 apidomain validation response wrapper v1 +// ModelsAggregateValuesByFieldResponse models aggregate values by field response // -// swagger:model apidomain.ValidationResponseWrapperV1 -type ApidomainValidationResponseWrapperV1 struct { +// swagger:model models.AggregateValuesByFieldResponse +type ModelsAggregateValuesByFieldResponse struct { // errors - // Required: true Errors []*MsaAPIError `json:"errors"` // meta @@ -30,11 +29,11 @@ type ApidomainValidationResponseWrapperV1 struct { // resources // Required: true - Resources *ApidomainValidationResponseV1 `json:"resources"` + Resources []*ModelsAPIFilterResponse `json:"resources"` } -// Validate validates this apidomain validation response wrapper v1 -func (m *ApidomainValidationResponseWrapperV1) Validate(formats strfmt.Registry) error { +// Validate validates this models aggregate values by field response +func (m *ModelsAggregateValuesByFieldResponse) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,10 +54,9 @@ func (m *ApidomainValidationResponseWrapperV1) Validate(formats strfmt.Registry) return nil } -func (m *ApidomainValidationResponseWrapperV1) validateErrors(formats strfmt.Registry) error { - - if err := validate.Required("errors", "body", m.Errors); err != nil { - return err +func (m *ModelsAggregateValuesByFieldResponse) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil } for i := 0; i < len(m.Errors); i++ { @@ -82,7 +80,7 @@ func (m *ApidomainValidationResponseWrapperV1) validateErrors(formats strfmt.Reg return nil } -func (m *ApidomainValidationResponseWrapperV1) validateMeta(formats strfmt.Registry) error { +func (m *ModelsAggregateValuesByFieldResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,28 +100,35 @@ func (m *ApidomainValidationResponseWrapperV1) validateMeta(formats strfmt.Regis return nil } -func (m *ApidomainValidationResponseWrapperV1) validateResources(formats strfmt.Registry) error { +func (m *ModelsAggregateValuesByFieldResponse) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err } - if m.Resources != nil { - if err := m.Resources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } -// ContextValidate validate this apidomain validation response wrapper v1 based on the context it is used -func (m *ApidomainValidationResponseWrapperV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this models aggregate values by field response based on the context it is used +func (m *ModelsAggregateValuesByFieldResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -144,7 +149,7 @@ func (m *ApidomainValidationResponseWrapperV1) ContextValidate(ctx context.Conte return nil } -func (m *ApidomainValidationResponseWrapperV1) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsAggregateValuesByFieldResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -169,7 +174,7 @@ func (m *ApidomainValidationResponseWrapperV1) contextValidateErrors(ctx context return nil } -func (m *ApidomainValidationResponseWrapperV1) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsAggregateValuesByFieldResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -186,25 +191,33 @@ func (m *ApidomainValidationResponseWrapperV1) contextValidateMeta(ctx context.C return nil } -func (m *ApidomainValidationResponseWrapperV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsAggregateValuesByFieldResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { - if m.Resources != nil { + for i := 0; i < len(m.Resources); i++ { - if err := m.Resources.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } // MarshalBinary interface implementation -func (m *ApidomainValidationResponseWrapperV1) MarshalBinary() ([]byte, error) { +func (m *ModelsAggregateValuesByFieldResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -212,8 +225,8 @@ func (m *ApidomainValidationResponseWrapperV1) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *ApidomainValidationResponseWrapperV1) UnmarshalBinary(b []byte) error { - var res ApidomainValidationResponseWrapperV1 +func (m *ModelsAggregateValuesByFieldResponse) UnmarshalBinary(b []byte) error { + var res ModelsAggregateValuesByFieldResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/models_api_assessment_detections.go b/falcon/models/models_api_assessment_detections.go new file mode 100644 index 00000000..c218fcd7 --- /dev/null +++ b/falcon/models/models_api_assessment_detections.go @@ -0,0 +1,360 @@ +// 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" +) + +// ModelsAPIAssessmentDetections models API assessment detections +// +// swagger:model models.APIAssessmentDetections +type ModelsAPIAssessmentDetections struct { + + // description + // Required: true + Description *string `json:"description"` + + // details + // Required: true + Details *string `json:"details"` + + // detection type + // Required: true + DetectionType *string `json:"detection_type"` + + // id + // Required: true + ID *string `json:"id"` + + // image architecture + // Required: true + ImageArchitecture *string `json:"image_architecture"` + + // image created at + // Required: true + ImageCreatedAt *string `json:"image_created_at"` + + // image digest + // Required: true + ImageDigest *string `json:"image_digest"` + + // image id + // Required: true + ImageID *string `json:"image_id"` + + // image registry + // Required: true + ImageRegistry *string `json:"image_registry"` + + // image repository + // Required: true + ImageRepository *string `json:"image_repository"` + + // image size + // Required: true + ImageSize *string `json:"image_size"` + + // image tag + // Required: true + ImageTag *string `json:"image_tag"` + + // name + // Required: true + Name *string `json:"name"` + + // os name + // Required: true + OsName *string `json:"os_name"` + + // os version + // Required: true + OsVersion *string `json:"os_version"` + + // remediation + // Required: true + Remediation *string `json:"remediation"` + + // severity + // Required: true + Severity *string `json:"severity"` + + // title + // Required: true + Title *string `json:"title"` +} + +// Validate validates this models API assessment detections +func (m *ModelsAPIAssessmentDetections) 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.validateDetectionType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageArchitecture(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageDigest(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageRegistry(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageRepository(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageSize(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOsName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOsVersion(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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateDetails(formats strfmt.Registry) error { + + if err := validate.Required("details", "body", m.Details); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateDetectionType(formats strfmt.Registry) error { + + if err := validate.Required("detection_type", "body", m.DetectionType); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageArchitecture(formats strfmt.Registry) error { + + if err := validate.Required("image_architecture", "body", m.ImageArchitecture); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("image_created_at", "body", m.ImageCreatedAt); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageDigest(formats strfmt.Registry) error { + + if err := validate.Required("image_digest", "body", m.ImageDigest); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageID(formats strfmt.Registry) error { + + if err := validate.Required("image_id", "body", m.ImageID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageRegistry(formats strfmt.Registry) error { + + if err := validate.Required("image_registry", "body", m.ImageRegistry); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageRepository(formats strfmt.Registry) error { + + if err := validate.Required("image_repository", "body", m.ImageRepository); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageSize(formats strfmt.Registry) error { + + if err := validate.Required("image_size", "body", m.ImageSize); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateImageTag(formats strfmt.Registry) error { + + if err := validate.Required("image_tag", "body", m.ImageTag); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateOsName(formats strfmt.Registry) error { + + if err := validate.Required("os_name", "body", m.OsName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateOsVersion(formats strfmt.Registry) error { + + if err := validate.Required("os_version", "body", m.OsVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateRemediation(formats strfmt.Registry) error { + + if err := validate.Required("remediation", "body", m.Remediation); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIAssessmentDetections) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API assessment detections based on context it is used +func (m *ModelsAPIAssessmentDetections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIAssessmentDetections) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIAssessmentDetections) UnmarshalBinary(b []byte) error { + var res ModelsAPIAssessmentDetections + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_combined_detections.go b/falcon/models/models_api_combined_detections.go new file mode 100644 index 00000000..8144bf73 --- /dev/null +++ b/falcon/models/models_api_combined_detections.go @@ -0,0 +1,258 @@ +// 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" +) + +// ModelsAPICombinedDetections models API combined detections +// +// swagger:model models.APICombinedDetections +type ModelsAPICombinedDetections struct { + + // cid + // Required: true + Cid *string `json:"cid"` + + // containers impacted + // Required: true + ContainersImpacted *int64 `json:"containers_impacted"` + + // description + // Required: true + Description *string `json:"description"` + + // details + // Required: true + Details []string `json:"details"` + + // detection id + // Required: true + DetectionID *string `json:"detection_id"` + + // detection name + // Required: true + DetectionName *string `json:"detection_name"` + + // detection severity + // Required: true + DetectionSeverity *string `json:"detection_severity"` + + // detection type + // Required: true + DetectionType *string `json:"detection_type"` + + // images impacted + // Required: true + ImagesImpacted *int64 `json:"images_impacted"` + + // last detected + // Required: true + LastDetected *string `json:"last_detected"` + + // remediation + // Required: true + Remediation *string `json:"remediation"` + + // title + // Required: true + Title *string `json:"title"` +} + +// Validate validates this models API combined detections +func (m *ModelsAPICombinedDetections) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainersImpacted(formats); err != nil { + res = append(res, err) + } + + 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.validateDetectionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImagesImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastDetected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediation(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 *ModelsAPICombinedDetections) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateContainersImpacted(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted", "body", m.ContainersImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateDetails(formats strfmt.Registry) error { + + if err := validate.Required("details", "body", m.Details); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateDetectionID(formats strfmt.Registry) error { + + if err := validate.Required("detection_id", "body", m.DetectionID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateDetectionName(formats strfmt.Registry) error { + + if err := validate.Required("detection_name", "body", m.DetectionName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateDetectionSeverity(formats strfmt.Registry) error { + + if err := validate.Required("detection_severity", "body", m.DetectionSeverity); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateDetectionType(formats strfmt.Registry) error { + + if err := validate.Required("detection_type", "body", m.DetectionType); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateImagesImpacted(formats strfmt.Registry) error { + + if err := validate.Required("images_impacted", "body", m.ImagesImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateLastDetected(formats strfmt.Registry) error { + + if err := validate.Required("last_detected", "body", m.LastDetected); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateRemediation(formats strfmt.Registry) error { + + if err := validate.Required("remediation", "body", m.Remediation); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICombinedDetections) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API combined detections based on context it is used +func (m *ModelsAPICombinedDetections) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPICombinedDetections) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPICombinedDetections) UnmarshalBinary(b []byte) error { + var res ModelsAPICombinedDetections + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_container_alert.go b/falcon/models/models_api_container_alert.go new file mode 100644 index 00000000..f343f3c8 --- /dev/null +++ b/falcon/models/models_api_container_alert.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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsAPIContainerAlert models API container alert +// +// swagger:model models.APIContainerAlert +type ModelsAPIContainerAlert struct { + + // containers impacted count + // Required: true + ContainersImpactedCount *string `json:"containers_impacted_count"` + + // containers impacted ids + // Required: true + ContainersImpactedIds []string `json:"containers_impacted_ids"` + + // detection description + // Required: true + DetectionDescription *string `json:"detection_description"` + + // detection event simple name + // Required: true + DetectionEventSimpleName *string `json:"detection_event_simple_name"` + + // detection name + // Required: true + DetectionName *string `json:"detection_name"` + + // first seen timestamp + // Required: true + FirstSeenTimestamp *string `json:"first_seen_timestamp"` + + // last seen timestamp + // Required: true + LastSeenTimestamp *string `json:"last_seen_timestamp"` + + // severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this models API container alert +func (m *ModelsAPIContainerAlert) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContainersImpactedCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainersImpactedIds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionEventSimpleName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeenTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeenTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIContainerAlert) validateContainersImpactedCount(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted_count", "body", m.ContainersImpactedCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIContainerAlert) validateContainersImpactedIds(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted_ids", "body", m.ContainersImpactedIds); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIContainerAlert) validateDetectionDescription(formats strfmt.Registry) error { + + if err := validate.Required("detection_description", "body", m.DetectionDescription); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIContainerAlert) validateDetectionEventSimpleName(formats strfmt.Registry) error { + + if err := validate.Required("detection_event_simple_name", "body", m.DetectionEventSimpleName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIContainerAlert) validateDetectionName(formats strfmt.Registry) error { + + if err := validate.Required("detection_name", "body", m.DetectionName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIContainerAlert) validateFirstSeenTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("first_seen_timestamp", "body", m.FirstSeenTimestamp); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIContainerAlert) validateLastSeenTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("last_seen_timestamp", "body", m.LastSeenTimestamp); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIContainerAlert) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API container alert based on context it is used +func (m *ModelsAPIContainerAlert) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIContainerAlert) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIContainerAlert) UnmarshalBinary(b []byte) error { + var res ModelsAPIContainerAlert + 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 new file mode 100644 index 00000000..ce7bdd01 --- /dev/null +++ b/falcon/models/models_api_customer_and_image.go @@ -0,0 +1,382 @@ +// 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" +) + +// ModelsAPICustomerAndImage models API customer and image +// +// swagger:model models.APICustomerAndImage +type ModelsAPICustomerAndImage struct { + + // base os + // Required: true + BaseOs *string `json:"base_os"` + + // base os version + // Required: true + BaseOsVersion *string `json:"base_os_version"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // config + Config *ModelsLightWeightConfig `json:"config,omitempty"` + + // created at + // Required: true + CreatedAt *string `json:"created_at"` + + // crowdstrike user + // Required: true + CrowdstrikeUser *string `json:"crowdstrike_user"` + + // digest + // Required: true + Digest *string `json:"digest"` + + // eol date + // Required: true + EolDate *string `json:"eol_date"` + + // first scanned + // Required: true + FirstScanned *string `json:"first_scanned"` + + // image id + // Required: true + ImageID *string `json:"image_id"` + + // image scanning active + // Required: true + ImageScanningActive *bool `json:"image_scanning_active"` + + // image size + // Required: true + ImageSize *int64 `json:"image_size"` + + // registry + // Required: true + Registry *string `json:"registry"` + + // repository + // Required: true + Repository *string `json:"repository"` + + // tag + // Required: true + Tag *string `json:"tag"` + + // updated at + // Required: true + UpdatedAt *string `json:"updated_at"` + + // uuid + // Required: true + UUID *string `json:"uuid"` +} + +// Validate validates this models API customer and image +func (m *ModelsAPICustomerAndImage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBaseOs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBaseOsVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrowdstrikeUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDigest(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEolDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstScanned(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageScanningActive(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageSize(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistry(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRepository(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUUID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPICustomerAndImage) validateBaseOs(formats strfmt.Registry) error { + + if err := validate.Required("base_os", "body", m.BaseOs); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateBaseOsVersion(formats strfmt.Registry) error { + + if err := validate.Required("base_os_version", "body", m.BaseOsVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateConfig(formats strfmt.Registry) error { + if swag.IsZero(m.Config) { // not required + return nil + } + + if m.Config != nil { + if err := m.Config.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("config") + } + return err + } + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateCrowdstrikeUser(formats strfmt.Registry) error { + + if err := validate.Required("crowdstrike_user", "body", m.CrowdstrikeUser); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateDigest(formats strfmt.Registry) error { + + if err := validate.Required("digest", "body", m.Digest); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateEolDate(formats strfmt.Registry) error { + + if err := validate.Required("eol_date", "body", m.EolDate); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateFirstScanned(formats strfmt.Registry) error { + + if err := validate.Required("first_scanned", "body", m.FirstScanned); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateImageID(formats strfmt.Registry) error { + + if err := validate.Required("image_id", "body", m.ImageID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateImageScanningActive(formats strfmt.Registry) error { + + if err := validate.Required("image_scanning_active", "body", m.ImageScanningActive); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateImageSize(formats strfmt.Registry) error { + + if err := validate.Required("image_size", "body", m.ImageSize); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateRegistry(formats strfmt.Registry) error { + + if err := validate.Required("registry", "body", m.Registry); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateRepository(formats strfmt.Registry) error { + + if err := validate.Required("repository", "body", m.Repository); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateTag(formats strfmt.Registry) error { + + if err := validate.Required("tag", "body", m.Tag); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPICustomerAndImage) validateUUID(formats strfmt.Registry) error { + + if err := validate.Required("uuid", "body", m.UUID); 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 + + if err := m.contextValidateConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPICustomerAndImage) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.Config != nil { + + if swag.IsZero(m.Config) { // not required + return nil + } + + if err := m.Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPICustomerAndImage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPICustomerAndImage) UnmarshalBinary(b []byte) error { + var res ModelsAPICustomerAndImage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_detection_count.go b/falcon/models/models_api_detection_count.go new file mode 100644 index 00000000..69d2161f --- /dev/null +++ b/falcon/models/models_api_detection_count.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" +) + +// ModelsAPIDetectionCount models API detection count +// +// swagger:model models.APIDetectionCount +type ModelsAPIDetectionCount struct { + + // count + // Required: true + Count *int64 `json:"count"` +} + +// Validate validates this models API detection count +func (m *ModelsAPIDetectionCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIDetectionCount) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API detection count based on context it is used +func (m *ModelsAPIDetectionCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIDetectionCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIDetectionCount) UnmarshalBinary(b []byte) error { + var res ModelsAPIDetectionCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_detection_count_by_type.go b/falcon/models/models_api_detection_count_by_type.go new file mode 100644 index 00000000..e3a77a1b --- /dev/null +++ b/falcon/models/models_api_detection_count_by_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" +) + +// ModelsAPIDetectionCountByType models API detection count by type +// +// swagger:model models.APIDetectionCountByType +type ModelsAPIDetectionCountByType struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // type + // Required: true + Type *string `json:"type"` +} + +// Validate validates this models API detection count by type +func (m *ModelsAPIDetectionCountByType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(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 *ModelsAPIDetectionCountByType) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDetectionCountByType) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API detection count by type based on context it is used +func (m *ModelsAPIDetectionCountByType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIDetectionCountByType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIDetectionCountByType) UnmarshalBinary(b []byte) error { + var res ModelsAPIDetectionCountByType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_drift_indicators.go b/falcon/models/models_api_drift_indicators.go new file mode 100644 index 00000000..b598c328 --- /dev/null +++ b/falcon/models/models_api_drift_indicators.go @@ -0,0 +1,479 @@ +// 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" +) + +// ModelsAPIDriftIndicators models API drift indicators +// +// swagger:model models.APIDriftIndicators +type ModelsAPIDriftIndicators struct { + + // agent id + // Required: true + AgentID *string `json:"agent_id"` + + // aid + // Required: true + Aid *string `json:"aid"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cloud name + // Required: true + CloudName *string `json:"cloud_name"` + + // command line + // Required: true + CommandLine *string `json:"command_line"` + + // computer name + // Required: true + ComputerName *string `json:"computer_name"` + + // container id + // Required: true + ContainerID *string `json:"container_id"` + + // detection description + // Required: true + DetectionDescription *string `json:"detection_description"` + + // detection id + // Required: true + DetectionID *string `json:"detection_id"` + + // detection name + // Required: true + DetectionName *string `json:"detection_name"` + + // file name + // Required: true + FileName *string `json:"file_name"` + + // host id + // Required: true + HostID *string `json:"host_id"` + + // indicator process id + // Required: true + IndicatorProcessID *string `json:"indicator_process_id"` + + // namespace + // Required: true + Namespace *string `json:"namespace"` + + // occurred at + // Required: true + OccurredAt *string `json:"occurred_at"` + + // parent process id + // Required: true + ParentProcessID *string `json:"parent_process_id"` + + // pod id + // Required: true + PodID *string `json:"pod_id"` + + // pod name + // Required: true + PodName *string `json:"pod_name"` + + // prevented + // Required: true + Prevented *bool `json:"prevented"` + + // prevention status + // Required: true + PreventionStatus []string `json:"prevention_status"` + + // prevention status string + // Required: true + PreventionStatusString *string `json:"prevention_status_string"` + + // scheduler name + // Required: true + SchedulerName *string `json:"scheduler_name"` + + // severity + // Required: true + Severity *string `json:"severity"` + + // sha256 + // Required: true + Sha256 *string `json:"sha256"` + + // timestamp + // Required: true + Timestamp *string `json:"timestamp"` +} + +// Validate validates this models API drift indicators +func (m *ModelsAPIDriftIndicators) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCommandLine(formats); err != nil { + res = append(res, err) + } + + if err := m.validateComputerName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFileName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHostID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIndicatorProcessID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNamespace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOccurredAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParentProcessID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrevented(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePreventionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePreventionStatusString(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSchedulerName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSha256(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestamp(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIDriftIndicators) validateAgentID(formats strfmt.Registry) error { + + if err := validate.Required("agent_id", "body", m.AgentID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateAid(formats strfmt.Registry) error { + + if err := validate.Required("aid", "body", m.Aid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateCloudName(formats strfmt.Registry) error { + + if err := validate.Required("cloud_name", "body", m.CloudName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateCommandLine(formats strfmt.Registry) error { + + if err := validate.Required("command_line", "body", m.CommandLine); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateComputerName(formats strfmt.Registry) error { + + if err := validate.Required("computer_name", "body", m.ComputerName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateContainerID(formats strfmt.Registry) error { + + if err := validate.Required("container_id", "body", m.ContainerID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateDetectionDescription(formats strfmt.Registry) error { + + if err := validate.Required("detection_description", "body", m.DetectionDescription); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateDetectionID(formats strfmt.Registry) error { + + if err := validate.Required("detection_id", "body", m.DetectionID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateDetectionName(formats strfmt.Registry) error { + + if err := validate.Required("detection_name", "body", m.DetectionName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateFileName(formats strfmt.Registry) error { + + if err := validate.Required("file_name", "body", m.FileName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateHostID(formats strfmt.Registry) error { + + if err := validate.Required("host_id", "body", m.HostID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateIndicatorProcessID(formats strfmt.Registry) error { + + if err := validate.Required("indicator_process_id", "body", m.IndicatorProcessID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateNamespace(formats strfmt.Registry) error { + + if err := validate.Required("namespace", "body", m.Namespace); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateOccurredAt(formats strfmt.Registry) error { + + if err := validate.Required("occurred_at", "body", m.OccurredAt); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateParentProcessID(formats strfmt.Registry) error { + + if err := validate.Required("parent_process_id", "body", m.ParentProcessID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validatePodID(formats strfmt.Registry) error { + + if err := validate.Required("pod_id", "body", m.PodID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validatePodName(formats strfmt.Registry) error { + + if err := validate.Required("pod_name", "body", m.PodName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validatePrevented(formats strfmt.Registry) error { + + if err := validate.Required("prevented", "body", m.Prevented); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validatePreventionStatus(formats strfmt.Registry) error { + + if err := validate.Required("prevention_status", "body", m.PreventionStatus); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validatePreventionStatusString(formats strfmt.Registry) error { + + if err := validate.Required("prevention_status_string", "body", m.PreventionStatusString); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateSchedulerName(formats strfmt.Registry) error { + + if err := validate.Required("scheduler_name", "body", m.SchedulerName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateSha256(formats strfmt.Registry) error { + + if err := validate.Required("sha256", "body", m.Sha256); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIDriftIndicators) validateTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("timestamp", "body", m.Timestamp); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API drift indicators based on context it is used +func (m *ModelsAPIDriftIndicators) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIDriftIndicators) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIDriftIndicators) UnmarshalBinary(b []byte) error { + var res ModelsAPIDriftIndicators + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_filter_label.go b/falcon/models/models_api_filter_label.go new file mode 100644 index 00000000..50587e80 --- /dev/null +++ b/falcon/models/models_api_filter_label.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" +) + +// ModelsAPIFilterLabel models API filter label +// +// swagger:model models.APIFilterLabel +type ModelsAPIFilterLabel struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // label + // Required: true + Label *string `json:"label"` +} + +// Validate validates this models API filter label +func (m *ModelsAPIFilterLabel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIFilterLabel) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIFilterLabel) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API filter label based on context it is used +func (m *ModelsAPIFilterLabel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIFilterLabel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIFilterLabel) UnmarshalBinary(b []byte) error { + var res ModelsAPIFilterLabel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_filter_response.go b/falcon/models/models_api_filter_response.go new file mode 100644 index 00000000..77bea9f9 --- /dev/null +++ b/falcon/models/models_api_filter_response.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" +) + +// ModelsAPIFilterResponse models API filter response +// +// swagger:model models.APIFilterResponse +type ModelsAPIFilterResponse struct { + + // buckets + // Required: true + Buckets []*ModelsAPIFilterLabel `json:"buckets"` + + // name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this models API filter response +func (m *ModelsAPIFilterResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuckets(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 *ModelsAPIFilterResponse) validateBuckets(formats strfmt.Registry) error { + + if err := validate.Required("buckets", "body", m.Buckets); err != nil { + return err + } + + for i := 0; i < len(m.Buckets); i++ { + if swag.IsZero(m.Buckets[i]) { // not required + continue + } + + if m.Buckets[i] != nil { + if err := m.Buckets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("buckets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("buckets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIFilterResponse) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models API filter response based on the context it is used +func (m *ModelsAPIFilterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBuckets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIFilterResponse) contextValidateBuckets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Buckets); i++ { + + if m.Buckets[i] != nil { + + if swag.IsZero(m.Buckets[i]) { // not required + return nil + } + + if err := m.Buckets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("buckets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("buckets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIFilterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIFilterResponse) UnmarshalBinary(b []byte) error { + var res ModelsAPIFilterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_image_assessment.go b/falcon/models/models_api_image_assessment.go new file mode 100644 index 00000000..6a696676 --- /dev/null +++ b/falcon/models/models_api_image_assessment.go @@ -0,0 +1,156 @@ +// 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" +) + +// ModelsAPIImageAssessment models API image assessment +// +// swagger:model models.APIImageAssessment +type ModelsAPIImageAssessment struct { + + // assessed + // Required: true + Assessed *int64 `json:"assessed"` + + // error image pull + // Required: true + ErrorImagePull *int64 `json:"error_image_pull"` + + // error image push + // Required: true + ErrorImagePush *int64 `json:"error_image_push"` + + // error missing config + // Required: true + ErrorMissingConfig *int64 `json:"error_missing_config"` + + // error unsupported schema version + // Required: true + ErrorUnsupportedSchemaVersion *int64 `json:"error_unsupported_schema_version"` + + // time stamp + // Required: true + TimeStamp *string `json:"time_stamp"` +} + +// Validate validates this models API image assessment +func (m *ModelsAPIImageAssessment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssessed(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrorImagePull(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrorImagePush(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrorMissingConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrorUnsupportedSchemaVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeStamp(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageAssessment) validateAssessed(formats strfmt.Registry) error { + + if err := validate.Required("assessed", "body", m.Assessed); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageAssessment) validateErrorImagePull(formats strfmt.Registry) error { + + if err := validate.Required("error_image_pull", "body", m.ErrorImagePull); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageAssessment) validateErrorImagePush(formats strfmt.Registry) error { + + if err := validate.Required("error_image_push", "body", m.ErrorImagePush); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageAssessment) validateErrorMissingConfig(formats strfmt.Registry) error { + + if err := validate.Required("error_missing_config", "body", m.ErrorMissingConfig); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageAssessment) validateErrorUnsupportedSchemaVersion(formats strfmt.Registry) error { + + if err := validate.Required("error_unsupported_schema_version", "body", m.ErrorUnsupportedSchemaVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageAssessment) validateTimeStamp(formats strfmt.Registry) error { + + if err := validate.Required("time_stamp", "body", m.TimeStamp); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API image assessment based on context it is used +func (m *ModelsAPIImageAssessment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIImageAssessment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIImageAssessment) UnmarshalBinary(b []byte) error { + var res ModelsAPIImageAssessment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_image_assessment_history.go b/falcon/models/models_api_image_assessment_history.go new file mode 100644 index 00000000..c6dcd088 --- /dev/null +++ b/falcon/models/models_api_image_assessment_history.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" +) + +// ModelsAPIImageAssessmentHistory models API image assessment history +// +// swagger:model models.APIImageAssessmentHistory +type ModelsAPIImageAssessmentHistory struct { + + // buckets + // Required: true + Buckets []*ModelsAPIImageAssessment `json:"buckets"` + + // name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this models API image assessment history +func (m *ModelsAPIImageAssessmentHistory) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBuckets(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 *ModelsAPIImageAssessmentHistory) validateBuckets(formats strfmt.Registry) error { + + if err := validate.Required("buckets", "body", m.Buckets); err != nil { + return err + } + + for i := 0; i < len(m.Buckets); i++ { + if swag.IsZero(m.Buckets[i]) { // not required + continue + } + + if m.Buckets[i] != nil { + if err := m.Buckets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("buckets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("buckets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageAssessmentHistory) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models API image assessment history based on the context it is used +func (m *ModelsAPIImageAssessmentHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBuckets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageAssessmentHistory) contextValidateBuckets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Buckets); i++ { + + if m.Buckets[i] != nil { + + if swag.IsZero(m.Buckets[i]) { // not required + return nil + } + + if err := m.Buckets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("buckets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("buckets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIImageAssessmentHistory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIImageAssessmentHistory) UnmarshalBinary(b []byte) error { + var res ModelsAPIImageAssessmentHistory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_image_by_vulnerability_count.go b/falcon/models/models_api_image_by_vulnerability_count.go new file mode 100644 index 00000000..48b35c68 --- /dev/null +++ b/falcon/models/models_api_image_by_vulnerability_count.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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsAPIImageByVulnerabilityCount models API image by vulnerability count +// +// swagger:model models.APIImageByVulnerabilityCount +type ModelsAPIImageByVulnerabilityCount struct { + + // image id + // Required: true + ImageID *string `json:"image_id"` + + // registry + // Required: true + Registry *string `json:"registry"` + + // repository + // Required: true + Repository *string `json:"repository"` + + // tag + // Required: true + Tag *string `json:"tag"` + + // vulnerability count + // Required: true + VulnerabilityCount *int32 `json:"vulnerability_count"` +} + +// Validate validates this models API image by vulnerability count +func (m *ModelsAPIImageByVulnerabilityCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImageID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistry(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRepository(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilityCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageByVulnerabilityCount) validateImageID(formats strfmt.Registry) error { + + if err := validate.Required("image_id", "body", m.ImageID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageByVulnerabilityCount) validateRegistry(formats strfmt.Registry) error { + + if err := validate.Required("registry", "body", m.Registry); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageByVulnerabilityCount) validateRepository(formats strfmt.Registry) error { + + if err := validate.Required("repository", "body", m.Repository); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageByVulnerabilityCount) validateTag(formats strfmt.Registry) error { + + if err := validate.Required("tag", "body", m.Tag); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageByVulnerabilityCount) validateVulnerabilityCount(formats strfmt.Registry) error { + + if err := validate.Required("vulnerability_count", "body", m.VulnerabilityCount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API image by vulnerability count based on context it is used +func (m *ModelsAPIImageByVulnerabilityCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIImageByVulnerabilityCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIImageByVulnerabilityCount) UnmarshalBinary(b []byte) error { + var res ModelsAPIImageByVulnerabilityCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_image_combined_export.go b/falcon/models/models_api_image_combined_export.go new file mode 100644 index 00000000..8f4780e4 --- /dev/null +++ b/falcon/models/models_api_image_combined_export.go @@ -0,0 +1,394 @@ +// 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" +) + +// ModelsAPIImageCombinedExport models API image combined export +// +// swagger:model models.APIImageCombinedExport +type ModelsAPIImageCombinedExport struct { + + // base os + // Required: true + BaseOs *string `json:"base_os"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cve id + // Required: true + CveID *string `json:"cve_id"` + + // cvss score + // Required: true + CvssScore *string `json:"cvss_score"` + + // detection name + // Required: true + DetectionName *string `json:"detection_name"` + + // detection severity + // Required: true + DetectionSeverity *string `json:"detection_severity"` + + // detection type + // Required: true + DetectionType *string `json:"detection_type"` + + // first seen + // Required: true + FirstSeen *string `json:"first_seen"` + + // image digest + // Required: true + ImageDigest *string `json:"image_digest"` + + // image id + // Required: true + ImageID *string `json:"image_id"` + + // last seen + // Required: true + LastSeen *string `json:"last_seen"` + + // packages impacted + // Required: true + PackagesImpacted *int32 `json:"packages_impacted"` + + // registry + // Required: true + Registry *string `json:"registry"` + + // repository + // Required: true + Repository *string `json:"repository"` + + // started containers + // Required: true + StartedContainers *int64 `json:"started_containers"` + + // stopped containers + // Required: true + StoppedContainers *int64 `json:"stopped_containers"` + + // tag + // Required: true + Tag *string `json:"tag"` + + // vulnerability cps rating + // Required: true + VulnerabilityCpsRating *string `json:"vulnerability_cps_rating"` + + // vulnerability description + // Required: true + VulnerabilityDescription *string `json:"vulnerability_description"` + + // vulnerability severity + // Required: true + VulnerabilitySeverity *string `json:"vulnerability_severity"` +} + +// Validate validates this models API image combined export +func (m *ModelsAPIImageCombinedExport) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBaseOs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageDigest(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackagesImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegistry(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRepository(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedContainers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStoppedContainers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilityCpsRating(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilityDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilitySeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateBaseOs(formats strfmt.Registry) error { + + if err := validate.Required("base_os", "body", m.BaseOs); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateCveID(formats strfmt.Registry) error { + + if err := validate.Required("cve_id", "body", m.CveID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateCvssScore(formats strfmt.Registry) error { + + if err := validate.Required("cvss_score", "body", m.CvssScore); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateDetectionName(formats strfmt.Registry) error { + + if err := validate.Required("detection_name", "body", m.DetectionName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateDetectionSeverity(formats strfmt.Registry) error { + + if err := validate.Required("detection_severity", "body", m.DetectionSeverity); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateDetectionType(formats strfmt.Registry) error { + + if err := validate.Required("detection_type", "body", m.DetectionType); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateFirstSeen(formats strfmt.Registry) error { + + if err := validate.Required("first_seen", "body", m.FirstSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateImageDigest(formats strfmt.Registry) error { + + if err := validate.Required("image_digest", "body", m.ImageDigest); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateImageID(formats strfmt.Registry) error { + + if err := validate.Required("image_id", "body", m.ImageID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validatePackagesImpacted(formats strfmt.Registry) error { + + if err := validate.Required("packages_impacted", "body", m.PackagesImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateRegistry(formats strfmt.Registry) error { + + if err := validate.Required("registry", "body", m.Registry); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateRepository(formats strfmt.Registry) error { + + if err := validate.Required("repository", "body", m.Repository); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateStartedContainers(formats strfmt.Registry) error { + + if err := validate.Required("started_containers", "body", m.StartedContainers); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateStoppedContainers(formats strfmt.Registry) error { + + if err := validate.Required("stopped_containers", "body", m.StoppedContainers); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateTag(formats strfmt.Registry) error { + + if err := validate.Required("tag", "body", m.Tag); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateVulnerabilityCpsRating(formats strfmt.Registry) error { + + if err := validate.Required("vulnerability_cps_rating", "body", m.VulnerabilityCpsRating); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateVulnerabilityDescription(formats strfmt.Registry) error { + + if err := validate.Required("vulnerability_description", "body", m.VulnerabilityDescription); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageCombinedExport) validateVulnerabilitySeverity(formats strfmt.Registry) error { + + if err := validate.Required("vulnerability_severity", "body", m.VulnerabilitySeverity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API image combined export based on context it is used +func (m *ModelsAPIImageCombinedExport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIImageCombinedExport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIImageCombinedExport) UnmarshalBinary(b []byte) error { + var res ModelsAPIImageCombinedExport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_image_count.go b/falcon/models/models_api_image_count.go new file mode 100644 index 00000000..dc61fdac --- /dev/null +++ b/falcon/models/models_api_image_count.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" +) + +// ModelsAPIImageCount models API image count +// +// swagger:model models.APIImageCount +type ModelsAPIImageCount struct { + + // count + // Required: true + Count *int64 `json:"count"` +} + +// Validate validates this models API image count +func (m *ModelsAPIImageCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageCount) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API image count based on context it is used +func (m *ModelsAPIImageCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIImageCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIImageCount) UnmarshalBinary(b []byte) error { + var res ModelsAPIImageCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_image_issues_summary.go b/falcon/models/models_api_image_issues_summary.go new file mode 100644 index 00000000..a150616c --- /dev/null +++ b/falcon/models/models_api_image_issues_summary.go @@ -0,0 +1,465 @@ +// 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" +) + +// ModelsAPIImageIssuesSummary models API image issues summary +// +// swagger:model models.APIImageIssuesSummary +type ModelsAPIImageIssuesSummary struct { + + // image container info + // Required: true + ImageContainerInfo *ModelsIssuesSummaryContainerInfo `json:"image_container_info"` + + // image detections + // Required: true + ImageDetections []*ModelsAPIDetectionCountByType `json:"image_detections"` + + // is dca run + // Required: true + IsDcaRun *bool `json:"is_dca_run"` + + // known issues + // Required: true + KnownIssues *int64 `json:"known_issues"` + + // packages info + // Required: true + PackagesInfo *ModelsImageSummaryPackagesInfo `json:"packages_info"` + + // policies summary + // Required: true + PoliciesSummary []*ModelsAPIPolicyCountByAction `json:"policies_summary"` + + // runtime detections + // Required: true + RuntimeDetections []*ModelsAPIFilterLabel `json:"runtime_detections"` + + // vulnerabilities summary + // Required: true + VulnerabilitiesSummary []*ModelsAPIVulnCountBySeverity `json:"vulnerabilities_summary"` + + // zero day impacted + // Required: true + ZeroDayImpacted *bool `json:"zero_day_impacted"` +} + +// Validate validates this models API image issues summary +func (m *ModelsAPIImageIssuesSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImageContainerInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageDetections(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsDcaRun(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKnownIssues(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackagesInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePoliciesSummary(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRuntimeDetections(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilitiesSummary(formats); err != nil { + res = append(res, err) + } + + if err := m.validateZeroDayImpacted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validateImageContainerInfo(formats strfmt.Registry) error { + + if err := validate.Required("image_container_info", "body", m.ImageContainerInfo); err != nil { + return err + } + + if m.ImageContainerInfo != nil { + if err := m.ImageContainerInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image_container_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image_container_info") + } + return err + } + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validateImageDetections(formats strfmt.Registry) error { + + if err := validate.Required("image_detections", "body", m.ImageDetections); err != nil { + return err + } + + for i := 0; i < len(m.ImageDetections); i++ { + if swag.IsZero(m.ImageDetections[i]) { // not required + continue + } + + if m.ImageDetections[i] != nil { + if err := m.ImageDetections[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image_detections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image_detections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validateIsDcaRun(formats strfmt.Registry) error { + + if err := validate.Required("is_dca_run", "body", m.IsDcaRun); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validateKnownIssues(formats strfmt.Registry) error { + + if err := validate.Required("known_issues", "body", m.KnownIssues); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validatePackagesInfo(formats strfmt.Registry) error { + + if err := validate.Required("packages_info", "body", m.PackagesInfo); err != nil { + return err + } + + if m.PackagesInfo != nil { + if err := m.PackagesInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("packages_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("packages_info") + } + return err + } + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validatePoliciesSummary(formats strfmt.Registry) error { + + if err := validate.Required("policies_summary", "body", m.PoliciesSummary); err != nil { + return err + } + + for i := 0; i < len(m.PoliciesSummary); i++ { + if swag.IsZero(m.PoliciesSummary[i]) { // not required + continue + } + + if m.PoliciesSummary[i] != nil { + if err := m.PoliciesSummary[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policies_summary" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policies_summary" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validateRuntimeDetections(formats strfmt.Registry) error { + + if err := validate.Required("runtime_detections", "body", m.RuntimeDetections); err != nil { + return err + } + + for i := 0; i < len(m.RuntimeDetections); i++ { + if swag.IsZero(m.RuntimeDetections[i]) { // not required + continue + } + + if m.RuntimeDetections[i] != nil { + if err := m.RuntimeDetections[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("runtime_detections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("runtime_detections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validateVulnerabilitiesSummary(formats strfmt.Registry) error { + + if err := validate.Required("vulnerabilities_summary", "body", m.VulnerabilitiesSummary); err != nil { + return err + } + + for i := 0; i < len(m.VulnerabilitiesSummary); i++ { + if swag.IsZero(m.VulnerabilitiesSummary[i]) { // not required + continue + } + + if m.VulnerabilitiesSummary[i] != nil { + if err := m.VulnerabilitiesSummary[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vulnerabilities_summary" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vulnerabilities_summary" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) validateZeroDayImpacted(formats strfmt.Registry) error { + + if err := validate.Required("zero_day_impacted", "body", m.ZeroDayImpacted); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models API image issues summary based on the context it is used +func (m *ModelsAPIImageIssuesSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImageContainerInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImageDetections(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePackagesInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePoliciesSummary(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRuntimeDetections(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVulnerabilitiesSummary(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageIssuesSummary) contextValidateImageContainerInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.ImageContainerInfo != nil { + + if err := m.ImageContainerInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image_container_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image_container_info") + } + return err + } + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) contextValidateImageDetections(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ImageDetections); i++ { + + if m.ImageDetections[i] != nil { + + if swag.IsZero(m.ImageDetections[i]) { // not required + return nil + } + + if err := m.ImageDetections[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image_detections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image_detections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) contextValidatePackagesInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.PackagesInfo != nil { + + if err := m.PackagesInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("packages_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("packages_info") + } + return err + } + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) contextValidatePoliciesSummary(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PoliciesSummary); i++ { + + if m.PoliciesSummary[i] != nil { + + if swag.IsZero(m.PoliciesSummary[i]) { // not required + return nil + } + + if err := m.PoliciesSummary[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("policies_summary" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("policies_summary" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) contextValidateRuntimeDetections(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.RuntimeDetections); i++ { + + if m.RuntimeDetections[i] != nil { + + if swag.IsZero(m.RuntimeDetections[i]) { // not required + return nil + } + + if err := m.RuntimeDetections[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("runtime_detections" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("runtime_detections" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageIssuesSummary) contextValidateVulnerabilitiesSummary(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VulnerabilitiesSummary); i++ { + + if m.VulnerabilitiesSummary[i] != nil { + + if swag.IsZero(m.VulnerabilitiesSummary[i]) { // not required + return nil + } + + if err := m.VulnerabilitiesSummary[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vulnerabilities_summary" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vulnerabilities_summary" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIImageIssuesSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIImageIssuesSummary) UnmarshalBinary(b []byte) error { + var res ModelsAPIImageIssuesSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_image_vulnerabilities_summary.go b/falcon/models/models_api_image_vulnerabilities_summary.go new file mode 100644 index 00000000..a4af387f --- /dev/null +++ b/falcon/models/models_api_image_vulnerabilities_summary.go @@ -0,0 +1,354 @@ +// 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" +) + +// ModelsAPIImageVulnerabilitiesSummary models API image vulnerabilities summary +// +// swagger:model models.APIImageVulnerabilitiesSummary +type ModelsAPIImageVulnerabilitiesSummary struct { + + // app packages with vulnerabilities + // Required: true + AppPackagesWithVulnerabilities *int32 `json:"app_packages_with_vulnerabilities"` + + // app vuln by severity + // Required: true + AppVulnBySeverity []*ModelsAPIVulnCountBySeverity `json:"app_vuln_by_severity"` + + // image vuln by severity + // Required: true + ImageVulnBySeverity []*ModelsAPIVulnCountBySeverity `json:"image_vuln_by_severity"` + + // layers with vulnerabilities + // Required: true + LayersWithVulnerabilities *int32 `json:"layers_with_vulnerabilities"` + + // os packages with vulnerabilities + // Required: true + OsPackagesWithVulnerabilities *int32 `json:"os_packages_with_vulnerabilities"` + + // os vuln by severity + // Required: true + OsVulnBySeverity []*ModelsAPIVulnCountBySeverity `json:"os_vuln_by_severity"` + + // total app packages + // Required: true + TotalAppPackages *int32 `json:"total_app_packages"` + + // total os packages + // Required: true + TotalOsPackages *int32 `json:"total_os_packages"` + + // total vulnerabilities + // Required: true + TotalVulnerabilities *int32 `json:"total_vulnerabilities"` +} + +// Validate validates this models API image vulnerabilities summary +func (m *ModelsAPIImageVulnerabilitiesSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppPackagesWithVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAppVulnBySeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageVulnBySeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLayersWithVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOsPackagesWithVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOsVulnBySeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalAppPackages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalOsPackages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateAppPackagesWithVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("app_packages_with_vulnerabilities", "body", m.AppPackagesWithVulnerabilities); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateAppVulnBySeverity(formats strfmt.Registry) error { + + if err := validate.Required("app_vuln_by_severity", "body", m.AppVulnBySeverity); err != nil { + return err + } + + for i := 0; i < len(m.AppVulnBySeverity); i++ { + if swag.IsZero(m.AppVulnBySeverity[i]) { // not required + continue + } + + if m.AppVulnBySeverity[i] != nil { + if err := m.AppVulnBySeverity[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("app_vuln_by_severity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("app_vuln_by_severity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateImageVulnBySeverity(formats strfmt.Registry) error { + + if err := validate.Required("image_vuln_by_severity", "body", m.ImageVulnBySeverity); err != nil { + return err + } + + for i := 0; i < len(m.ImageVulnBySeverity); i++ { + if swag.IsZero(m.ImageVulnBySeverity[i]) { // not required + continue + } + + if m.ImageVulnBySeverity[i] != nil { + if err := m.ImageVulnBySeverity[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image_vuln_by_severity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image_vuln_by_severity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateLayersWithVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("layers_with_vulnerabilities", "body", m.LayersWithVulnerabilities); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateOsPackagesWithVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("os_packages_with_vulnerabilities", "body", m.OsPackagesWithVulnerabilities); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateOsVulnBySeverity(formats strfmt.Registry) error { + + if err := validate.Required("os_vuln_by_severity", "body", m.OsVulnBySeverity); err != nil { + return err + } + + for i := 0; i < len(m.OsVulnBySeverity); i++ { + if swag.IsZero(m.OsVulnBySeverity[i]) { // not required + continue + } + + if m.OsVulnBySeverity[i] != nil { + if err := m.OsVulnBySeverity[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("os_vuln_by_severity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("os_vuln_by_severity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateTotalAppPackages(formats strfmt.Registry) error { + + if err := validate.Required("total_app_packages", "body", m.TotalAppPackages); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateTotalOsPackages(formats strfmt.Registry) error { + + if err := validate.Required("total_os_packages", "body", m.TotalOsPackages); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) validateTotalVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("total_vulnerabilities", "body", m.TotalVulnerabilities); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models API image vulnerabilities summary based on the context it is used +func (m *ModelsAPIImageVulnerabilitiesSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAppVulnBySeverity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImageVulnBySeverity(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOsVulnBySeverity(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) contextValidateAppVulnBySeverity(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AppVulnBySeverity); i++ { + + if m.AppVulnBySeverity[i] != nil { + + if swag.IsZero(m.AppVulnBySeverity[i]) { // not required + return nil + } + + if err := m.AppVulnBySeverity[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("app_vuln_by_severity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("app_vuln_by_severity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) contextValidateImageVulnBySeverity(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ImageVulnBySeverity); i++ { + + if m.ImageVulnBySeverity[i] != nil { + + if swag.IsZero(m.ImageVulnBySeverity[i]) { // not required + return nil + } + + if err := m.ImageVulnBySeverity[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image_vuln_by_severity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image_vuln_by_severity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIImageVulnerabilitiesSummary) contextValidateOsVulnBySeverity(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OsVulnBySeverity); i++ { + + if m.OsVulnBySeverity[i] != nil { + + if swag.IsZero(m.OsVulnBySeverity[i]) { // not required + return nil + } + + if err := m.OsVulnBySeverity[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("os_vuln_by_severity" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("os_vuln_by_severity" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIImageVulnerabilitiesSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIImageVulnerabilitiesSummary) UnmarshalBinary(b []byte) error { + var res ModelsAPIImageVulnerabilitiesSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_kubernetes_i_o_m.go b/falcon/models/models_api_kubernetes_i_o_m.go new file mode 100644 index 00000000..5e186ddb --- /dev/null +++ b/falcon/models/models_api_kubernetes_i_o_m.go @@ -0,0 +1,507 @@ +// 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" +) + +// ModelsAPIKubernetesIOM models API kubernetes i o m +// +// swagger:model models.APIKubernetesIOM +type ModelsAPIKubernetesIOM struct { + + // admission review action + AdmissionReviewAction string `json:"admission_review_action,omitempty"` + + // admission review id + AdmissionReviewID string `json:"admission_review_id,omitempty"` + + // admission review msg + AdmissionReviewMsg string `json:"admission_review_msg,omitempty"` + + // admission review operation + AdmissionReviewOperation string `json:"admission_review_operation,omitempty"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cis id + // Required: true + CisID []string `json:"cis_id"` + + // cluster id + // Required: true + ClusterID *string `json:"cluster_id"` + + // cluster name + // Required: true + ClusterName *string `json:"cluster_name"` + + // containers impacted count + // Required: true + ContainersImpactedCount *string `json:"containers_impacted_count"` + + // containers impacted ids + // Required: true + ContainersImpactedIds []string `json:"containers_impacted_ids"` + + // description + // Required: true + Description *string `json:"description"` + + // detect timestamp + // Required: true + DetectTimestamp *string `json:"detect_timestamp"` + + // detection id + // Required: true + DetectionID *string `json:"detection_id"` + + // detection name + // Required: true + DetectionName *string `json:"detection_name"` + + // detection type + // Required: true + DetectionType *string `json:"detection_type"` + + // last seen timestamp + LastSeenTimestamp string `json:"last_seen_timestamp,omitempty"` + + // mitigation id + MitigationID string `json:"mitigation_id,omitempty"` + + // mitigation name + MitigationName string `json:"mitigation_name,omitempty"` + + // namespace + // Required: true + Namespace *string `json:"namespace"` + + // nist id + NistID string `json:"nist_id,omitempty"` + + // pod label + PodLabel string `json:"pod_label,omitempty"` + + // pods impacted count + PodsImpactedCount string `json:"pods_impacted_count,omitempty"` + + // policy id + PolicyID string `json:"policy_id,omitempty"` + + // policy name + PolicyName string `json:"policy_name,omitempty"` + + // ports + Ports []string `json:"ports"` + + // prevented + // Required: true + Prevented *string `json:"prevented"` + + // remediation + // Required: true + Remediation *string `json:"remediation"` + + // resource creation timestamp + // Required: true + ResourceCreationTimestamp *string `json:"resource_creation_timestamp"` + + // resource group name + ResourceGroupName string `json:"resource_group_name,omitempty"` + + // resource id + // Required: true + ResourceID *string `json:"resource_id"` + + // resource name + // Required: true + ResourceName *string `json:"resource_name"` + + // resource type + // Required: true + ResourceType *string `json:"resource_type"` + + // sensitive env vars + // Required: true + SensitiveEnvVars []string `json:"sensitive_env_vars"` + + // service type + ServiceType string `json:"service_type,omitempty"` + + // severity + // Required: true + Severity *string `json:"severity"` + + // tactic id + // Required: true + TacticID *string `json:"tactic_id"` + + // tactic name + // Required: true + TacticName *string `json:"tactic_name"` + + // technique id + // Required: true + TechniqueID *string `json:"technique_id"` + + // technique name + // Required: true + TechniqueName *string `json:"technique_name"` +} + +// Validate validates this models API kubernetes i o m +func (m *ModelsAPIKubernetesIOM) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCisID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainersImpactedCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainersImpactedIds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNamespace(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrevented(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceCreationTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSensitiveEnvVars(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTacticID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTacticName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTechniqueID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTechniqueName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateCisID(formats strfmt.Registry) error { + + if err := validate.Required("cis_id", "body", m.CisID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("cluster_id", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("cluster_name", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateContainersImpactedCount(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted_count", "body", m.ContainersImpactedCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateContainersImpactedIds(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted_ids", "body", m.ContainersImpactedIds); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateDetectTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("detect_timestamp", "body", m.DetectTimestamp); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateDetectionID(formats strfmt.Registry) error { + + if err := validate.Required("detection_id", "body", m.DetectionID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateDetectionName(formats strfmt.Registry) error { + + if err := validate.Required("detection_name", "body", m.DetectionName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateDetectionType(formats strfmt.Registry) error { + + if err := validate.Required("detection_type", "body", m.DetectionType); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateNamespace(formats strfmt.Registry) error { + + if err := validate.Required("namespace", "body", m.Namespace); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validatePrevented(formats strfmt.Registry) error { + + if err := validate.Required("prevented", "body", m.Prevented); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateRemediation(formats strfmt.Registry) error { + + if err := validate.Required("remediation", "body", m.Remediation); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateResourceCreationTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("resource_creation_timestamp", "body", m.ResourceCreationTimestamp); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateResourceID(formats strfmt.Registry) error { + + if err := validate.Required("resource_id", "body", m.ResourceID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateResourceName(formats strfmt.Registry) error { + + if err := validate.Required("resource_name", "body", m.ResourceName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateResourceType(formats strfmt.Registry) error { + + if err := validate.Required("resource_type", "body", m.ResourceType); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateSensitiveEnvVars(formats strfmt.Registry) error { + + if err := validate.Required("sensitive_env_vars", "body", m.SensitiveEnvVars); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateTacticID(formats strfmt.Registry) error { + + if err := validate.Required("tactic_id", "body", m.TacticID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateTacticName(formats strfmt.Registry) error { + + if err := validate.Required("tactic_name", "body", m.TacticName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateTechniqueID(formats strfmt.Registry) error { + + if err := validate.Required("technique_id", "body", m.TechniqueID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIKubernetesIOM) validateTechniqueName(formats strfmt.Registry) error { + + if err := validate.Required("technique_name", "body", m.TechniqueName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API kubernetes i o m based on context it is used +func (m *ModelsAPIKubernetesIOM) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIKubernetesIOM) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIKubernetesIOM) UnmarshalBinary(b []byte) error { + var res ModelsAPIKubernetesIOM + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_package_combined.go b/falcon/models/models_api_package_combined.go new file mode 100644 index 00000000..669d67fc --- /dev/null +++ b/falcon/models/models_api_package_combined.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" +) + +// ModelsAPIPackageCombined models API package combined +// +// swagger:model models.APIPackageCombined +type ModelsAPIPackageCombined struct { + + // all images + // Required: true + AllImages *int64 `json:"all_images"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // license + // Required: true + License *string `json:"license"` + + // package name version + // Required: true + PackageNameVersion *string `json:"package_name_version"` + + // running images + // Required: true + RunningImages *int64 `json:"running_images"` + + // type + // Required: true + Type *string `json:"type"` + + // vulnerabilities + // Required: true + Vulnerabilities []*ModelsAPIPackageVulnerability `json:"vulnerabilities"` + + // vulnerability count + // Required: true + VulnerabilityCount *int32 `json:"vulnerability_count"` +} + +// Validate validates this models API package combined +func (m *ModelsAPIPackageCombined) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAllImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLicense(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageNameVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunningImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVulnerabilityCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIPackageCombined) validateAllImages(formats strfmt.Registry) error { + + if err := validate.Required("all_images", "body", m.AllImages); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageCombined) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageCombined) validateLicense(formats strfmt.Registry) error { + + if err := validate.Required("license", "body", m.License); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageCombined) validatePackageNameVersion(formats strfmt.Registry) error { + + if err := validate.Required("package_name_version", "body", m.PackageNameVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageCombined) validateRunningImages(formats strfmt.Registry) error { + + if err := validate.Required("running_images", "body", m.RunningImages); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageCombined) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageCombined) 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 *ModelsAPIPackageCombined) validateVulnerabilityCount(formats strfmt.Registry) error { + + if err := validate.Required("vulnerability_count", "body", m.VulnerabilityCount); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models API package combined based on the context it is used +func (m *ModelsAPIPackageCombined) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVulnerabilities(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIPackageCombined) 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 *ModelsAPIPackageCombined) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIPackageCombined) UnmarshalBinary(b []byte) error { + var res ModelsAPIPackageCombined + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_package_vulnerability.go b/falcon/models/models_api_package_vulnerability.go new file mode 100644 index 00000000..fd16a62e --- /dev/null +++ b/falcon/models/models_api_package_vulnerability.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" +) + +// ModelsAPIPackageVulnerability models API package vulnerability +// +// swagger:model models.APIPackageVulnerability +type ModelsAPIPackageVulnerability struct { + + // cveid + // Required: true + Cveid *string `json:"cveid"` + + // description + // Required: true + Description *string `json:"description"` + + // fix resolution + // Required: true + FixResolution []string `json:"fix_resolution"` + + // severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this models API package vulnerability +func (m *ModelsAPIPackageVulnerability) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCveid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFixResolution(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIPackageVulnerability) validateCveid(formats strfmt.Registry) error { + + if err := validate.Required("cveid", "body", m.Cveid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageVulnerability) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageVulnerability) validateFixResolution(formats strfmt.Registry) error { + + if err := validate.Required("fix_resolution", "body", m.FixResolution); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackageVulnerability) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API package vulnerability based on context it is used +func (m *ModelsAPIPackageVulnerability) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIPackageVulnerability) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIPackageVulnerability) UnmarshalBinary(b []byte) error { + var res ModelsAPIPackageVulnerability + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_packages_by_vuln_count.go b/falcon/models/models_api_packages_by_vuln_count.go new file mode 100644 index 00000000..a297496b --- /dev/null +++ b/falcon/models/models_api_packages_by_vuln_count.go @@ -0,0 +1,156 @@ +// 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" +) + +// ModelsAPIPackagesByVulnCount models API packages by vuln count +// +// swagger:model models.APIPackagesByVulnCount +type ModelsAPIPackagesByVulnCount struct { + + // images + // Required: true + Images *int64 `json:"images"` + + // package + // Required: true + Package *string `json:"package"` + + // packages type + // Required: true + PackagesType *string `json:"packages_type"` + + // running images + // Required: true + RunningImages *int64 `json:"running_images"` + + // version + // Required: true + Version *string `json:"version"` + + // vulnerabilities + // Required: true + Vulnerabilities *int32 `json:"vulnerabilities"` +} + +// Validate validates this models API packages by vuln count +func (m *ModelsAPIPackagesByVulnCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackage(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackagesType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunningImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(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 *ModelsAPIPackagesByVulnCount) validateImages(formats strfmt.Registry) error { + + if err := validate.Required("images", "body", m.Images); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackagesByVulnCount) validatePackage(formats strfmt.Registry) error { + + if err := validate.Required("package", "body", m.Package); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackagesByVulnCount) validatePackagesType(formats strfmt.Registry) error { + + if err := validate.Required("packages_type", "body", m.PackagesType); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackagesByVulnCount) validateRunningImages(formats strfmt.Registry) error { + + if err := validate.Required("running_images", "body", m.RunningImages); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackagesByVulnCount) validateVersion(formats strfmt.Registry) error { + + if err := validate.Required("version", "body", m.Version); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPackagesByVulnCount) validateVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("vulnerabilities", "body", m.Vulnerabilities); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API packages by vuln count based on context it is used +func (m *ModelsAPIPackagesByVulnCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIPackagesByVulnCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIPackagesByVulnCount) UnmarshalBinary(b []byte) error { + var res ModelsAPIPackagesByVulnCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_policy_count_by_action.go b/falcon/models/models_api_policy_count_by_action.go new file mode 100644 index 00000000..443ff5f9 --- /dev/null +++ b/falcon/models/models_api_policy_count_by_action.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" +) + +// ModelsAPIPolicyCountByAction models API policy count by action +// +// swagger:model models.APIPolicyCountByAction +type ModelsAPIPolicyCountByAction struct { + + // action + // Required: true + Action *string `json:"action"` + + // count + // Required: true + Count *int32 `json:"count"` +} + +// Validate validates this models API policy count by action +func (m *ModelsAPIPolicyCountByAction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIPolicyCountByAction) validateAction(formats strfmt.Registry) error { + + if err := validate.Required("action", "body", m.Action); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIPolicyCountByAction) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API policy count by action based on context it is used +func (m *ModelsAPIPolicyCountByAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIPolicyCountByAction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIPolicyCountByAction) UnmarshalBinary(b []byte) error { + var res ModelsAPIPolicyCountByAction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_unidentified_container.go b/falcon/models/models_api_unidentified_container.go new file mode 100644 index 00000000..19d8db09 --- /dev/null +++ b/falcon/models/models_api_unidentified_container.go @@ -0,0 +1,558 @@ +// 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" +) + +// ModelsAPIUnidentifiedContainer models API unidentified container +// +// swagger:model models.APIUnidentifiedContainer +type ModelsAPIUnidentifiedContainer struct { + + // assessed images + // Required: true + AssessedImages []*ModelsImageInformation `json:"assessed_images"` + + // assessed images count + // Required: true + AssessedImagesCount *string `json:"assessed_images_count"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cluster name + // Required: true + ClusterName *string `json:"cluster_name"` + + // containers impacted + // Required: true + ContainersImpacted []*ModelsContainerInformation `json:"containers_impacted"` + + // containers impacted count + // Required: true + ContainersImpactedCount *string `json:"containers_impacted_count"` + + // detect timestamp + // Required: true + DetectTimestamp *string `json:"detect_timestamp"` + + // detections count + // Required: true + DetectionsCount *string `json:"detections_count"` + + // first seen + // Required: true + FirstSeen *string `json:"first_seen"` + + // host id + // Required: true + HostID *string `json:"host_id"` + + // image assessment detections count + // Required: true + ImageAssessmentDetectionsCount *string `json:"image_assessment_detections_count"` + + // last seen + // Required: true + LastSeen *string `json:"last_seen"` + + // namespace + // Required: true + Namespace *string `json:"namespace"` + + // node name + // Required: true + NodeName *string `json:"node_name"` + + // pod id + // Required: true + PodID *string `json:"pod_id"` + + // pod name + // Required: true + PodName *string `json:"pod_name"` + + // runtime detections count + // Required: true + RuntimeDetectionsCount *string `json:"runtime_detections_count"` + + // severity + // Required: true + Severity *string `json:"severity"` + + // unassessed images + // Required: true + UnassessedImages []*ModelsImageInformation `json:"unassessed_images"` + + // unassessed images count + // Required: true + UnassessedImagesCount *string `json:"unassessed_images_count"` + + // visible to k8s + // Required: true + VisibleToK8s *string `json:"visible_to_k8s"` +} + +// Validate validates this models API unidentified container +func (m *ModelsAPIUnidentifiedContainer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssessedImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssessedImagesCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainersImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainersImpactedCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDetectionsCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHostID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageAssessmentDetectionsCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNamespace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRuntimeDetectionsCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnassessedImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnassessedImagesCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVisibleToK8s(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateAssessedImages(formats strfmt.Registry) error { + + if err := validate.Required("assessed_images", "body", m.AssessedImages); err != nil { + return err + } + + for i := 0; i < len(m.AssessedImages); i++ { + if swag.IsZero(m.AssessedImages[i]) { // not required + continue + } + + if m.AssessedImages[i] != nil { + if err := m.AssessedImages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assessed_images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assessed_images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateAssessedImagesCount(formats strfmt.Registry) error { + + if err := validate.Required("assessed_images_count", "body", m.AssessedImagesCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("cluster_name", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateContainersImpacted(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted", "body", m.ContainersImpacted); err != nil { + return err + } + + for i := 0; i < len(m.ContainersImpacted); i++ { + if swag.IsZero(m.ContainersImpacted[i]) { // not required + continue + } + + if m.ContainersImpacted[i] != nil { + if err := m.ContainersImpacted[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("containers_impacted" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("containers_impacted" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateContainersImpactedCount(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted_count", "body", m.ContainersImpactedCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateDetectTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("detect_timestamp", "body", m.DetectTimestamp); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateDetectionsCount(formats strfmt.Registry) error { + + if err := validate.Required("detections_count", "body", m.DetectionsCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateFirstSeen(formats strfmt.Registry) error { + + if err := validate.Required("first_seen", "body", m.FirstSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateHostID(formats strfmt.Registry) error { + + if err := validate.Required("host_id", "body", m.HostID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateImageAssessmentDetectionsCount(formats strfmt.Registry) error { + + if err := validate.Required("image_assessment_detections_count", "body", m.ImageAssessmentDetectionsCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateNamespace(formats strfmt.Registry) error { + + if err := validate.Required("namespace", "body", m.Namespace); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateNodeName(formats strfmt.Registry) error { + + if err := validate.Required("node_name", "body", m.NodeName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validatePodID(formats strfmt.Registry) error { + + if err := validate.Required("pod_id", "body", m.PodID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validatePodName(formats strfmt.Registry) error { + + if err := validate.Required("pod_name", "body", m.PodName); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateRuntimeDetectionsCount(formats strfmt.Registry) error { + + if err := validate.Required("runtime_detections_count", "body", m.RuntimeDetectionsCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateUnassessedImages(formats strfmt.Registry) error { + + if err := validate.Required("unassessed_images", "body", m.UnassessedImages); err != nil { + return err + } + + for i := 0; i < len(m.UnassessedImages); i++ { + if swag.IsZero(m.UnassessedImages[i]) { // not required + continue + } + + if m.UnassessedImages[i] != nil { + if err := m.UnassessedImages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("unassessed_images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("unassessed_images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateUnassessedImagesCount(formats strfmt.Registry) error { + + if err := validate.Required("unassessed_images_count", "body", m.UnassessedImagesCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) validateVisibleToK8s(formats strfmt.Registry) error { + + if err := validate.Required("visible_to_k8s", "body", m.VisibleToK8s); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models API unidentified container based on the context it is used +func (m *ModelsAPIUnidentifiedContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAssessedImages(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContainersImpacted(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUnassessedImages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) contextValidateAssessedImages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AssessedImages); i++ { + + if m.AssessedImages[i] != nil { + + if swag.IsZero(m.AssessedImages[i]) { // not required + return nil + } + + if err := m.AssessedImages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assessed_images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assessed_images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) contextValidateContainersImpacted(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ContainersImpacted); i++ { + + if m.ContainersImpacted[i] != nil { + + if swag.IsZero(m.ContainersImpacted[i]) { // not required + return nil + } + + if err := m.ContainersImpacted[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("containers_impacted" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("containers_impacted" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIUnidentifiedContainer) contextValidateUnassessedImages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.UnassessedImages); i++ { + + if m.UnassessedImages[i] != nil { + + if swag.IsZero(m.UnassessedImages[i]) { // not required + return nil + } + + if err := m.UnassessedImages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("unassessed_images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("unassessed_images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIUnidentifiedContainer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIUnidentifiedContainer) UnmarshalBinary(b []byte) error { + var res ModelsAPIUnidentifiedContainer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_vuln_by_image_count.go b/falcon/models/models_api_vuln_by_image_count.go new file mode 100644 index 00000000..abaaa4b6 --- /dev/null +++ b/falcon/models/models_api_vuln_by_image_count.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" +) + +// ModelsAPIVulnByImageCount models API vuln by image count +// +// swagger:model models.APIVulnByImageCount +type ModelsAPIVulnByImageCount struct { + + // cve id + // Required: true + CveID *string `json:"cve_id"` + + // images impacted + // Required: true + ImagesImpacted *int64 `json:"images_impacted"` + + // product + // Required: true + Product []string `json:"product"` + + // severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this models API vuln by image count +func (m *ModelsAPIVulnByImageCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImagesImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProduct(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIVulnByImageCount) validateCveID(formats strfmt.Registry) error { + + if err := validate.Required("cve_id", "body", m.CveID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByImageCount) validateImagesImpacted(formats strfmt.Registry) error { + + if err := validate.Required("images_impacted", "body", m.ImagesImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByImageCount) validateProduct(formats strfmt.Registry) error { + + if err := validate.Required("product", "body", m.Product); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByImageCount) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API vuln by image count based on context it is used +func (m *ModelsAPIVulnByImageCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIVulnByImageCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIVulnByImageCount) UnmarshalBinary(b []byte) error { + var res ModelsAPIVulnByImageCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_vuln_by_publication_date.go b/falcon/models/models_api_vuln_by_publication_date.go new file mode 100644 index 00000000..942e3ff7 --- /dev/null +++ b/falcon/models/models_api_vuln_by_publication_date.go @@ -0,0 +1,156 @@ +// 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" +) + +// ModelsAPIVulnByPublicationDate models API vuln by publication date +// +// swagger:model models.APIVulnByPublicationDate +type ModelsAPIVulnByPublicationDate struct { + + // containers impacted + // Required: true + ContainersImpacted *int64 `json:"containers_impacted"` + + // cve id + // Required: true + CveID *string `json:"cve_id"` + + // cvss score + // Required: true + CvssScore *float32 `json:"cvss_score"` + + // images impacted + // Required: true + ImagesImpacted *int64 `json:"images_impacted"` + + // published date + // Required: true + PublishedDate *string `json:"published_date"` + + // severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this models API vuln by publication date +func (m *ModelsAPIVulnByPublicationDate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContainersImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImagesImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePublishedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIVulnByPublicationDate) validateContainersImpacted(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted", "body", m.ContainersImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByPublicationDate) validateCveID(formats strfmt.Registry) error { + + if err := validate.Required("cve_id", "body", m.CveID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByPublicationDate) validateCvssScore(formats strfmt.Registry) error { + + if err := validate.Required("cvss_score", "body", m.CvssScore); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByPublicationDate) validateImagesImpacted(formats strfmt.Registry) error { + + if err := validate.Required("images_impacted", "body", m.ImagesImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByPublicationDate) validatePublishedDate(formats strfmt.Registry) error { + + if err := validate.Required("published_date", "body", m.PublishedDate); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnByPublicationDate) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API vuln by publication date based on context it is used +func (m *ModelsAPIVulnByPublicationDate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIVulnByPublicationDate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIVulnByPublicationDate) UnmarshalBinary(b []byte) error { + var res ModelsAPIVulnByPublicationDate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_vuln_count.go b/falcon/models/models_api_vuln_count.go new file mode 100644 index 00000000..40d6496d --- /dev/null +++ b/falcon/models/models_api_vuln_count.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" +) + +// ModelsAPIVulnCount models API vuln count +// +// swagger:model models.APIVulnCount +type ModelsAPIVulnCount struct { + + // count + // Required: true + Count *int64 `json:"count"` +} + +// Validate validates this models API vuln count +func (m *ModelsAPIVulnCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIVulnCount) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API vuln count based on context it is used +func (m *ModelsAPIVulnCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIVulnCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIVulnCount) UnmarshalBinary(b []byte) error { + var res ModelsAPIVulnCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_vuln_count_by_severity.go b/falcon/models/models_api_vuln_count_by_severity.go new file mode 100644 index 00000000..943e8ce5 --- /dev/null +++ b/falcon/models/models_api_vuln_count_by_severity.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" +) + +// ModelsAPIVulnCountBySeverity models API vuln count by severity +// +// swagger:model models.APIVulnCountBySeverity +type ModelsAPIVulnCountBySeverity struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this models API vuln count by severity +func (m *ModelsAPIVulnCountBySeverity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIVulnCountBySeverity) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnCountBySeverity) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API vuln count by severity based on context it is used +func (m *ModelsAPIVulnCountBySeverity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIVulnCountBySeverity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIVulnCountBySeverity) UnmarshalBinary(b []byte) error { + var res ModelsAPIVulnCountBySeverity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_vulnerability_combined.go b/falcon/models/models_api_vulnerability_combined.go new file mode 100644 index 00000000..055d4d42 --- /dev/null +++ b/falcon/models/models_api_vulnerability_combined.go @@ -0,0 +1,258 @@ +// 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" +) + +// ModelsAPIVulnerabilityCombined models API vulnerability combined +// +// swagger:model models.APIVulnerabilityCombined +type ModelsAPIVulnerabilityCombined struct { + + // containers impacted + // Required: true + ContainersImpacted *int64 `json:"containers_impacted"` + + // cps current rating + // Required: true + CpsCurrentRating *string `json:"cps_current_rating"` + + // cve id + // Required: true + CveID *string `json:"cve_id"` + + // cvss score + // Required: true + CvssScore *float32 `json:"cvss_score"` + + // description + // Required: true + Description *string `json:"description"` + + // exploit found + // Required: true + ExploitFound *bool `json:"exploit_found"` + + // exploited status + // Required: true + ExploitedStatus *int32 `json:"exploited_status"` + + // images impacted + // Required: true + ImagesImpacted *int64 `json:"images_impacted"` + + // packages impacted + // Required: true + PackagesImpacted *int64 `json:"packages_impacted"` + + // published date + // Required: true + PublishedDate *string `json:"published_date"` + + // remediation available + // Required: true + RemediationAvailable *bool `json:"remediation_available"` + + // severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this models API vulnerability combined +func (m *ModelsAPIVulnerabilityCombined) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContainersImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCpsCurrentRating(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploitFound(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploitedStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImagesImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackagesImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePublishedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediationAvailable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateContainersImpacted(formats strfmt.Registry) error { + + if err := validate.Required("containers_impacted", "body", m.ContainersImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateCpsCurrentRating(formats strfmt.Registry) error { + + if err := validate.Required("cps_current_rating", "body", m.CpsCurrentRating); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateCveID(formats strfmt.Registry) error { + + if err := validate.Required("cve_id", "body", m.CveID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateCvssScore(formats strfmt.Registry) error { + + if err := validate.Required("cvss_score", "body", m.CvssScore); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateExploitFound(formats strfmt.Registry) error { + + if err := validate.Required("exploit_found", "body", m.ExploitFound); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateExploitedStatus(formats strfmt.Registry) error { + + if err := validate.Required("exploited_status", "body", m.ExploitedStatus); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateImagesImpacted(formats strfmt.Registry) error { + + if err := validate.Required("images_impacted", "body", m.ImagesImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validatePackagesImpacted(formats strfmt.Registry) error { + + if err := validate.Required("packages_impacted", "body", m.PackagesImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validatePublishedDate(formats strfmt.Registry) error { + + if err := validate.Required("published_date", "body", m.PublishedDate); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateRemediationAvailable(formats strfmt.Registry) error { + + if err := validate.Required("remediation_available", "body", m.RemediationAvailable); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityCombined) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API vulnerability combined based on context it is used +func (m *ModelsAPIVulnerabilityCombined) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIVulnerabilityCombined) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIVulnerabilityCombined) UnmarshalBinary(b []byte) error { + var res ModelsAPIVulnerabilityCombined + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_vulnerability_details.go b/falcon/models/models_api_vulnerability_details.go new file mode 100644 index 00000000..ca169f69 --- /dev/null +++ b/falcon/models/models_api_vulnerability_details.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" +) + +// ModelsAPIVulnerabilityDetails models API vulnerability details +// +// swagger:model models.APIVulnerabilityDetails +type ModelsAPIVulnerabilityDetails struct { + + // cps current rating + // Required: true + CpsCurrentRating *string `json:"cps_current_rating"` + + // cve id + // Required: true + CveID *string `json:"cve_id"` + + // cvss score + // Required: true + CvssScore *string `json:"cvss_score"` + + // exploited status + // Required: true + ExploitedStatus *int32 `json:"exploited_status"` + + // layer command + // Required: true + LayerCommand *string `json:"layer_command"` + + // layer index + // Required: true + LayerIndex *int32 `json:"layer_index"` + + // package name version + // Required: true + PackageNameVersion *string `json:"package_name_version"` + + // package path + // Required: true + PackagePath *string `json:"package_path"` + + // remediation available + // Required: true + RemediationAvailable *bool `json:"remediation_available"` + + // severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this models API vulnerability details +func (m *ModelsAPIVulnerabilityDetails) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCpsCurrentRating(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploitedStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLayerCommand(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLayerIndex(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageNameVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackagePath(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemediationAvailable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateCpsCurrentRating(formats strfmt.Registry) error { + + if err := validate.Required("cps_current_rating", "body", m.CpsCurrentRating); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateCveID(formats strfmt.Registry) error { + + if err := validate.Required("cve_id", "body", m.CveID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateCvssScore(formats strfmt.Registry) error { + + if err := validate.Required("cvss_score", "body", m.CvssScore); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateExploitedStatus(formats strfmt.Registry) error { + + if err := validate.Required("exploited_status", "body", m.ExploitedStatus); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateLayerCommand(formats strfmt.Registry) error { + + if err := validate.Required("layer_command", "body", m.LayerCommand); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateLayerIndex(formats strfmt.Registry) error { + + if err := validate.Required("layer_index", "body", m.LayerIndex); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validatePackageNameVersion(formats strfmt.Registry) error { + + if err := validate.Required("package_name_version", "body", m.PackageNameVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validatePackagePath(formats strfmt.Registry) error { + + if err := validate.Required("package_path", "body", m.PackagePath); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateRemediationAvailable(formats strfmt.Registry) error { + + if err := validate.Required("remediation_available", "body", m.RemediationAvailable); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityDetails) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models API vulnerability details based on context it is used +func (m *ModelsAPIVulnerabilityDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIVulnerabilityDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIVulnerabilityDetails) UnmarshalBinary(b []byte) error { + var res ModelsAPIVulnerabilityDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_api_vulnerability_info.go b/falcon/models/models_api_vulnerability_info.go new file mode 100644 index 00000000..2a700763 --- /dev/null +++ b/falcon/models/models_api_vulnerability_info.go @@ -0,0 +1,294 @@ +// 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" +) + +// ModelsAPIVulnerabilityInfo models API vulnerability info +// +// swagger:model models.APIVulnerabilityInfo +type ModelsAPIVulnerabilityInfo struct { + + // cps current rating + // Required: true + CpsCurrentRating *string `json:"cps_current_rating"` + + // cve id + // Required: true + CveID *string `json:"cve_id"` + + // cvss score + // Required: true + CvssScore *string `json:"cvss_score"` + + // description + // Required: true + Description *string `json:"description"` + + // exploit found + // Required: true + ExploitFound *string `json:"exploit_found"` + + // exploited status string + // Required: true + ExploitedStatusString *string `json:"exploited_status_string"` + + // images impacted + // Required: true + ImagesImpacted *int64 `json:"images_impacted"` + + // packages + // Required: true + Packages []*ModelsPackageNameVersionType `json:"packages"` + + // published date + // Required: true + PublishedDate *string `json:"published_date"` + + // severity + // Required: true + Severity *string `json:"severity"` + + // threat actors + // Required: true + ThreatActors []string `json:"threat_actors"` +} + +// Validate validates this models API vulnerability info +func (m *ModelsAPIVulnerabilityInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCpsCurrentRating(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCvssScore(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploitFound(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExploitedStatusString(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImagesImpacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackages(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePublishedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(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 *ModelsAPIVulnerabilityInfo) validateCpsCurrentRating(formats strfmt.Registry) error { + + if err := validate.Required("cps_current_rating", "body", m.CpsCurrentRating); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateCveID(formats strfmt.Registry) error { + + if err := validate.Required("cve_id", "body", m.CveID); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateCvssScore(formats strfmt.Registry) error { + + if err := validate.Required("cvss_score", "body", m.CvssScore); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateExploitFound(formats strfmt.Registry) error { + + if err := validate.Required("exploit_found", "body", m.ExploitFound); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateExploitedStatusString(formats strfmt.Registry) error { + + if err := validate.Required("exploited_status_string", "body", m.ExploitedStatusString); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateImagesImpacted(formats strfmt.Registry) error { + + if err := validate.Required("images_impacted", "body", m.ImagesImpacted); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validatePackages(formats strfmt.Registry) error { + + if err := validate.Required("packages", "body", m.Packages); err != nil { + return err + } + + for i := 0; i < len(m.Packages); i++ { + if swag.IsZero(m.Packages[i]) { // not required + continue + } + + if m.Packages[i] != nil { + if err := m.Packages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("packages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("packages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validatePublishedDate(formats strfmt.Registry) error { + + if err := validate.Required("published_date", "body", m.PublishedDate); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) validateThreatActors(formats strfmt.Registry) error { + + if err := validate.Required("threat_actors", "body", m.ThreatActors); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models API vulnerability info based on the context it is used +func (m *ModelsAPIVulnerabilityInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePackages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsAPIVulnerabilityInfo) contextValidatePackages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Packages); i++ { + + if m.Packages[i] != nil { + + if swag.IsZero(m.Packages[i]) { // not required + return nil + } + + if err := m.Packages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("packages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("packages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsAPIVulnerabilityInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsAPIVulnerabilityInfo) UnmarshalBinary(b []byte) error { + var res ModelsAPIVulnerabilityInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_cluster.go b/falcon/models/models_cluster.go new file mode 100644 index 00000000..d71be6cc --- /dev/null +++ b/falcon/models/models_cluster.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" +) + +// ModelsCluster models cluster +// +// swagger:model models.Cluster +type ModelsCluster struct { + + // access + // Required: true + Access *string `json:"access"` + + // agent status + // Required: true + AgentStatus *string `json:"agent_status"` + + // agents + // Required: true + Agents []ModelsClusterAgents `json:"agents"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cloud account id + // Required: true + CloudAccountID *string `json:"cloud_account_id"` + + // cloud name + // Required: true + CloudName *string `json:"cloud_name"` + + // cloud region + // Required: true + CloudRegion *string `json:"cloud_region"` + + // cluster id + // Required: true + ClusterID *string `json:"cluster_id"` + + // cluster name + // Required: true + ClusterName *string `json:"cluster_name"` + + // cluster security group + // Required: true + ClusterSecurityGroup *string `json:"cluster_security_group"` + + // cluster status + // Required: true + ClusterStatus *string `json:"cluster_status"` + + // container count + // Required: true + ContainerCount *int32 `json:"container_count"` + + // first seen + // Required: true + FirstSeen *string `json:"first_seen"` + + // kubernetes version + // Required: true + KubernetesVersion *string `json:"kubernetes_version"` + + // labels list + // Required: true + LabelsList []string `json:"labels_list"` + + // last seen + // Required: true + LastSeen *string `json:"last_seen"` + + // management status + // Required: true + ManagementStatus *string `json:"management_status"` + + // node count + // Required: true + NodeCount *int32 `json:"node_count"` + + // pod count + // Required: true + PodCount *int32 `json:"pod_count"` + + // security group + // Required: true + SecurityGroup *string `json:"security_group"` + + // tags + // Required: true + Tags map[string]string `json:"tags"` + + // virtual network + // Required: true + VirtualNetwork *string `json:"virtual_network"` +} + +// Validate validates this models cluster +func (m *ModelsCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccess(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAgentStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudAccountID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudRegion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterSecurityGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKubernetesVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabelsList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateManagementStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecurityGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVirtualNetwork(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsCluster) validateAccess(formats strfmt.Registry) error { + + if err := validate.Required("access", "body", m.Access); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateAgentStatus(formats strfmt.Registry) error { + + if err := validate.Required("agent_status", "body", m.AgentStatus); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) 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 +} + +func (m *ModelsCluster) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateCloudAccountID(formats strfmt.Registry) error { + + if err := validate.Required("cloud_account_id", "body", m.CloudAccountID); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateCloudName(formats strfmt.Registry) error { + + if err := validate.Required("cloud_name", "body", m.CloudName); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateCloudRegion(formats strfmt.Registry) error { + + if err := validate.Required("cloud_region", "body", m.CloudRegion); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("cluster_id", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("cluster_name", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateClusterSecurityGroup(formats strfmt.Registry) error { + + if err := validate.Required("cluster_security_group", "body", m.ClusterSecurityGroup); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateClusterStatus(formats strfmt.Registry) error { + + if err := validate.Required("cluster_status", "body", m.ClusterStatus); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateContainerCount(formats strfmt.Registry) error { + + if err := validate.Required("container_count", "body", m.ContainerCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateFirstSeen(formats strfmt.Registry) error { + + if err := validate.Required("first_seen", "body", m.FirstSeen); 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 { + return err + } + + return nil +} + +func (m *ModelsCluster) validateLabelsList(formats strfmt.Registry) error { + + if err := validate.Required("labels_list", "body", m.LabelsList); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateManagementStatus(formats strfmt.Registry) error { + + if err := validate.Required("management_status", "body", m.ManagementStatus); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateNodeCount(formats strfmt.Registry) error { + + if err := validate.Required("node_count", "body", m.NodeCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validatePodCount(formats strfmt.Registry) error { + + if err := validate.Required("pod_count", "body", m.PodCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateSecurityGroup(formats strfmt.Registry) error { + + if err := validate.Required("security_group", "body", m.SecurityGroup); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateTags(formats strfmt.Registry) error { + + if err := validate.Required("tags", "body", m.Tags); err != nil { + return err + } + + return nil +} + +func (m *ModelsCluster) validateVirtualNetwork(formats strfmt.Registry) error { + + if err := validate.Required("virtual_network", "body", m.VirtualNetwork); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models cluster based on the context it is used +func (m *ModelsCluster) 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 *ModelsCluster) 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 *ModelsCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsCluster) UnmarshalBinary(b []byte) error { + var res ModelsCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_cluster_agents.go b/falcon/models/models_cluster_agents.go new file mode 100644 index 00000000..84e15ea8 --- /dev/null +++ b/falcon/models/models_cluster_agents.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" +) + +// ModelsClusterAgents models cluster agents +// +// swagger:model models.Cluster.agents +type ModelsClusterAgents map[string]string + +// Validate validates this models cluster agents +func (m ModelsClusterAgents) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this models cluster agents based on context it is used +func (m ModelsClusterAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/apidomain_data_ingest_response_wrapper_v1.go b/falcon/models/models_cluster_entity_response.go similarity index 59% rename from falcon/models/apidomain_data_ingest_response_wrapper_v1.go rename to falcon/models/models_cluster_entity_response.go index 6e538e96..5f7c3aa6 100644 --- a/falcon/models/apidomain_data_ingest_response_wrapper_v1.go +++ b/falcon/models/models_cluster_entity_response.go @@ -15,13 +15,12 @@ import ( "github.com/go-openapi/validate" ) -// ApidomainDataIngestResponseWrapperV1 apidomain data ingest response wrapper v1 +// ModelsClusterEntityResponse models cluster entity response // -// swagger:model apidomain.DataIngestResponseWrapperV1 -type ApidomainDataIngestResponseWrapperV1 struct { +// swagger:model models.ClusterEntityResponse +type ModelsClusterEntityResponse struct { // errors - // Required: true Errors []*MsaAPIError `json:"errors"` // meta @@ -30,11 +29,11 @@ type ApidomainDataIngestResponseWrapperV1 struct { // resources // Required: true - Resources *ApidomainDataIngestResponseV1 `json:"resources"` + Resources []*ModelsCluster `json:"resources"` } -// Validate validates this apidomain data ingest response wrapper v1 -func (m *ApidomainDataIngestResponseWrapperV1) Validate(formats strfmt.Registry) error { +// Validate validates this models cluster entity response +func (m *ModelsClusterEntityResponse) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,10 +54,9 @@ func (m *ApidomainDataIngestResponseWrapperV1) Validate(formats strfmt.Registry) return nil } -func (m *ApidomainDataIngestResponseWrapperV1) validateErrors(formats strfmt.Registry) error { - - if err := validate.Required("errors", "body", m.Errors); err != nil { - return err +func (m *ModelsClusterEntityResponse) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil } for i := 0; i < len(m.Errors); i++ { @@ -82,7 +80,7 @@ func (m *ApidomainDataIngestResponseWrapperV1) validateErrors(formats strfmt.Reg return nil } -func (m *ApidomainDataIngestResponseWrapperV1) validateMeta(formats strfmt.Registry) error { +func (m *ModelsClusterEntityResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,28 +100,35 @@ func (m *ApidomainDataIngestResponseWrapperV1) validateMeta(formats strfmt.Regis return nil } -func (m *ApidomainDataIngestResponseWrapperV1) validateResources(formats strfmt.Registry) error { +func (m *ModelsClusterEntityResponse) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err } - if m.Resources != nil { - if err := m.Resources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } -// ContextValidate validate this apidomain data ingest response wrapper v1 based on the context it is used -func (m *ApidomainDataIngestResponseWrapperV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this models cluster entity response based on the context it is used +func (m *ModelsClusterEntityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -144,7 +149,7 @@ func (m *ApidomainDataIngestResponseWrapperV1) ContextValidate(ctx context.Conte return nil } -func (m *ApidomainDataIngestResponseWrapperV1) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsClusterEntityResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -169,7 +174,7 @@ func (m *ApidomainDataIngestResponseWrapperV1) contextValidateErrors(ctx context return nil } -func (m *ApidomainDataIngestResponseWrapperV1) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsClusterEntityResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -186,25 +191,33 @@ func (m *ApidomainDataIngestResponseWrapperV1) contextValidateMeta(ctx context.C return nil } -func (m *ApidomainDataIngestResponseWrapperV1) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsClusterEntityResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { - if m.Resources != nil { + for i := 0; i < len(m.Resources); i++ { - if err := m.Resources.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } // MarshalBinary interface implementation -func (m *ApidomainDataIngestResponseWrapperV1) MarshalBinary() ([]byte, error) { +func (m *ModelsClusterEntityResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -212,8 +225,8 @@ func (m *ApidomainDataIngestResponseWrapperV1) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *ApidomainDataIngestResponseWrapperV1) UnmarshalBinary(b []byte) error { - var res ApidomainDataIngestResponseWrapperV1 +func (m *ModelsClusterEntityResponse) UnmarshalBinary(b []byte) error { + var res ModelsClusterEntityResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/models_container.go b/falcon/models/models_container.go new file mode 100644 index 00000000..4f218426 --- /dev/null +++ b/falcon/models/models_container.go @@ -0,0 +1,386 @@ +// 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" +) + +// ModelsContainer models container +// +// swagger:model models.Container +type ModelsContainer struct { + + // agents + Agents []ModelsContainerAgents `json:"agents"` + + // allow privilege escalation + AllowPrivilegeEscalation bool `json:"allow_privilege_escalation,omitempty"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cloud + Cloud string `json:"cloud,omitempty"` + + // cloud account id + CloudAccountID string `json:"cloud_account_id,omitempty"` + + // cloud region + CloudRegion string `json:"cloud_region,omitempty"` + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // cluster name + ClusterName string `json:"cluster_name,omitempty"` + + // config labels + ConfigLabels string `json:"config_labels,omitempty"` + + // config user + ConfigUser string `json:"config_user,omitempty"` + + // container image id + ContainerImageID string `json:"container_image_id,omitempty"` + + // created at + CreatedAt int64 `json:"created_at,omitempty"` + + // cve ids + CveIds []string `json:"cve_ids"` + + // first seen + FirstSeen int64 `json:"first_seen,omitempty"` + + // host config devices + HostConfigDevices string `json:"host_config_devices,omitempty"` + + // id + // Required: true + ID *string `json:"id"` + + // image application package count + ImageApplicationPackageCount int32 `json:"image_application_package_count,omitempty"` + + // image assessed at + ImageAssessedAt int64 `json:"image_assessed_at,omitempty"` + + // image detection count + ImageDetectionCount int32 `json:"image_detection_count,omitempty"` + + // image detection id list + ImageDetectionIDList []string `json:"image_detection_id_list"` + + // image detection name list + ImageDetectionNameList []string `json:"image_detection_name_list"` + + // image detection severity by type + ImageDetectionSeverityByType map[string]int64 `json:"image_detection_severity_by_type,omitempty"` + + // image digest + ImageDigest string `json:"image_digest,omitempty"` + + // image has been assessed + ImageHasBeenAssessed bool `json:"image_has_been_assessed,omitempty"` + + // image highest severity vulnerability + ImageHighestSeverityVulnerability string `json:"image_highest_severity_vulnerability,omitempty"` + + // image id + ImageID string `json:"image_id,omitempty"` + + // image package count + ImagePackageCount int32 `json:"image_package_count,omitempty"` + + // image registry + ImageRegistry string `json:"image_registry,omitempty"` + + // image repo + ImageRepo string `json:"image_repo,omitempty"` + + // image tag + ImageTag string `json:"image_tag,omitempty"` + + // image vulnerability count + ImageVulnerabilityCount int32 `json:"image_vulnerability_count,omitempty"` + + // image vulnerability severity by type + ImageVulnerabilitySeverityByType map[string]int64 `json:"image_vulnerability_severity_by_type,omitempty"` + + // insecure mount source + InsecureMountSource string `json:"insecure_mount_source,omitempty"` + + // insecure mount type + InsecureMountType string `json:"insecure_mount_type,omitempty"` + + // insecure propagation mode + InsecurePropagationMode bool `json:"insecure_propagation_mode,omitempty"` + + // interactive mode + InteractiveMode bool `json:"interactive_mode,omitempty"` + + // ipv4 + IPV4 string `json:"ipv4,omitempty"` + + // ipv6 + IPV6 string `json:"ipv6,omitempty"` + + // kpa coverage + KpaCoverage bool `json:"kpa_coverage,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // labels list + LabelsList []string `json:"labels_list"` + + // last seen + LastSeen int64 `json:"last_seen,omitempty"` + + // linux sensor aid + LinuxSensorAid string `json:"linux_sensor_aid,omitempty"` + + // linux sensor config build + LinuxSensorConfigBuild string `json:"linux_sensor_config_build,omitempty"` + + // linux sensor coverage + LinuxSensorCoverage bool `json:"linux_sensor_coverage,omitempty"` + + // lumos sensor aid + LumosSensorAid string `json:"lumos_sensor_aid,omitempty"` + + // lumos sensor config build + LumosSensorConfigBuild string `json:"lumos_sensor_config_build,omitempty"` + + // lumos sensor coverage + LumosSensorCoverage bool `json:"lumos_sensor_coverage,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // namespace + Namespace string `json:"namespace,omitempty"` + + // node id + NodeID string `json:"node_id,omitempty"` + + // node name + NodeName string `json:"node_name,omitempty"` + + // pod id + PodID string `json:"pod_id,omitempty"` + + // pod name + PodName string `json:"pod_name,omitempty"` + + // port list + PortList []ModelsContainerPortList `json:"port_list"` + + // privileged + Privileged bool `json:"privileged,omitempty"` + + // root write access + RootWriteAccess bool `json:"root_write_access,omitempty"` + + // rpd + Rpd []int64 `json:"rpd"` + + // run as root group + RunAsRootGroup bool `json:"run_as_root_group,omitempty"` + + // run as root user + RunAsRootUser bool `json:"run_as_root_user,omitempty"` + + // running status + RunningStatus bool `json:"running_status,omitempty"` + + // snapshot coverage + SnapshotCoverage bool `json:"snapshot_coverage,omitempty"` + + // unidentified + Unidentified bool `json:"unidentified,omitempty"` + + // volume mounts + VolumeMounts string `json:"volume_mounts,omitempty"` +} + +// Validate validates this models container +func (m *ModelsContainer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePortList(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsContainer) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + 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 +} + +func (m *ModelsContainer) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainer) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainer) validatePortList(formats strfmt.Registry) error { + if swag.IsZero(m.PortList) { // not required + return nil + } + + for i := 0; i < len(m.PortList); i++ { + + if m.PortList[i] != nil { + if err := m.PortList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("port_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("port_list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this models container based on the context it is used +func (m *ModelsContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePortList(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsContainer) 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 +} + +func (m *ModelsContainer) contextValidatePortList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PortList); i++ { + + if swag.IsZero(m.PortList[i]) { // not required + return nil + } + + if err := m.PortList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("port_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("port_list" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsContainer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainer) UnmarshalBinary(b []byte) error { + var res ModelsContainer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_container_agents.go b/falcon/models/models_container_agents.go new file mode 100644 index 00000000..a6be62f8 --- /dev/null +++ b/falcon/models/models_container_agents.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" +) + +// ModelsContainerAgents models container agents +// +// swagger:model models.Container.agents +type ModelsContainerAgents map[string]string + +// Validate validates this models container agents +func (m ModelsContainerAgents) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this models container agents based on context it is used +func (m ModelsContainerAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/models_container_coverage.go b/falcon/models/models_container_coverage.go new file mode 100644 index 00000000..cf74c0e5 --- /dev/null +++ b/falcon/models/models_container_coverage.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" +) + +// ModelsContainerCoverage models container coverage +// +// swagger:model models.ContainerCoverage +type ModelsContainerCoverage struct { + + // managed + // Required: true + Managed *int64 `json:"managed"` + + // unmanaged + // Required: true + Unmanaged *int64 `json:"unmanaged"` +} + +// Validate validates this models container coverage +func (m *ModelsContainerCoverage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateManaged(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnmanaged(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsContainerCoverage) validateManaged(formats strfmt.Registry) error { + + if err := validate.Required("managed", "body", m.Managed); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerCoverage) validateUnmanaged(formats strfmt.Registry) error { + + if err := validate.Required("unmanaged", "body", m.Unmanaged); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models container coverage based on context it is used +func (m *ModelsContainerCoverage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsContainerCoverage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainerCoverage) UnmarshalBinary(b []byte) error { + var res ModelsContainerCoverage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_container_coverage_response_entity.go b/falcon/models/models_container_coverage_response_entity.go new file mode 100644 index 00000000..f583b727 --- /dev/null +++ b/falcon/models/models_container_coverage_response_entity.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" +) + +// ModelsContainerCoverageResponseEntity models container coverage response entity +// +// swagger:model models.ContainerCoverageResponseEntity +type ModelsContainerCoverageResponseEntity struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsContainerCoverage `json:"resources"` +} + +// Validate validates this models container coverage response entity +func (m *ModelsContainerCoverageResponseEntity) 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 *ModelsContainerCoverageResponseEntity) 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 *ModelsContainerCoverageResponseEntity) 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 *ModelsContainerCoverageResponseEntity) 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 container coverage response entity based on the context it is used +func (m *ModelsContainerCoverageResponseEntity) 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 *ModelsContainerCoverageResponseEntity) 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 *ModelsContainerCoverageResponseEntity) 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 *ModelsContainerCoverageResponseEntity) 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 *ModelsContainerCoverageResponseEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainerCoverageResponseEntity) UnmarshalBinary(b []byte) error { + var res ModelsContainerCoverageResponseEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_container_entity_response.go b/falcon/models/models_container_entity_response.go new file mode 100644 index 00000000..c888f7f2 --- /dev/null +++ b/falcon/models/models_container_entity_response.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" +) + +// ModelsContainerEntityResponse models container entity response +// +// swagger:model models.ContainerEntityResponse +type ModelsContainerEntityResponse struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsContainer `json:"resources"` +} + +// Validate validates this models container entity response +func (m *ModelsContainerEntityResponse) 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 *ModelsContainerEntityResponse) 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 *ModelsContainerEntityResponse) 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 *ModelsContainerEntityResponse) 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 container entity response based on the context it is used +func (m *ModelsContainerEntityResponse) 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 *ModelsContainerEntityResponse) 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 *ModelsContainerEntityResponse) 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 *ModelsContainerEntityResponse) 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 *ModelsContainerEntityResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainerEntityResponse) UnmarshalBinary(b []byte) error { + var res ModelsContainerEntityResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_container_image.go b/falcon/models/models_container_image.go new file mode 100644 index 00000000..a5d7f4d0 --- /dev/null +++ b/falcon/models/models_container_image.go @@ -0,0 +1,326 @@ +// 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" +) + +// ModelsContainerImage models container image +// +// swagger:model models.ContainerImage +type ModelsContainerImage struct { + + // cid + // Required: true + Cid *string `json:"cid"` + + // container count + // Required: true + ContainerCount *int32 `json:"container_count"` + + // containers running status + // Required: true + ContainersRunningStatus map[string]bool `json:"containers_running_status"` + + // hosts + // Required: true + Hosts []string `json:"hosts"` + + // id + // Required: true + ID *string `json:"id"` + + // image detection count + // Required: true + ImageDetectionCount *int32 `json:"image_detection_count"` + + // image digest + // Required: true + ImageDigest *string `json:"image_digest"` + + // image has been assessed + // Required: true + ImageHasBeenAssessed *bool `json:"image_has_been_assessed"` + + // image id + // Required: true + ImageID *string `json:"image_id"` + + // image name + // Required: true + ImageName *string `json:"image_name"` + + // image registry + // Required: true + ImageRegistry *string `json:"image_registry"` + + // image repository + // Required: true + ImageRepository *string `json:"image_repository"` + + // image tag + // Required: true + ImageTag *string `json:"image_tag"` + + // image vulnerability count + // Required: true + ImageVulnerabilityCount *int32 `json:"image_vulnerability_count"` + + // last seen + // Required: true + LastSeen *string `json:"last_seen"` + + // running container count + // Required: true + RunningContainerCount *int32 `json:"running_container_count"` +} + +// Validate validates this models container image +func (m *ModelsContainerImage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainersRunningStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageDetectionCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageDigest(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageHasBeenAssessed(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageRegistry(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageRepository(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageVulnerabilityCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunningContainerCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsContainerImage) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); 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 { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateContainersRunningStatus(formats strfmt.Registry) error { + + if err := validate.Required("containers_running_status", "body", m.ContainersRunningStatus); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateHosts(formats strfmt.Registry) error { + + if err := validate.Required("hosts", "body", m.Hosts); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageDetectionCount(formats strfmt.Registry) error { + + if err := validate.Required("image_detection_count", "body", m.ImageDetectionCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageDigest(formats strfmt.Registry) error { + + if err := validate.Required("image_digest", "body", m.ImageDigest); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageHasBeenAssessed(formats strfmt.Registry) error { + + if err := validate.Required("image_has_been_assessed", "body", m.ImageHasBeenAssessed); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageID(formats strfmt.Registry) error { + + if err := validate.Required("image_id", "body", m.ImageID); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageName(formats strfmt.Registry) error { + + if err := validate.Required("image_name", "body", m.ImageName); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageRegistry(formats strfmt.Registry) error { + + if err := validate.Required("image_registry", "body", m.ImageRegistry); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageRepository(formats strfmt.Registry) error { + + if err := validate.Required("image_repository", "body", m.ImageRepository); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageTag(formats strfmt.Registry) error { + + if err := validate.Required("image_tag", "body", m.ImageTag); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateImageVulnerabilityCount(formats strfmt.Registry) error { + + if err := validate.Required("image_vulnerability_count", "body", m.ImageVulnerabilityCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerImage) validateRunningContainerCount(formats strfmt.Registry) error { + + if err := validate.Required("running_container_count", "body", m.RunningContainerCount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models container image based on context it is used +func (m *ModelsContainerImage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsContainerImage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainerImage) UnmarshalBinary(b []byte) error { + var res ModelsContainerImage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_container_information.go b/falcon/models/models_container_information.go new file mode 100644 index 00000000..3a21749a --- /dev/null +++ b/falcon/models/models_container_information.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" +) + +// ModelsContainerInformation models container information +// +// swagger:model models.ContainerInformation +type ModelsContainerInformation struct { + + // container detection count + // Required: true + ContainerDetectionCount *string `json:"container_detection_count"` + + // container id + // Required: true + ContainerID *string `json:"container_id"` +} + +// Validate validates this models container information +func (m *ModelsContainerInformation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContainerDetectionCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsContainerInformation) validateContainerDetectionCount(formats strfmt.Registry) error { + + if err := validate.Required("container_detection_count", "body", m.ContainerDetectionCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerInformation) validateContainerID(formats strfmt.Registry) error { + + if err := validate.Required("container_id", "body", m.ContainerID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models container information based on context it is used +func (m *ModelsContainerInformation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsContainerInformation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainerInformation) UnmarshalBinary(b []byte) error { + var res ModelsContainerInformation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_container_port_list.go b/falcon/models/models_container_port_list.go new file mode 100644 index 00000000..369ecf25 --- /dev/null +++ b/falcon/models/models_container_port_list.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" +) + +// ModelsContainerPortList models container port list +// +// swagger:model models.Container.port_list +type ModelsContainerPortList map[string]string + +// Validate validates this models container port list +func (m ModelsContainerPortList) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this models container port list based on context it is used +func (m ModelsContainerPortList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/models_container_runtime_pivot.go b/falcon/models/models_container_runtime_pivot.go new file mode 100644 index 00000000..43ba7ab3 --- /dev/null +++ b/falcon/models/models_container_runtime_pivot.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" +) + +// ModelsContainerRuntimePivot models container runtime pivot +// +// swagger:model models.ContainerRuntimePivot +type ModelsContainerRuntimePivot struct { + + // cid + // Required: true + Cid *string `json:"cid"` + + // cloud name + // Required: true + CloudName *string `json:"cloud_name"` + + // cluster name + // Required: true + ClusterName *string `json:"cluster_name"` + + // container runtime version + // Required: true + ContainerRuntimeVersion *string `json:"container_runtime_version"` + + // created at + // Required: true + CreatedAt *string `json:"created_at"` + + // first seen + // Required: true + FirstSeen *string `json:"first_seen"` + + // last seen + // Required: true + LastSeen *string `json:"last_seen"` + + // node name + // Required: true + NodeName *string `json:"node_name"` + + // pod name + // Required: true + PodName []string `json:"pod_name"` +} + +// Validate validates this models container runtime pivot +func (m *ModelsContainerRuntimePivot) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerRuntimeVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsContainerRuntimePivot) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validateCloudName(formats strfmt.Registry) error { + + if err := validate.Required("cloud_name", "body", m.CloudName); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("cluster_name", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validateContainerRuntimeVersion(formats strfmt.Registry) error { + + if err := validate.Required("container_runtime_version", "body", m.ContainerRuntimeVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validateFirstSeen(formats strfmt.Registry) error { + + if err := validate.Required("first_seen", "body", m.FirstSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validateNodeName(formats strfmt.Registry) error { + + if err := validate.Required("node_name", "body", m.NodeName); err != nil { + return err + } + + return nil +} + +func (m *ModelsContainerRuntimePivot) validatePodName(formats strfmt.Registry) error { + + if err := validate.Required("pod_name", "body", m.PodName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models container runtime pivot based on context it is used +func (m *ModelsContainerRuntimePivot) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsContainerRuntimePivot) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainerRuntimePivot) UnmarshalBinary(b []byte) error { + var res ModelsContainerRuntimePivot + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_container_runtime_pivot_response.go b/falcon/models/models_container_runtime_pivot_response.go new file mode 100644 index 00000000..83856276 --- /dev/null +++ b/falcon/models/models_container_runtime_pivot_response.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" +) + +// ModelsContainerRuntimePivotResponse models container runtime pivot response +// +// swagger:model models.ContainerRuntimePivotResponse +type ModelsContainerRuntimePivotResponse struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsContainerRuntimePivot `json:"resources"` +} + +// Validate validates this models container runtime pivot response +func (m *ModelsContainerRuntimePivotResponse) 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 *ModelsContainerRuntimePivotResponse) 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 *ModelsContainerRuntimePivotResponse) 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 *ModelsContainerRuntimePivotResponse) 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 container runtime pivot response based on the context it is used +func (m *ModelsContainerRuntimePivotResponse) 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 *ModelsContainerRuntimePivotResponse) 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 *ModelsContainerRuntimePivotResponse) 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 *ModelsContainerRuntimePivotResponse) 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 *ModelsContainerRuntimePivotResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsContainerRuntimePivotResponse) UnmarshalBinary(b []byte) error { + var res ModelsContainerRuntimePivotResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_deployment.go b/falcon/models/models_deployment.go new file mode 100644 index 00000000..e733964f --- /dev/null +++ b/falcon/models/models_deployment.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" +) + +// ModelsDeployment models deployment +// +// swagger:model models.Deployment +type ModelsDeployment 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"` + + // id + // Required: true + ID *string `json:"id"` + + // instance type + // Required: true + InstanceType *string `json:"instance_type"` + + // last updated timestamp + // Required: true + LastUpdatedTimestamp *string `json:"last_updated_timestamp"` + + // region + // Required: true + Region *string `json:"region"` + + // status + // Required: true + Status *string `json:"status"` + + // status detail + // Required: true + StatusDetail *string `json:"status_detail"` +} + +// Validate validates this models deployment +func (m *ModelsDeployment) 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.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdatedTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatusDetail(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsDeployment) validateAccountID(formats strfmt.Registry) error { + + if err := validate.Required("account_id", "body", m.AccountID); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateAssetIdentifier(formats strfmt.Registry) error { + + if err := validate.Required("asset_identifier", "body", m.AssetIdentifier); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateCloudProvider(formats strfmt.Registry) error { + + if err := validate.Required("cloud_provider", "body", m.CloudProvider); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateInstanceType(formats strfmt.Registry) error { + + if err := validate.Required("instance_type", "body", m.InstanceType); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateLastUpdatedTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("last_updated_timestamp", "body", m.LastUpdatedTimestamp); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateRegion(formats strfmt.Registry) error { + + if err := validate.Required("region", "body", m.Region); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *ModelsDeployment) validateStatusDetail(formats strfmt.Registry) error { + + if err := validate.Required("status_detail", "body", m.StatusDetail); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models deployment based on context it is used +func (m *ModelsDeployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsDeployment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsDeployment) UnmarshalBinary(b []byte) error { + var res ModelsDeployment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_deployment_entity_response.go b/falcon/models/models_deployment_entity_response.go new file mode 100644 index 00000000..9ad6ec8c --- /dev/null +++ b/falcon/models/models_deployment_entity_response.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" +) + +// ModelsDeploymentEntityResponse models deployment entity response +// +// swagger:model models.DeploymentEntityResponse +type ModelsDeploymentEntityResponse struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsDeployment `json:"resources"` +} + +// Validate validates this models deployment entity response +func (m *ModelsDeploymentEntityResponse) 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 *ModelsDeploymentEntityResponse) 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 *ModelsDeploymentEntityResponse) 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 *ModelsDeploymentEntityResponse) 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 deployment entity response based on the context it is used +func (m *ModelsDeploymentEntityResponse) 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 *ModelsDeploymentEntityResponse) 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 *ModelsDeploymentEntityResponse) 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 *ModelsDeploymentEntityResponse) 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 *ModelsDeploymentEntityResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsDeploymentEntityResponse) UnmarshalBinary(b []byte) error { + var res ModelsDeploymentEntityResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_image_information.go b/falcon/models/models_image_information.go new file mode 100644 index 00000000..41af68ba --- /dev/null +++ b/falcon/models/models_image_information.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" +) + +// ModelsImageInformation models image information +// +// swagger:model models.ImageInformation +type ModelsImageInformation struct { + + // image digest + // Required: true + ImageDigest *string `json:"image_digest"` + + // image id + // Required: true + ImageID *string `json:"image_id"` + + // image name + // Required: true + ImageName *string `json:"image_name"` +} + +// Validate validates this models image information +func (m *ModelsImageInformation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImageDigest(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImageName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsImageInformation) validateImageDigest(formats strfmt.Registry) error { + + if err := validate.Required("image_digest", "body", m.ImageDigest); err != nil { + return err + } + + return nil +} + +func (m *ModelsImageInformation) validateImageID(formats strfmt.Registry) error { + + if err := validate.Required("image_id", "body", m.ImageID); err != nil { + return err + } + + return nil +} + +func (m *ModelsImageInformation) validateImageName(formats strfmt.Registry) error { + + if err := validate.Required("image_name", "body", m.ImageName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models image information based on context it is used +func (m *ModelsImageInformation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsImageInformation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsImageInformation) UnmarshalBinary(b []byte) error { + var res ModelsImageInformation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_image_summary_packages_info.go b/falcon/models/models_image_summary_packages_info.go new file mode 100644 index 00000000..3c85c86e --- /dev/null +++ b/falcon/models/models_image_summary_packages_info.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" +) + +// ModelsImageSummaryPackagesInfo models image summary packages info +// +// swagger:model models.ImageSummaryPackagesInfo +type ModelsImageSummaryPackagesInfo struct { + + // count with vulnerabilities + // Required: true + CountWithVulnerabilities *int32 `json:"count_with_vulnerabilities"` + + // total count + // Required: true + TotalCount *int32 `json:"total_count"` +} + +// Validate validates this models image summary packages info +func (m *ModelsImageSummaryPackagesInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCountWithVulnerabilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsImageSummaryPackagesInfo) validateCountWithVulnerabilities(formats strfmt.Registry) error { + + if err := validate.Required("count_with_vulnerabilities", "body", m.CountWithVulnerabilities); err != nil { + return err + } + + return nil +} + +func (m *ModelsImageSummaryPackagesInfo) validateTotalCount(formats strfmt.Registry) error { + + if err := validate.Required("total_count", "body", m.TotalCount); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models image summary packages info based on context it is used +func (m *ModelsImageSummaryPackagesInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsImageSummaryPackagesInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsImageSummaryPackagesInfo) UnmarshalBinary(b []byte) error { + var res ModelsImageSummaryPackagesInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_issues_summary_container_info.go b/falcon/models/models_issues_summary_container_info.go new file mode 100644 index 00000000..91ed0eb8 --- /dev/null +++ b/falcon/models/models_issues_summary_container_info.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" +) + +// ModelsIssuesSummaryContainerInfo models issues summary container info +// +// swagger:model models.IssuesSummaryContainerInfo +type ModelsIssuesSummaryContainerInfo struct { + + // first seen + // Required: true + FirstSeen *int64 `json:"first_seen"` + + // last seen + // Required: true + LastSeen *int64 `json:"last_seen"` + + // running containers + // Required: true + RunningContainers *int64 `json:"running_containers"` +} + +// Validate validates this models issues summary container info +func (m *ModelsIssuesSummaryContainerInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunningContainers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsIssuesSummaryContainerInfo) validateFirstSeen(formats strfmt.Registry) error { + + if err := validate.Required("first_seen", "body", m.FirstSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsIssuesSummaryContainerInfo) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsIssuesSummaryContainerInfo) validateRunningContainers(formats strfmt.Registry) error { + + if err := validate.Required("running_containers", "body", m.RunningContainers); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models issues summary container info based on context it is used +func (m *ModelsIssuesSummaryContainerInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsIssuesSummaryContainerInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsIssuesSummaryContainerInfo) UnmarshalBinary(b []byte) error { + var res ModelsIssuesSummaryContainerInfo + 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 deleted file mode 100644 index 0249dbce..00000000 --- a/falcon/models/models_job_meta_data.go +++ /dev/null @@ -1,200 +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" -) - -// 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_light_weight_config.go b/falcon/models/models_light_weight_config.go new file mode 100644 index 00000000..e2916fe7 --- /dev/null +++ b/falcon/models/models_light_weight_config.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" +) + +// ModelsLightWeightConfig models light weight config +// +// swagger:model models.LightWeightConfig +type ModelsLightWeightConfig struct { + + // architecture + // Required: true + Architecture *string `json:"architecture"` + + // cmd + // Required: true + Cmd []string `json:"cmd"` + + // entry point + // Required: true + EntryPoint []string `json:"entry_point"` + + // env + // Required: true + Env []string `json:"env"` + + // exposed ports + // Required: true + ExposedPorts map[string]ModelsLightWeightConfigExposedPorts `json:"exposed_ports"` + + // labels + // Required: true + Labels map[string]string `json:"labels"` + + // user + // Required: true + User *string `json:"user"` + + // working dir + // Required: true + WorkingDir *string `json:"working_dir"` +} + +// Validate validates this models light weight config +func (m *ModelsLightWeightConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateArchitecture(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCmd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntryPoint(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnv(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExposedPorts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabels(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWorkingDir(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsLightWeightConfig) validateArchitecture(formats strfmt.Registry) error { + + if err := validate.Required("architecture", "body", m.Architecture); err != nil { + return err + } + + return nil +} + +func (m *ModelsLightWeightConfig) validateCmd(formats strfmt.Registry) error { + + if err := validate.Required("cmd", "body", m.Cmd); err != nil { + return err + } + + return nil +} + +func (m *ModelsLightWeightConfig) validateEntryPoint(formats strfmt.Registry) error { + + if err := validate.Required("entry_point", "body", m.EntryPoint); err != nil { + return err + } + + return nil +} + +func (m *ModelsLightWeightConfig) validateEnv(formats strfmt.Registry) error { + + if err := validate.Required("env", "body", m.Env); err != nil { + return err + } + + return nil +} + +func (m *ModelsLightWeightConfig) validateExposedPorts(formats strfmt.Registry) error { + + if err := validate.Required("exposed_ports", "body", m.ExposedPorts); err != nil { + return err + } + + for k := range m.ExposedPorts { + + if err := validate.Required("exposed_ports"+"."+k, "body", m.ExposedPorts[k]); err != nil { + return err + } + + } + + return nil +} + +func (m *ModelsLightWeightConfig) validateLabels(formats strfmt.Registry) error { + + if err := validate.Required("labels", "body", m.Labels); err != nil { + return err + } + + return nil +} + +func (m *ModelsLightWeightConfig) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + return nil +} + +func (m *ModelsLightWeightConfig) validateWorkingDir(formats strfmt.Registry) error { + + if err := validate.Required("working_dir", "body", m.WorkingDir); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models light weight config based on context it is used +func (m *ModelsLightWeightConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsLightWeightConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsLightWeightConfig) UnmarshalBinary(b []byte) error { + var res ModelsLightWeightConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_light_weight_config_exposed_ports.go b/falcon/models/models_light_weight_config_exposed_ports.go new file mode 100644 index 00000000..7b00fa19 --- /dev/null +++ b/falcon/models/models_light_weight_config_exposed_ports.go @@ -0,0 +1,11 @@ +// 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 + +// ModelsLightWeightConfigExposedPorts models light weight config exposed ports +// +// swagger:model models.LightWeightConfig.exposed_ports +type ModelsLightWeightConfigExposedPorts interface{} diff --git a/falcon/models/models_node.go b/falcon/models/models_node.go new file mode 100644 index 00000000..2ab3bd9e --- /dev/null +++ b/falcon/models/models_node.go @@ -0,0 +1,679 @@ +// 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" +) + +// ModelsNode models node +// +// swagger:model models.Node +type ModelsNode struct { + + // agents + // Required: true + Agents []ModelsNodeAgents `json:"agents"` + + // annotations list + // Required: true + AnnotationsList []string `json:"annotations_list"` + + // architecture + // Required: true + Architecture *string `json:"architecture"` + + // base image + // Required: true + BaseImage *string `json:"base_image"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cloud account id + // Required: true + CloudAccountID *string `json:"cloud_account_id"` + + // cloud instance id + // Required: true + CloudInstanceID *string `json:"cloud_instance_id"` + + // cloud instance type + // Required: true + CloudInstanceType *string `json:"cloud_instance_type"` + + // cloud name + // Required: true + CloudName *string `json:"cloud_name"` + + // cloud region + // Required: true + CloudRegion *string `json:"cloud_region"` + + // cluster id + // Required: true + ClusterID *string `json:"cluster_id"` + + // cluster name + // Required: true + ClusterName *string `json:"cluster_name"` + + // container count + // Required: true + ContainerCount *int32 `json:"container_count"` + + // container runtime version + // Required: true + ContainerRuntimeVersion *string `json:"container_runtime_version"` + + // cpu + // Required: true + CPU *string `json:"cpu"` + + // created at + // Required: true + CreatedAt *string `json:"created_at"` + + // external ip + // Required: true + ExternalIP *string `json:"external_ip"` + + // first seen + // Required: true + FirstSeen *string `json:"first_seen"` + + // ipv4 + // Required: true + IPV4 *string `json:"ipv4"` + + // ipv6 + // Required: true + IPV6 *string `json:"ipv6"` + + // kernel version + // Required: true + KernelVersion *string `json:"kernel_version"` + + // kubernetes version + // Required: true + KubernetesVersion *string `json:"kubernetes_version"` + + // labels + // Required: true + Labels map[string]string `json:"labels"` + + // labels list + // Required: true + LabelsList []string `json:"labels_list"` + + // last seen + // Required: true + LastSeen *string `json:"last_seen"` + + // memory + // Required: true + Memory *string `json:"memory"` + + // node id + // Required: true + NodeID *string `json:"node_id"` + + // node name + // Required: true + NodeName *string `json:"node_name"` + + // os + // Required: true + Os *string `json:"os"` + + // pod cidr + // Required: true + PodCidr *string `json:"pod_cidr"` + + // pod count + // Required: true + PodCount *int32 `json:"pod_count"` + + // provider id + // Required: true + ProviderID *string `json:"provider_id"` + + // storage + // Required: true + Storage *string `json:"storage"` + + // uid + // Required: true + UID *string `json:"uid"` +} + +// Validate validates this models node +func (m *ModelsNode) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAnnotationsList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateArchitecture(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBaseImage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudAccountID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudInstanceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudInstanceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudRegion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerRuntimeVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCPU(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalIP(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIPV4(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIPV6(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKernelVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKubernetesVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabels(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabelsList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOs(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodCidr(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProviderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsNode) 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 +} + +func (m *ModelsNode) validateAnnotationsList(formats strfmt.Registry) error { + + if err := validate.Required("annotations_list", "body", m.AnnotationsList); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateArchitecture(formats strfmt.Registry) error { + + if err := validate.Required("architecture", "body", m.Architecture); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateBaseImage(formats strfmt.Registry) error { + + if err := validate.Required("base_image", "body", m.BaseImage); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCloudAccountID(formats strfmt.Registry) error { + + if err := validate.Required("cloud_account_id", "body", m.CloudAccountID); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCloudInstanceID(formats strfmt.Registry) error { + + if err := validate.Required("cloud_instance_id", "body", m.CloudInstanceID); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCloudInstanceType(formats strfmt.Registry) error { + + if err := validate.Required("cloud_instance_type", "body", m.CloudInstanceType); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCloudName(formats strfmt.Registry) error { + + if err := validate.Required("cloud_name", "body", m.CloudName); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCloudRegion(formats strfmt.Registry) error { + + if err := validate.Required("cloud_region", "body", m.CloudRegion); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("cluster_id", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("cluster_name", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateContainerCount(formats strfmt.Registry) error { + + if err := validate.Required("container_count", "body", m.ContainerCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateContainerRuntimeVersion(formats strfmt.Registry) error { + + if err := validate.Required("container_runtime_version", "body", m.ContainerRuntimeVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCPU(formats strfmt.Registry) error { + + if err := validate.Required("cpu", "body", m.CPU); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateExternalIP(formats strfmt.Registry) error { + + if err := validate.Required("external_ip", "body", m.ExternalIP); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateFirstSeen(formats strfmt.Registry) error { + + if err := validate.Required("first_seen", "body", m.FirstSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateIPV4(formats strfmt.Registry) error { + + if err := validate.Required("ipv4", "body", m.IPV4); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateIPV6(formats strfmt.Registry) error { + + if err := validate.Required("ipv6", "body", m.IPV6); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateKernelVersion(formats strfmt.Registry) error { + + if err := validate.Required("kernel_version", "body", m.KernelVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateKubernetesVersion(formats strfmt.Registry) error { + + if err := validate.Required("kubernetes_version", "body", m.KubernetesVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateLabels(formats strfmt.Registry) error { + + if err := validate.Required("labels", "body", m.Labels); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateLabelsList(formats strfmt.Registry) error { + + if err := validate.Required("labels_list", "body", m.LabelsList); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateMemory(formats strfmt.Registry) error { + + if err := validate.Required("memory", "body", m.Memory); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateNodeID(formats strfmt.Registry) error { + + if err := validate.Required("node_id", "body", m.NodeID); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateNodeName(formats strfmt.Registry) error { + + if err := validate.Required("node_name", "body", m.NodeName); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateOs(formats strfmt.Registry) error { + + if err := validate.Required("os", "body", m.Os); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validatePodCidr(formats strfmt.Registry) error { + + if err := validate.Required("pod_cidr", "body", m.PodCidr); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validatePodCount(formats strfmt.Registry) error { + + if err := validate.Required("pod_count", "body", m.PodCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateProviderID(formats strfmt.Registry) error { + + if err := validate.Required("provider_id", "body", m.ProviderID); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateStorage(formats strfmt.Registry) error { + + if err := validate.Required("storage", "body", m.Storage); err != nil { + return err + } + + return nil +} + +func (m *ModelsNode) validateUID(formats strfmt.Registry) error { + + if err := validate.Required("uid", "body", m.UID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models node based on the context it is used +func (m *ModelsNode) 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 *ModelsNode) 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 *ModelsNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsNode) UnmarshalBinary(b []byte) error { + var res ModelsNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_node_agents.go b/falcon/models/models_node_agents.go new file mode 100644 index 00000000..3617b0b9 --- /dev/null +++ b/falcon/models/models_node_agents.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" +) + +// ModelsNodeAgents models node agents +// +// swagger:model models.Node.agents +type ModelsNodeAgents map[string]string + +// Validate validates this models node agents +func (m ModelsNodeAgents) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this models node agents based on context it is used +func (m ModelsNodeAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/domain_saved_search_wrapper.go b/falcon/models/models_node_entity_response.go similarity index 80% rename from falcon/models/domain_saved_search_wrapper.go rename to falcon/models/models_node_entity_response.go index 99e584e1..9bebc247 100644 --- a/falcon/models/domain_saved_search_wrapper.go +++ b/falcon/models/models_node_entity_response.go @@ -15,13 +15,12 @@ import ( "github.com/go-openapi/validate" ) -// DomainSavedSearchWrapper domain saved search wrapper +// ModelsNodeEntityResponse models node entity response // -// swagger:model domain.SavedSearchWrapper -type DomainSavedSearchWrapper struct { +// swagger:model models.NodeEntityResponse +type ModelsNodeEntityResponse struct { // errors - // Required: true Errors []*MsaAPIError `json:"errors"` // meta @@ -30,11 +29,11 @@ type DomainSavedSearchWrapper struct { // resources // Required: true - Resources []*DomainSavedSearch `json:"resources"` + Resources []*ModelsNode `json:"resources"` } -// Validate validates this domain saved search wrapper -func (m *DomainSavedSearchWrapper) Validate(formats strfmt.Registry) error { +// Validate validates this models node entity response +func (m *ModelsNodeEntityResponse) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,10 +54,9 @@ func (m *DomainSavedSearchWrapper) Validate(formats strfmt.Registry) error { return nil } -func (m *DomainSavedSearchWrapper) validateErrors(formats strfmt.Registry) error { - - if err := validate.Required("errors", "body", m.Errors); err != nil { - return err +func (m *ModelsNodeEntityResponse) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil } for i := 0; i < len(m.Errors); i++ { @@ -82,7 +80,7 @@ func (m *DomainSavedSearchWrapper) validateErrors(formats strfmt.Registry) error return nil } -func (m *DomainSavedSearchWrapper) validateMeta(formats strfmt.Registry) error { +func (m *ModelsNodeEntityResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,7 +100,7 @@ func (m *DomainSavedSearchWrapper) validateMeta(formats strfmt.Registry) error { return nil } -func (m *DomainSavedSearchWrapper) validateResources(formats strfmt.Registry) error { +func (m *ModelsNodeEntityResponse) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err @@ -129,8 +127,8 @@ func (m *DomainSavedSearchWrapper) validateResources(formats strfmt.Registry) er return nil } -// ContextValidate validate this domain saved search wrapper based on the context it is used -func (m *DomainSavedSearchWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this models node entity response based on the context it is used +func (m *ModelsNodeEntityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -151,7 +149,7 @@ func (m *DomainSavedSearchWrapper) ContextValidate(ctx context.Context, formats return nil } -func (m *DomainSavedSearchWrapper) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsNodeEntityResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -176,7 +174,7 @@ func (m *DomainSavedSearchWrapper) contextValidateErrors(ctx context.Context, fo return nil } -func (m *DomainSavedSearchWrapper) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsNodeEntityResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -193,7 +191,7 @@ func (m *DomainSavedSearchWrapper) contextValidateMeta(ctx context.Context, form return nil } -func (m *DomainSavedSearchWrapper) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsNodeEntityResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Resources); i++ { @@ -219,7 +217,7 @@ func (m *DomainSavedSearchWrapper) contextValidateResources(ctx context.Context, } // MarshalBinary interface implementation -func (m *DomainSavedSearchWrapper) MarshalBinary() ([]byte, error) { +func (m *ModelsNodeEntityResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -227,8 +225,8 @@ func (m *DomainSavedSearchWrapper) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *DomainSavedSearchWrapper) UnmarshalBinary(b []byte) error { - var res DomainSavedSearchWrapper +func (m *ModelsNodeEntityResponse) UnmarshalBinary(b []byte) error { + var res ModelsNodeEntityResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/models_package_name_version_type.go b/falcon/models/models_package_name_version_type.go new file mode 100644 index 00000000..d7418ffc --- /dev/null +++ b/falcon/models/models_package_name_version_type.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" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelsPackageNameVersionType models package name version type +// +// swagger:model models.PackageNameVersionType +type ModelsPackageNameVersionType struct { + + // package fixed version + // Required: true + PackageFixedVersion *string `json:"package_fixed_version"` + + // package name version + // Required: true + PackageNameVersion *string `json:"package_name_version"` + + // package os version + // Required: true + PackageOsVersion *string `json:"package_os_version"` + + // package remediation + // Required: true + PackageRemediation *string `json:"package_remediation"` + + // package type + // Required: true + PackageType *string `json:"package_type"` +} + +// Validate validates this models package name version type +func (m *ModelsPackageNameVersionType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePackageFixedVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageNameVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageOsVersion(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageRemediation(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePackageType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsPackageNameVersionType) validatePackageFixedVersion(formats strfmt.Registry) error { + + if err := validate.Required("package_fixed_version", "body", m.PackageFixedVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsPackageNameVersionType) validatePackageNameVersion(formats strfmt.Registry) error { + + if err := validate.Required("package_name_version", "body", m.PackageNameVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsPackageNameVersionType) validatePackageOsVersion(formats strfmt.Registry) error { + + if err := validate.Required("package_os_version", "body", m.PackageOsVersion); err != nil { + return err + } + + return nil +} + +func (m *ModelsPackageNameVersionType) validatePackageRemediation(formats strfmt.Registry) error { + + if err := validate.Required("package_remediation", "body", m.PackageRemediation); err != nil { + return err + } + + return nil +} + +func (m *ModelsPackageNameVersionType) validatePackageType(formats strfmt.Registry) error { + + if err := validate.Required("package_type", "body", m.PackageType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this models package name version type based on context it is used +func (m *ModelsPackageNameVersionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsPackageNameVersionType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsPackageNameVersionType) UnmarshalBinary(b []byte) error { + var res ModelsPackageNameVersionType + 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 new file mode 100644 index 00000000..c3a25175 --- /dev/null +++ b/falcon/models/models_pod.go @@ -0,0 +1,880 @@ +// 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" +) + +// ModelsPod models pod +// +// swagger:model models.Pod +type ModelsPod struct { + + // agents + // Required: true + Agents []ModelsPodAgents `json:"agents"` + + // allow privilege escalation + // Required: true + AllowPrivilegeEscalation *bool `json:"allow_privilege_escalation"` + + // annotations list + // Required: true + AnnotationsList []string `json:"annotations_list"` + + // automount service token + // Required: true + AutomountServiceToken *bool `json:"automount_service_token"` + + // cid + // Required: true + Cid *string `json:"cid"` + + // cloud account id + // Required: true + CloudAccountID *string `json:"cloud_account_id"` + + // cloud name + // Required: true + CloudName *string `json:"cloud_name"` + + // cloud region + // Required: true + CloudRegion *string `json:"cloud_region"` + + // cluster id + // Required: true + ClusterID *string `json:"cluster_id"` + + // cluster name + // Required: true + ClusterName *string `json:"cluster_name"` + + // container count + // Required: true + ContainerCount *int32 `json:"container_count"` + + // containers + // Required: true + Containers []ModelsPodContainers `json:"containers"` + + // created at + // Required: true + CreatedAt *string `json:"created_at"` + + // first seen + // Required: true + FirstSeen *string `json:"first_seen"` + + // host ipc + // Required: true + HostIpc *bool `json:"host_ipc"` + + // host network + // Required: true + HostNetwork *bool `json:"host_network"` + + // host pid + // Required: true + HostPid *bool `json:"host_pid"` + + // image pull secrets + // Required: true + ImagePullSecrets []string `json:"image_pull_secrets"` + + // ipv4 + // Required: true + IPV4 *string `json:"ipv4"` + + // ipv6 + // Required: true + IPV6 *string `json:"ipv6"` + + // labels + // Required: true + Labels map[string]string `json:"labels"` + + // labels list + // Required: true + LabelsList []string `json:"labels_list"` + + // last seen + // Required: true + LastSeen *string `json:"last_seen"` + + // namespace + // Required: true + Namespace *string `json:"namespace"` + + // node ipv4 + // Required: true + NodeIPV4 *string `json:"node_ipv4"` + + // node name + // Required: true + NodeName *string `json:"node_name"` + + // node selector + // Required: true + NodeSelector *string `json:"node_selector"` + + // node uid + // Required: true + NodeUID *string `json:"node_uid"` + + // owner id + // Required: true + OwnerID *string `json:"owner_id"` + + // owner type + // Required: true + OwnerType *string `json:"owner_type"` + + // pod id + // Required: true + PodID *string `json:"pod_id"` + + // pod name + // Required: true + PodName *string `json:"pod_name"` + + // ports + // Required: true + Ports []ModelsPodPorts `json:"ports"` + + // privileged + // Required: true + Privileged *bool `json:"privileged"` + + // root write access + // Required: true + RootWriteAccess *bool `json:"root_write_access"` + + // run as root group + // Required: true + RunAsRootGroup *bool `json:"run_as_root_group"` + + // run as root user + // Required: true + RunAsRootUser *bool `json:"run_as_root_user"` + + // scheduler name + // Required: true + SchedulerName *string `json:"scheduler_name"` + + // service account name + // Required: true + ServiceAccountName *string `json:"service_account_name"` + + // share process namespace + // Required: true + ShareProcessNamespace *bool `json:"share_process_namespace"` + + // volume mounts + // Required: true + VolumeMounts *string `json:"volume_mounts"` +} + +// Validate validates this models pod +func (m *ModelsPod) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAllowPrivilegeEscalation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAnnotationsList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAutomountServiceToken(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudAccountID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloudRegion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainerCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHostIpc(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHostNetwork(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHostPid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImagePullSecrets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIPV4(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIPV6(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabels(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabelsList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSeen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNamespace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeIPV4(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeSelector(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNodeUID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwnerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwnerType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePodName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePorts(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrivileged(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRootWriteAccess(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunAsRootGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunAsRootUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSchedulerName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceAccountName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShareProcessNamespace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVolumeMounts(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsPod) 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 +} + +func (m *ModelsPod) validateAllowPrivilegeEscalation(formats strfmt.Registry) error { + + if err := validate.Required("allow_privilege_escalation", "body", m.AllowPrivilegeEscalation); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateAnnotationsList(formats strfmt.Registry) error { + + if err := validate.Required("annotations_list", "body", m.AnnotationsList); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateAutomountServiceToken(formats strfmt.Registry) error { + + if err := validate.Required("automount_service_token", "body", m.AutomountServiceToken); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateCloudAccountID(formats strfmt.Registry) error { + + if err := validate.Required("cloud_account_id", "body", m.CloudAccountID); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateCloudName(formats strfmt.Registry) error { + + if err := validate.Required("cloud_name", "body", m.CloudName); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateCloudRegion(formats strfmt.Registry) error { + + if err := validate.Required("cloud_region", "body", m.CloudRegion); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("cluster_id", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("cluster_name", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateContainerCount(formats strfmt.Registry) error { + + if err := validate.Required("container_count", "body", m.ContainerCount); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) 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 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 *ModelsPod) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateFirstSeen(formats strfmt.Registry) error { + + if err := validate.Required("first_seen", "body", m.FirstSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateHostIpc(formats strfmt.Registry) error { + + if err := validate.Required("host_ipc", "body", m.HostIpc); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateHostNetwork(formats strfmt.Registry) error { + + if err := validate.Required("host_network", "body", m.HostNetwork); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateHostPid(formats strfmt.Registry) error { + + if err := validate.Required("host_pid", "body", m.HostPid); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateImagePullSecrets(formats strfmt.Registry) error { + + if err := validate.Required("image_pull_secrets", "body", m.ImagePullSecrets); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateIPV4(formats strfmt.Registry) error { + + if err := validate.Required("ipv4", "body", m.IPV4); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateIPV6(formats strfmt.Registry) error { + + if err := validate.Required("ipv6", "body", m.IPV6); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateLabels(formats strfmt.Registry) error { + + if err := validate.Required("labels", "body", m.Labels); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateLabelsList(formats strfmt.Registry) error { + + if err := validate.Required("labels_list", "body", m.LabelsList); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateLastSeen(formats strfmt.Registry) error { + + if err := validate.Required("last_seen", "body", m.LastSeen); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateNamespace(formats strfmt.Registry) error { + + if err := validate.Required("namespace", "body", m.Namespace); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateNodeIPV4(formats strfmt.Registry) error { + + if err := validate.Required("node_ipv4", "body", m.NodeIPV4); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateNodeName(formats strfmt.Registry) error { + + if err := validate.Required("node_name", "body", m.NodeName); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateNodeSelector(formats strfmt.Registry) error { + + if err := validate.Required("node_selector", "body", m.NodeSelector); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateNodeUID(formats strfmt.Registry) error { + + if err := validate.Required("node_uid", "body", m.NodeUID); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateOwnerID(formats strfmt.Registry) error { + + if err := validate.Required("owner_id", "body", m.OwnerID); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateOwnerType(formats strfmt.Registry) error { + + if err := validate.Required("owner_type", "body", m.OwnerType); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validatePodID(formats strfmt.Registry) error { + + if err := validate.Required("pod_id", "body", m.PodID); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validatePodName(formats strfmt.Registry) error { + + if err := validate.Required("pod_name", "body", m.PodName); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validatePorts(formats strfmt.Registry) error { + + if err := validate.Required("ports", "body", m.Ports); err != nil { + return err + } + + for i := 0; i < len(m.Ports); i++ { + + if m.Ports[i] != nil { + if err := m.Ports[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ModelsPod) validatePrivileged(formats strfmt.Registry) error { + + if err := validate.Required("privileged", "body", m.Privileged); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateRootWriteAccess(formats strfmt.Registry) error { + + if err := validate.Required("root_write_access", "body", m.RootWriteAccess); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateRunAsRootGroup(formats strfmt.Registry) error { + + if err := validate.Required("run_as_root_group", "body", m.RunAsRootGroup); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateRunAsRootUser(formats strfmt.Registry) error { + + if err := validate.Required("run_as_root_user", "body", m.RunAsRootUser); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateSchedulerName(formats strfmt.Registry) error { + + if err := validate.Required("scheduler_name", "body", m.SchedulerName); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateServiceAccountName(formats strfmt.Registry) error { + + if err := validate.Required("service_account_name", "body", m.ServiceAccountName); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateShareProcessNamespace(formats strfmt.Registry) error { + + if err := validate.Required("share_process_namespace", "body", m.ShareProcessNamespace); err != nil { + return err + } + + return nil +} + +func (m *ModelsPod) validateVolumeMounts(formats strfmt.Registry) error { + + if err := validate.Required("volume_mounts", "body", m.VolumeMounts); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this models pod based on the context it is used +func (m *ModelsPod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContainers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePorts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelsPod) 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 +} + +func (m *ModelsPod) contextValidateContainers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Containers); i++ { + + 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 *ModelsPod) contextValidatePorts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Ports); i++ { + + if swag.IsZero(m.Ports[i]) { // not required + return nil + } + + if err := m.Ports[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ports" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ports" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelsPod) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelsPod) UnmarshalBinary(b []byte) error { + var res ModelsPod + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/models_pod_agents.go b/falcon/models/models_pod_agents.go new file mode 100644 index 00000000..df74a7b0 --- /dev/null +++ b/falcon/models/models_pod_agents.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" +) + +// ModelsPodAgents models pod agents +// +// swagger:model models.Pod.agents +type ModelsPodAgents map[string]string + +// Validate validates this models pod agents +func (m ModelsPodAgents) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this models pod agents based on context it is used +func (m ModelsPodAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/models_pod_containers.go b/falcon/models/models_pod_containers.go new file mode 100644 index 00000000..eb877f82 --- /dev/null +++ b/falcon/models/models_pod_containers.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" +) + +// ModelsPodContainers models pod containers +// +// swagger:model models.Pod.containers +type ModelsPodContainers map[string]string + +// Validate validates this models pod containers +func (m ModelsPodContainers) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this models pod containers based on context it is used +func (m ModelsPodContainers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/custom_type2096042126.go b/falcon/models/models_pod_entity_response.go similarity index 60% rename from falcon/models/custom_type2096042126.go rename to falcon/models/models_pod_entity_response.go index b6f184aa..a3cf5b0a 100644 --- a/falcon/models/custom_type2096042126.go +++ b/falcon/models/models_pod_entity_response.go @@ -15,13 +15,12 @@ import ( "github.com/go-openapi/validate" ) -// CustomType2096042126 custom type 2096042126 +// ModelsPodEntityResponse models pod entity response // -// swagger:model CustomType_2096042126 -type CustomType2096042126 struct { +// swagger:model models.PodEntityResponse +type ModelsPodEntityResponse struct { // errors - // Required: true Errors []*MsaAPIError `json:"errors"` // meta @@ -30,11 +29,11 @@ type CustomType2096042126 struct { // resources // Required: true - Resources *APIObjectMetadata `json:"resources"` + Resources []*ModelsPod `json:"resources"` } -// Validate validates this custom type 2096042126 -func (m *CustomType2096042126) Validate(formats strfmt.Registry) error { +// Validate validates this models pod entity response +func (m *ModelsPodEntityResponse) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrors(formats); err != nil { @@ -55,10 +54,9 @@ func (m *CustomType2096042126) Validate(formats strfmt.Registry) error { return nil } -func (m *CustomType2096042126) validateErrors(formats strfmt.Registry) error { - - if err := validate.Required("errors", "body", m.Errors); err != nil { - return err +func (m *ModelsPodEntityResponse) validateErrors(formats strfmt.Registry) error { + if swag.IsZero(m.Errors) { // not required + return nil } for i := 0; i < len(m.Errors); i++ { @@ -82,7 +80,7 @@ func (m *CustomType2096042126) validateErrors(formats strfmt.Registry) error { return nil } -func (m *CustomType2096042126) validateMeta(formats strfmt.Registry) error { +func (m *ModelsPodEntityResponse) validateMeta(formats strfmt.Registry) error { if err := validate.Required("meta", "body", m.Meta); err != nil { return err @@ -102,28 +100,35 @@ func (m *CustomType2096042126) validateMeta(formats strfmt.Registry) error { return nil } -func (m *CustomType2096042126) validateResources(formats strfmt.Registry) error { +func (m *ModelsPodEntityResponse) validateResources(formats strfmt.Registry) error { if err := validate.Required("resources", "body", m.Resources); err != nil { return err } - if m.Resources != nil { - if err := m.Resources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } -// ContextValidate validate this custom type 2096042126 based on the context it is used -func (m *CustomType2096042126) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this models pod entity response based on the context it is used +func (m *ModelsPodEntityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateErrors(ctx, formats); err != nil { @@ -144,7 +149,7 @@ func (m *CustomType2096042126) ContextValidate(ctx context.Context, formats strf return nil } -func (m *CustomType2096042126) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsPodEntityResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Errors); i++ { @@ -169,7 +174,7 @@ func (m *CustomType2096042126) contextValidateErrors(ctx context.Context, format return nil } -func (m *CustomType2096042126) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsPodEntityResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { if m.Meta != nil { @@ -186,25 +191,33 @@ func (m *CustomType2096042126) contextValidateMeta(ctx context.Context, formats return nil } -func (m *CustomType2096042126) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { +func (m *ModelsPodEntityResponse) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { - if m.Resources != nil { + for i := 0; i < len(m.Resources); i++ { - if err := m.Resources.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("resources") + 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 err } + } return nil } // MarshalBinary interface implementation -func (m *CustomType2096042126) MarshalBinary() ([]byte, error) { +func (m *ModelsPodEntityResponse) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -212,8 +225,8 @@ func (m *CustomType2096042126) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *CustomType2096042126) UnmarshalBinary(b []byte) error { - var res CustomType2096042126 +func (m *ModelsPodEntityResponse) UnmarshalBinary(b []byte) error { + var res ModelsPodEntityResponse if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/models_pod_ports.go b/falcon/models/models_pod_ports.go new file mode 100644 index 00000000..c2005180 --- /dev/null +++ b/falcon/models/models_pod_ports.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" +) + +// ModelsPodPorts models pod ports +// +// swagger:model models.Pod.ports +type ModelsPodPorts map[string]string + +// Validate validates this models pod ports +func (m ModelsPodPorts) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this models pod ports based on context it is used +func (m ModelsPodPorts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/falcon/models/models_scan_results.go b/falcon/models/models_scan_results.go deleted file mode 100644 index 823d1586..00000000 --- a/falcon/models/models_scan_results.go +++ /dev/null @@ -1,141 +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" -) - -// ModelsScanResults models scan results -// -// swagger:model models.ScanResults -type ModelsScanResults struct { - - // applications - // Required: true - Applications []*ModelsSnapshotInventoryApplication `json:"applications"` - - // 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.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) 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 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 -} - -// 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 deleted file mode 100644 index 6073b9d6..00000000 --- a/falcon/models/models_snapshot_inventory_application.go +++ /dev/null @@ -1,207 +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" -) - -// 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_snapshot_inventory_payload.go b/falcon/models/models_snapshot_inventory_payload.go deleted file mode 100644 index fbf3363d..00000000 --- a/falcon/models/models_snapshot_inventory_payload.go +++ /dev/null @@ -1,157 +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" -) - -// ModelsSnapshotInventoryPayload models snapshot inventory payload -// -// swagger:model models.SnapshotInventoryPayload -type ModelsSnapshotInventoryPayload struct { - - // job metadata - // Required: true - JobMetadata *ModelsJobMetaData `json:"job_metadata"` - - // results - // Required: true - Results *ModelsScanResults `json:"results"` -} - -// Validate validates this models snapshot inventory payload -func (m *ModelsSnapshotInventoryPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateJobMetadata(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 *ModelsSnapshotInventoryPayload) 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 *ModelsSnapshotInventoryPayload) 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 snapshot inventory payload based on the context it is used -func (m *ModelsSnapshotInventoryPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateJobMetadata(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 *ModelsSnapshotInventoryPayload) 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 *ModelsSnapshotInventoryPayload) 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 *ModelsSnapshotInventoryPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ModelsSnapshotInventoryPayload) UnmarshalBinary(b []byte) error { - var res ModelsSnapshotInventoryPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/msa_aggregation_result.go b/falcon/models/msa_aggregation_result.go index ba3d31b0..cf480347 100644 --- a/falcon/models/msa_aggregation_result.go +++ b/falcon/models/msa_aggregation_result.go @@ -24,6 +24,9 @@ type MsaAggregationResult struct { // Required: true Buckets []*MsaAggregationResultItem `json:"buckets"` + // doc count error upper bound + DocCountErrorUpperBound int64 `json:"doc_count_error_upper_bound,omitempty"` + // name // Required: true Name *string `json:"name"` diff --git a/falcon/models/packages_api_combined_package.go b/falcon/models/packages_api_combined_package.go new file mode 100644 index 00000000..589df4ed --- /dev/null +++ b/falcon/models/packages_api_combined_package.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" +) + +// PackagesAPICombinedPackage packages api combined package +// +// swagger:model packages.apiCombinedPackage +type PackagesAPICombinedPackage struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIPackageCombined `json:"resources"` +} + +// Validate validates this packages api combined package +func (m *PackagesAPICombinedPackage) 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 *PackagesAPICombinedPackage) 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 *PackagesAPICombinedPackage) 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 *PackagesAPICombinedPackage) 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 packages api combined package based on the context it is used +func (m *PackagesAPICombinedPackage) 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 *PackagesAPICombinedPackage) 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 *PackagesAPICombinedPackage) 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 *PackagesAPICombinedPackage) 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 *PackagesAPICombinedPackage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackagesAPICombinedPackage) UnmarshalBinary(b []byte) error { + var res PackagesAPICombinedPackage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/packages_api_combined_package_export.go b/falcon/models/packages_api_combined_package_export.go new file mode 100644 index 00000000..11dfe0db --- /dev/null +++ b/falcon/models/packages_api_combined_package_export.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" +) + +// PackagesAPICombinedPackageExport packages api combined package export +// +// swagger:model packages.apiCombinedPackageExport +type PackagesAPICombinedPackageExport struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIPackageCombined `json:"resources"` +} + +// Validate validates this packages api combined package export +func (m *PackagesAPICombinedPackageExport) 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 *PackagesAPICombinedPackageExport) 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 *PackagesAPICombinedPackageExport) 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 *PackagesAPICombinedPackageExport) 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 packages api combined package export based on the context it is used +func (m *PackagesAPICombinedPackageExport) 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 *PackagesAPICombinedPackageExport) 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 *PackagesAPICombinedPackageExport) 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 *PackagesAPICombinedPackageExport) 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 *PackagesAPICombinedPackageExport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackagesAPICombinedPackageExport) UnmarshalBinary(b []byte) error { + var res PackagesAPICombinedPackageExport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/packages_api_packages_by_vuln_count.go b/falcon/models/packages_api_packages_by_vuln_count.go new file mode 100644 index 00000000..dea85f5d --- /dev/null +++ b/falcon/models/packages_api_packages_by_vuln_count.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" +) + +// PackagesAPIPackagesByVulnCount packages api packages by vuln count +// +// swagger:model packages.apiPackagesByVulnCount +type PackagesAPIPackagesByVulnCount struct { + + // resources + // Required: true + Resources []*ModelsAPIPackagesByVulnCount `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this packages api packages by vuln count +func (m *PackagesAPIPackagesByVulnCount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PackagesAPIPackagesByVulnCount) 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 +} + +func (m *PackagesAPIPackagesByVulnCount) 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 *PackagesAPIPackagesByVulnCount) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this packages api packages by vuln count based on the context it is used +func (m *PackagesAPIPackagesByVulnCount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *PackagesAPIPackagesByVulnCount) 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 +} + +func (m *PackagesAPIPackagesByVulnCount) 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 *PackagesAPIPackagesByVulnCount) 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 *PackagesAPIPackagesByVulnCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackagesAPIPackagesByVulnCount) UnmarshalBinary(b []byte) error { + var res PackagesAPIPackagesByVulnCount + 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 94bf8683..db20c65d 100644 --- a/falcon/models/rulegroups_rule.go +++ b/falcon/models/rulegroups_rule.go @@ -19,6 +19,12 @@ import ( // swagger:model rulegroups.Rule type RulegroupsRule struct { + // content files + ContentFiles []string `json:"content_files"` + + // content registry values + ContentRegistryValues []string `json:"content_registry_values"` + // created timestamp CreatedTimestamp string `json:"created_timestamp,omitempty"` @@ -29,6 +35,9 @@ type RulegroupsRule struct { // description Description string `json:"description,omitempty"` + // enable content capture + EnableContentCapture bool `json:"enable_content_capture,omitempty"` + // exclude Exclude string `json:"exclude,omitempty"` diff --git a/falcon/models/sadomain_submit_for_blocking_info.go b/falcon/models/sadomain_submission_information.go similarity index 68% rename from falcon/models/sadomain_submit_for_blocking_info.go rename to falcon/models/sadomain_submission_information.go index 58d618dc..18c3476c 100644 --- a/falcon/models/sadomain_submit_for_blocking_info.go +++ b/falcon/models/sadomain_submission_information.go @@ -14,10 +14,10 @@ import ( "github.com/go-openapi/validate" ) -// SadomainSubmitForBlockingInfo sadomain submit for blocking info +// SadomainSubmissionInformation sadomain submission information // -// swagger:model sadomain.SubmitForBlockingInfo -type SadomainSubmitForBlockingInfo struct { +// swagger:model sadomain.SubmissionInformation +type SadomainSubmissionInformation struct { // date // Required: true @@ -33,8 +33,8 @@ type SadomainSubmitForBlockingInfo struct { UserUUID *string `json:"user_uuid"` } -// Validate validates this sadomain submit for blocking info -func (m *SadomainSubmitForBlockingInfo) Validate(formats strfmt.Registry) error { +// Validate validates this sadomain submission information +func (m *SadomainSubmissionInformation) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDate(formats); err != nil { @@ -55,7 +55,7 @@ func (m *SadomainSubmitForBlockingInfo) Validate(formats strfmt.Registry) error return nil } -func (m *SadomainSubmitForBlockingInfo) validateDate(formats strfmt.Registry) error { +func (m *SadomainSubmissionInformation) validateDate(formats strfmt.Registry) error { if err := validate.Required("date", "body", m.Date); err != nil { return err @@ -68,7 +68,7 @@ func (m *SadomainSubmitForBlockingInfo) validateDate(formats strfmt.Registry) er return nil } -func (m *SadomainSubmitForBlockingInfo) validateStatus(formats strfmt.Registry) error { +func (m *SadomainSubmissionInformation) validateStatus(formats strfmt.Registry) error { if err := validate.Required("status", "body", m.Status); err != nil { return err @@ -77,7 +77,7 @@ func (m *SadomainSubmitForBlockingInfo) validateStatus(formats strfmt.Registry) return nil } -func (m *SadomainSubmitForBlockingInfo) validateUserUUID(formats strfmt.Registry) error { +func (m *SadomainSubmissionInformation) validateUserUUID(formats strfmt.Registry) error { if err := validate.Required("user_uuid", "body", m.UserUUID); err != nil { return err @@ -86,13 +86,13 @@ func (m *SadomainSubmitForBlockingInfo) validateUserUUID(formats strfmt.Registry return nil } -// ContextValidate validates this sadomain submit for blocking info based on context it is used -func (m *SadomainSubmitForBlockingInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this sadomain submission information based on context it is used +func (m *SadomainSubmissionInformation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *SadomainSubmitForBlockingInfo) MarshalBinary() ([]byte, error) { +func (m *SadomainSubmissionInformation) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -100,8 +100,8 @@ func (m *SadomainSubmitForBlockingInfo) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *SadomainSubmitForBlockingInfo) UnmarshalBinary(b []byte) error { - var res SadomainSubmitForBlockingInfo +func (m *SadomainSubmissionInformation) UnmarshalBinary(b []byte) error { + var res SadomainSubmissionInformation if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/falcon/models/sadomain_typosquatting_component.go b/falcon/models/sadomain_typosquatting_component.go index 1ab06863..1c08151d 100644 --- a/falcon/models/sadomain_typosquatting_component.go +++ b/falcon/models/sadomain_typosquatting_component.go @@ -36,7 +36,10 @@ type SadomainTyposquattingComponent struct { PunycodeFormat *string `json:"punycode_format"` // submit for blocking info - SubmitForBlockingInfo *SadomainSubmitForBlockingInfo `json:"submit_for_blocking_info,omitempty"` + SubmitForBlockingInfo *SadomainSubmissionInformation `json:"submit_for_blocking_info,omitempty"` + + // submit for takedown info + SubmitForTakedownInfo *SadomainSubmissionInformation `json:"submit_for_takedown_info,omitempty"` // The Unicode representation of the infrastructure component // Required: true @@ -67,6 +70,10 @@ func (m *SadomainTyposquattingComponent) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateSubmitForTakedownInfo(formats); err != nil { + res = append(res, err) + } + if err := m.validateUnicodeFormat(formats); err != nil { res = append(res, err) } @@ -154,6 +161,25 @@ func (m *SadomainTyposquattingComponent) validateSubmitForBlockingInfo(formats s return nil } +func (m *SadomainTyposquattingComponent) validateSubmitForTakedownInfo(formats strfmt.Registry) error { + if swag.IsZero(m.SubmitForTakedownInfo) { // not required + return nil + } + + if m.SubmitForTakedownInfo != nil { + if err := m.SubmitForTakedownInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("submit_for_takedown_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("submit_for_takedown_info") + } + return err + } + } + + return nil +} + func (m *SadomainTyposquattingComponent) validateUnicodeFormat(formats strfmt.Registry) error { if err := validate.Required("unicode_format", "body", m.UnicodeFormat); err != nil { @@ -179,6 +205,10 @@ func (m *SadomainTyposquattingComponent) ContextValidate(ctx context.Context, fo res = append(res, err) } + if err := m.contextValidateSubmitForTakedownInfo(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -240,6 +270,27 @@ func (m *SadomainTyposquattingComponent) contextValidateSubmitForBlockingInfo(ct return nil } +func (m *SadomainTyposquattingComponent) contextValidateSubmitForTakedownInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.SubmitForTakedownInfo != nil { + + if swag.IsZero(m.SubmitForTakedownInfo) { // not required + return nil + } + + if err := m.SubmitForTakedownInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("submit_for_takedown_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("submit_for_takedown_info") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *SadomainTyposquattingComponent) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/falcon/models/scheduledexclusions_create_request.go b/falcon/models/scheduledexclusions_create_request.go index 020da952..fc044dd9 100644 --- a/falcon/models/scheduledexclusions_create_request.go +++ b/falcon/models/scheduledexclusions_create_request.go @@ -32,12 +32,19 @@ type ScheduledexclusionsCreateRequest struct { // processes Processes string `json:"processes,omitempty"` + // repeated + Repeated *ScheduledexclusionsRepeated `json:"repeated,omitempty"` + // schedule end ScheduleEnd string `json:"schedule_end,omitempty"` // schedule start ScheduleStart string `json:"schedule_start,omitempty"` + // timezone + // Required: true + Timezone *string `json:"timezone"` + // users Users string `json:"users,omitempty"` } @@ -50,6 +57,14 @@ func (m *ScheduledexclusionsCreateRequest) Validate(formats strfmt.Registry) err res = append(res, err) } + if err := m.validateRepeated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimezone(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -65,8 +80,66 @@ func (m *ScheduledexclusionsCreateRequest) validateName(formats strfmt.Registry) return nil } -// ContextValidate validates this scheduledexclusions create request based on context it is used +func (m *ScheduledexclusionsCreateRequest) validateRepeated(formats strfmt.Registry) error { + if swag.IsZero(m.Repeated) { // not required + return nil + } + + if m.Repeated != nil { + if err := m.Repeated.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("repeated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("repeated") + } + return err + } + } + + return nil +} + +func (m *ScheduledexclusionsCreateRequest) validateTimezone(formats strfmt.Registry) error { + + if err := validate.Required("timezone", "body", m.Timezone); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this scheduledexclusions create request based on the context it is used func (m *ScheduledexclusionsCreateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRepeated(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScheduledexclusionsCreateRequest) contextValidateRepeated(ctx context.Context, formats strfmt.Registry) error { + + if m.Repeated != nil { + + if swag.IsZero(m.Repeated) { // not required + return nil + } + + if err := m.Repeated.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("repeated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("repeated") + } + return err + } + } + return nil } diff --git a/falcon/models/scheduledexclusions_repeated.go b/falcon/models/scheduledexclusions_repeated.go new file mode 100644 index 00000000..b761ee16 --- /dev/null +++ b/falcon/models/scheduledexclusions_repeated.go @@ -0,0 +1,68 @@ +// 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" +) + +// ScheduledexclusionsRepeated scheduledexclusions repeated +// +// swagger:model scheduledexclusions.Repeated +type ScheduledexclusionsRepeated struct { + + // all day + AllDay bool `json:"all_day,omitempty"` + + // end time + EndTime string `json:"end_time,omitempty"` + + // frequency + Frequency string `json:"frequency,omitempty"` + + // monthly days + MonthlyDays []int64 `json:"monthly_days"` + + // occurrence + Occurrence string `json:"occurrence,omitempty"` + + // start time + StartTime string `json:"start_time,omitempty"` + + // weekly days + WeeklyDays []string `json:"weekly_days"` +} + +// Validate validates this scheduledexclusions repeated +func (m *ScheduledexclusionsRepeated) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this scheduledexclusions repeated based on context it is used +func (m *ScheduledexclusionsRepeated) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ScheduledexclusionsRepeated) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ScheduledexclusionsRepeated) UnmarshalBinary(b []byte) error { + var res ScheduledexclusionsRepeated + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/scheduledexclusions_scheduled_exclusion.go b/falcon/models/scheduledexclusions_scheduled_exclusion.go index 0d8fbb7e..a2ca5df0 100644 --- a/falcon/models/scheduledexclusions_scheduled_exclusion.go +++ b/falcon/models/scheduledexclusions_scheduled_exclusion.go @@ -42,12 +42,19 @@ type ScheduledexclusionsScheduledExclusion struct { // processes Processes string `json:"processes,omitempty"` + // repeated + Repeated *ScheduledexclusionsRepeated `json:"repeated,omitempty"` + // schedule end ScheduleEnd string `json:"schedule_end,omitempty"` // schedule start ScheduleStart string `json:"schedule_start,omitempty"` + // timezone + // Required: true + Timezone *string `json:"timezone"` + // users Users string `json:"users,omitempty"` } @@ -64,6 +71,14 @@ func (m *ScheduledexclusionsScheduledExclusion) Validate(formats strfmt.Registry res = append(res, err) } + if err := m.validateRepeated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimezone(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -88,8 +103,66 @@ func (m *ScheduledexclusionsScheduledExclusion) validateName(formats strfmt.Regi return nil } -// ContextValidate validates this scheduledexclusions scheduled exclusion based on context it is used +func (m *ScheduledexclusionsScheduledExclusion) validateRepeated(formats strfmt.Registry) error { + if swag.IsZero(m.Repeated) { // not required + return nil + } + + if m.Repeated != nil { + if err := m.Repeated.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("repeated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("repeated") + } + return err + } + } + + return nil +} + +func (m *ScheduledexclusionsScheduledExclusion) validateTimezone(formats strfmt.Registry) error { + + if err := validate.Required("timezone", "body", m.Timezone); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this scheduledexclusions scheduled exclusion based on the context it is used func (m *ScheduledexclusionsScheduledExclusion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRepeated(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScheduledexclusionsScheduledExclusion) contextValidateRepeated(ctx context.Context, formats strfmt.Registry) error { + + if m.Repeated != nil { + + if swag.IsZero(m.Repeated) { // not required + return nil + } + + if err := m.Repeated.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("repeated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("repeated") + } + return err + } + } + return nil } diff --git a/falcon/models/scheduledexclusions_update_request.go b/falcon/models/scheduledexclusions_update_request.go index 1f452467..6b1c0629 100644 --- a/falcon/models/scheduledexclusions_update_request.go +++ b/falcon/models/scheduledexclusions_update_request.go @@ -36,12 +36,19 @@ type ScheduledexclusionsUpdateRequest struct { // processes Processes string `json:"processes,omitempty"` + // repeated + Repeated *ScheduledexclusionsRepeated `json:"repeated,omitempty"` + // schedule end ScheduleEnd string `json:"schedule_end,omitempty"` // schedule start ScheduleStart string `json:"schedule_start,omitempty"` + // timezone + // Required: true + Timezone *string `json:"timezone"` + // users Users string `json:"users,omitempty"` } @@ -58,6 +65,14 @@ func (m *ScheduledexclusionsUpdateRequest) Validate(formats strfmt.Registry) err res = append(res, err) } + if err := m.validateRepeated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimezone(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -82,8 +97,66 @@ func (m *ScheduledexclusionsUpdateRequest) validateName(formats strfmt.Registry) return nil } -// ContextValidate validates this scheduledexclusions update request based on context it is used +func (m *ScheduledexclusionsUpdateRequest) validateRepeated(formats strfmt.Registry) error { + if swag.IsZero(m.Repeated) { // not required + return nil + } + + if m.Repeated != nil { + if err := m.Repeated.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("repeated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("repeated") + } + return err + } + } + + return nil +} + +func (m *ScheduledexclusionsUpdateRequest) validateTimezone(formats strfmt.Registry) error { + + if err := validate.Required("timezone", "body", m.Timezone); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this scheduledexclusions update request based on the context it is used func (m *ScheduledexclusionsUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRepeated(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScheduledexclusionsUpdateRequest) contextValidateRepeated(ctx context.Context, formats strfmt.Registry) error { + + if m.Repeated != nil { + + if swag.IsZero(m.Repeated) { // not required + return nil + } + + if err := m.Repeated.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("repeated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("repeated") + } + return err + } + } + return nil } diff --git a/falcon/models/unidentifiedcontainers_unidentified_container_api_response.go b/falcon/models/unidentifiedcontainers_unidentified_container_api_response.go new file mode 100644 index 00000000..252d7429 --- /dev/null +++ b/falcon/models/unidentifiedcontainers_unidentified_container_api_response.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" +) + +// UnidentifiedcontainersUnidentifiedContainerAPIResponse unidentifiedcontainers unidentified container API response +// +// swagger:model unidentifiedcontainers.UnidentifiedContainerAPIResponse +type UnidentifiedcontainersUnidentifiedContainerAPIResponse struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIUnidentifiedContainer `json:"resources"` +} + +// Validate validates this unidentifiedcontainers unidentified container API response +func (m *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 unidentifiedcontainers unidentified container API response based on the context it is used +func (m *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 *UnidentifiedcontainersUnidentifiedContainerAPIResponse) 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 *UnidentifiedcontainersUnidentifiedContainerAPIResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UnidentifiedcontainersUnidentifiedContainerAPIResponse) UnmarshalBinary(b []byte) error { + var res UnidentifiedcontainersUnidentifiedContainerAPIResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/unidentifiedcontainers_unidentified_containers_count_value.go b/falcon/models/unidentifiedcontainers_unidentified_containers_count_value.go new file mode 100644 index 00000000..b9a524da --- /dev/null +++ b/falcon/models/unidentifiedcontainers_unidentified_containers_count_value.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" +) + +// UnidentifiedcontainersUnidentifiedContainersCountValue unidentifiedcontainers unidentified containers count value +// +// swagger:model unidentifiedcontainers.unidentifiedContainersCountValue +type UnidentifiedcontainersUnidentifiedContainersCountValue struct { + + // resources + // Required: true + Resources []*CommonCountAsResource `json:"Resources"` + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` +} + +// Validate validates this unidentifiedcontainers unidentified containers count value +func (m *UnidentifiedcontainersUnidentifiedContainersCountValue) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateErrors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UnidentifiedcontainersUnidentifiedContainersCountValue) 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 +} + +func (m *UnidentifiedcontainersUnidentifiedContainersCountValue) 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 *UnidentifiedcontainersUnidentifiedContainersCountValue) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this unidentifiedcontainers unidentified containers count value based on the context it is used +func (m *UnidentifiedcontainersUnidentifiedContainersCountValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + 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 *UnidentifiedcontainersUnidentifiedContainersCountValue) 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 +} + +func (m *UnidentifiedcontainersUnidentifiedContainersCountValue) 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 *UnidentifiedcontainersUnidentifiedContainersCountValue) 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 *UnidentifiedcontainersUnidentifiedContainersCountValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UnidentifiedcontainersUnidentifiedContainersCountValue) UnmarshalBinary(b []byte) error { + var res UnidentifiedcontainersUnidentifiedContainersCountValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_combined_vulnerability.go b/falcon/models/vulnerabilities_api_combined_vulnerability.go new file mode 100644 index 00000000..ac2c3f21 --- /dev/null +++ b/falcon/models/vulnerabilities_api_combined_vulnerability.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" +) + +// VulnerabilitiesAPICombinedVulnerability vulnerabilities api combined vulnerability +// +// swagger:model vulnerabilities.apiCombinedVulnerability +type VulnerabilitiesAPICombinedVulnerability struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIVulnerabilityCombined `json:"resources"` +} + +// Validate validates this vulnerabilities api combined vulnerability +func (m *VulnerabilitiesAPICombinedVulnerability) 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 *VulnerabilitiesAPICombinedVulnerability) 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 *VulnerabilitiesAPICombinedVulnerability) 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 *VulnerabilitiesAPICombinedVulnerability) 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 vulnerabilities api combined vulnerability based on the context it is used +func (m *VulnerabilitiesAPICombinedVulnerability) 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 *VulnerabilitiesAPICombinedVulnerability) 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 *VulnerabilitiesAPICombinedVulnerability) 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 *VulnerabilitiesAPICombinedVulnerability) 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 *VulnerabilitiesAPICombinedVulnerability) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPICombinedVulnerability) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPICombinedVulnerability + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_combined_vulnerability_details.go b/falcon/models/vulnerabilities_api_combined_vulnerability_details.go new file mode 100644 index 00000000..aa4f11e0 --- /dev/null +++ b/falcon/models/vulnerabilities_api_combined_vulnerability_details.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" +) + +// VulnerabilitiesAPICombinedVulnerabilityDetails vulnerabilities api combined vulnerability details +// +// swagger:model vulnerabilities.apiCombinedVulnerabilityDetails +type VulnerabilitiesAPICombinedVulnerabilityDetails struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIVulnerabilityDetails `json:"resources"` +} + +// Validate validates this vulnerabilities api combined vulnerability details +func (m *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 vulnerabilities api combined vulnerability details based on the context it is used +func (m *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 *VulnerabilitiesAPICombinedVulnerabilityDetails) 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 *VulnerabilitiesAPICombinedVulnerabilityDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPICombinedVulnerabilityDetails) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPICombinedVulnerabilityDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_combined_vulnerability_info.go b/falcon/models/vulnerabilities_api_combined_vulnerability_info.go new file mode 100644 index 00000000..fe05591f --- /dev/null +++ b/falcon/models/vulnerabilities_api_combined_vulnerability_info.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" +) + +// VulnerabilitiesAPICombinedVulnerabilityInfo vulnerabilities api combined vulnerability info +// +// swagger:model vulnerabilities.apiCombinedVulnerabilityInfo +type VulnerabilitiesAPICombinedVulnerabilityInfo struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIVulnerabilityInfo `json:"resources"` +} + +// Validate validates this vulnerabilities api combined vulnerability info +func (m *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 vulnerabilities api combined vulnerability info based on the context it is used +func (m *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 *VulnerabilitiesAPICombinedVulnerabilityInfo) 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 *VulnerabilitiesAPICombinedVulnerabilityInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPICombinedVulnerabilityInfo) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPICombinedVulnerabilityInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_vuln_by_image_count.go b/falcon/models/vulnerabilities_api_vuln_by_image_count.go new file mode 100644 index 00000000..bef4c1a8 --- /dev/null +++ b/falcon/models/vulnerabilities_api_vuln_by_image_count.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" +) + +// VulnerabilitiesAPIVulnByImageCount vulnerabilities api vuln by image count +// +// swagger:model vulnerabilities.apiVulnByImageCount +type VulnerabilitiesAPIVulnByImageCount struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIVulnByImageCount `json:"resources"` +} + +// Validate validates this vulnerabilities api vuln by image count +func (m *VulnerabilitiesAPIVulnByImageCount) 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 *VulnerabilitiesAPIVulnByImageCount) 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 *VulnerabilitiesAPIVulnByImageCount) 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 *VulnerabilitiesAPIVulnByImageCount) 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 vulnerabilities api vuln by image count based on the context it is used +func (m *VulnerabilitiesAPIVulnByImageCount) 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 *VulnerabilitiesAPIVulnByImageCount) 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 *VulnerabilitiesAPIVulnByImageCount) 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 *VulnerabilitiesAPIVulnByImageCount) 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 *VulnerabilitiesAPIVulnByImageCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPIVulnByImageCount) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPIVulnByImageCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_vuln_by_publication.go b/falcon/models/vulnerabilities_api_vuln_by_publication.go new file mode 100644 index 00000000..797a0c7b --- /dev/null +++ b/falcon/models/vulnerabilities_api_vuln_by_publication.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" +) + +// VulnerabilitiesAPIVulnByPublication vulnerabilities api vuln by publication +// +// swagger:model vulnerabilities.apiVulnByPublication +type VulnerabilitiesAPIVulnByPublication struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIVulnByPublicationDate `json:"resources"` +} + +// Validate validates this vulnerabilities api vuln by publication +func (m *VulnerabilitiesAPIVulnByPublication) 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 *VulnerabilitiesAPIVulnByPublication) 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 *VulnerabilitiesAPIVulnByPublication) 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 *VulnerabilitiesAPIVulnByPublication) 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 vulnerabilities api vuln by publication based on the context it is used +func (m *VulnerabilitiesAPIVulnByPublication) 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 *VulnerabilitiesAPIVulnByPublication) 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 *VulnerabilitiesAPIVulnByPublication) 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 *VulnerabilitiesAPIVulnByPublication) 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 *VulnerabilitiesAPIVulnByPublication) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPIVulnByPublication) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPIVulnByPublication + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_vuln_count.go b/falcon/models/vulnerabilities_api_vuln_count.go new file mode 100644 index 00000000..ac669216 --- /dev/null +++ b/falcon/models/vulnerabilities_api_vuln_count.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" +) + +// VulnerabilitiesAPIVulnCount vulnerabilities api vuln count +// +// swagger:model vulnerabilities.apiVulnCount +type VulnerabilitiesAPIVulnCount struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIVulnCount `json:"resources"` +} + +// Validate validates this vulnerabilities api vuln count +func (m *VulnerabilitiesAPIVulnCount) 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 *VulnerabilitiesAPIVulnCount) 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 *VulnerabilitiesAPIVulnCount) 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 *VulnerabilitiesAPIVulnCount) 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 vulnerabilities api vuln count based on the context it is used +func (m *VulnerabilitiesAPIVulnCount) 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 *VulnerabilitiesAPIVulnCount) 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 *VulnerabilitiesAPIVulnCount) 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 *VulnerabilitiesAPIVulnCount) 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 *VulnerabilitiesAPIVulnCount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPIVulnCount) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPIVulnCount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_vuln_count_by_actively_exploited.go b/falcon/models/vulnerabilities_api_vuln_count_by_actively_exploited.go new file mode 100644 index 00000000..87f1c2af --- /dev/null +++ b/falcon/models/vulnerabilities_api_vuln_count_by_actively_exploited.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" +) + +// VulnerabilitiesAPIVulnCountByActivelyExploited vulnerabilities api vuln count by actively exploited +// +// swagger:model vulnerabilities.apiVulnCountByActivelyExploited +type VulnerabilitiesAPIVulnCountByActivelyExploited struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIVulnCount `json:"resources"` +} + +// Validate validates this vulnerabilities api vuln count by actively exploited +func (m *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 vulnerabilities api vuln count by actively exploited based on the context it is used +func (m *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 *VulnerabilitiesAPIVulnCountByActivelyExploited) 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 *VulnerabilitiesAPIVulnCountByActivelyExploited) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPIVulnCountByActivelyExploited) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPIVulnCountByActivelyExploited + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_vuln_count_by_c_s_p_rating.go b/falcon/models/vulnerabilities_api_vuln_count_by_c_s_p_rating.go new file mode 100644 index 00000000..ef624347 --- /dev/null +++ b/falcon/models/vulnerabilities_api_vuln_count_by_c_s_p_rating.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" +) + +// VulnerabilitiesAPIVulnCountByCSPRating vulnerabilities api vuln count by c s p rating +// +// swagger:model vulnerabilities.apiVulnCountByCSPRating +type VulnerabilitiesAPIVulnCountByCSPRating struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"resources"` +} + +// Validate validates this vulnerabilities api vuln count by c s p rating +func (m *VulnerabilitiesAPIVulnCountByCSPRating) 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 *VulnerabilitiesAPIVulnCountByCSPRating) 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 *VulnerabilitiesAPIVulnCountByCSPRating) 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 *VulnerabilitiesAPIVulnCountByCSPRating) 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 vulnerabilities api vuln count by c s p rating based on the context it is used +func (m *VulnerabilitiesAPIVulnCountByCSPRating) 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 *VulnerabilitiesAPIVulnCountByCSPRating) 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 *VulnerabilitiesAPIVulnCountByCSPRating) 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 *VulnerabilitiesAPIVulnCountByCSPRating) 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 *VulnerabilitiesAPIVulnCountByCSPRating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPIVulnCountByCSPRating) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPIVulnCountByCSPRating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_vuln_count_by_c_v_s_s_score.go b/falcon/models/vulnerabilities_api_vuln_count_by_c_v_s_s_score.go new file mode 100644 index 00000000..c1c5da00 --- /dev/null +++ b/falcon/models/vulnerabilities_api_vuln_count_by_c_v_s_s_score.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" +) + +// VulnerabilitiesAPIVulnCountByCVSSScore vulnerabilities api vuln count by c v s s score +// +// swagger:model vulnerabilities.apiVulnCountByCVSSScore +type VulnerabilitiesAPIVulnCountByCVSSScore struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"resources"` +} + +// Validate validates this vulnerabilities api vuln count by c v s s score +func (m *VulnerabilitiesAPIVulnCountByCVSSScore) 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 *VulnerabilitiesAPIVulnCountByCVSSScore) 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 *VulnerabilitiesAPIVulnCountByCVSSScore) 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 *VulnerabilitiesAPIVulnCountByCVSSScore) 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 vulnerabilities api vuln count by c v s s score based on the context it is used +func (m *VulnerabilitiesAPIVulnCountByCVSSScore) 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 *VulnerabilitiesAPIVulnCountByCVSSScore) 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 *VulnerabilitiesAPIVulnCountByCVSSScore) 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 *VulnerabilitiesAPIVulnCountByCVSSScore) 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 *VulnerabilitiesAPIVulnCountByCVSSScore) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPIVulnCountByCVSSScore) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPIVulnCountByCVSSScore + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/vulnerabilities_api_vuln_count_by_severity.go b/falcon/models/vulnerabilities_api_vuln_count_by_severity.go new file mode 100644 index 00000000..dc9c3376 --- /dev/null +++ b/falcon/models/vulnerabilities_api_vuln_count_by_severity.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" +) + +// VulnerabilitiesAPIVulnCountBySeverity vulnerabilities api vuln count by severity +// +// swagger:model vulnerabilities.apiVulnCountBySeverity +type VulnerabilitiesAPIVulnCountBySeverity struct { + + // errors + Errors []*MsaAPIError `json:"errors"` + + // meta + // Required: true + Meta *MsaMetaInfo `json:"meta"` + + // resources + // Required: true + Resources []*ModelsAPIFilterResponse `json:"resources"` +} + +// Validate validates this vulnerabilities api vuln count by severity +func (m *VulnerabilitiesAPIVulnCountBySeverity) 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 *VulnerabilitiesAPIVulnCountBySeverity) 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 *VulnerabilitiesAPIVulnCountBySeverity) 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 *VulnerabilitiesAPIVulnCountBySeverity) 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 vulnerabilities api vuln count by severity based on the context it is used +func (m *VulnerabilitiesAPIVulnCountBySeverity) 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 *VulnerabilitiesAPIVulnCountBySeverity) 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 *VulnerabilitiesAPIVulnCountBySeverity) 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 *VulnerabilitiesAPIVulnCountBySeverity) 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 *VulnerabilitiesAPIVulnCountBySeverity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilitiesAPIVulnCountBySeverity) UnmarshalBinary(b []byte) error { + var res VulnerabilitiesAPIVulnCountBySeverity + 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 d3548431..9ccb0c00 100644 --- a/specs/transformation.jq +++ b/specs/transformation.jq @@ -23,10 +23,6 @@ # Rename msaspec.MetaInfo to msa.MetaInfo. These are two names for the same type. | del(.definitions."msaspec.MetaInfo") - - # Device v1 API has been deprecated since August 2022. And the end point will be removed at some point in the future. - | del(.paths."/devices/entities/devices/v1") - # Misc fixes | .paths."/intel/entities/rules-latest-files/v1".get.parameters |= . + [{type: "string", description: "Download Only if changed since", name: "If-Modified-Since", "in": "header"}] | .paths."/intel/entities/rules-latest-files/v1".get.responses."304" = {description: "Not Modified"} @@ -48,15 +44,16 @@ | .paths."/cloud-connect-gcp/entities/user-scripts/v1".get.operationId = "GetD4CGcpUserScripts" # Rename spotlight-vulnerabilities and spotlight-evaluation-logic collections back to vulnerabilities & vulnerabilities-evaluation-logic - | walk( - if type == "object" and .tags and (.tags | index("spotlight-vulnerabilities")) then - .tags |= map(gsub("spotlight-vulnerabilities"; "vulnerabilities")) - elif type == "object" and .tags and (.tags | index("spotlight-evaluation-logic")) then - .tags |= map(gsub("spotlight-evaluation-logic"; "vulnerabilities-evaluation-logic")) - else - . - end - ) + # looks like spotlight is staying to reverting it again... keeping this code incase it can be used some other time. + # | walk( + # if type == "object" and .tags and (.tags | index("spotlight-vulnerabilities")) then + # .tags |= map(gsub("spotlight-vulnerabilities"; "vulnerabilities")) + # elif type == "object" and .tags and (.tags | index("spotlight-evaluation-logic")) then + # .tags |= map(gsub("spotlight-evaluation-logic"; "vulnerabilities-evaluation-logic")) + # else + # . + # end + # ) # Revert msaspec.QueryResponse back to msa.QueryResponse for falconcomplete-dashboard | if .paths."/falcon-complete-dashboards/queries/alerts/v1".get.responses."200".schema."$ref" = "#/definitions/msaspec.QueryResponse" then .paths."/falcon-complete-dashboards/queries/alerts/v1".get.responses."200".schema |= {"$ref": "#/definitions/msa.QueryResponse"} else . end @@ -78,40 +75,67 @@ | if .paths."/message-center/aggregates/cases/GET/v1".post.responses."403".schema."$ref" = "#/definitions/msa.ReplyMetaOnly" then .paths."/message-center/aggregates/cases/GET/v1".post.responses."403".schema = {"$ref": "#/definitions/msaspec.ResponseFields"} else . end + + # Custom Storage "custom-type" rename + | .definitions."CustomStorageObjectKeys" = .definitions."CustomType_1255839303" + | del(.definitions."CustomType_1255839303") + | if .paths."/customobjects/v1/collections/{collection_name}/objects".get.responses."200".schema."$ref" = "#/definitions/CustomType_1255839303" then + .paths."/customobjects/v1/collections/{collection_name}/objects".get.responses."200".schema = {"$ref": "#/definitions/CustomStorageObjectKeys"} else . end + + | .definitions."CustomStorageResponse" = .definitions."CustomType_3191042536" + | del(.definitions."CustomType_3191042536") + | if .paths."/customobjects/v1/collections/{collection_name}/objects".post.responses."200".schema."$ref" = "#/definitions/CustomType_3191042536" then + .paths."/customobjects/v1/collections/{collection_name}/objects".post.responses."200".schema = {"$ref": "#/definitions/CustomStorageResponse"} else . end + | if .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}".put.responses."200".schema."$ref" = "#/definitions/CustomType_3191042536" then + .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}".put.responses."200".schema = {"$ref": "#/definitions/CustomStorageResponse"} else . end + | if .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}".delete.responses."200".schema."$ref" = "#/definitions/CustomType_3191042536" then + .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}".delete.responses."200".schema = {"$ref": "#/definitions/CustomStorageResponse"} else . end + | if .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata".get.responses."200".schema."$ref" = "#/definitions/CustomType_3191042536" then + .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata".get.responses."200".schema = {"$ref": "#/definitions/CustomStorageResponse"} else . end + + # Better operationId for workflows collection - | .paths."/workflows/entities/execute/v1".post.operationId = "execute" - | .paths."/workflows/entities/execution-actions/v1".post.operationId = "executions.action" - | .paths."/workflows/entities/execution-results/v1".get.operationId = "executions.result" - | .paths."/workflows/system-definitions/deprovision/v1".post.operationId = "deprovision.system-definition" - | .paths."/workflows/system-definitions/promote/v1".post.operationId = "promote.system-definition" - | .paths."/workflows/system-definitions/provision/v1".post.operationId = "provision.system-definition" + | .paths."/workflows/entities/execute/v1".post.operationId = "Execute" + | .paths."/workflows/entities/execution-actions/v1".post.operationId = "ExecutionAction" + | .paths."/workflows/entities/execution-results/v1".get.operationId = "ExecutionResults" + | .paths."/workflows/system-definitions/deprovision/v1".post.operationId = "Deprovision" + | .paths."/workflows/system-definitions/promote/v1".post.operationId = "Promote" + | .paths."/workflows/system-definitions/provision/v1".post.operationId = "Provision" - # Better operationId for logscale-management collection - | .paths."/loggingapi/combined/initialize/v1".post.operationId = "Initialize" + # Better operationId for foundry-logscale collection | .paths."/loggingapi/combined/repos/v1".get.operationId = "ListRepos" + | .paths."/loggingapi/entities/data-ingestion/ingest/v1".post.operationId = "IngestData" + | .paths."/loggingapi/entities/saved-searches/execute-dynamic/v1".post.operationId = "ExecuteDynamic" + | .paths."/loggingapi/entities/saved-searches/execute/v1".get.operationId = "GetSearchResults" + | .paths."/loggingapi/entities/saved-searches/execute/v1".post.operationId = "Execute" + | .paths."/loggingapi/entities/saved-searches/ingest/v1".post.operationId = "Populate" + | .paths."/loggingapi/entities/saved-searches/job-results-download/v1".get.operationId = "DownloadResults" | .paths."/loggingapi/entities/views/v1".get.operationId = "ListViews" - | .paths."/loggingapi/entities/views/v1".post.operationId = "CreateView" - + + # Better operationId for custom-storage collection + | .paths."/customobjects/v1/collections/{collection_name}/objects".get.operationId = "list" + | .paths."/customobjects/v1/collections/{collection_name}/objects".post.operationId = "search" + | .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}".get.operationId = "get" + | .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}".put.operationId = "upload" + | .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}".delete.operationId = "delete" + | .paths."/customobjects/v1/collections/{collection_name}/objects/{object_key}/metadata".get.operationId = "metadata" + + # Better operationId for unidentified-containers collection + | .paths."/container-security/aggregates/unidentified-containers/count-by-date/v1".get.operationId = "CountByDateRange" + | .paths."/container-security/aggregates/unidentified-containers/count/v1".get.operationId = "Count" + | .paths."/container-security/combined/unidentified-containers/v1".get.operationId = "Search" + + # Better operationId for snapshots-registration collection + | .paths."/snapshots/entities/accounts/v1".post.operationId = "Register" + # Better operationId for scheduled-reports collection | .paths."/reports/entities/scheduled-reports/execution/v1".post.operationId = "Execute" | .paths."/reports/entities/scheduled-reports/v1".get.operationId = "QueryById" | .paths."/reports/queries/scheduled-reports/v1".get.operationId = "Query" -# Better operationId for saved-searches collection - | .paths."/loggingapi/combined/saved-searches/v1".get.operationId = "QueryCombined" - | .paths."/loggingapi/entities/saved-searches-deploy/v1".post.operationId = "Deploy" - | .paths."/loggingapi/entities/saved-searches-dynamic-execute/v1".post.operationId = "ExecuteDynamic" - | .paths."/loggingapi/entities/saved-searches-execute/v1".get.operationId = "Result" - | .paths."/loggingapi/entities/saved-searches-execute/v1".post.operationId = "Execute" - | .paths."/loggingapi/entities/saved-searches-ingest/v1".post.operationId = "Ingest" - | .paths."/loggingapi/entities/saved-searches-validate/v1".post.operationId = "Validate" - | .paths."/loggingapi/entities/saved-searches/v1".get.operationId = "QueryById" - | .paths."/loggingapi/entities/saved-searches/v1".post.operationId = "CreateSavedSearch" - | .paths."/loggingapi/entities/saved-searches/v1".delete.operationId = "DeleteSavedSearch" - | .paths."/loggingapi/entities/saved-searches/v1".patch.operationId = "UpdateSavedSearch" - | .paths."/loggingapi/queries/saved-searches/v1".get.operationId = "Query" - - - - + # Better operationId for alerts collection + | .paths."/alerts/queries/alerts/v2".get.operationId = "QueryV2" + | .paths."/alerts/entities/alerts/v3".patch.operationId = "UpdateV3" + | .paths."/alerts/aggregates/alerts/v2".post.operationId = "GetAggregateV2" + | .paths."/alerts/entities/alerts/v2".post.operationId = "GetV2" \ No newline at end of file