From 403a069303106cfdb7c6c9628287dfb38cbcb20d Mon Sep 17 00:00:00 2001 From: DEXREQ Automation Date: Mon, 5 Dec 2022 19:14:52 +0000 Subject: [PATCH] Merge pull request #2212 in SDK/oci-go-sdk from merge_to_github2022-12-05 to github Releasing Version 65.27.0 Squashed commit of the following: commit 86fd0ee1fa65c578913a81044b194a00500ada53 Author: oci-dex-release-bot Date: Mon Dec 5 19:01:29 2022 +0000 Releasing version 65 27 0 --- CHANGELOG.md | 38 + Makefile | 2 +- .../aidocument_aiservicedocument_client.go | 266 ++++ aidocument/analyze_document_result.go | 67 + aidocument/bounding_polygon.go | 40 + .../cancel_processor_job_request_response.go | 94 ++ aidocument/cell.go | 53 + aidocument/create_processor_job_details.go | 92 ++ .../create_processor_job_request_response.go | 100 ++ aidocument/detected_document_type.go | 42 + aidocument/detected_language.go | 42 + aidocument/dimensions.go | 90 ++ aidocument/document_classification_feature.go | 54 + aidocument/document_feature.go | 146 +++ aidocument/document_field.go | 132 ++ .../document_key_value_extraction_feature.go | 51 + ...ocument_language_classification_feature.go | 54 + aidocument/document_metadata.go | 42 + .../document_table_extraction_feature.go | 51 + .../document_text_extraction_feature.go | 54 + aidocument/document_type.go | 88 ++ aidocument/field_label.go | 42 + aidocument/field_name.go | 47 + aidocument/field_value.go | 201 +++ aidocument/general_processor_config.go | 102 ++ .../get_processor_job_request_response.go | 93 ++ aidocument/inline_document_content.go | 54 + aidocument/input_location.go | 122 ++ aidocument/line.go | 47 + aidocument/normalized_vertex.go | 44 + aidocument/object_location.go | 45 + aidocument/object_storage_locations.go | 54 + aidocument/output_location.go | 45 + aidocument/page.go | 59 + aidocument/processing_error.go | 42 + aidocument/processor_config.go | 76 ++ aidocument/processor_job.go | 241 ++++ aidocument/processor_type.go | 52 + aidocument/table.go | 56 + aidocument/table_row.go | 39 + aidocument/value_array.go | 84 ++ aidocument/value_date.go | 85 ++ aidocument/value_integer.go | 85 ++ aidocument/value_number.go | 85 ++ aidocument/value_phone_number.go | 85 ++ aidocument/value_string.go | 85 ++ aidocument/value_time.go | 85 ++ aidocument/word.go | 44 + .../announcement_subscription.go | 6 + .../announcements_preferences.go | 8 + .../announcements_preferences_summary.go | 8 + ...nnouncementsservice_announcement_client.go | 2 +- ...service_announcementspreferences_client.go | 2 +- ...service_announcementsubscription_client.go | 2 +- announcementsservice/base_announcement.go | 16 +- .../base_announcements_preferences.go | 26 +- ...reate_announcements_preferences_details.go | 20 +- ...reate_announcement_subscription_details.go | 6 + ...reate_announcements_preferences_details.go | 8 + ...pdate_announcement_subscription_details.go | 6 + ...pdate_announcements_preferences_details.go | 8 + apigateway/additional_validation_policy.go | 47 + apigateway/any_of_selection_key.go | 6 +- apigateway/api_specification_route_backend.go | 8 + apigateway/authentication_policy.go | 8 + apigateway/authentication_server_policy.go | 2 +- apigateway/client_app_details.go | 124 ++ apigateway/custom_client_app_details.go | 62 + .../discovery_uri_source_uri_details.go | 56 + apigateway/dynamic_authentication_policy.go | 2 +- apigateway/dynamic_routing_backend.go | 2 +- .../dynamic_routing_type_routing_backend.go | 2 +- apigateway/dynamic_selection_key.go | 4 +- apigateway/jwt_authentication_policy.go | 12 +- apigateway/o_auth2_logout_backend.go | 57 + ...uth2_response_validation_failure_policy.go | 184 +++ apigateway/selection_source_policy.go | 2 +- apigateway/single_selection_source_policy.go | 2 +- apigateway/source_uri_details.go | 124 ++ apigateway/token_authentication_policy.go | 130 ++ ...tion_remote_discovery_validation_policy.go | 115 ++ ...ntication_remote_jwks_validation_policy.go | 73 ++ ...ntication_static_keys_validation_policy.go | 92 ++ .../token_authentication_validation_policy.go | 140 ++ .../validation_block_client_app_details.go | 53 + .../validation_block_source_uri_details.go | 53 + apigateway/validation_failure_policy.go | 8 + apigateway/wildcard_selection_key.go | 6 +- common/version.go | 4 +- containerinstances/action_type.go | 72 ++ containerinstances/basic_image_pull_secret.go | 59 + ..._container_instance_compartment_details.go | 40 + ...r_instance_compartment_request_response.go | 100 ++ containerinstances/container.go | 320 +++++ containerinstances/container_capability.go | 56 + containerinstances/container_collection.go | 39 + .../container_command_health_check.go | 133 ++ containerinstances/container_config_file.go | 45 + .../container_config_file_volume.go | 62 + containerinstances/container_dns_config.go | 45 + .../container_empty_dir_volume.go | 107 ++ containerinstances/container_health_check.go | 227 ++++ .../container_health_check_failure_action.go | 56 + .../container_health_check_type.go | 60 + .../container_http_health_check.go | 139 ++ containerinstances/container_instance.go | 335 +++++ .../container_instance_collection.go | 39 + .../container_instance_container.go | 42 + .../container_instance_shape_collection.go | 39 + .../container_instance_shape_config.go | 49 + .../container_instance_shape_summary.go | 48 + .../container_instance_summary.go | 99 ++ .../container_resource_config.go | 49 + containerinstances/container_summary.go | 97 ++ .../container_tcp_health_check.go | 133 ++ containerinstances/container_vnic.go | 41 + containerinstances/container_volume.go | 91 ++ containerinstances/container_volume_type.go | 56 + ...ainerinstances_containerinstance_client.go | 1136 +++++++++++++++++ .../create_basic_image_pull_secret_details.go | 65 + ..._container_command_health_check_details.go | 114 ++ ...te_container_config_file_volume_details.go | 62 + .../create_container_details.go | 181 +++ .../create_container_dns_config_details.go | 49 + ...eate_container_empty_dir_volume_details.go | 65 + .../create_container_health_check_details.go | 158 +++ ...ate_container_http_health_check_details.go | 120 ++ .../create_container_instance_details.go | 174 +++ ...ate_container_instance_request_response.go | 103 ++ ...container_instance_shape_config_details.go | 42 + ...reate_container_resource_config_details.go | 49 + ...eate_container_tcp_health_check_details.go | 114 ++ .../create_container_vnic_details.go | 72 ++ .../create_container_volume_details.go | 91 ++ .../create_image_pull_secret_details.go | 132 ++ .../create_vault_image_pull_secret_details.go | 69 + .../create_volume_mount_details.go | 56 + ...ete_container_instance_request_response.go | 97 ++ ...get_container_instance_request_response.go | 93 ++ .../get_container_request_response.go | 93 ++ .../get_work_request_request_response.go | 93 ++ .../health_check_http_header.go | 42 + containerinstances/image_pull_secret.go | 132 ++ ...tainer_instance_shapes_request_response.go | 105 ++ ...st_container_instances_request_response.go | 210 +++ .../list_containers_request_response.go | 213 ++++ ...st_work_request_errors_request_response.go | 101 ++ ...list_work_request_logs_request_response.go | 101 ++ .../list_work_requests_request_response.go | 104 ++ containerinstances/operation_status.go | 72 ++ containerinstances/operation_type.go | 80 ++ ...art_container_instance_request_response.go | 97 ++ .../retrieve_logs_request_response.go | 91 ++ containerinstances/shape_memory_options.go | 51 + .../shape_networking_bandwidth_options.go | 45 + containerinstances/shape_ocpu_options.go | 42 + containerinstances/sort_order.go | 56 + ...art_container_instance_request_response.go | 97 ++ ...top_container_instance_request_response.go | 97 ++ .../update_container_details.go | 48 + .../update_container_instance_details.go | 47 + ...ate_container_instance_request_response.go | 100 ++ .../update_container_request_response.go | 100 ++ containerinstances/vault_image_pull_secret.go | 62 + containerinstances/volume_mount.go | 56 + containerinstances/work_request.go | 74 ++ containerinstances/work_request_error.go | 46 + .../work_request_error_collection.go | 39 + containerinstances/work_request_log_entry.go | 42 + .../work_request_log_entry_collection.go | 39 + containerinstances/work_request_resource.go | 54 + containerinstances/work_request_summary.go | 74 ++ .../work_request_summary_collection.go | 39 + datasafe/alerts_update_details.go | 48 + datasafe/alerts_update_request_response.go | 157 +++ datasafe/audit_event_summary.go | 2 +- datasafe/audit_trail.go | 4 + datasafe/audit_trail_status.go | 60 +- datasafe/autonomous_database_details.go | 2 +- datasafe/database_cloud_service_details.go | 7 +- datasafe/datasafe_client.go | 251 ++++ datasafe/discovery_job_result.go | 3 + datasafe/discovery_job_result_summary.go | 3 + datasafe/download_masking_log_details.go | 3 + datasafe/installed_database_details.go | 12 +- .../list_audit_trails_request_response.go | 60 +- .../list_masking_columns_request_response.go | 4 + ...ist_on_prem_connectors_request_response.go | 46 +- datasafe/list_reports_request_response.go | 48 + ...list_sensitive_columns_request_response.go | 4 + ...rt_policy_associations_request_response.go | 16 +- datasafe/masking_report.go | 9 + datasafe/masking_report_summary.go | 9 + datasafe/on_prem_connector_lifecycle_state.go | 46 +- datasafe/on_premise_connector.go | 2 +- datasafe/patch_alerts_details.go | 10 +- datasafe/patch_alerts_request_response.go | 55 + ...target_alert_policy_association_details.go | 73 ++ ...ert_policy_association_request_response.go | 96 ++ datasafe/private_endpoint.go | 2 +- ...remove_schedule_report_request_response.go | 102 ++ datasafe/report.go | 6 + datasafe/report_definition.go | 87 ++ datasafe/report_definition_summary.go | 18 + datasafe/report_details.go | 114 ++ datasafe/report_summary.go | 6 + datasafe/report_type.go | 56 + datasafe/schedule_audit_report_details.go | 65 + datasafe/schedule_report_details.go | 145 +++ datasafe/schedule_report_request_response.go | 105 ++ datasafe/update_masking_column_details.go | 3 +- datasafe/user_assessment.go | 4 +- datasafe/user_assessment_summary.go | 4 +- datasafe/work_request.go | 16 + datasafe/work_request_summary.go | 16 + ...eate_deploy_pipeline_deployment_details.go | 2 + ..._single_deploy_stage_deployment_details.go | 2 + devops/deploy_pipeline_deployment.go | 7 + devops/deploy_pipeline_deployment_summary.go | 7 + devops/deploy_pipeline_redeployment.go | 7 + .../deploy_pipeline_redeployment_summary.go | 7 + devops/deploy_stage_override_argument.go | 45 + ...ploy_stage_override_argument_collection.go | 39 + devops/deployment.go | 9 + devops/deployment_summary.go | 9 + devops/list_work_requests_request_response.go | 44 +- devops/operation_status.go | 44 +- devops/single_deploy_stage_deployment.go | 7 + .../single_deploy_stage_deployment_summary.go | 7 + devops/single_deploy_stage_redeployment.go | 7 + ...ingle_deploy_stage_redeployment_summary.go | 7 + .../collect_deployment_diagnostic_details.go | 51 + ..._deployment_diagnostic_request_response.go | 107 ++ goldengate/deployment.go | 2 + goldengate/deployment_diagnostic_data.go | 57 + goldengate/deployment_diagnostic_state.go | 60 + goldengate/goldengate_client.go | 63 + jms/add_fleet_installation_sites_details.go | 3 + jms/advanced_usage_tracking.go | 39 + jms/algorithms.go | 64 + jms/create_fleet_details.go | 3 +- jms/crypto_analysis_result.go | 92 ++ jms/crypto_analysis_result_collection.go | 39 + jms/crypto_analysis_result_mode.go | 56 + jms/crypto_analysis_result_sort_by.go | 60 + jms/crypto_analysis_result_summary.go | 92 ++ jms/crypto_event_analysis.go | 41 + ...crypto_analysis_result_request_response.go | 101 ++ jms/deployed_application_sort_by.go | 72 ++ jms/deployed_application_usage.go | 72 ++ jms/deployed_application_usage_collection.go | 39 + jms/fleet.go | 7 +- jms/fleet_advanced_feature_configuration.go | 53 + jms/fleet_agent_configuration.go | 6 + jms/fleet_summary.go | 7 +- ...crypto_analysis_result_request_response.go | 96 ++ ..._feature_configuration_request_response.go | 100 ++ jms/java_family.go | 3 +- jms/java_family_collection.go | 5 +- jms/java_family_summary.go | 1 + jms/java_release.go | 10 +- jms/java_release_collection.go | 2 +- jms/java_release_summary.go | 8 + jms/java_server_instance_sort_by.go | 68 + jms/java_server_instance_usage.go | 99 ++ jms/java_server_instance_usage_collection.go | 39 + jms/java_server_sort_by.go | 72 ++ jms/java_server_usage.go | 72 ++ jms/java_server_usage_collection.go | 39 + jms/jfr_attachment_target.go | 47 + jms/jfr_recording.go | 39 + jms/jms_javamanagementservice_client.go | 910 ++++++++++++- jms/key_size_algorithm.go | 46 + jms/lcm.go | 41 + jms/library_sort_by.go | 84 ++ jms/library_usage.go | 81 ++ jms/library_usage_collection.go | 39 + jms/list_blocklists_request_response.go | 16 + ...rypto_analysis_results_request_response.go | 261 ++++ jms/minimum_key_size_settings.go | 55 + jms/new_installation_site.go | 6 + jms/operation_type.go | 16 + jms/post_installation_action_settings.go | 47 + jms/post_installation_actions.go | 72 ++ jms/request_crypto_analyses_details.go | 43 + ...equest_crypto_analyses_request_response.go | 94 ++ jms/request_jfr_recordings_details.go | 57 + ...request_jfr_recordings_request_response.go | 94 ++ jms/scan_java_server_usage_details.go | 39 + ...scan_java_server_usage_request_response.go | 108 ++ jms/scan_library_usage_details.go | 39 + jms/scan_library_usage_request_response.go | 108 ++ ...rize_application_usage_request_response.go | 3 + ...oyed_application_usage_request_response.go | 241 ++++ ..._server_instance_usage_request_response.go | 237 ++++ ...rize_java_server_usage_request_response.go | 232 ++++ jms/summarize_jre_usage_request_response.go | 3 + ...ummarize_library_usage_request_response.go | 250 ++++ ...managed_instance_usage_request_response.go | 3 + jms/summarized_events_log.go | 42 + jms/tls_versions.go | 56 + ..._advanced_feature_configuration_details.go | 51 + ..._feature_configuration_request_response.go | 110 ++ ...pdate_fleet_agent_configuration_details.go | 6 + jms/update_fleet_details.go | 3 +- mysql/anonymous_transactions_handling.go | 131 ++ mysql/assign_manual_uuid_handling.go | 68 + mysql/assign_target_uuid_handling.go | 64 + mysql/backup_summary.go | 3 + mysql/channel_filter.go | 111 ++ mysql/channel_source_mysql.go | 23 +- mysql/channel_target_db_system.go | 3 + ...reate_channel_source_from_mysql_details.go | 25 +- ...e_channel_target_from_db_system_details.go | 3 + mysql/create_maintenance_details.go | 3 +- mysql/create_replica_details.go | 59 + mysql/create_replica_request_response.go | 109 ++ mysql/db_system_endpoint.go | 55 + mysql/delete_replica_request_response.go | 99 ++ mysql/error_on_anonymous_handling.go | 52 + mysql/get_replica_request_response.go | 108 ++ mysql/list_replicas_request_response.go | 217 ++++ mysql/maintenance_details.go | 3 +- mysql/mysql_replicas_client.go | 383 ++++++ mysql/replica.go | 164 +++ mysql/replica_summary.go | 164 +++ ...pdate_channel_source_from_mysql_details.go | 25 +- ...e_channel_target_from_db_system_details.go | 3 + mysql/update_maintenance_details.go | 4 +- mysql/update_replica_details.go | 56 + mysql/update_replica_request_response.go | 108 ++ mysql/work_request_operation_type.go | 32 + opsi/add_exadata_insight_members_details.go | 4 + ...managed_exadata_insight_members_details.go | 54 + opsi/create_exadata_insight_details.go | 4 + ...te_pe_comanaged_exadata_insight_details.go | 84 ++ ..._pe_comanaged_exadata_vmcluster_details.go | 50 + opsi/enable_exadata_insight_details.go | 4 + ...le_pe_comanaged_exadata_insight_details.go | 53 + opsi/exadata_configuration_summary.go | 14 + ..._database_machine_configuration_summary.go | 8 + opsi/exadata_details.go | 5 +- opsi/exadata_entity_source.go | 4 + opsi/exadata_exacs_configuration_summary.go | 139 ++ opsi/exadata_insight.go | 4 + opsi/exadata_insight_summary.go | 4 + opsi/exadata_member_summary.go | 4 + opsi/exadata_rack_type.go | 4 + opsi/exadata_resource_type.go | 54 + ...atabase_configurations_request_response.go | 3 + ...st_host_configurations_request_response.go | 3 + opsi/pe_comanaged_database_insight.go | 12 + opsi/pe_comanaged_database_insight_summary.go | 6 + opsi/pe_comanaged_exadata_insight.go | 200 +++ opsi/pe_comanaged_exadata_insight_summary.go | 192 +++ ...pe_comanaged_host_configuration_summary.go | 2 + ...external_database_configuration_summary.go | 2 + ...esource_capacity_trend_request_response.go | 3 + ...esource_forecast_trend_request_response.go | 3 + ...ht_resource_statistics_request_response.go | 3 + ...insight_resource_usage_request_response.go | 3 + ...t_resource_usage_trend_request_response.go | 3 + ...ce_utilization_insight_request_response.go | 3 + ...esource_capacity_trend_request_response.go | 3 + ...esource_forecast_trend_request_response.go | 3 + ...ht_resource_statistics_request_response.go | 3 + ...insight_resource_usage_request_response.go | 3 + ...t_resource_usage_trend_request_response.go | 3 + ...ce_utilization_insight_request_response.go | 3 + ...mmarize_sql_statistics_request_response.go | 3 + ...statistics_time_series_request_response.go | 3 + opsi/update_exadata_insight_details.go | 4 + ...te_pe_comanaged_exadata_insight_details.go | 71 ++ opsi/vm_cluster_summary.go | 50 + .../bitbucket_cloud_config_source.go | 79 ++ .../bitbucket_cloud_config_source_record.go | 70 + ..._password_configuration_source_provider.go | 157 +++ ...d_configuration_source_provider_summary.go | 143 +++ ...ess_token_configuration_source_provider.go | 157 +++ ...n_configuration_source_provider_summary.go | 143 +++ .../bitbucket_server_config_source.go | 85 ++ .../bitbucket_server_config_source_record.go | 67 + resourcemanager/config_source.go | 48 +- resourcemanager/config_source_record.go | 48 +- .../configuration_source_provider.go | 48 +- .../configuration_source_provider_summary.go | 8 + ...e_bitbucket_cloud_config_source_details.go | 79 ++ ...d_configuration_source_provider_details.go | 117 ++ ...n_configuration_source_provider_details.go | 114 ++ ..._bitbucket_server_config_source_details.go | 83 ++ .../create_config_source_details.go | 12 + ...e_configuration_source_provider_details.go | 8 + .../create_dev_ops_config_source_details.go | 76 ++ resourcemanager/dev_ops_config_source.go | 76 ++ .../dev_ops_config_source_record.go | 66 + ...ess_token_configuration_source_provider.go | 16 + ...ess_token_configuration_source_provider.go | 16 + ...e_bitbucket_cloud_config_source_details.go | 79 ++ ...d_configuration_source_provider_details.go | 108 ++ ...n_configuration_source_provider_details.go | 105 ++ ..._bitbucket_server_config_source_details.go | 83 ++ .../update_config_source_details.go | 12 + ...e_configuration_source_provider_details.go | 8 + .../update_dev_ops_config_source_details.go | 76 ++ stackmonitoring/discovery_details.go | 12 + stackmonitoring/discovery_job_summary.go | 12 + 406 files changed, 26103 insertions(+), 326 deletions(-) create mode 100644 aidocument/aidocument_aiservicedocument_client.go create mode 100644 aidocument/analyze_document_result.go create mode 100644 aidocument/bounding_polygon.go create mode 100644 aidocument/cancel_processor_job_request_response.go create mode 100644 aidocument/cell.go create mode 100644 aidocument/create_processor_job_details.go create mode 100644 aidocument/create_processor_job_request_response.go create mode 100644 aidocument/detected_document_type.go create mode 100644 aidocument/detected_language.go create mode 100644 aidocument/dimensions.go create mode 100644 aidocument/document_classification_feature.go create mode 100644 aidocument/document_feature.go create mode 100644 aidocument/document_field.go create mode 100644 aidocument/document_key_value_extraction_feature.go create mode 100644 aidocument/document_language_classification_feature.go create mode 100644 aidocument/document_metadata.go create mode 100644 aidocument/document_table_extraction_feature.go create mode 100644 aidocument/document_text_extraction_feature.go create mode 100644 aidocument/document_type.go create mode 100644 aidocument/field_label.go create mode 100644 aidocument/field_name.go create mode 100644 aidocument/field_value.go create mode 100644 aidocument/general_processor_config.go create mode 100644 aidocument/get_processor_job_request_response.go create mode 100644 aidocument/inline_document_content.go create mode 100644 aidocument/input_location.go create mode 100644 aidocument/line.go create mode 100644 aidocument/normalized_vertex.go create mode 100644 aidocument/object_location.go create mode 100644 aidocument/object_storage_locations.go create mode 100644 aidocument/output_location.go create mode 100644 aidocument/page.go create mode 100644 aidocument/processing_error.go create mode 100644 aidocument/processor_config.go create mode 100644 aidocument/processor_job.go create mode 100644 aidocument/processor_type.go create mode 100644 aidocument/table.go create mode 100644 aidocument/table_row.go create mode 100644 aidocument/value_array.go create mode 100644 aidocument/value_date.go create mode 100644 aidocument/value_integer.go create mode 100644 aidocument/value_number.go create mode 100644 aidocument/value_phone_number.go create mode 100644 aidocument/value_string.go create mode 100644 aidocument/value_time.go create mode 100644 aidocument/word.go create mode 100644 apigateway/additional_validation_policy.go create mode 100644 apigateway/client_app_details.go create mode 100644 apigateway/custom_client_app_details.go create mode 100644 apigateway/discovery_uri_source_uri_details.go create mode 100644 apigateway/o_auth2_logout_backend.go create mode 100644 apigateway/o_auth2_response_validation_failure_policy.go create mode 100644 apigateway/source_uri_details.go create mode 100644 apigateway/token_authentication_policy.go create mode 100644 apigateway/token_authentication_remote_discovery_validation_policy.go create mode 100644 apigateway/token_authentication_remote_jwks_validation_policy.go create mode 100644 apigateway/token_authentication_static_keys_validation_policy.go create mode 100644 apigateway/token_authentication_validation_policy.go create mode 100644 apigateway/validation_block_client_app_details.go create mode 100644 apigateway/validation_block_source_uri_details.go create mode 100644 containerinstances/action_type.go create mode 100644 containerinstances/basic_image_pull_secret.go create mode 100644 containerinstances/change_container_instance_compartment_details.go create mode 100644 containerinstances/change_container_instance_compartment_request_response.go create mode 100644 containerinstances/container.go create mode 100644 containerinstances/container_capability.go create mode 100644 containerinstances/container_collection.go create mode 100644 containerinstances/container_command_health_check.go create mode 100644 containerinstances/container_config_file.go create mode 100644 containerinstances/container_config_file_volume.go create mode 100644 containerinstances/container_dns_config.go create mode 100644 containerinstances/container_empty_dir_volume.go create mode 100644 containerinstances/container_health_check.go create mode 100644 containerinstances/container_health_check_failure_action.go create mode 100644 containerinstances/container_health_check_type.go create mode 100644 containerinstances/container_http_health_check.go create mode 100644 containerinstances/container_instance.go create mode 100644 containerinstances/container_instance_collection.go create mode 100644 containerinstances/container_instance_container.go create mode 100644 containerinstances/container_instance_shape_collection.go create mode 100644 containerinstances/container_instance_shape_config.go create mode 100644 containerinstances/container_instance_shape_summary.go create mode 100644 containerinstances/container_instance_summary.go create mode 100644 containerinstances/container_resource_config.go create mode 100644 containerinstances/container_summary.go create mode 100644 containerinstances/container_tcp_health_check.go create mode 100644 containerinstances/container_vnic.go create mode 100644 containerinstances/container_volume.go create mode 100644 containerinstances/container_volume_type.go create mode 100644 containerinstances/containerinstances_containerinstance_client.go create mode 100644 containerinstances/create_basic_image_pull_secret_details.go create mode 100644 containerinstances/create_container_command_health_check_details.go create mode 100644 containerinstances/create_container_config_file_volume_details.go create mode 100644 containerinstances/create_container_details.go create mode 100644 containerinstances/create_container_dns_config_details.go create mode 100644 containerinstances/create_container_empty_dir_volume_details.go create mode 100644 containerinstances/create_container_health_check_details.go create mode 100644 containerinstances/create_container_http_health_check_details.go create mode 100644 containerinstances/create_container_instance_details.go create mode 100644 containerinstances/create_container_instance_request_response.go create mode 100644 containerinstances/create_container_instance_shape_config_details.go create mode 100644 containerinstances/create_container_resource_config_details.go create mode 100644 containerinstances/create_container_tcp_health_check_details.go create mode 100644 containerinstances/create_container_vnic_details.go create mode 100644 containerinstances/create_container_volume_details.go create mode 100644 containerinstances/create_image_pull_secret_details.go create mode 100644 containerinstances/create_vault_image_pull_secret_details.go create mode 100644 containerinstances/create_volume_mount_details.go create mode 100644 containerinstances/delete_container_instance_request_response.go create mode 100644 containerinstances/get_container_instance_request_response.go create mode 100644 containerinstances/get_container_request_response.go create mode 100644 containerinstances/get_work_request_request_response.go create mode 100644 containerinstances/health_check_http_header.go create mode 100644 containerinstances/image_pull_secret.go create mode 100644 containerinstances/list_container_instance_shapes_request_response.go create mode 100644 containerinstances/list_container_instances_request_response.go create mode 100644 containerinstances/list_containers_request_response.go create mode 100644 containerinstances/list_work_request_errors_request_response.go create mode 100644 containerinstances/list_work_request_logs_request_response.go create mode 100644 containerinstances/list_work_requests_request_response.go create mode 100644 containerinstances/operation_status.go create mode 100644 containerinstances/operation_type.go create mode 100644 containerinstances/restart_container_instance_request_response.go create mode 100644 containerinstances/retrieve_logs_request_response.go create mode 100644 containerinstances/shape_memory_options.go create mode 100644 containerinstances/shape_networking_bandwidth_options.go create mode 100644 containerinstances/shape_ocpu_options.go create mode 100644 containerinstances/sort_order.go create mode 100644 containerinstances/start_container_instance_request_response.go create mode 100644 containerinstances/stop_container_instance_request_response.go create mode 100644 containerinstances/update_container_details.go create mode 100644 containerinstances/update_container_instance_details.go create mode 100644 containerinstances/update_container_instance_request_response.go create mode 100644 containerinstances/update_container_request_response.go create mode 100644 containerinstances/vault_image_pull_secret.go create mode 100644 containerinstances/volume_mount.go create mode 100644 containerinstances/work_request.go create mode 100644 containerinstances/work_request_error.go create mode 100644 containerinstances/work_request_error_collection.go create mode 100644 containerinstances/work_request_log_entry.go create mode 100644 containerinstances/work_request_log_entry_collection.go create mode 100644 containerinstances/work_request_resource.go create mode 100644 containerinstances/work_request_summary.go create mode 100644 containerinstances/work_request_summary_collection.go create mode 100644 datasafe/alerts_update_details.go create mode 100644 datasafe/alerts_update_request_response.go create mode 100644 datasafe/patch_target_alert_policy_association_details.go create mode 100644 datasafe/patch_target_alert_policy_association_request_response.go create mode 100644 datasafe/remove_schedule_report_request_response.go create mode 100644 datasafe/report_details.go create mode 100644 datasafe/report_type.go create mode 100644 datasafe/schedule_audit_report_details.go create mode 100644 datasafe/schedule_report_details.go create mode 100644 datasafe/schedule_report_request_response.go create mode 100644 devops/deploy_stage_override_argument.go create mode 100644 devops/deploy_stage_override_argument_collection.go create mode 100644 goldengate/collect_deployment_diagnostic_details.go create mode 100644 goldengate/collect_deployment_diagnostic_request_response.go create mode 100644 goldengate/deployment_diagnostic_data.go create mode 100644 goldengate/deployment_diagnostic_state.go create mode 100644 jms/advanced_usage_tracking.go create mode 100644 jms/algorithms.go create mode 100644 jms/crypto_analysis_result.go create mode 100644 jms/crypto_analysis_result_collection.go create mode 100644 jms/crypto_analysis_result_mode.go create mode 100644 jms/crypto_analysis_result_sort_by.go create mode 100644 jms/crypto_analysis_result_summary.go create mode 100644 jms/crypto_event_analysis.go create mode 100644 jms/delete_crypto_analysis_result_request_response.go create mode 100644 jms/deployed_application_sort_by.go create mode 100644 jms/deployed_application_usage.go create mode 100644 jms/deployed_application_usage_collection.go create mode 100644 jms/fleet_advanced_feature_configuration.go create mode 100644 jms/get_crypto_analysis_result_request_response.go create mode 100644 jms/get_fleet_advanced_feature_configuration_request_response.go create mode 100644 jms/java_server_instance_sort_by.go create mode 100644 jms/java_server_instance_usage.go create mode 100644 jms/java_server_instance_usage_collection.go create mode 100644 jms/java_server_sort_by.go create mode 100644 jms/java_server_usage.go create mode 100644 jms/java_server_usage_collection.go create mode 100644 jms/jfr_attachment_target.go create mode 100644 jms/jfr_recording.go create mode 100644 jms/key_size_algorithm.go create mode 100644 jms/lcm.go create mode 100644 jms/library_sort_by.go create mode 100644 jms/library_usage.go create mode 100644 jms/library_usage_collection.go create mode 100644 jms/list_crypto_analysis_results_request_response.go create mode 100644 jms/minimum_key_size_settings.go create mode 100644 jms/post_installation_action_settings.go create mode 100644 jms/post_installation_actions.go create mode 100644 jms/request_crypto_analyses_details.go create mode 100644 jms/request_crypto_analyses_request_response.go create mode 100644 jms/request_jfr_recordings_details.go create mode 100644 jms/request_jfr_recordings_request_response.go create mode 100644 jms/scan_java_server_usage_details.go create mode 100644 jms/scan_java_server_usage_request_response.go create mode 100644 jms/scan_library_usage_details.go create mode 100644 jms/scan_library_usage_request_response.go create mode 100644 jms/summarize_deployed_application_usage_request_response.go create mode 100644 jms/summarize_java_server_instance_usage_request_response.go create mode 100644 jms/summarize_java_server_usage_request_response.go create mode 100644 jms/summarize_library_usage_request_response.go create mode 100644 jms/summarized_events_log.go create mode 100644 jms/tls_versions.go create mode 100644 jms/update_fleet_advanced_feature_configuration_details.go create mode 100644 jms/update_fleet_advanced_feature_configuration_request_response.go create mode 100644 mysql/anonymous_transactions_handling.go create mode 100644 mysql/assign_manual_uuid_handling.go create mode 100644 mysql/assign_target_uuid_handling.go create mode 100644 mysql/channel_filter.go create mode 100644 mysql/create_replica_details.go create mode 100644 mysql/create_replica_request_response.go create mode 100644 mysql/delete_replica_request_response.go create mode 100644 mysql/error_on_anonymous_handling.go create mode 100644 mysql/get_replica_request_response.go create mode 100644 mysql/list_replicas_request_response.go create mode 100644 mysql/mysql_replicas_client.go create mode 100644 mysql/replica.go create mode 100644 mysql/replica_summary.go create mode 100644 mysql/update_replica_details.go create mode 100644 mysql/update_replica_request_response.go create mode 100644 opsi/add_pe_comanaged_exadata_insight_members_details.go create mode 100644 opsi/create_pe_comanaged_exadata_insight_details.go create mode 100644 opsi/create_pe_comanaged_exadata_vmcluster_details.go create mode 100644 opsi/enable_pe_comanaged_exadata_insight_details.go create mode 100644 opsi/exadata_exacs_configuration_summary.go create mode 100644 opsi/exadata_resource_type.go create mode 100644 opsi/pe_comanaged_exadata_insight.go create mode 100644 opsi/pe_comanaged_exadata_insight_summary.go create mode 100644 opsi/update_pe_comanaged_exadata_insight_details.go create mode 100644 opsi/vm_cluster_summary.go create mode 100644 resourcemanager/bitbucket_cloud_config_source.go create mode 100644 resourcemanager/bitbucket_cloud_config_source_record.go create mode 100644 resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider.go create mode 100644 resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider_summary.go create mode 100644 resourcemanager/bitbucket_server_access_token_configuration_source_provider.go create mode 100644 resourcemanager/bitbucket_server_access_token_configuration_source_provider_summary.go create mode 100644 resourcemanager/bitbucket_server_config_source.go create mode 100644 resourcemanager/bitbucket_server_config_source_record.go create mode 100644 resourcemanager/create_bitbucket_cloud_config_source_details.go create mode 100644 resourcemanager/create_bitbucket_cloud_username_app_password_configuration_source_provider_details.go create mode 100644 resourcemanager/create_bitbucket_server_access_token_configuration_source_provider_details.go create mode 100644 resourcemanager/create_bitbucket_server_config_source_details.go create mode 100644 resourcemanager/create_dev_ops_config_source_details.go create mode 100644 resourcemanager/dev_ops_config_source.go create mode 100644 resourcemanager/dev_ops_config_source_record.go create mode 100644 resourcemanager/update_bitbucket_cloud_config_source_details.go create mode 100644 resourcemanager/update_bitbucket_cloud_username_app_password_configuration_source_provider_details.go create mode 100644 resourcemanager/update_bitbucket_server_access_token_configuration_source_provider_details.go create mode 100644 resourcemanager/update_bitbucket_server_config_source_details.go create mode 100644 resourcemanager/update_dev_ops_config_source_details.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 2195d56087..69789adc49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,44 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.27.0 - 2022-12-06 +### Added +- Support for the Container Instances service +- Support for the Document Understanding service +- Support for creating stacks from OCI DevOps service and Bitbucket Cloud/Server as source control management in the Resource Manager service +- Support for deployment stage level parameters in the DevOps service +- Support for PeopleSoft discovery in the Stack Monitoring service +- Support for Apache Tomcat discovery in the Stack Monitoring service +- Support for SQL Server discovery in the Stack Monitoring service +- Support for OpenId Connect in the API Gateway service +- Support for returning compartment ids when listing backups in the MySQL Database service +- Support for adding a load balancer endpoint to a DB system in the MySQL Database service +- Support for managed read replicas in the MySQL Database service +- Support for setting replication filters on channels in the MySQL Database service +- Support for replicating from a source configured without global transaction identifiers into a channel in the MySQL Database service +- Support for time zone and language preferences in the Announcements service +- Support for adding report schedules for activity auditing and alerts reports in the Data Safe service +- Support for bulk operations on alerts in the Data Safe service +- Support for Java server usage reporting in the Java Management service +- Support for Java library usage reporting in the Java Management service +- Support for cryptographic roadmap impact analysis in the Java Management service +- Support for Java Flight Recorder recordings in the Java Management service +- Support for post-installation steps in the Java Management service +- Support for restricting management of advanced functionality in the Java Management service +- Support for plugin improvements in the Java Management service +- Support for collecting diagnostics on deployments in the GoldenGate service +- Support for onboarding Exadata Public Cloud (ExaCS) targets to the Operations Insights service + +### Breaking Changes +- A required property `CompartmentId` was added to `PatchAlertsDetails` model in the Data Safe service +- The property `items` is changed from optional to required in `PatchAlertsDetails` model in the Data Safe service +- The property `datasafePrivateEndpointId` is changed from optional to required in the `PrivateEndpoint` model in the Data Safe service +- The properties `ListenerPort` and `ServiceName` were made required in `InstalledDatabaseDetails` model in the Data Safe service +- The property `serviceName` is is changed from optional to required in `DatabaseCloudServiceDetails` model in the Data Safe service +- The property `AutonomousDatabaseId` was made required in `AutonomousDatabaseDetails` model in the Data Safe service +- The property `OnPremConnectorId` was made required in `OnPremiseConnector` model in the Data Safe service + + ## 65.26.1 - 2022-11-15 ### Added - Support for mTLS authentication with listeners during Autonomous VM Cluster creation on Exadata Cloud at Customer in the Database service diff --git a/Makefile b/Makefile index 06cc3bbae9..15069ccb09 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com -GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech dataconnectivity stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery ##SPECNAME## +GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech dataconnectivity stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/aidocument/aidocument_aiservicedocument_client.go b/aidocument/aidocument_aiservicedocument_client.go new file mode 100644 index 0000000000..314fc38496 --- /dev/null +++ b/aidocument/aidocument_aiservicedocument_client.go @@ -0,0 +1,266 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +//AIServiceDocumentClient a client for AIServiceDocument +type AIServiceDocumentClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewAIServiceDocumentClientWithConfigurationProvider Creates a new default AIServiceDocument client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewAIServiceDocumentClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client AIServiceDocumentClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newAIServiceDocumentClientFromBaseClient(baseClient, provider) +} + +// NewAIServiceDocumentClientWithOboToken Creates a new default AIServiceDocument client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// as well as reading the region +func NewAIServiceDocumentClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client AIServiceDocumentClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newAIServiceDocumentClientFromBaseClient(baseClient, configProvider) +} + +func newAIServiceDocumentClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client AIServiceDocumentClient, err error) { + // AIServiceDocument service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("AIServiceDocument")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = AIServiceDocumentClient{BaseClient: baseClient} + client.BasePath = "20221109" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *AIServiceDocumentClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("aidocument", "https://document.aiservice.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *AIServiceDocumentClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *AIServiceDocumentClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CancelProcessorJob Cancel a processor job. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/CancelProcessorJob.go.html to see an example of how to use CancelProcessorJob API. +func (client AIServiceDocumentClient) CancelProcessorJob(ctx context.Context, request CancelProcessorJobRequest) (response CancelProcessorJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.cancelProcessorJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelProcessorJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelProcessorJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelProcessorJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelProcessorJobResponse") + } + return +} + +// cancelProcessorJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceDocumentClient) cancelProcessorJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/processorJobs/{processorJobId}/actions/cancel", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelProcessorJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "AIServiceDocument", "CancelProcessorJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateProcessorJob Create a processor job for document analysis. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/CreateProcessorJob.go.html to see an example of how to use CreateProcessorJob API. +// A default retry strategy applies to this operation CreateProcessorJob() +func (client AIServiceDocumentClient) CreateProcessorJob(ctx context.Context, request CreateProcessorJobRequest) (response CreateProcessorJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createProcessorJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateProcessorJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateProcessorJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateProcessorJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateProcessorJobResponse") + } + return +} + +// createProcessorJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceDocumentClient) createProcessorJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/processorJobs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateProcessorJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "AIServiceDocument", "CreateProcessorJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetProcessorJob Get the details of a processor job. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/GetProcessorJob.go.html to see an example of how to use GetProcessorJob API. +// A default retry strategy applies to this operation GetProcessorJob() +func (client AIServiceDocumentClient) GetProcessorJob(ctx context.Context, request GetProcessorJobRequest) (response GetProcessorJobResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getProcessorJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetProcessorJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetProcessorJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetProcessorJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetProcessorJobResponse") + } + return +} + +// getProcessorJob implements the OCIOperation interface (enables retrying operations) +func (client AIServiceDocumentClient) getProcessorJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/processorJobs/{processorJobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetProcessorJobResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "AIServiceDocument", "GetProcessorJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/aidocument/analyze_document_result.go b/aidocument/analyze_document_result.go new file mode 100644 index 0000000000..e3d512119e --- /dev/null +++ b/aidocument/analyze_document_result.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AnalyzeDocumentResult The document analysis results. +type AnalyzeDocumentResult struct { + DocumentMetadata *DocumentMetadata `mandatory:"true" json:"documentMetadata"` + + // The array of a Page. + Pages []Page `mandatory:"true" json:"pages"` + + // An array of detected document types. + DetectedDocumentTypes []DetectedDocumentType `mandatory:"false" json:"detectedDocumentTypes"` + + // An array of detected languages. + DetectedLanguages []DetectedLanguage `mandatory:"false" json:"detectedLanguages"` + + // The document classification model version. + DocumentClassificationModelVersion *string `mandatory:"false" json:"documentClassificationModelVersion"` + + // The document language classification model version. + LanguageClassificationModelVersion *string `mandatory:"false" json:"languageClassificationModelVersion"` + + // The document text extraction model version. + TextExtractionModelVersion *string `mandatory:"false" json:"textExtractionModelVersion"` + + // The document keyValue extraction model version. + KeyValueExtractionModelVersion *string `mandatory:"false" json:"keyValueExtractionModelVersion"` + + // The document table extraction model version. + TableExtractionModelVersion *string `mandatory:"false" json:"tableExtractionModelVersion"` + + // The errors encountered during document analysis. + Errors []ProcessingError `mandatory:"false" json:"errors"` + + // The searchable PDF file that was generated. + SearchablePdf []byte `mandatory:"false" json:"searchablePdf"` +} + +func (m AnalyzeDocumentResult) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AnalyzeDocumentResult) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/bounding_polygon.go b/aidocument/bounding_polygon.go new file mode 100644 index 0000000000..a9d055c994 --- /dev/null +++ b/aidocument/bounding_polygon.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BoundingPolygon The object-bounding polygon box. +type BoundingPolygon struct { + + // An array of normalized points defining the polygon's perimeter, with an implicit segment between subsequent points and between the first and last point. + // Rectangles are defined with four points. For example, `[{"x": 0, "y": 0}, {"x": 1, "y": 0}, {"x": 1, "y": 0.5}, {"x": 0, "y": 0.5}]` represents the top half of an image. + NormalizedVertices []NormalizedVertex `mandatory:"true" json:"normalizedVertices"` +} + +func (m BoundingPolygon) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BoundingPolygon) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/cancel_processor_job_request_response.go b/aidocument/cancel_processor_job_request_response.go new file mode 100644 index 0000000000..a75786b4e0 --- /dev/null +++ b/aidocument/cancel_processor_job_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelProcessorJobRequest wrapper for the CancelProcessorJob operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/CancelProcessorJob.go.html to see an example of how to use CancelProcessorJobRequest. +type CancelProcessorJobRequest struct { + + // Processor job id. + ProcessorJobId *string `mandatory:"true" contributesTo:"path" name:"processorJobId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelProcessorJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelProcessorJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CancelProcessorJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelProcessorJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CancelProcessorJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelProcessorJobResponse wrapper for the CancelProcessorJob operation +type CancelProcessorJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CancelProcessorJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelProcessorJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/aidocument/cell.go b/aidocument/cell.go new file mode 100644 index 0000000000..20360520cf --- /dev/null +++ b/aidocument/cell.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Cell A single cell in a table. +type Cell struct { + + // The text recognized in the cell. + Text *string `mandatory:"true" json:"text"` + + // The index of the cell inside the row. + RowIndex *int `mandatory:"true" json:"rowIndex"` + + // The index of the cell inside the column. + ColumnIndex *int `mandatory:"true" json:"columnIndex"` + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The words detected in the cell. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` +} + +func (m Cell) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Cell) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/create_processor_job_details.go b/aidocument/create_processor_job_details.go new file mode 100644 index 0000000000..e3e1d2c0d1 --- /dev/null +++ b/aidocument/create_processor_job_details.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateProcessorJobDetails The details used to create a processor job. +type CreateProcessorJobDetails struct { + InputLocation InputLocation `mandatory:"true" json:"inputLocation"` + + OutputLocation *OutputLocation `mandatory:"true" json:"outputLocation"` + + // The compartment identifier. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + ProcessorConfig ProcessorConfig `mandatory:"true" json:"processorConfig"` + + // The display name of the processor job. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m CreateProcessorJobDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateProcessorJobDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *CreateProcessorJobDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + InputLocation inputlocation `json:"inputLocation"` + OutputLocation *OutputLocation `json:"outputLocation"` + CompartmentId *string `json:"compartmentId"` + ProcessorConfig processorconfig `json:"processorConfig"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + nn, e = model.InputLocation.UnmarshalPolymorphicJSON(model.InputLocation.JsonData) + if e != nil { + return + } + if nn != nil { + m.InputLocation = nn.(InputLocation) + } else { + m.InputLocation = nil + } + + m.OutputLocation = model.OutputLocation + + m.CompartmentId = model.CompartmentId + + nn, e = model.ProcessorConfig.UnmarshalPolymorphicJSON(model.ProcessorConfig.JsonData) + if e != nil { + return + } + if nn != nil { + m.ProcessorConfig = nn.(ProcessorConfig) + } else { + m.ProcessorConfig = nil + } + + return +} diff --git a/aidocument/create_processor_job_request_response.go b/aidocument/create_processor_job_request_response.go new file mode 100644 index 0000000000..f3f87ad7d8 --- /dev/null +++ b/aidocument/create_processor_job_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateProcessorJobRequest wrapper for the CreateProcessorJob operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/CreateProcessorJob.go.html to see an example of how to use CreateProcessorJobRequest. +type CreateProcessorJobRequest struct { + + // The details for creating the processor job. + CreateProcessorJobDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without the risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateProcessorJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateProcessorJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateProcessorJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateProcessorJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateProcessorJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateProcessorJobResponse wrapper for the CreateProcessorJob operation +type CreateProcessorJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ProcessorJob instance + ProcessorJob `presentIn:"body"` + + // A unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateProcessorJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateProcessorJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/aidocument/detected_document_type.go b/aidocument/detected_document_type.go new file mode 100644 index 0000000000..241a910d03 --- /dev/null +++ b/aidocument/detected_document_type.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DetectedDocumentType The detected document type. +type DetectedDocumentType struct { + + // The document type. + DocumentType *string `mandatory:"true" json:"documentType"` + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` +} + +func (m DetectedDocumentType) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DetectedDocumentType) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/detected_language.go b/aidocument/detected_language.go new file mode 100644 index 0000000000..3c308ffe77 --- /dev/null +++ b/aidocument/detected_language.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DetectedLanguage The language detected in a document. +type DetectedLanguage struct { + + // The document language, abbreviated according to the BCP 47 syntax. + Language *string `mandatory:"true" json:"language"` + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` +} + +func (m DetectedLanguage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DetectedLanguage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/dimensions.go b/aidocument/dimensions.go new file mode 100644 index 0000000000..0a2223191c --- /dev/null +++ b/aidocument/dimensions.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Dimensions The width and height of a page. +type Dimensions struct { + + // the width of a page. + Width *float64 `mandatory:"true" json:"width"` + + // The height of a page. + Height *float64 `mandatory:"true" json:"height"` + + // The unit of length. + Unit DimensionsUnitEnum `mandatory:"true" json:"unit"` +} + +func (m Dimensions) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Dimensions) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDimensionsUnitEnum(string(m.Unit)); !ok && m.Unit != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Unit: %s. Supported values are: %s.", m.Unit, strings.Join(GetDimensionsUnitEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DimensionsUnitEnum Enum with underlying type: string +type DimensionsUnitEnum string + +// Set of constants representing the allowable values for DimensionsUnitEnum +const ( + DimensionsUnitPixel DimensionsUnitEnum = "PIXEL" + DimensionsUnitInch DimensionsUnitEnum = "INCH" +) + +var mappingDimensionsUnitEnum = map[string]DimensionsUnitEnum{ + "PIXEL": DimensionsUnitPixel, + "INCH": DimensionsUnitInch, +} + +var mappingDimensionsUnitEnumLowerCase = map[string]DimensionsUnitEnum{ + "pixel": DimensionsUnitPixel, + "inch": DimensionsUnitInch, +} + +// GetDimensionsUnitEnumValues Enumerates the set of values for DimensionsUnitEnum +func GetDimensionsUnitEnumValues() []DimensionsUnitEnum { + values := make([]DimensionsUnitEnum, 0) + for _, v := range mappingDimensionsUnitEnum { + values = append(values, v) + } + return values +} + +// GetDimensionsUnitEnumStringValues Enumerates the set of values in String for DimensionsUnitEnum +func GetDimensionsUnitEnumStringValues() []string { + return []string{ + "PIXEL", + "INCH", + } +} + +// GetMappingDimensionsUnitEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDimensionsUnitEnum(val string) (DimensionsUnitEnum, bool) { + enum, ok := mappingDimensionsUnitEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/document_classification_feature.go b/aidocument/document_classification_feature.go new file mode 100644 index 0000000000..6957c33dce --- /dev/null +++ b/aidocument/document_classification_feature.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentClassificationFeature Identifying the document type. +type DocumentClassificationFeature struct { + + // The maximum number of results to return. + MaxResults *int `mandatory:"false" json:"maxResults"` +} + +func (m DocumentClassificationFeature) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentClassificationFeature) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DocumentClassificationFeature) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDocumentClassificationFeature DocumentClassificationFeature + s := struct { + DiscriminatorParam string `json:"featureType"` + MarshalTypeDocumentClassificationFeature + }{ + "DOCUMENT_CLASSIFICATION", + (MarshalTypeDocumentClassificationFeature)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/document_feature.go b/aidocument/document_feature.go new file mode 100644 index 0000000000..5a44102f1d --- /dev/null +++ b/aidocument/document_feature.go @@ -0,0 +1,146 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentFeature The type of document analysis. +type DocumentFeature interface { +} + +type documentfeature struct { + JsonData []byte + FeatureType string `json:"featureType"` +} + +// UnmarshalJSON unmarshals json +func (m *documentfeature) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerdocumentfeature documentfeature + s := struct { + Model Unmarshalerdocumentfeature + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.FeatureType = s.Model.FeatureType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *documentfeature) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.FeatureType { + case "DOCUMENT_CLASSIFICATION": + mm := DocumentClassificationFeature{} + err = json.Unmarshal(data, &mm) + return mm, err + case "KEY_VALUE_EXTRACTION": + mm := DocumentKeyValueExtractionFeature{} + err = json.Unmarshal(data, &mm) + return mm, err + case "LANGUAGE_CLASSIFICATION": + mm := DocumentLanguageClassificationFeature{} + err = json.Unmarshal(data, &mm) + return mm, err + case "TEXT_EXTRACTION": + mm := DocumentTextExtractionFeature{} + err = json.Unmarshal(data, &mm) + return mm, err + case "TABLE_EXTRACTION": + mm := DocumentTableExtractionFeature{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m documentfeature) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m documentfeature) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DocumentFeatureFeatureTypeEnum Enum with underlying type: string +type DocumentFeatureFeatureTypeEnum string + +// Set of constants representing the allowable values for DocumentFeatureFeatureTypeEnum +const ( + DocumentFeatureFeatureTypeLanguageClassification DocumentFeatureFeatureTypeEnum = "LANGUAGE_CLASSIFICATION" + DocumentFeatureFeatureTypeTextExtraction DocumentFeatureFeatureTypeEnum = "TEXT_EXTRACTION" + DocumentFeatureFeatureTypeTableExtraction DocumentFeatureFeatureTypeEnum = "TABLE_EXTRACTION" + DocumentFeatureFeatureTypeKeyValueExtraction DocumentFeatureFeatureTypeEnum = "KEY_VALUE_EXTRACTION" + DocumentFeatureFeatureTypeDocumentClassification DocumentFeatureFeatureTypeEnum = "DOCUMENT_CLASSIFICATION" +) + +var mappingDocumentFeatureFeatureTypeEnum = map[string]DocumentFeatureFeatureTypeEnum{ + "LANGUAGE_CLASSIFICATION": DocumentFeatureFeatureTypeLanguageClassification, + "TEXT_EXTRACTION": DocumentFeatureFeatureTypeTextExtraction, + "TABLE_EXTRACTION": DocumentFeatureFeatureTypeTableExtraction, + "KEY_VALUE_EXTRACTION": DocumentFeatureFeatureTypeKeyValueExtraction, + "DOCUMENT_CLASSIFICATION": DocumentFeatureFeatureTypeDocumentClassification, +} + +var mappingDocumentFeatureFeatureTypeEnumLowerCase = map[string]DocumentFeatureFeatureTypeEnum{ + "language_classification": DocumentFeatureFeatureTypeLanguageClassification, + "text_extraction": DocumentFeatureFeatureTypeTextExtraction, + "table_extraction": DocumentFeatureFeatureTypeTableExtraction, + "key_value_extraction": DocumentFeatureFeatureTypeKeyValueExtraction, + "document_classification": DocumentFeatureFeatureTypeDocumentClassification, +} + +// GetDocumentFeatureFeatureTypeEnumValues Enumerates the set of values for DocumentFeatureFeatureTypeEnum +func GetDocumentFeatureFeatureTypeEnumValues() []DocumentFeatureFeatureTypeEnum { + values := make([]DocumentFeatureFeatureTypeEnum, 0) + for _, v := range mappingDocumentFeatureFeatureTypeEnum { + values = append(values, v) + } + return values +} + +// GetDocumentFeatureFeatureTypeEnumStringValues Enumerates the set of values in String for DocumentFeatureFeatureTypeEnum +func GetDocumentFeatureFeatureTypeEnumStringValues() []string { + return []string{ + "LANGUAGE_CLASSIFICATION", + "TEXT_EXTRACTION", + "TABLE_EXTRACTION", + "KEY_VALUE_EXTRACTION", + "DOCUMENT_CLASSIFICATION", + } +} + +// GetMappingDocumentFeatureFeatureTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDocumentFeatureFeatureTypeEnum(val string) (DocumentFeatureFeatureTypeEnum, bool) { + enum, ok := mappingDocumentFeatureFeatureTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/document_field.go b/aidocument/document_field.go new file mode 100644 index 0000000000..be5e4a0230 --- /dev/null +++ b/aidocument/document_field.go @@ -0,0 +1,132 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentField Form field. +type DocumentField struct { + + // The field type. + FieldType DocumentFieldFieldTypeEnum `mandatory:"true" json:"fieldType"` + + FieldValue FieldValue `mandatory:"true" json:"fieldValue"` + + FieldLabel *FieldLabel `mandatory:"false" json:"fieldLabel"` + + FieldName *FieldName `mandatory:"false" json:"fieldName"` +} + +func (m DocumentField) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentField) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDocumentFieldFieldTypeEnum(string(m.FieldType)); !ok && m.FieldType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FieldType: %s. Supported values are: %s.", m.FieldType, strings.Join(GetDocumentFieldFieldTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *DocumentField) UnmarshalJSON(data []byte) (e error) { + model := struct { + FieldLabel *FieldLabel `json:"fieldLabel"` + FieldName *FieldName `json:"fieldName"` + FieldType DocumentFieldFieldTypeEnum `json:"fieldType"` + FieldValue fieldvalue `json:"fieldValue"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.FieldLabel = model.FieldLabel + + m.FieldName = model.FieldName + + m.FieldType = model.FieldType + + nn, e = model.FieldValue.UnmarshalPolymorphicJSON(model.FieldValue.JsonData) + if e != nil { + return + } + if nn != nil { + m.FieldValue = nn.(FieldValue) + } else { + m.FieldValue = nil + } + + return +} + +// DocumentFieldFieldTypeEnum Enum with underlying type: string +type DocumentFieldFieldTypeEnum string + +// Set of constants representing the allowable values for DocumentFieldFieldTypeEnum +const ( + DocumentFieldFieldTypeLineItemGroup DocumentFieldFieldTypeEnum = "LINE_ITEM_GROUP" + DocumentFieldFieldTypeLineItem DocumentFieldFieldTypeEnum = "LINE_ITEM" + DocumentFieldFieldTypeLineItemField DocumentFieldFieldTypeEnum = "LINE_ITEM_FIELD" + DocumentFieldFieldTypeKeyValue DocumentFieldFieldTypeEnum = "KEY_VALUE" +) + +var mappingDocumentFieldFieldTypeEnum = map[string]DocumentFieldFieldTypeEnum{ + "LINE_ITEM_GROUP": DocumentFieldFieldTypeLineItemGroup, + "LINE_ITEM": DocumentFieldFieldTypeLineItem, + "LINE_ITEM_FIELD": DocumentFieldFieldTypeLineItemField, + "KEY_VALUE": DocumentFieldFieldTypeKeyValue, +} + +var mappingDocumentFieldFieldTypeEnumLowerCase = map[string]DocumentFieldFieldTypeEnum{ + "line_item_group": DocumentFieldFieldTypeLineItemGroup, + "line_item": DocumentFieldFieldTypeLineItem, + "line_item_field": DocumentFieldFieldTypeLineItemField, + "key_value": DocumentFieldFieldTypeKeyValue, +} + +// GetDocumentFieldFieldTypeEnumValues Enumerates the set of values for DocumentFieldFieldTypeEnum +func GetDocumentFieldFieldTypeEnumValues() []DocumentFieldFieldTypeEnum { + values := make([]DocumentFieldFieldTypeEnum, 0) + for _, v := range mappingDocumentFieldFieldTypeEnum { + values = append(values, v) + } + return values +} + +// GetDocumentFieldFieldTypeEnumStringValues Enumerates the set of values in String for DocumentFieldFieldTypeEnum +func GetDocumentFieldFieldTypeEnumStringValues() []string { + return []string{ + "LINE_ITEM_GROUP", + "LINE_ITEM", + "LINE_ITEM_FIELD", + "KEY_VALUE", + } +} + +// GetMappingDocumentFieldFieldTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDocumentFieldFieldTypeEnum(val string) (DocumentFieldFieldTypeEnum, bool) { + enum, ok := mappingDocumentFieldFieldTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/document_key_value_extraction_feature.go b/aidocument/document_key_value_extraction_feature.go new file mode 100644 index 0000000000..f439dc1deb --- /dev/null +++ b/aidocument/document_key_value_extraction_feature.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentKeyValueExtractionFeature Extracting form fields. +type DocumentKeyValueExtractionFeature struct { +} + +func (m DocumentKeyValueExtractionFeature) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentKeyValueExtractionFeature) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DocumentKeyValueExtractionFeature) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDocumentKeyValueExtractionFeature DocumentKeyValueExtractionFeature + s := struct { + DiscriminatorParam string `json:"featureType"` + MarshalTypeDocumentKeyValueExtractionFeature + }{ + "KEY_VALUE_EXTRACTION", + (MarshalTypeDocumentKeyValueExtractionFeature)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/document_language_classification_feature.go b/aidocument/document_language_classification_feature.go new file mode 100644 index 0000000000..d19ce25449 --- /dev/null +++ b/aidocument/document_language_classification_feature.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentLanguageClassificationFeature Detecting the language of the document. +type DocumentLanguageClassificationFeature struct { + + // The maximum number of results to return. + MaxResults *int `mandatory:"false" json:"maxResults"` +} + +func (m DocumentLanguageClassificationFeature) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentLanguageClassificationFeature) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DocumentLanguageClassificationFeature) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDocumentLanguageClassificationFeature DocumentLanguageClassificationFeature + s := struct { + DiscriminatorParam string `json:"featureType"` + MarshalTypeDocumentLanguageClassificationFeature + }{ + "LANGUAGE_CLASSIFICATION", + (MarshalTypeDocumentLanguageClassificationFeature)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/document_metadata.go b/aidocument/document_metadata.go new file mode 100644 index 0000000000..8de07e27be --- /dev/null +++ b/aidocument/document_metadata.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentMetadata The document information. +type DocumentMetadata struct { + + // Teh number of pages in the document. + PageCount *int `mandatory:"true" json:"pageCount"` + + // The result data format. + MimeType *string `mandatory:"true" json:"mimeType"` +} + +func (m DocumentMetadata) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/document_table_extraction_feature.go b/aidocument/document_table_extraction_feature.go new file mode 100644 index 0000000000..a43a75d2d3 --- /dev/null +++ b/aidocument/document_table_extraction_feature.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentTableExtractionFeature Detecting and extracting data in tables. +type DocumentTableExtractionFeature struct { +} + +func (m DocumentTableExtractionFeature) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentTableExtractionFeature) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DocumentTableExtractionFeature) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDocumentTableExtractionFeature DocumentTableExtractionFeature + s := struct { + DiscriminatorParam string `json:"featureType"` + MarshalTypeDocumentTableExtractionFeature + }{ + "TABLE_EXTRACTION", + (MarshalTypeDocumentTableExtractionFeature)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/document_text_extraction_feature.go b/aidocument/document_text_extraction_feature.go new file mode 100644 index 0000000000..158de1f53e --- /dev/null +++ b/aidocument/document_text_extraction_feature.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DocumentTextExtractionFeature Text recognition +type DocumentTextExtractionFeature struct { + + // Whether or not to generate a searchable PDF file. + GenerateSearchablePdf *bool `mandatory:"false" json:"generateSearchablePdf"` +} + +func (m DocumentTextExtractionFeature) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DocumentTextExtractionFeature) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DocumentTextExtractionFeature) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDocumentTextExtractionFeature DocumentTextExtractionFeature + s := struct { + DiscriminatorParam string `json:"featureType"` + MarshalTypeDocumentTextExtractionFeature + }{ + "TEXT_EXTRACTION", + (MarshalTypeDocumentTextExtractionFeature)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/document_type.go b/aidocument/document_type.go new file mode 100644 index 0000000000..75a9f38e43 --- /dev/null +++ b/aidocument/document_type.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "strings" +) + +// DocumentTypeEnum Enum with underlying type: string +type DocumentTypeEnum string + +// Set of constants representing the allowable values for DocumentTypeEnum +const ( + DocumentTypeInvoice DocumentTypeEnum = "INVOICE" + DocumentTypeReceipt DocumentTypeEnum = "RECEIPT" + DocumentTypeResume DocumentTypeEnum = "RESUME" + DocumentTypeTaxForm DocumentTypeEnum = "TAX_FORM" + DocumentTypeDriverLicense DocumentTypeEnum = "DRIVER_LICENSE" + DocumentTypePassport DocumentTypeEnum = "PASSPORT" + DocumentTypeBankStatement DocumentTypeEnum = "BANK_STATEMENT" + DocumentTypeCheck DocumentTypeEnum = "CHECK" + DocumentTypePayslip DocumentTypeEnum = "PAYSLIP" + DocumentTypeOthers DocumentTypeEnum = "OTHERS" +) + +var mappingDocumentTypeEnum = map[string]DocumentTypeEnum{ + "INVOICE": DocumentTypeInvoice, + "RECEIPT": DocumentTypeReceipt, + "RESUME": DocumentTypeResume, + "TAX_FORM": DocumentTypeTaxForm, + "DRIVER_LICENSE": DocumentTypeDriverLicense, + "PASSPORT": DocumentTypePassport, + "BANK_STATEMENT": DocumentTypeBankStatement, + "CHECK": DocumentTypeCheck, + "PAYSLIP": DocumentTypePayslip, + "OTHERS": DocumentTypeOthers, +} + +var mappingDocumentTypeEnumLowerCase = map[string]DocumentTypeEnum{ + "invoice": DocumentTypeInvoice, + "receipt": DocumentTypeReceipt, + "resume": DocumentTypeResume, + "tax_form": DocumentTypeTaxForm, + "driver_license": DocumentTypeDriverLicense, + "passport": DocumentTypePassport, + "bank_statement": DocumentTypeBankStatement, + "check": DocumentTypeCheck, + "payslip": DocumentTypePayslip, + "others": DocumentTypeOthers, +} + +// GetDocumentTypeEnumValues Enumerates the set of values for DocumentTypeEnum +func GetDocumentTypeEnumValues() []DocumentTypeEnum { + values := make([]DocumentTypeEnum, 0) + for _, v := range mappingDocumentTypeEnum { + values = append(values, v) + } + return values +} + +// GetDocumentTypeEnumStringValues Enumerates the set of values in String for DocumentTypeEnum +func GetDocumentTypeEnumStringValues() []string { + return []string{ + "INVOICE", + "RECEIPT", + "RESUME", + "TAX_FORM", + "DRIVER_LICENSE", + "PASSPORT", + "BANK_STATEMENT", + "CHECK", + "PAYSLIP", + "OTHERS", + } +} + +// GetMappingDocumentTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDocumentTypeEnum(val string) (DocumentTypeEnum, bool) { + enum, ok := mappingDocumentTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/field_label.go b/aidocument/field_label.go new file mode 100644 index 0000000000..d6629b460b --- /dev/null +++ b/aidocument/field_label.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FieldLabel The label in a field. +type FieldLabel struct { + + // The name of the field label. + Name *string `mandatory:"true" json:"name"` + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"false" json:"confidence"` +} + +func (m FieldLabel) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m FieldLabel) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/field_name.go b/aidocument/field_name.go new file mode 100644 index 0000000000..bb0b6146e5 --- /dev/null +++ b/aidocument/field_name.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FieldName The name of a form field. +type FieldName struct { + + // The name of the field. + Name *string `mandatory:"true" json:"name"` + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"false" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"false" json:"boundingPolygon"` + + // The indexes of the words in the field name. + WordIndexes []int `mandatory:"false" json:"wordIndexes"` +} + +func (m FieldName) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m FieldName) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/field_value.go b/aidocument/field_value.go new file mode 100644 index 0000000000..c17783da56 --- /dev/null +++ b/aidocument/field_value.go @@ -0,0 +1,201 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FieldValue The value of a form field. +type FieldValue interface { + + // The confidence score between 0 and 1. + GetConfidence() *float32 + + GetBoundingPolygon() *BoundingPolygon + + // The indexes of the words in the field value. + GetWordIndexes() []int + + // The detected text of a field. + GetText() *string +} + +type fieldvalue struct { + JsonData []byte + Confidence *float32 `mandatory:"true" json:"confidence"` + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + Text *string `mandatory:"false" json:"text"` + ValueType string `json:"valueType"` +} + +// UnmarshalJSON unmarshals json +func (m *fieldvalue) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerfieldvalue fieldvalue + s := struct { + Model Unmarshalerfieldvalue + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Confidence = s.Model.Confidence + m.BoundingPolygon = s.Model.BoundingPolygon + m.WordIndexes = s.Model.WordIndexes + m.Text = s.Model.Text + m.ValueType = s.Model.ValueType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *fieldvalue) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ValueType { + case "TIME": + mm := ValueTime{} + err = json.Unmarshal(data, &mm) + return mm, err + case "INTEGER": + mm := ValueInteger{} + err = json.Unmarshal(data, &mm) + return mm, err + case "DATE": + mm := ValueDate{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NUMBER": + mm := ValueNumber{} + err = json.Unmarshal(data, &mm) + return mm, err + case "STRING": + mm := ValueString{} + err = json.Unmarshal(data, &mm) + return mm, err + case "PHONE_NUMBER": + mm := ValuePhoneNumber{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ARRAY": + mm := ValueArray{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetConfidence returns Confidence +func (m fieldvalue) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m fieldvalue) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m fieldvalue) GetWordIndexes() []int { + return m.WordIndexes +} + +//GetText returns Text +func (m fieldvalue) GetText() *string { + return m.Text +} + +func (m fieldvalue) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m fieldvalue) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FieldValueValueTypeEnum Enum with underlying type: string +type FieldValueValueTypeEnum string + +// Set of constants representing the allowable values for FieldValueValueTypeEnum +const ( + FieldValueValueTypeString FieldValueValueTypeEnum = "STRING" + FieldValueValueTypeDate FieldValueValueTypeEnum = "DATE" + FieldValueValueTypeTime FieldValueValueTypeEnum = "TIME" + FieldValueValueTypePhoneNumber FieldValueValueTypeEnum = "PHONE_NUMBER" + FieldValueValueTypeNumber FieldValueValueTypeEnum = "NUMBER" + FieldValueValueTypeInteger FieldValueValueTypeEnum = "INTEGER" + FieldValueValueTypeArray FieldValueValueTypeEnum = "ARRAY" +) + +var mappingFieldValueValueTypeEnum = map[string]FieldValueValueTypeEnum{ + "STRING": FieldValueValueTypeString, + "DATE": FieldValueValueTypeDate, + "TIME": FieldValueValueTypeTime, + "PHONE_NUMBER": FieldValueValueTypePhoneNumber, + "NUMBER": FieldValueValueTypeNumber, + "INTEGER": FieldValueValueTypeInteger, + "ARRAY": FieldValueValueTypeArray, +} + +var mappingFieldValueValueTypeEnumLowerCase = map[string]FieldValueValueTypeEnum{ + "string": FieldValueValueTypeString, + "date": FieldValueValueTypeDate, + "time": FieldValueValueTypeTime, + "phone_number": FieldValueValueTypePhoneNumber, + "number": FieldValueValueTypeNumber, + "integer": FieldValueValueTypeInteger, + "array": FieldValueValueTypeArray, +} + +// GetFieldValueValueTypeEnumValues Enumerates the set of values for FieldValueValueTypeEnum +func GetFieldValueValueTypeEnumValues() []FieldValueValueTypeEnum { + values := make([]FieldValueValueTypeEnum, 0) + for _, v := range mappingFieldValueValueTypeEnum { + values = append(values, v) + } + return values +} + +// GetFieldValueValueTypeEnumStringValues Enumerates the set of values in String for FieldValueValueTypeEnum +func GetFieldValueValueTypeEnumStringValues() []string { + return []string{ + "STRING", + "DATE", + "TIME", + "PHONE_NUMBER", + "NUMBER", + "INTEGER", + "ARRAY", + } +} + +// GetMappingFieldValueValueTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingFieldValueValueTypeEnum(val string) (FieldValueValueTypeEnum, bool) { + enum, ok := mappingFieldValueValueTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/general_processor_config.go b/aidocument/general_processor_config.go new file mode 100644 index 0000000000..99d33a6cf4 --- /dev/null +++ b/aidocument/general_processor_config.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GeneralProcessorConfig The configuration of a general processor. +type GeneralProcessorConfig struct { + + // The types of document analysis requested. + Features []DocumentFeature `mandatory:"true" json:"features"` + + // Whether or not to generate a ZIP file containing the results. + IsZipOutputEnabled *bool `mandatory:"false" json:"isZipOutputEnabled"` + + // The document language, abbreviated according to the BCP 47 Language-Tag syntax. + Language *string `mandatory:"false" json:"language"` + + // The document type. + DocumentType DocumentTypeEnum `mandatory:"false" json:"documentType,omitempty"` +} + +func (m GeneralProcessorConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m GeneralProcessorConfig) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDocumentTypeEnum(string(m.DocumentType)); !ok && m.DocumentType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DocumentType: %s. Supported values are: %s.", m.DocumentType, strings.Join(GetDocumentTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GeneralProcessorConfig) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGeneralProcessorConfig GeneralProcessorConfig + s := struct { + DiscriminatorParam string `json:"processorType"` + MarshalTypeGeneralProcessorConfig + }{ + "GENERAL", + (MarshalTypeGeneralProcessorConfig)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GeneralProcessorConfig) UnmarshalJSON(data []byte) (e error) { + model := struct { + DocumentType DocumentTypeEnum `json:"documentType"` + IsZipOutputEnabled *bool `json:"isZipOutputEnabled"` + Language *string `json:"language"` + Features []documentfeature `json:"features"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DocumentType = model.DocumentType + + m.IsZipOutputEnabled = model.IsZipOutputEnabled + + m.Language = model.Language + + m.Features = make([]DocumentFeature, len(model.Features)) + for i, n := range model.Features { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Features[i] = nn.(DocumentFeature) + } else { + m.Features[i] = nil + } + } + + return +} diff --git a/aidocument/get_processor_job_request_response.go b/aidocument/get_processor_job_request_response.go new file mode 100644 index 0000000000..b364169905 --- /dev/null +++ b/aidocument/get_processor_job_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetProcessorJobRequest wrapper for the GetProcessorJob operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/GetProcessorJob.go.html to see an example of how to use GetProcessorJobRequest. +type GetProcessorJobRequest struct { + + // Processor job id. + ProcessorJobId *string `mandatory:"true" contributesTo:"path" name:"processorJobId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetProcessorJobRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetProcessorJobRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetProcessorJobRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetProcessorJobRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetProcessorJobRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetProcessorJobResponse wrapper for the GetProcessorJob operation +type GetProcessorJobResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ProcessorJob instance + ProcessorJob `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetProcessorJobResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetProcessorJobResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/aidocument/inline_document_content.go b/aidocument/inline_document_content.go new file mode 100644 index 0000000000..f01cebda48 --- /dev/null +++ b/aidocument/inline_document_content.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InlineDocumentContent The content of an inline document. +type InlineDocumentContent struct { + + // Raw document data with Base64 encoding. + Data []byte `mandatory:"true" json:"data"` +} + +func (m InlineDocumentContent) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m InlineDocumentContent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m InlineDocumentContent) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInlineDocumentContent InlineDocumentContent + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeInlineDocumentContent + }{ + "INLINE_DOCUMENT_CONTENT", + (MarshalTypeInlineDocumentContent)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/input_location.go b/aidocument/input_location.go new file mode 100644 index 0000000000..ac95b0b3aa --- /dev/null +++ b/aidocument/input_location.go @@ -0,0 +1,122 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InputLocation The location of the inputs. +type InputLocation interface { +} + +type inputlocation struct { + JsonData []byte + SourceType string `json:"sourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *inputlocation) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerinputlocation inputlocation + s := struct { + Model Unmarshalerinputlocation + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.SourceType = s.Model.SourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *inputlocation) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SourceType { + case "INLINE_DOCUMENT_CONTENT": + mm := InlineDocumentContent{} + err = json.Unmarshal(data, &mm) + return mm, err + case "OBJECT_STORAGE_LOCATIONS": + mm := ObjectStorageLocations{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m inputlocation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m inputlocation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// InputLocationSourceTypeEnum Enum with underlying type: string +type InputLocationSourceTypeEnum string + +// Set of constants representing the allowable values for InputLocationSourceTypeEnum +const ( + InputLocationSourceTypeObjectStorageLocations InputLocationSourceTypeEnum = "OBJECT_STORAGE_LOCATIONS" + InputLocationSourceTypeInlineDocumentContent InputLocationSourceTypeEnum = "INLINE_DOCUMENT_CONTENT" +) + +var mappingInputLocationSourceTypeEnum = map[string]InputLocationSourceTypeEnum{ + "OBJECT_STORAGE_LOCATIONS": InputLocationSourceTypeObjectStorageLocations, + "INLINE_DOCUMENT_CONTENT": InputLocationSourceTypeInlineDocumentContent, +} + +var mappingInputLocationSourceTypeEnumLowerCase = map[string]InputLocationSourceTypeEnum{ + "object_storage_locations": InputLocationSourceTypeObjectStorageLocations, + "inline_document_content": InputLocationSourceTypeInlineDocumentContent, +} + +// GetInputLocationSourceTypeEnumValues Enumerates the set of values for InputLocationSourceTypeEnum +func GetInputLocationSourceTypeEnumValues() []InputLocationSourceTypeEnum { + values := make([]InputLocationSourceTypeEnum, 0) + for _, v := range mappingInputLocationSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetInputLocationSourceTypeEnumStringValues Enumerates the set of values in String for InputLocationSourceTypeEnum +func GetInputLocationSourceTypeEnumStringValues() []string { + return []string{ + "OBJECT_STORAGE_LOCATIONS", + "INLINE_DOCUMENT_CONTENT", + } +} + +// GetMappingInputLocationSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingInputLocationSourceTypeEnum(val string) (InputLocationSourceTypeEnum, bool) { + enum, ok := mappingInputLocationSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/line.go b/aidocument/line.go new file mode 100644 index 0000000000..5165aef1b7 --- /dev/null +++ b/aidocument/line.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Line The line of text. +type Line struct { + + // The text recognized. + Text *string `mandatory:"true" json:"text"` + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The array of words. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` +} + +func (m Line) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Line) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/normalized_vertex.go b/aidocument/normalized_vertex.go new file mode 100644 index 0000000000..000d229448 --- /dev/null +++ b/aidocument/normalized_vertex.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NormalizedVertex An (x, y) coordinate in the image with dimensions normalized from zero to one. +// The origin is at top left, with the positive x-axis pointing right and the positive y-axis pointing down. +// The bottom right corner is at (1, 1). +type NormalizedVertex struct { + + // The X-axis normalized coordinate. + X *float64 `mandatory:"true" json:"x"` + + // The Y-axis normalized coordinate. + Y *float64 `mandatory:"true" json:"y"` +} + +func (m NormalizedVertex) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NormalizedVertex) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/object_location.go b/aidocument/object_location.go new file mode 100644 index 0000000000..3204adf2cb --- /dev/null +++ b/aidocument/object_location.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectLocation A location in Object Storage that is uniquely identified by namespace name, bucket name and object name. +type ObjectLocation struct { + + // The Object Storage namespace name. + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // The Object Storage bucket name. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The Object Storage object name. + ObjectName *string `mandatory:"true" json:"objectName"` +} + +func (m ObjectLocation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ObjectLocation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/object_storage_locations.go b/aidocument/object_storage_locations.go new file mode 100644 index 0000000000..d890712489 --- /dev/null +++ b/aidocument/object_storage_locations.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectStorageLocations A list of object locations in Object Storage. +type ObjectStorageLocations struct { + + // The list of ObjectLocations. + ObjectLocations []ObjectLocation `mandatory:"true" json:"objectLocations"` +} + +func (m ObjectStorageLocations) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ObjectStorageLocations) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ObjectStorageLocations) MarshalJSON() (buff []byte, e error) { + type MarshalTypeObjectStorageLocations ObjectStorageLocations + s := struct { + DiscriminatorParam string `json:"sourceType"` + MarshalTypeObjectStorageLocations + }{ + "OBJECT_STORAGE_LOCATIONS", + (MarshalTypeObjectStorageLocations)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/output_location.go b/aidocument/output_location.go new file mode 100644 index 0000000000..f60f88b044 --- /dev/null +++ b/aidocument/output_location.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OutputLocation The Object Storage Location. +type OutputLocation struct { + + // The Object Storage namespace. + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // The Object Storage bucket name. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The Object Storage folder name. + Prefix *string `mandatory:"true" json:"prefix"` +} + +func (m OutputLocation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OutputLocation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/page.go b/aidocument/page.go new file mode 100644 index 0000000000..67eb171464 --- /dev/null +++ b/aidocument/page.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Page One page document analysis result. +type Page struct { + + // The document page number. + PageNumber *int `mandatory:"true" json:"pageNumber"` + + Dimensions *Dimensions `mandatory:"false" json:"dimensions"` + + // An array of detected document types. + DetectedDocumentTypes []DetectedDocumentType `mandatory:"false" json:"detectedDocumentTypes"` + + // An array of detected languages. + DetectedLanguages []DetectedLanguage `mandatory:"false" json:"detectedLanguages"` + + // The words detected on the page. + Words []Word `mandatory:"false" json:"words"` + + // The lines of text detected on the page. + Lines []Line `mandatory:"false" json:"lines"` + + // The tables detected on the page. + Tables []Table `mandatory:"false" json:"tables"` + + // The form fields detected on the page. + DocumentFields []DocumentField `mandatory:"false" json:"documentFields"` +} + +func (m Page) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Page) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/processing_error.go b/aidocument/processing_error.go new file mode 100644 index 0000000000..d6d4858ddf --- /dev/null +++ b/aidocument/processing_error.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProcessingError The error in document processing. +type ProcessingError struct { + + // The error code. + Code *string `mandatory:"true" json:"code"` + + // The error message. + Message *string `mandatory:"true" json:"message"` +} + +func (m ProcessingError) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ProcessingError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/processor_config.go b/aidocument/processor_config.go new file mode 100644 index 0000000000..f8a668df6d --- /dev/null +++ b/aidocument/processor_config.go @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProcessorConfig The configuration of a processor. +type ProcessorConfig interface { +} + +type processorconfig struct { + JsonData []byte + ProcessorType string `json:"processorType"` +} + +// UnmarshalJSON unmarshals json +func (m *processorconfig) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerprocessorconfig processorconfig + s := struct { + Model Unmarshalerprocessorconfig + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ProcessorType = s.Model.ProcessorType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *processorconfig) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ProcessorType { + case "GENERAL": + mm := GeneralProcessorConfig{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m processorconfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m processorconfig) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/processor_job.go b/aidocument/processor_job.go new file mode 100644 index 0000000000..0e00cec244 --- /dev/null +++ b/aidocument/processor_job.go @@ -0,0 +1,241 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ProcessorJob Details of a processor job. +type ProcessorJob struct { + + // The id of the processor job. + Id *string `mandatory:"true" json:"id"` + + // The compartment identifier. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + ProcessorConfig ProcessorConfig `mandatory:"true" json:"processorConfig"` + + // The job acceptance time. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + OutputLocation *OutputLocation `mandatory:"true" json:"outputLocation"` + + // The current state of the processor job. + LifecycleState ProcessorJobLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The display name of the processor job. + DisplayName *string `mandatory:"false" json:"displayName"` + + InputLocation InputLocation `mandatory:"false" json:"inputLocation"` + + // The job start time. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The job finish time. + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // How much progress the operation has made, compared to the total amount of work to be performed. + PercentComplete *float32 `mandatory:"false" json:"percentComplete"` + + // The detailed status of FAILED state. + LifecycleDetails ProcessorJobLifecycleDetailsEnum `mandatory:"false" json:"lifecycleDetails,omitempty"` +} + +func (m ProcessorJob) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ProcessorJob) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingProcessorJobLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetProcessorJobLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingProcessorJobLifecycleDetailsEnum(string(m.LifecycleDetails)); !ok && m.LifecycleDetails != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleDetails: %s. Supported values are: %s.", m.LifecycleDetails, strings.Join(GetProcessorJobLifecycleDetailsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ProcessorJob) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + InputLocation inputlocation `json:"inputLocation"` + TimeStarted *common.SDKTime `json:"timeStarted"` + TimeFinished *common.SDKTime `json:"timeFinished"` + PercentComplete *float32 `json:"percentComplete"` + LifecycleDetails ProcessorJobLifecycleDetailsEnum `json:"lifecycleDetails"` + Id *string `json:"id"` + CompartmentId *string `json:"compartmentId"` + ProcessorConfig processorconfig `json:"processorConfig"` + TimeAccepted *common.SDKTime `json:"timeAccepted"` + OutputLocation *OutputLocation `json:"outputLocation"` + LifecycleState ProcessorJobLifecycleStateEnum `json:"lifecycleState"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + nn, e = model.InputLocation.UnmarshalPolymorphicJSON(model.InputLocation.JsonData) + if e != nil { + return + } + if nn != nil { + m.InputLocation = nn.(InputLocation) + } else { + m.InputLocation = nil + } + + m.TimeStarted = model.TimeStarted + + m.TimeFinished = model.TimeFinished + + m.PercentComplete = model.PercentComplete + + m.LifecycleDetails = model.LifecycleDetails + + m.Id = model.Id + + m.CompartmentId = model.CompartmentId + + nn, e = model.ProcessorConfig.UnmarshalPolymorphicJSON(model.ProcessorConfig.JsonData) + if e != nil { + return + } + if nn != nil { + m.ProcessorConfig = nn.(ProcessorConfig) + } else { + m.ProcessorConfig = nil + } + + m.TimeAccepted = model.TimeAccepted + + m.OutputLocation = model.OutputLocation + + m.LifecycleState = model.LifecycleState + + return +} + +// ProcessorJobLifecycleStateEnum Enum with underlying type: string +type ProcessorJobLifecycleStateEnum string + +// Set of constants representing the allowable values for ProcessorJobLifecycleStateEnum +const ( + ProcessorJobLifecycleStateSucceeded ProcessorJobLifecycleStateEnum = "SUCCEEDED" + ProcessorJobLifecycleStateFailed ProcessorJobLifecycleStateEnum = "FAILED" + ProcessorJobLifecycleStateAccepted ProcessorJobLifecycleStateEnum = "ACCEPTED" + ProcessorJobLifecycleStateCanceled ProcessorJobLifecycleStateEnum = "CANCELED" + ProcessorJobLifecycleStateInProgress ProcessorJobLifecycleStateEnum = "IN_PROGRESS" + ProcessorJobLifecycleStateCanceling ProcessorJobLifecycleStateEnum = "CANCELING" +) + +var mappingProcessorJobLifecycleStateEnum = map[string]ProcessorJobLifecycleStateEnum{ + "SUCCEEDED": ProcessorJobLifecycleStateSucceeded, + "FAILED": ProcessorJobLifecycleStateFailed, + "ACCEPTED": ProcessorJobLifecycleStateAccepted, + "CANCELED": ProcessorJobLifecycleStateCanceled, + "IN_PROGRESS": ProcessorJobLifecycleStateInProgress, + "CANCELING": ProcessorJobLifecycleStateCanceling, +} + +var mappingProcessorJobLifecycleStateEnumLowerCase = map[string]ProcessorJobLifecycleStateEnum{ + "succeeded": ProcessorJobLifecycleStateSucceeded, + "failed": ProcessorJobLifecycleStateFailed, + "accepted": ProcessorJobLifecycleStateAccepted, + "canceled": ProcessorJobLifecycleStateCanceled, + "in_progress": ProcessorJobLifecycleStateInProgress, + "canceling": ProcessorJobLifecycleStateCanceling, +} + +// GetProcessorJobLifecycleStateEnumValues Enumerates the set of values for ProcessorJobLifecycleStateEnum +func GetProcessorJobLifecycleStateEnumValues() []ProcessorJobLifecycleStateEnum { + values := make([]ProcessorJobLifecycleStateEnum, 0) + for _, v := range mappingProcessorJobLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetProcessorJobLifecycleStateEnumStringValues Enumerates the set of values in String for ProcessorJobLifecycleStateEnum +func GetProcessorJobLifecycleStateEnumStringValues() []string { + return []string{ + "SUCCEEDED", + "FAILED", + "ACCEPTED", + "CANCELED", + "IN_PROGRESS", + "CANCELING", + } +} + +// GetMappingProcessorJobLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingProcessorJobLifecycleStateEnum(val string) (ProcessorJobLifecycleStateEnum, bool) { + enum, ok := mappingProcessorJobLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ProcessorJobLifecycleDetailsEnum Enum with underlying type: string +type ProcessorJobLifecycleDetailsEnum string + +// Set of constants representing the allowable values for ProcessorJobLifecycleDetailsEnum +const ( + ProcessorJobLifecycleDetailsPartiallySucceeded ProcessorJobLifecycleDetailsEnum = "PARTIALLY_SUCCEEDED" + ProcessorJobLifecycleDetailsCompletelyFailed ProcessorJobLifecycleDetailsEnum = "COMPLETELY_FAILED" +) + +var mappingProcessorJobLifecycleDetailsEnum = map[string]ProcessorJobLifecycleDetailsEnum{ + "PARTIALLY_SUCCEEDED": ProcessorJobLifecycleDetailsPartiallySucceeded, + "COMPLETELY_FAILED": ProcessorJobLifecycleDetailsCompletelyFailed, +} + +var mappingProcessorJobLifecycleDetailsEnumLowerCase = map[string]ProcessorJobLifecycleDetailsEnum{ + "partially_succeeded": ProcessorJobLifecycleDetailsPartiallySucceeded, + "completely_failed": ProcessorJobLifecycleDetailsCompletelyFailed, +} + +// GetProcessorJobLifecycleDetailsEnumValues Enumerates the set of values for ProcessorJobLifecycleDetailsEnum +func GetProcessorJobLifecycleDetailsEnumValues() []ProcessorJobLifecycleDetailsEnum { + values := make([]ProcessorJobLifecycleDetailsEnum, 0) + for _, v := range mappingProcessorJobLifecycleDetailsEnum { + values = append(values, v) + } + return values +} + +// GetProcessorJobLifecycleDetailsEnumStringValues Enumerates the set of values in String for ProcessorJobLifecycleDetailsEnum +func GetProcessorJobLifecycleDetailsEnumStringValues() []string { + return []string{ + "PARTIALLY_SUCCEEDED", + "COMPLETELY_FAILED", + } +} + +// GetMappingProcessorJobLifecycleDetailsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingProcessorJobLifecycleDetailsEnum(val string) (ProcessorJobLifecycleDetailsEnum, bool) { + enum, ok := mappingProcessorJobLifecycleDetailsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/processor_type.go b/aidocument/processor_type.go new file mode 100644 index 0000000000..bd8fb08304 --- /dev/null +++ b/aidocument/processor_type.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "strings" +) + +// ProcessorTypeEnum Enum with underlying type: string +type ProcessorTypeEnum string + +// Set of constants representing the allowable values for ProcessorTypeEnum +const ( + ProcessorTypeGeneral ProcessorTypeEnum = "GENERAL" +) + +var mappingProcessorTypeEnum = map[string]ProcessorTypeEnum{ + "GENERAL": ProcessorTypeGeneral, +} + +var mappingProcessorTypeEnumLowerCase = map[string]ProcessorTypeEnum{ + "general": ProcessorTypeGeneral, +} + +// GetProcessorTypeEnumValues Enumerates the set of values for ProcessorTypeEnum +func GetProcessorTypeEnumValues() []ProcessorTypeEnum { + values := make([]ProcessorTypeEnum, 0) + for _, v := range mappingProcessorTypeEnum { + values = append(values, v) + } + return values +} + +// GetProcessorTypeEnumStringValues Enumerates the set of values in String for ProcessorTypeEnum +func GetProcessorTypeEnumStringValues() []string { + return []string{ + "GENERAL", + } +} + +// GetMappingProcessorTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingProcessorTypeEnum(val string) (ProcessorTypeEnum, bool) { + enum, ok := mappingProcessorTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/table.go b/aidocument/table.go new file mode 100644 index 0000000000..f70298c2fe --- /dev/null +++ b/aidocument/table.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Table The table extracted from a document. +type Table struct { + + // The number of rows. + RowCount *int `mandatory:"true" json:"rowCount"` + + // The number of columns. + ColumnCount *int `mandatory:"true" json:"columnCount"` + + // The header rows. + HeaderRows []TableRow `mandatory:"true" json:"headerRows"` + + // The body rows. + BodyRows []TableRow `mandatory:"true" json:"bodyRows"` + + // the footer rows. + FooterRows []TableRow `mandatory:"true" json:"footerRows"` + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` +} + +func (m Table) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Table) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/table_row.go b/aidocument/table_row.go new file mode 100644 index 0000000000..885870a979 --- /dev/null +++ b/aidocument/table_row.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TableRow A single row in a table. +type TableRow struct { + + // The cells in the row. + Cells []Cell `mandatory:"true" json:"cells"` +} + +func (m TableRow) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TableRow) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/aidocument/value_array.go b/aidocument/value_array.go new file mode 100644 index 0000000000..69710957c9 --- /dev/null +++ b/aidocument/value_array.go @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValueArray The array of field values. +type ValueArray struct { + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The indexes of the words in the field value. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + + Items []DocumentField `mandatory:"true" json:"items"` + + // The detected text of a field. + Text *string `mandatory:"false" json:"text"` +} + +//GetText returns Text +func (m ValueArray) GetText() *string { + return m.Text +} + +//GetConfidence returns Confidence +func (m ValueArray) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m ValueArray) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m ValueArray) GetWordIndexes() []int { + return m.WordIndexes +} + +func (m ValueArray) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValueArray) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValueArray) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValueArray ValueArray + s := struct { + DiscriminatorParam string `json:"valueType"` + MarshalTypeValueArray + }{ + "ARRAY", + (MarshalTypeValueArray)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/value_date.go b/aidocument/value_date.go new file mode 100644 index 0000000000..f013143f70 --- /dev/null +++ b/aidocument/value_date.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValueDate The date field value. +type ValueDate struct { + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The indexes of the words in the field value. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + + // The date field value as yyyy-mm-dd. + Value *common.SDKTime `mandatory:"true" json:"value"` + + // The detected text of a field. + Text *string `mandatory:"false" json:"text"` +} + +//GetText returns Text +func (m ValueDate) GetText() *string { + return m.Text +} + +//GetConfidence returns Confidence +func (m ValueDate) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m ValueDate) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m ValueDate) GetWordIndexes() []int { + return m.WordIndexes +} + +func (m ValueDate) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValueDate) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValueDate) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValueDate ValueDate + s := struct { + DiscriminatorParam string `json:"valueType"` + MarshalTypeValueDate + }{ + "DATE", + (MarshalTypeValueDate)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/value_integer.go b/aidocument/value_integer.go new file mode 100644 index 0000000000..ed7b18d740 --- /dev/null +++ b/aidocument/value_integer.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValueInteger The integer field value. +type ValueInteger struct { + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The indexes of the words in the field value. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + + // The integer value. + Value *int `mandatory:"true" json:"value"` + + // The detected text of a field. + Text *string `mandatory:"false" json:"text"` +} + +//GetText returns Text +func (m ValueInteger) GetText() *string { + return m.Text +} + +//GetConfidence returns Confidence +func (m ValueInteger) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m ValueInteger) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m ValueInteger) GetWordIndexes() []int { + return m.WordIndexes +} + +func (m ValueInteger) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValueInteger) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValueInteger) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValueInteger ValueInteger + s := struct { + DiscriminatorParam string `json:"valueType"` + MarshalTypeValueInteger + }{ + "INTEGER", + (MarshalTypeValueInteger)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/value_number.go b/aidocument/value_number.go new file mode 100644 index 0000000000..4d0dc3a180 --- /dev/null +++ b/aidocument/value_number.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValueNumber The floating point number field value. +type ValueNumber struct { + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The indexes of the words in the field value. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + + // The number value. + Value *float32 `mandatory:"true" json:"value"` + + // The detected text of a field. + Text *string `mandatory:"false" json:"text"` +} + +//GetText returns Text +func (m ValueNumber) GetText() *string { + return m.Text +} + +//GetConfidence returns Confidence +func (m ValueNumber) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m ValueNumber) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m ValueNumber) GetWordIndexes() []int { + return m.WordIndexes +} + +func (m ValueNumber) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValueNumber) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValueNumber) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValueNumber ValueNumber + s := struct { + DiscriminatorParam string `json:"valueType"` + MarshalTypeValueNumber + }{ + "NUMBER", + (MarshalTypeValueNumber)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/value_phone_number.go b/aidocument/value_phone_number.go new file mode 100644 index 0000000000..b46f230c3c --- /dev/null +++ b/aidocument/value_phone_number.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValuePhoneNumber The phone number field value. +type ValuePhoneNumber struct { + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The indexes of the words in the field value. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + + // The phone number field value. + Value *string `mandatory:"true" json:"value"` + + // The detected text of a field. + Text *string `mandatory:"false" json:"text"` +} + +//GetText returns Text +func (m ValuePhoneNumber) GetText() *string { + return m.Text +} + +//GetConfidence returns Confidence +func (m ValuePhoneNumber) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m ValuePhoneNumber) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m ValuePhoneNumber) GetWordIndexes() []int { + return m.WordIndexes +} + +func (m ValuePhoneNumber) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValuePhoneNumber) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValuePhoneNumber) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValuePhoneNumber ValuePhoneNumber + s := struct { + DiscriminatorParam string `json:"valueType"` + MarshalTypeValuePhoneNumber + }{ + "PHONE_NUMBER", + (MarshalTypeValuePhoneNumber)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/value_string.go b/aidocument/value_string.go new file mode 100644 index 0000000000..e936e9500f --- /dev/null +++ b/aidocument/value_string.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValueString The string field value. +type ValueString struct { + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The indexes of the words in the field value. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + + // The string text. + Value *string `mandatory:"true" json:"value"` + + // The detected text of a field. + Text *string `mandatory:"false" json:"text"` +} + +//GetText returns Text +func (m ValueString) GetText() *string { + return m.Text +} + +//GetConfidence returns Confidence +func (m ValueString) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m ValueString) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m ValueString) GetWordIndexes() []int { + return m.WordIndexes +} + +func (m ValueString) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValueString) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValueString) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValueString ValueString + s := struct { + DiscriminatorParam string `json:"valueType"` + MarshalTypeValueString + }{ + "STRING", + (MarshalTypeValueString)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/value_time.go b/aidocument/value_time.go new file mode 100644 index 0000000000..d7a2d91ffb --- /dev/null +++ b/aidocument/value_time.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValueTime The time field value. +type ValueTime struct { + + // The confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` + + // The indexes of the words in the field value. + WordIndexes []int `mandatory:"true" json:"wordIndexes"` + + // The time field value as yyyy-mm-dd hh-mm-ss. + Value *common.SDKTime `mandatory:"true" json:"value"` + + // The detected text of a field. + Text *string `mandatory:"false" json:"text"` +} + +//GetText returns Text +func (m ValueTime) GetText() *string { + return m.Text +} + +//GetConfidence returns Confidence +func (m ValueTime) GetConfidence() *float32 { + return m.Confidence +} + +//GetBoundingPolygon returns BoundingPolygon +func (m ValueTime) GetBoundingPolygon() *BoundingPolygon { + return m.BoundingPolygon +} + +//GetWordIndexes returns WordIndexes +func (m ValueTime) GetWordIndexes() []int { + return m.WordIndexes +} + +func (m ValueTime) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValueTime) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValueTime) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValueTime ValueTime + s := struct { + DiscriminatorParam string `json:"valueType"` + MarshalTypeValueTime + }{ + "TIME", + (MarshalTypeValueTime)(m), + } + + return json.Marshal(&s) +} diff --git a/aidocument/word.go b/aidocument/word.go new file mode 100644 index 0000000000..f47775a03f --- /dev/null +++ b/aidocument/word.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Word A single word. +type Word struct { + + // The string of text characters in the word. + Text *string `mandatory:"true" json:"text"` + + // the confidence score between 0 and 1. + Confidence *float32 `mandatory:"true" json:"confidence"` + + BoundingPolygon *BoundingPolygon `mandatory:"true" json:"boundingPolygon"` +} + +func (m Word) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Word) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/announcementsservice/announcement_subscription.go b/announcementsservice/announcement_subscription.go index ba6892dd45..4c0232bd4c 100644 --- a/announcementsservice/announcement_subscription.go +++ b/announcementsservice/announcement_subscription.go @@ -56,6 +56,12 @@ type AnnouncementSubscription struct { // A list of filter groups for the announcement subscription. A filter group is a combination of multiple filters applied to announcements for matching purposes. FilterGroups map[string]FilterGroup `mandatory:"false" json:"filterGroups"` + // (For announcement subscriptions with Oracle Fusion Applications configured as the service only) The language in which the user prefers to receive emailed announcements. Specify the preference with a value that uses the language tag format (x-obmcs-human-language). For example fr-FR. + PreferredLanguage *string `mandatory:"false" json:"preferredLanguage"` + + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` diff --git a/announcementsservice/announcements_preferences.go b/announcementsservice/announcements_preferences.go index cf7b0eab2c..9a06acd754 100644 --- a/announcementsservice/announcements_preferences.go +++ b/announcementsservice/announcements_preferences.go @@ -36,6 +36,9 @@ type AnnouncementsPreferences struct { // When the preferences were last updated. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + // The string representing the user's preference regarding receiving announcements by email. PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"false" json:"preferenceType,omitempty"` } @@ -70,6 +73,11 @@ func (m AnnouncementsPreferences) GetPreferenceType() BaseCreateAnnouncementsPre return m.PreferenceType } +//GetPreferredTimeZone returns PreferredTimeZone +func (m AnnouncementsPreferences) GetPreferredTimeZone() *string { + return m.PreferredTimeZone +} + func (m AnnouncementsPreferences) String() string { return common.PointerString(m) } diff --git a/announcementsservice/announcements_preferences_summary.go b/announcementsservice/announcements_preferences_summary.go index ca6dcc06c1..f9cb5731ca 100644 --- a/announcementsservice/announcements_preferences_summary.go +++ b/announcementsservice/announcements_preferences_summary.go @@ -36,6 +36,9 @@ type AnnouncementsPreferencesSummary struct { // When the preferences were last updated. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + // The string representing the user's preference regarding receiving announcements by email. PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"false" json:"preferenceType,omitempty"` } @@ -70,6 +73,11 @@ func (m AnnouncementsPreferencesSummary) GetPreferenceType() BaseCreateAnnouncem return m.PreferenceType } +//GetPreferredTimeZone returns PreferredTimeZone +func (m AnnouncementsPreferencesSummary) GetPreferredTimeZone() *string { + return m.PreferredTimeZone +} + func (m AnnouncementsPreferencesSummary) String() string { return common.PointerString(m) } diff --git a/announcementsservice/announcementsservice_announcement_client.go b/announcementsservice/announcementsservice_announcement_client.go index 2e82431afd..b0755fa802 100644 --- a/announcementsservice/announcementsservice_announcement_client.go +++ b/announcementsservice/announcementsservice_announcement_client.go @@ -63,7 +63,7 @@ func newAnnouncementClientFromBaseClient(baseClient common.BaseClient, configPro // SetRegion overrides the region of this client. func (client *AnnouncementClient) SetRegion(region string) { - client.Host = common.StringToRegion(region).EndpointForTemplate("announcements", "https://announcements.{region}.oci.{secondLevelDomain}") + client.Host = common.StringToRegion(region).EndpointForTemplate("announcements", "https://announcements.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid diff --git a/announcementsservice/announcementsservice_announcementspreferences_client.go b/announcementsservice/announcementsservice_announcementspreferences_client.go index 65d5f49556..05a6f2cc23 100644 --- a/announcementsservice/announcementsservice_announcementspreferences_client.go +++ b/announcementsservice/announcementsservice_announcementspreferences_client.go @@ -63,7 +63,7 @@ func newAnnouncementsPreferencesClientFromBaseClient(baseClient common.BaseClien // SetRegion overrides the region of this client. func (client *AnnouncementsPreferencesClient) SetRegion(region string) { - client.Host = common.StringToRegion(region).EndpointForTemplate("announcements", "https://announcements.{region}.oci.{secondLevelDomain}") + client.Host = common.StringToRegion(region).EndpointForTemplate("announcements", "https://announcements.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid diff --git a/announcementsservice/announcementsservice_announcementsubscription_client.go b/announcementsservice/announcementsservice_announcementsubscription_client.go index 12a6e74260..2f41e92e17 100644 --- a/announcementsservice/announcementsservice_announcementsubscription_client.go +++ b/announcementsservice/announcementsservice_announcementsubscription_client.go @@ -63,7 +63,7 @@ func newAnnouncementSubscriptionClientFromBaseClient(baseClient common.BaseClien // SetRegion overrides the region of this client. func (client *AnnouncementSubscriptionClient) SetRegion(region string) { - client.Host = common.StringToRegion(region).EndpointForTemplate("announcements", "https://announcements.{region}.oci.{secondLevelDomain}") + client.Host = common.StringToRegion(region).EndpointForTemplate("announcements", "https://announcements.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid diff --git a/announcementsservice/base_announcement.go b/announcementsservice/base_announcement.go index 3cef638479..bc26e255d8 100644 --- a/announcementsservice/base_announcement.go +++ b/announcementsservice/base_announcement.go @@ -346,18 +346,21 @@ type BaseAnnouncementTimeTwoTypeEnum string // Set of constants representing the allowable values for BaseAnnouncementTimeTwoTypeEnum const ( - BaseAnnouncementTimeTwoTypeEndTime BaseAnnouncementTimeTwoTypeEnum = "END_TIME" - BaseAnnouncementTimeTwoTypeNewEndTime BaseAnnouncementTimeTwoTypeEnum = "NEW_END_TIME" + BaseAnnouncementTimeTwoTypeEndTime BaseAnnouncementTimeTwoTypeEnum = "END_TIME" + BaseAnnouncementTimeTwoTypeNewEndTime BaseAnnouncementTimeTwoTypeEnum = "NEW_END_TIME" + BaseAnnouncementTimeTwoTypeEstimatedEndTime BaseAnnouncementTimeTwoTypeEnum = "ESTIMATED_END_TIME" ) var mappingBaseAnnouncementTimeTwoTypeEnum = map[string]BaseAnnouncementTimeTwoTypeEnum{ - "END_TIME": BaseAnnouncementTimeTwoTypeEndTime, - "NEW_END_TIME": BaseAnnouncementTimeTwoTypeNewEndTime, + "END_TIME": BaseAnnouncementTimeTwoTypeEndTime, + "NEW_END_TIME": BaseAnnouncementTimeTwoTypeNewEndTime, + "ESTIMATED_END_TIME": BaseAnnouncementTimeTwoTypeEstimatedEndTime, } var mappingBaseAnnouncementTimeTwoTypeEnumLowerCase = map[string]BaseAnnouncementTimeTwoTypeEnum{ - "end_time": BaseAnnouncementTimeTwoTypeEndTime, - "new_end_time": BaseAnnouncementTimeTwoTypeNewEndTime, + "end_time": BaseAnnouncementTimeTwoTypeEndTime, + "new_end_time": BaseAnnouncementTimeTwoTypeNewEndTime, + "estimated_end_time": BaseAnnouncementTimeTwoTypeEstimatedEndTime, } // GetBaseAnnouncementTimeTwoTypeEnumValues Enumerates the set of values for BaseAnnouncementTimeTwoTypeEnum @@ -374,6 +377,7 @@ func GetBaseAnnouncementTimeTwoTypeEnumStringValues() []string { return []string{ "END_TIME", "NEW_END_TIME", + "ESTIMATED_END_TIME", } } diff --git a/announcementsservice/base_announcements_preferences.go b/announcementsservice/base_announcements_preferences.go index 1b2561a19e..97f38cbfa6 100644 --- a/announcementsservice/base_announcements_preferences.go +++ b/announcementsservice/base_announcements_preferences.go @@ -38,17 +38,21 @@ type BaseAnnouncementsPreferences interface { // The string representing the user's preference regarding receiving announcements by email. GetPreferenceType() BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum + + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + GetPreferredTimeZone() *string } type baseannouncementspreferences struct { - JsonData []byte - CompartmentId *string `mandatory:"false" json:"compartmentId"` - Id *string `mandatory:"false" json:"id"` - IsUnsubscribed *bool `mandatory:"false" json:"isUnsubscribed"` - TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"false" json:"preferenceType,omitempty"` - Type string `json:"type"` + JsonData []byte + CompartmentId *string `mandatory:"false" json:"compartmentId"` + Id *string `mandatory:"false" json:"id"` + IsUnsubscribed *bool `mandatory:"false" json:"isUnsubscribed"` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"false" json:"preferenceType,omitempty"` + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + Type string `json:"type"` } // UnmarshalJSON unmarshals json @@ -68,6 +72,7 @@ func (m *baseannouncementspreferences) UnmarshalJSON(data []byte) error { m.TimeCreated = s.Model.TimeCreated m.TimeUpdated = s.Model.TimeUpdated m.PreferenceType = s.Model.PreferenceType + m.PreferredTimeZone = s.Model.PreferredTimeZone m.Type = s.Model.Type return err @@ -125,6 +130,11 @@ func (m baseannouncementspreferences) GetPreferenceType() BaseCreateAnnouncement return m.PreferenceType } +//GetPreferredTimeZone returns PreferredTimeZone +func (m baseannouncementspreferences) GetPreferredTimeZone() *string { + return m.PreferredTimeZone +} + func (m baseannouncementspreferences) String() string { return common.PointerString(m) } diff --git a/announcementsservice/base_create_announcements_preferences_details.go b/announcementsservice/base_create_announcements_preferences_details.go index efe6f7c14e..d17bc6be88 100644 --- a/announcementsservice/base_create_announcements_preferences_details.go +++ b/announcementsservice/base_create_announcements_preferences_details.go @@ -29,14 +29,18 @@ type BaseCreateAnnouncementsPreferencesDetails interface { // The OCID of the compartment for which you want to manage announcement email preferences. (Specify the tenancy by providing the // root compartment OCID.) GetCompartmentId() *string + + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + GetPreferredTimeZone() *string } type basecreateannouncementspreferencesdetails struct { - JsonData []byte - PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"true" json:"preferenceType"` - IsUnsubscribed *bool `mandatory:"false" json:"isUnsubscribed"` - CompartmentId *string `mandatory:"false" json:"compartmentId"` - Type string `json:"type"` + JsonData []byte + PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"true" json:"preferenceType"` + IsUnsubscribed *bool `mandatory:"false" json:"isUnsubscribed"` + CompartmentId *string `mandatory:"false" json:"compartmentId"` + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + Type string `json:"type"` } // UnmarshalJSON unmarshals json @@ -53,6 +57,7 @@ func (m *basecreateannouncementspreferencesdetails) UnmarshalJSON(data []byte) e m.PreferenceType = s.Model.PreferenceType m.IsUnsubscribed = s.Model.IsUnsubscribed m.CompartmentId = s.Model.CompartmentId + m.PreferredTimeZone = s.Model.PreferredTimeZone m.Type = s.Model.Type return err @@ -95,6 +100,11 @@ func (m basecreateannouncementspreferencesdetails) GetCompartmentId() *string { return m.CompartmentId } +//GetPreferredTimeZone returns PreferredTimeZone +func (m basecreateannouncementspreferencesdetails) GetPreferredTimeZone() *string { + return m.PreferredTimeZone +} + func (m basecreateannouncementspreferencesdetails) String() string { return common.PointerString(m) } diff --git a/announcementsservice/create_announcement_subscription_details.go b/announcementsservice/create_announcement_subscription_details.go index c857d60770..4363b45280 100644 --- a/announcementsservice/create_announcement_subscription_details.go +++ b/announcementsservice/create_announcement_subscription_details.go @@ -33,6 +33,12 @@ type CreateAnnouncementSubscriptionDetails struct { // A list of filter groups for the announcement subscription. A filter group combines one or more filters that the Announcements service applies to announcements for matching purposes. FilterGroups map[string]FilterGroupDetails `mandatory:"false" json:"filterGroups"` + // (For announcement subscriptions with Oracle Fusion Applications configured as the service only) The language in which the user prefers to receive emailed announcements. Specify the preference with a value that uses the language tag format (x-obmcs-human-language). For example fr-FR. + PreferredLanguage *string `mandatory:"false" json:"preferredLanguage"` + + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff --git a/announcementsservice/create_announcements_preferences_details.go b/announcementsservice/create_announcements_preferences_details.go index f043f89356..40b2d8d18f 100644 --- a/announcementsservice/create_announcements_preferences_details.go +++ b/announcementsservice/create_announcements_preferences_details.go @@ -27,6 +27,9 @@ type CreateAnnouncementsPreferencesDetails struct { // root compartment OCID.) CompartmentId *string `mandatory:"false" json:"compartmentId"` + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + // The string representing the user's preference, whether to opt in to only required announcements, to opt in to all announcements, including informational announcements, or to opt out of all announcements. PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"true" json:"preferenceType"` } @@ -46,6 +49,11 @@ func (m CreateAnnouncementsPreferencesDetails) GetPreferenceType() BaseCreateAnn return m.PreferenceType } +//GetPreferredTimeZone returns PreferredTimeZone +func (m CreateAnnouncementsPreferencesDetails) GetPreferredTimeZone() *string { + return m.PreferredTimeZone +} + func (m CreateAnnouncementsPreferencesDetails) String() string { return common.PointerString(m) } diff --git a/announcementsservice/update_announcement_subscription_details.go b/announcementsservice/update_announcement_subscription_details.go index c8d2c932ef..d559aef639 100644 --- a/announcementsservice/update_announcement_subscription_details.go +++ b/announcementsservice/update_announcement_subscription_details.go @@ -27,6 +27,12 @@ type UpdateAnnouncementSubscriptionDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Notifications service topic that is the target for publishing announcements that match the configured announcement subscription. The caller of the operation needs the ONS_TOPIC_PUBLISH permission for the targeted Notifications service topic. For more information about Notifications permissions, see Details for Notifications (https://docs.cloud.oracle.com/Content/Identity/policyreference/notificationpolicyreference.htm). OnsTopicId *string `mandatory:"false" json:"onsTopicId"` + // (For announcement subscriptions with Oracle Fusion Applications configured as the service only) The language in which the user prefers to receive emailed announcements. Specify the preference with a value that uses the language tag format (x-obmcs-human-language). For example fr-FR. + PreferredLanguage *string `mandatory:"false" json:"preferredLanguage"` + + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff --git a/announcementsservice/update_announcements_preferences_details.go b/announcementsservice/update_announcements_preferences_details.go index 5e5e30205c..d12392fde9 100644 --- a/announcementsservice/update_announcements_preferences_details.go +++ b/announcementsservice/update_announcements_preferences_details.go @@ -27,6 +27,9 @@ type UpdateAnnouncementsPreferencesDetails struct { // root compartment OCID.) CompartmentId *string `mandatory:"false" json:"compartmentId"` + // The time zone that the user prefers for announcement time stamps. Specify the preference with a value that uses the IANA Time Zone Database format (x-obmcs-time-zone). For example America/Los_Angeles. + PreferredTimeZone *string `mandatory:"false" json:"preferredTimeZone"` + // The string representing the user's preference, whether to opt in to only required announcements, to opt in to all announcements, including informational announcements, or to opt out of all announcements. PreferenceType BaseCreateAnnouncementsPreferencesDetailsPreferenceTypeEnum `mandatory:"true" json:"preferenceType"` } @@ -46,6 +49,11 @@ func (m UpdateAnnouncementsPreferencesDetails) GetPreferenceType() BaseCreateAnn return m.PreferenceType } +//GetPreferredTimeZone returns PreferredTimeZone +func (m UpdateAnnouncementsPreferencesDetails) GetPreferredTimeZone() *string { + return m.PreferredTimeZone +} + func (m UpdateAnnouncementsPreferencesDetails) String() string { return common.PointerString(m) } diff --git a/apigateway/additional_validation_policy.go b/apigateway/additional_validation_policy.go new file mode 100644 index 0000000000..2ef2cab41d --- /dev/null +++ b/apigateway/additional_validation_policy.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AdditionalValidationPolicy Additional JWT validation checks. +type AdditionalValidationPolicy struct { + + // A list of parties that could have issued the token. + Issuers []string `mandatory:"false" json:"issuers"` + + // The list of intended recipients for the token. + Audiences []string `mandatory:"false" json:"audiences"` + + // A list of claims which should be validated to consider the token valid. + VerifyClaims []JsonWebTokenClaim `mandatory:"false" json:"verifyClaims"` +} + +func (m AdditionalValidationPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AdditionalValidationPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/apigateway/any_of_selection_key.go b/apigateway/any_of_selection_key.go index 306b19a5b8..4ec8e92d38 100644 --- a/apigateway/any_of_selection_key.go +++ b/apigateway/any_of_selection_key.go @@ -18,16 +18,16 @@ import ( "strings" ) -// AnyOfSelectionKey Information around the set of string values for selector of a dynamic authentication/ routing branch. Selector should match any one of the values present in set of string values. +// AnyOfSelectionKey When dynamically routing and dynamically authenticating requests, the route or authentication server associated with a set of selection keys is used if the context variable in an incoming request exactly matches one of the keys in the set. type AnyOfSelectionKey struct { // Name assigned to the branch. Name *string `mandatory:"true" json:"name"` - // Information regarding whether this is the default branch. + // Specifies whether to use the route or authentication server associated with this selection key as the default. The default is used if the value of a context variable in an incoming request does not match any of the other selection key values when dynamically routing and dynamically authenticating requests. IsDefault *bool `mandatory:"false" json:"isDefault"` - // Information regarding the set of values of selector for which this branch should be selected. + // The set of selection keys to match with the context variable in an incoming request. If the context variable exactly matches one of the keys in the set, the request is sent to the route or authentication server associated with the set. Values []string `mandatory:"false" json:"values"` } diff --git a/apigateway/api_specification_route_backend.go b/apigateway/api_specification_route_backend.go index 3a2781a806..8f10288e6c 100644 --- a/apigateway/api_specification_route_backend.go +++ b/apigateway/api_specification_route_backend.go @@ -52,6 +52,10 @@ func (m *apispecificationroutebackend) UnmarshalPolymorphicJSON(data []byte) (in var err error switch m.Type { + case "OAUTH2_LOGOUT_BACKEND": + mm := OAuth2LogoutBackend{} + err = json.Unmarshal(data, &mm) + return mm, err case "HTTP_BACKEND": mm := HttpBackend{} err = json.Unmarshal(data, &mm) @@ -98,6 +102,7 @@ const ( ApiSpecificationRouteBackendTypeHttpBackend ApiSpecificationRouteBackendTypeEnum = "HTTP_BACKEND" ApiSpecificationRouteBackendTypeStockResponseBackend ApiSpecificationRouteBackendTypeEnum = "STOCK_RESPONSE_BACKEND" ApiSpecificationRouteBackendTypeDynamicRoutingBackend ApiSpecificationRouteBackendTypeEnum = "DYNAMIC_ROUTING_BACKEND" + ApiSpecificationRouteBackendTypeOauth2LogoutBackend ApiSpecificationRouteBackendTypeEnum = "OAUTH2_LOGOUT_BACKEND" ) var mappingApiSpecificationRouteBackendTypeEnum = map[string]ApiSpecificationRouteBackendTypeEnum{ @@ -105,6 +110,7 @@ var mappingApiSpecificationRouteBackendTypeEnum = map[string]ApiSpecificationRou "HTTP_BACKEND": ApiSpecificationRouteBackendTypeHttpBackend, "STOCK_RESPONSE_BACKEND": ApiSpecificationRouteBackendTypeStockResponseBackend, "DYNAMIC_ROUTING_BACKEND": ApiSpecificationRouteBackendTypeDynamicRoutingBackend, + "OAUTH2_LOGOUT_BACKEND": ApiSpecificationRouteBackendTypeOauth2LogoutBackend, } var mappingApiSpecificationRouteBackendTypeEnumLowerCase = map[string]ApiSpecificationRouteBackendTypeEnum{ @@ -112,6 +118,7 @@ var mappingApiSpecificationRouteBackendTypeEnumLowerCase = map[string]ApiSpecifi "http_backend": ApiSpecificationRouteBackendTypeHttpBackend, "stock_response_backend": ApiSpecificationRouteBackendTypeStockResponseBackend, "dynamic_routing_backend": ApiSpecificationRouteBackendTypeDynamicRoutingBackend, + "oauth2_logout_backend": ApiSpecificationRouteBackendTypeOauth2LogoutBackend, } // GetApiSpecificationRouteBackendTypeEnumValues Enumerates the set of values for ApiSpecificationRouteBackendTypeEnum @@ -130,6 +137,7 @@ func GetApiSpecificationRouteBackendTypeEnumStringValues() []string { "HTTP_BACKEND", "STOCK_RESPONSE_BACKEND", "DYNAMIC_ROUTING_BACKEND", + "OAUTH2_LOGOUT_BACKEND", } } diff --git a/apigateway/authentication_policy.go b/apigateway/authentication_policy.go index a2c0f2a9c9..0a95255f60 100644 --- a/apigateway/authentication_policy.go +++ b/apigateway/authentication_policy.go @@ -58,6 +58,10 @@ func (m *authenticationpolicy) UnmarshalPolymorphicJSON(data []byte) (interface{ var err error switch m.Type { + case "TOKEN_AUTHENTICATION": + mm := TokenAuthenticationPolicy{} + err = json.Unmarshal(data, &mm) + return mm, err case "JWT_AUTHENTICATION": mm := JwtAuthenticationPolicy{} err = json.Unmarshal(data, &mm) @@ -99,16 +103,19 @@ type AuthenticationPolicyTypeEnum string const ( AuthenticationPolicyTypeCustomAuthentication AuthenticationPolicyTypeEnum = "CUSTOM_AUTHENTICATION" AuthenticationPolicyTypeJwtAuthentication AuthenticationPolicyTypeEnum = "JWT_AUTHENTICATION" + AuthenticationPolicyTypeTokenAuthentication AuthenticationPolicyTypeEnum = "TOKEN_AUTHENTICATION" ) var mappingAuthenticationPolicyTypeEnum = map[string]AuthenticationPolicyTypeEnum{ "CUSTOM_AUTHENTICATION": AuthenticationPolicyTypeCustomAuthentication, "JWT_AUTHENTICATION": AuthenticationPolicyTypeJwtAuthentication, + "TOKEN_AUTHENTICATION": AuthenticationPolicyTypeTokenAuthentication, } var mappingAuthenticationPolicyTypeEnumLowerCase = map[string]AuthenticationPolicyTypeEnum{ "custom_authentication": AuthenticationPolicyTypeCustomAuthentication, "jwt_authentication": AuthenticationPolicyTypeJwtAuthentication, + "token_authentication": AuthenticationPolicyTypeTokenAuthentication, } // GetAuthenticationPolicyTypeEnumValues Enumerates the set of values for AuthenticationPolicyTypeEnum @@ -125,6 +132,7 @@ func GetAuthenticationPolicyTypeEnumStringValues() []string { return []string{ "CUSTOM_AUTHENTICATION", "JWT_AUTHENTICATION", + "TOKEN_AUTHENTICATION", } } diff --git a/apigateway/authentication_server_policy.go b/apigateway/authentication_server_policy.go index 90e69ecbec..23f6c747fd 100644 --- a/apigateway/authentication_server_policy.go +++ b/apigateway/authentication_server_policy.go @@ -18,7 +18,7 @@ import ( "strings" ) -// AuthenticationServerPolicy Information around an authentication server for dynamic authentication. +// AuthenticationServerPolicy Policy for the details regarding each authentication server under dynamic authentication. We specify the value of selectors for which this authentication server must be selected for a request under keys. We specify the configuration details of authentication server under authenticationServerDetail. type AuthenticationServerPolicy struct { Key DynamicSelectionKey `mandatory:"true" json:"key"` diff --git a/apigateway/client_app_details.go b/apigateway/client_app_details.go new file mode 100644 index 0000000000..8b924d97d1 --- /dev/null +++ b/apigateway/client_app_details.go @@ -0,0 +1,124 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ClientAppDetails Client App Credential details. +type ClientAppDetails interface { +} + +type clientappdetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *clientappdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerclientappdetails clientappdetails + s := struct { + Model Unmarshalerclientappdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *clientappdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "CUSTOM": + mm := CustomClientAppDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VALIDATION_BLOCK": + mm := ValidationBlockClientAppDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m clientappdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m clientappdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ClientAppDetailsTypeEnum Enum with underlying type: string +type ClientAppDetailsTypeEnum string + +// Set of constants representing the allowable values for ClientAppDetailsTypeEnum +const ( + ClientAppDetailsTypeValidationBlock ClientAppDetailsTypeEnum = "VALIDATION_BLOCK" + ClientAppDetailsTypeCustom ClientAppDetailsTypeEnum = "CUSTOM" +) + +var mappingClientAppDetailsTypeEnum = map[string]ClientAppDetailsTypeEnum{ + "VALIDATION_BLOCK": ClientAppDetailsTypeValidationBlock, + "CUSTOM": ClientAppDetailsTypeCustom, +} + +var mappingClientAppDetailsTypeEnumLowerCase = map[string]ClientAppDetailsTypeEnum{ + "validation_block": ClientAppDetailsTypeValidationBlock, + "custom": ClientAppDetailsTypeCustom, +} + +// GetClientAppDetailsTypeEnumValues Enumerates the set of values for ClientAppDetailsTypeEnum +func GetClientAppDetailsTypeEnumValues() []ClientAppDetailsTypeEnum { + values := make([]ClientAppDetailsTypeEnum, 0) + for _, v := range mappingClientAppDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetClientAppDetailsTypeEnumStringValues Enumerates the set of values in String for ClientAppDetailsTypeEnum +func GetClientAppDetailsTypeEnumStringValues() []string { + return []string{ + "VALIDATION_BLOCK", + "CUSTOM", + } +} + +// GetMappingClientAppDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingClientAppDetailsTypeEnum(val string) (ClientAppDetailsTypeEnum, bool) { + enum, ok := mappingClientAppDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apigateway/custom_client_app_details.go b/apigateway/custom_client_app_details.go new file mode 100644 index 0000000000..44062345da --- /dev/null +++ b/apigateway/custom_client_app_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CustomClientAppDetails Client App Credentials to be provided again. +type CustomClientAppDetails struct { + + // Client ID for the OAuth2/OIDC app. + ClientId *string `mandatory:"true" json:"clientId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Vault Service secret resource. + ClientSecretId *string `mandatory:"true" json:"clientSecretId"` + + // The version number of the client secret to use. + ClientSecretVersionNumber *int64 `mandatory:"true" json:"clientSecretVersionNumber"` +} + +func (m CustomClientAppDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CustomClientAppDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CustomClientAppDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCustomClientAppDetails CustomClientAppDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCustomClientAppDetails + }{ + "CUSTOM", + (MarshalTypeCustomClientAppDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/apigateway/discovery_uri_source_uri_details.go b/apigateway/discovery_uri_source_uri_details.go new file mode 100644 index 0000000000..5eaae05740 --- /dev/null +++ b/apigateway/discovery_uri_source_uri_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DiscoveryUriSourceUriDetails Discovery Uri information. +type DiscoveryUriSourceUriDetails struct { + + // The discovery URI for the auth server. + Uri *string `mandatory:"true" json:"uri"` +} + +func (m DiscoveryUriSourceUriDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DiscoveryUriSourceUriDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DiscoveryUriSourceUriDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDiscoveryUriSourceUriDetails DiscoveryUriSourceUriDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeDiscoveryUriSourceUriDetails + }{ + "DISCOVERY_URI", + (MarshalTypeDiscoveryUriSourceUriDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/apigateway/dynamic_authentication_policy.go b/apigateway/dynamic_authentication_policy.go index e69d06b828..f29a97fb97 100644 --- a/apigateway/dynamic_authentication_policy.go +++ b/apigateway/dynamic_authentication_policy.go @@ -18,7 +18,7 @@ import ( "strings" ) -// DynamicAuthenticationPolicy Information on how to authenticate requests when multiple authentication options are configured for a deployment. +// DynamicAuthenticationPolicy Policy on how to authenticate requests when multiple authentication options are configured for a deployment. For an incoming request, the value of selector specified under selectionSource will be matched against the keys specified for each authentication server. The authentication server whose key matches the value of selector will be used for authentication. type DynamicAuthenticationPolicy struct { SelectionSource SelectionSourcePolicy `mandatory:"true" json:"selectionSource"` diff --git a/apigateway/dynamic_routing_backend.go b/apigateway/dynamic_routing_backend.go index bf934f7145..e926b55ce7 100644 --- a/apigateway/dynamic_routing_backend.go +++ b/apigateway/dynamic_routing_backend.go @@ -18,7 +18,7 @@ import ( "strings" ) -// DynamicRoutingBackend Send the request to a Dynamic Routing backend. +// DynamicRoutingBackend Send the request to the backend dynamically selected based on the incoming request's context. type DynamicRoutingBackend struct { SelectionSource SelectionSourcePolicy `mandatory:"true" json:"selectionSource"` diff --git a/apigateway/dynamic_routing_type_routing_backend.go b/apigateway/dynamic_routing_type_routing_backend.go index 414b9f684d..1f5f9e0992 100644 --- a/apigateway/dynamic_routing_type_routing_backend.go +++ b/apigateway/dynamic_routing_type_routing_backend.go @@ -18,7 +18,7 @@ import ( "strings" ) -// DynamicRoutingTypeRoutingBackend Information around a routing backend for dynamic routing. +// DynamicRoutingTypeRoutingBackend Policy for the details regarding each routing backend under dynamic routing. We specify the value of selectors for which this routing backend must be selected for a request under keys. We specify the configuration details of routing backend under backend. type DynamicRoutingTypeRoutingBackend struct { Key DynamicSelectionKey `mandatory:"true" json:"key"` diff --git a/apigateway/dynamic_selection_key.go b/apigateway/dynamic_selection_key.go index 5c40b5a8b4..20f48f1fa7 100644 --- a/apigateway/dynamic_selection_key.go +++ b/apigateway/dynamic_selection_key.go @@ -18,13 +18,13 @@ import ( "strings" ) -// DynamicSelectionKey Information around the values for selector of an authentication/ routing branch. +// DynamicSelectionKey Base policy for defining how to match the context variable in an incoming request with selection keys when dynamically routing and dynamically authenticating requests. type DynamicSelectionKey interface { // Name assigned to the branch. GetName() *string - // Information regarding whether this is the default branch. + // Specifies whether to use the route or authentication server associated with this selection key as the default. The default is used if the value of a context variable in an incoming request does not match any of the other selection key values when dynamically routing and dynamically authenticating requests. GetIsDefault() *bool } diff --git a/apigateway/jwt_authentication_policy.go b/apigateway/jwt_authentication_policy.go index 2dfdda8d2e..765fdd6b00 100644 --- a/apigateway/jwt_authentication_policy.go +++ b/apigateway/jwt_authentication_policy.go @@ -44,12 +44,12 @@ type JwtAuthenticationPolicy struct { // the token. This must to be provided if "tokenHeader" is specified. TokenAuthScheme *string `mandatory:"false" json:"tokenAuthScheme"` - // A list of claims which should be validated to consider the token valid. - VerifyClaims []JsonWebTokenClaim `mandatory:"false" json:"verifyClaims"` - // The maximum expected time difference between the system clocks // of the token issuer and the API Gateway. MaxClockSkewInSeconds *float32 `mandatory:"false" json:"maxClockSkewInSeconds"` + + // A list of claims which should be validated to consider the token valid. + VerifyClaims []JsonWebTokenClaim `mandatory:"false" json:"verifyClaims"` } //GetIsAnonymousAccessAllowed returns IsAnonymousAccessAllowed @@ -94,8 +94,8 @@ func (m *JwtAuthenticationPolicy) UnmarshalJSON(data []byte) (e error) { TokenHeader *string `json:"tokenHeader"` TokenQueryParam *string `json:"tokenQueryParam"` TokenAuthScheme *string `json:"tokenAuthScheme"` - VerifyClaims []JsonWebTokenClaim `json:"verifyClaims"` MaxClockSkewInSeconds *float32 `json:"maxClockSkewInSeconds"` + VerifyClaims []JsonWebTokenClaim `json:"verifyClaims"` Issuers []string `json:"issuers"` Audiences []string `json:"audiences"` PublicKeys publickeyset `json:"publicKeys"` @@ -114,13 +114,13 @@ func (m *JwtAuthenticationPolicy) UnmarshalJSON(data []byte) (e error) { m.TokenAuthScheme = model.TokenAuthScheme + m.MaxClockSkewInSeconds = model.MaxClockSkewInSeconds + m.VerifyClaims = make([]JsonWebTokenClaim, len(model.VerifyClaims)) for i, n := range model.VerifyClaims { m.VerifyClaims[i] = n } - m.MaxClockSkewInSeconds = model.MaxClockSkewInSeconds - m.Issuers = make([]string, len(model.Issuers)) for i, n := range model.Issuers { m.Issuers[i] = n diff --git a/apigateway/o_auth2_logout_backend.go b/apigateway/o_auth2_logout_backend.go new file mode 100644 index 0000000000..79656d8490 --- /dev/null +++ b/apigateway/o_auth2_logout_backend.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OAuth2LogoutBackend Backend which when called triggers OAuth2 logout. +type OAuth2LogoutBackend struct { + AllowedPostLogoutUris []string `mandatory:"false" json:"allowedPostLogoutUris"` + + // Defines a state that should be shared on redirecting to postLogout URL. + PostLogoutState *string `mandatory:"false" json:"postLogoutState"` +} + +func (m OAuth2LogoutBackend) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OAuth2LogoutBackend) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m OAuth2LogoutBackend) MarshalJSON() (buff []byte, e error) { + type MarshalTypeOAuth2LogoutBackend OAuth2LogoutBackend + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeOAuth2LogoutBackend + }{ + "OAUTH2_LOGOUT_BACKEND", + (MarshalTypeOAuth2LogoutBackend)(m), + } + + return json.Marshal(&s) +} diff --git a/apigateway/o_auth2_response_validation_failure_policy.go b/apigateway/o_auth2_response_validation_failure_policy.go new file mode 100644 index 0000000000..3278359e77 --- /dev/null +++ b/apigateway/o_auth2_response_validation_failure_policy.go @@ -0,0 +1,184 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OAuth2ResponseValidationFailurePolicy Policy to specify OAuth2 flow configuration. +type OAuth2ResponseValidationFailurePolicy struct { + ClientDetails ClientAppDetails `mandatory:"true" json:"clientDetails"` + + SourceUriDetails SourceUriDetails `mandatory:"true" json:"sourceUriDetails"` + + // List of scopes. + Scopes []string `mandatory:"true" json:"scopes"` + + // The duration for which the OAuth2 success token should be cached before it is + // fetched again. + MaxExpiryDurationInHours *int `mandatory:"false" json:"maxExpiryDurationInHours"` + + // Defines whether or not to use cookies for session maintenance. + UseCookiesForSession *bool `mandatory:"false" json:"useCookiesForSession"` + + // Defines whether or not to use cookies for OAuth2 intermediate steps. + UseCookiesForIntermediateSteps *bool `mandatory:"false" json:"useCookiesForIntermediateSteps"` + + // Defines whether or not to support PKCE. + UsePkce *bool `mandatory:"false" json:"usePkce"` + + // The path to be used as fallback after OAuth2. + FallbackRedirectPath *string `mandatory:"false" json:"fallbackRedirectPath"` + + // The path to be used as logout. + LogoutPath *string `mandatory:"false" json:"logoutPath"` + + // Response Type. + ResponseType OAuth2ResponseValidationFailurePolicyResponseTypeEnum `mandatory:"true" json:"responseType"` +} + +func (m OAuth2ResponseValidationFailurePolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OAuth2ResponseValidationFailurePolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOAuth2ResponseValidationFailurePolicyResponseTypeEnum(string(m.ResponseType)); !ok && m.ResponseType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResponseType: %s. Supported values are: %s.", m.ResponseType, strings.Join(GetOAuth2ResponseValidationFailurePolicyResponseTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m OAuth2ResponseValidationFailurePolicy) MarshalJSON() (buff []byte, e error) { + type MarshalTypeOAuth2ResponseValidationFailurePolicy OAuth2ResponseValidationFailurePolicy + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeOAuth2ResponseValidationFailurePolicy + }{ + "OAUTH2", + (MarshalTypeOAuth2ResponseValidationFailurePolicy)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *OAuth2ResponseValidationFailurePolicy) UnmarshalJSON(data []byte) (e error) { + model := struct { + MaxExpiryDurationInHours *int `json:"maxExpiryDurationInHours"` + UseCookiesForSession *bool `json:"useCookiesForSession"` + UseCookiesForIntermediateSteps *bool `json:"useCookiesForIntermediateSteps"` + UsePkce *bool `json:"usePkce"` + FallbackRedirectPath *string `json:"fallbackRedirectPath"` + LogoutPath *string `json:"logoutPath"` + ClientDetails clientappdetails `json:"clientDetails"` + SourceUriDetails sourceuridetails `json:"sourceUriDetails"` + Scopes []string `json:"scopes"` + ResponseType OAuth2ResponseValidationFailurePolicyResponseTypeEnum `json:"responseType"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.MaxExpiryDurationInHours = model.MaxExpiryDurationInHours + + m.UseCookiesForSession = model.UseCookiesForSession + + m.UseCookiesForIntermediateSteps = model.UseCookiesForIntermediateSteps + + m.UsePkce = model.UsePkce + + m.FallbackRedirectPath = model.FallbackRedirectPath + + m.LogoutPath = model.LogoutPath + + nn, e = model.ClientDetails.UnmarshalPolymorphicJSON(model.ClientDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ClientDetails = nn.(ClientAppDetails) + } else { + m.ClientDetails = nil + } + + nn, e = model.SourceUriDetails.UnmarshalPolymorphicJSON(model.SourceUriDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceUriDetails = nn.(SourceUriDetails) + } else { + m.SourceUriDetails = nil + } + + m.Scopes = make([]string, len(model.Scopes)) + for i, n := range model.Scopes { + m.Scopes[i] = n + } + + m.ResponseType = model.ResponseType + + return +} + +// OAuth2ResponseValidationFailurePolicyResponseTypeEnum Enum with underlying type: string +type OAuth2ResponseValidationFailurePolicyResponseTypeEnum string + +// Set of constants representing the allowable values for OAuth2ResponseValidationFailurePolicyResponseTypeEnum +const ( + OAuth2ResponseValidationFailurePolicyResponseTypeCode OAuth2ResponseValidationFailurePolicyResponseTypeEnum = "CODE" +) + +var mappingOAuth2ResponseValidationFailurePolicyResponseTypeEnum = map[string]OAuth2ResponseValidationFailurePolicyResponseTypeEnum{ + "CODE": OAuth2ResponseValidationFailurePolicyResponseTypeCode, +} + +var mappingOAuth2ResponseValidationFailurePolicyResponseTypeEnumLowerCase = map[string]OAuth2ResponseValidationFailurePolicyResponseTypeEnum{ + "code": OAuth2ResponseValidationFailurePolicyResponseTypeCode, +} + +// GetOAuth2ResponseValidationFailurePolicyResponseTypeEnumValues Enumerates the set of values for OAuth2ResponseValidationFailurePolicyResponseTypeEnum +func GetOAuth2ResponseValidationFailurePolicyResponseTypeEnumValues() []OAuth2ResponseValidationFailurePolicyResponseTypeEnum { + values := make([]OAuth2ResponseValidationFailurePolicyResponseTypeEnum, 0) + for _, v := range mappingOAuth2ResponseValidationFailurePolicyResponseTypeEnum { + values = append(values, v) + } + return values +} + +// GetOAuth2ResponseValidationFailurePolicyResponseTypeEnumStringValues Enumerates the set of values in String for OAuth2ResponseValidationFailurePolicyResponseTypeEnum +func GetOAuth2ResponseValidationFailurePolicyResponseTypeEnumStringValues() []string { + return []string{ + "CODE", + } +} + +// GetMappingOAuth2ResponseValidationFailurePolicyResponseTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOAuth2ResponseValidationFailurePolicyResponseTypeEnum(val string) (OAuth2ResponseValidationFailurePolicyResponseTypeEnum, bool) { + enum, ok := mappingOAuth2ResponseValidationFailurePolicyResponseTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apigateway/selection_source_policy.go b/apigateway/selection_source_policy.go index 38bb473a90..ddf17434d5 100644 --- a/apigateway/selection_source_policy.go +++ b/apigateway/selection_source_policy.go @@ -18,7 +18,7 @@ import ( "strings" ) -// SelectionSourcePolicy Information around selector used for branching among routes/ authentication servers while dynamic routing/ authentication. +// SelectionSourcePolicy The type of selector to use when dynamically routing and dynamically authenticating requests. type SelectionSourcePolicy interface { } diff --git a/apigateway/single_selection_source_policy.go b/apigateway/single_selection_source_policy.go index 256307cd6f..2496b43cda 100644 --- a/apigateway/single_selection_source_policy.go +++ b/apigateway/single_selection_source_policy.go @@ -18,7 +18,7 @@ import ( "strings" ) -// SingleSelectionSourcePolicy Information around selector used for branching among routes/ authentication servers in dynamic routing/ authentication where we are allowed to specify only a single context variable as selector. +// SingleSelectionSourcePolicy The single context variable in an incoming request to match against specified selection keys when dynamically routing and dynamically authenticating requests. type SingleSelectionSourcePolicy struct { // String describing the context variable used as selector. diff --git a/apigateway/source_uri_details.go b/apigateway/source_uri_details.go new file mode 100644 index 0000000000..60d1e96870 --- /dev/null +++ b/apigateway/source_uri_details.go @@ -0,0 +1,124 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SourceUriDetails Auth endpoint details. +type SourceUriDetails interface { +} + +type sourceuridetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *sourceuridetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersourceuridetails sourceuridetails + s := struct { + Model Unmarshalersourceuridetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *sourceuridetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "DISCOVERY_URI": + mm := DiscoveryUriSourceUriDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VALIDATION_BLOCK": + mm := ValidationBlockSourceUriDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m sourceuridetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m sourceuridetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SourceUriDetailsTypeEnum Enum with underlying type: string +type SourceUriDetailsTypeEnum string + +// Set of constants representing the allowable values for SourceUriDetailsTypeEnum +const ( + SourceUriDetailsTypeDiscoveryUri SourceUriDetailsTypeEnum = "DISCOVERY_URI" + SourceUriDetailsTypeValidationBlock SourceUriDetailsTypeEnum = "VALIDATION_BLOCK" +) + +var mappingSourceUriDetailsTypeEnum = map[string]SourceUriDetailsTypeEnum{ + "DISCOVERY_URI": SourceUriDetailsTypeDiscoveryUri, + "VALIDATION_BLOCK": SourceUriDetailsTypeValidationBlock, +} + +var mappingSourceUriDetailsTypeEnumLowerCase = map[string]SourceUriDetailsTypeEnum{ + "discovery_uri": SourceUriDetailsTypeDiscoveryUri, + "validation_block": SourceUriDetailsTypeValidationBlock, +} + +// GetSourceUriDetailsTypeEnumValues Enumerates the set of values for SourceUriDetailsTypeEnum +func GetSourceUriDetailsTypeEnumValues() []SourceUriDetailsTypeEnum { + values := make([]SourceUriDetailsTypeEnum, 0) + for _, v := range mappingSourceUriDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetSourceUriDetailsTypeEnumStringValues Enumerates the set of values in String for SourceUriDetailsTypeEnum +func GetSourceUriDetailsTypeEnumStringValues() []string { + return []string{ + "DISCOVERY_URI", + "VALIDATION_BLOCK", + } +} + +// GetMappingSourceUriDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSourceUriDetailsTypeEnum(val string) (SourceUriDetailsTypeEnum, bool) { + enum, ok := mappingSourceUriDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apigateway/token_authentication_policy.go b/apigateway/token_authentication_policy.go new file mode 100644 index 0000000000..00646befb2 --- /dev/null +++ b/apigateway/token_authentication_policy.go @@ -0,0 +1,130 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TokenAuthenticationPolicy Validate a token present in the header or query parameter. A valid +// policy must specify either tokenHeader or tokenQueryParam. +type TokenAuthenticationPolicy struct { + ValidationPolicy TokenAuthenticationValidationPolicy `mandatory:"true" json:"validationPolicy"` + + // Whether an unauthenticated user may access the API. Must be "true" to enable ANONYMOUS + // route authorization. + IsAnonymousAccessAllowed *bool `mandatory:"false" json:"isAnonymousAccessAllowed"` + + // The name of the header containing the authentication token. + TokenHeader *string `mandatory:"false" json:"tokenHeader"` + + // The name of the query parameter containing the authentication token. + TokenQueryParam *string `mandatory:"false" json:"tokenQueryParam"` + + // The authentication scheme that is to be used when authenticating + // the token. This must to be provided if "tokenHeader" is specified. + TokenAuthScheme *string `mandatory:"false" json:"tokenAuthScheme"` + + // The maximum expected time difference between the system clocks + // of the token issuer and the API Gateway. + MaxClockSkewInSeconds *float32 `mandatory:"false" json:"maxClockSkewInSeconds"` + + ValidationFailurePolicy ValidationFailurePolicy `mandatory:"false" json:"validationFailurePolicy"` +} + +//GetIsAnonymousAccessAllowed returns IsAnonymousAccessAllowed +func (m TokenAuthenticationPolicy) GetIsAnonymousAccessAllowed() *bool { + return m.IsAnonymousAccessAllowed +} + +func (m TokenAuthenticationPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TokenAuthenticationPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m TokenAuthenticationPolicy) MarshalJSON() (buff []byte, e error) { + type MarshalTypeTokenAuthenticationPolicy TokenAuthenticationPolicy + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeTokenAuthenticationPolicy + }{ + "TOKEN_AUTHENTICATION", + (MarshalTypeTokenAuthenticationPolicy)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *TokenAuthenticationPolicy) UnmarshalJSON(data []byte) (e error) { + model := struct { + IsAnonymousAccessAllowed *bool `json:"isAnonymousAccessAllowed"` + TokenHeader *string `json:"tokenHeader"` + TokenQueryParam *string `json:"tokenQueryParam"` + TokenAuthScheme *string `json:"tokenAuthScheme"` + MaxClockSkewInSeconds *float32 `json:"maxClockSkewInSeconds"` + ValidationFailurePolicy validationfailurepolicy `json:"validationFailurePolicy"` + ValidationPolicy tokenauthenticationvalidationpolicy `json:"validationPolicy"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.IsAnonymousAccessAllowed = model.IsAnonymousAccessAllowed + + m.TokenHeader = model.TokenHeader + + m.TokenQueryParam = model.TokenQueryParam + + m.TokenAuthScheme = model.TokenAuthScheme + + m.MaxClockSkewInSeconds = model.MaxClockSkewInSeconds + + nn, e = model.ValidationFailurePolicy.UnmarshalPolymorphicJSON(model.ValidationFailurePolicy.JsonData) + if e != nil { + return + } + if nn != nil { + m.ValidationFailurePolicy = nn.(ValidationFailurePolicy) + } else { + m.ValidationFailurePolicy = nil + } + + nn, e = model.ValidationPolicy.UnmarshalPolymorphicJSON(model.ValidationPolicy.JsonData) + if e != nil { + return + } + if nn != nil { + m.ValidationPolicy = nn.(TokenAuthenticationValidationPolicy) + } else { + m.ValidationPolicy = nil + } + + return +} diff --git a/apigateway/token_authentication_remote_discovery_validation_policy.go b/apigateway/token_authentication_remote_discovery_validation_policy.go new file mode 100644 index 0000000000..28f883e650 --- /dev/null +++ b/apigateway/token_authentication_remote_discovery_validation_policy.go @@ -0,0 +1,115 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TokenAuthenticationRemoteDiscoveryValidationPolicy Instrospect Url based validation retrieved at run-time from a remote location +// to verify the provided token. +type TokenAuthenticationRemoteDiscoveryValidationPolicy struct { + ClientDetails ClientAppDetails `mandatory:"true" json:"clientDetails"` + + SourceUriDetails SourceUriDetails `mandatory:"true" json:"sourceUriDetails"` + + AdditionalValidationPolicy *AdditionalValidationPolicy `mandatory:"false" json:"additionalValidationPolicy"` + + // Defines whether or not to uphold SSL verification. + IsSslVerifyDisabled *bool `mandatory:"false" json:"isSslVerifyDisabled"` + + // The duration for which the introspect URL response should be cached before it is + // fetched again. + MaxCacheDurationInHours *int `mandatory:"false" json:"maxCacheDurationInHours"` +} + +//GetAdditionalValidationPolicy returns AdditionalValidationPolicy +func (m TokenAuthenticationRemoteDiscoveryValidationPolicy) GetAdditionalValidationPolicy() *AdditionalValidationPolicy { + return m.AdditionalValidationPolicy +} + +func (m TokenAuthenticationRemoteDiscoveryValidationPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TokenAuthenticationRemoteDiscoveryValidationPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m TokenAuthenticationRemoteDiscoveryValidationPolicy) MarshalJSON() (buff []byte, e error) { + type MarshalTypeTokenAuthenticationRemoteDiscoveryValidationPolicy TokenAuthenticationRemoteDiscoveryValidationPolicy + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeTokenAuthenticationRemoteDiscoveryValidationPolicy + }{ + "REMOTE_DISCOVERY", + (MarshalTypeTokenAuthenticationRemoteDiscoveryValidationPolicy)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *TokenAuthenticationRemoteDiscoveryValidationPolicy) UnmarshalJSON(data []byte) (e error) { + model := struct { + AdditionalValidationPolicy *AdditionalValidationPolicy `json:"additionalValidationPolicy"` + IsSslVerifyDisabled *bool `json:"isSslVerifyDisabled"` + MaxCacheDurationInHours *int `json:"maxCacheDurationInHours"` + ClientDetails clientappdetails `json:"clientDetails"` + SourceUriDetails sourceuridetails `json:"sourceUriDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.AdditionalValidationPolicy = model.AdditionalValidationPolicy + + m.IsSslVerifyDisabled = model.IsSslVerifyDisabled + + m.MaxCacheDurationInHours = model.MaxCacheDurationInHours + + nn, e = model.ClientDetails.UnmarshalPolymorphicJSON(model.ClientDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ClientDetails = nn.(ClientAppDetails) + } else { + m.ClientDetails = nil + } + + nn, e = model.SourceUriDetails.UnmarshalPolymorphicJSON(model.SourceUriDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.SourceUriDetails = nn.(SourceUriDetails) + } else { + m.SourceUriDetails = nil + } + + return +} diff --git a/apigateway/token_authentication_remote_jwks_validation_policy.go b/apigateway/token_authentication_remote_jwks_validation_policy.go new file mode 100644 index 0000000000..da84eb3fc7 --- /dev/null +++ b/apigateway/token_authentication_remote_jwks_validation_policy.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TokenAuthenticationRemoteJwksValidationPolicy A set of public keys that is retrieved at run-time from a remote location +// to verify the JWT signature. The set should only contain JWK-formatted +// keys. +type TokenAuthenticationRemoteJwksValidationPolicy struct { + + // The uri from which to retrieve the key. It must be accessible + // without authentication. + Uri *string `mandatory:"true" json:"uri"` + + AdditionalValidationPolicy *AdditionalValidationPolicy `mandatory:"false" json:"additionalValidationPolicy"` + + // Defines whether or not to uphold SSL verification. + IsSslVerifyDisabled *bool `mandatory:"false" json:"isSslVerifyDisabled"` + + // The duration for which the JWKS should be cached before it is + // fetched again. + MaxCacheDurationInHours *int `mandatory:"false" json:"maxCacheDurationInHours"` +} + +//GetAdditionalValidationPolicy returns AdditionalValidationPolicy +func (m TokenAuthenticationRemoteJwksValidationPolicy) GetAdditionalValidationPolicy() *AdditionalValidationPolicy { + return m.AdditionalValidationPolicy +} + +func (m TokenAuthenticationRemoteJwksValidationPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TokenAuthenticationRemoteJwksValidationPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m TokenAuthenticationRemoteJwksValidationPolicy) MarshalJSON() (buff []byte, e error) { + type MarshalTypeTokenAuthenticationRemoteJwksValidationPolicy TokenAuthenticationRemoteJwksValidationPolicy + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeTokenAuthenticationRemoteJwksValidationPolicy + }{ + "REMOTE_JWKS", + (MarshalTypeTokenAuthenticationRemoteJwksValidationPolicy)(m), + } + + return json.Marshal(&s) +} diff --git a/apigateway/token_authentication_static_keys_validation_policy.go b/apigateway/token_authentication_static_keys_validation_policy.go new file mode 100644 index 0000000000..5c27c27a49 --- /dev/null +++ b/apigateway/token_authentication_static_keys_validation_policy.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TokenAuthenticationStaticKeysValidationPolicy A set of static public keys that will be used to verify the JWT signature. +type TokenAuthenticationStaticKeysValidationPolicy struct { + AdditionalValidationPolicy *AdditionalValidationPolicy `mandatory:"false" json:"additionalValidationPolicy"` + + // The set of static public keys. + Keys []StaticPublicKey `mandatory:"false" json:"keys"` +} + +//GetAdditionalValidationPolicy returns AdditionalValidationPolicy +func (m TokenAuthenticationStaticKeysValidationPolicy) GetAdditionalValidationPolicy() *AdditionalValidationPolicy { + return m.AdditionalValidationPolicy +} + +func (m TokenAuthenticationStaticKeysValidationPolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TokenAuthenticationStaticKeysValidationPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m TokenAuthenticationStaticKeysValidationPolicy) MarshalJSON() (buff []byte, e error) { + type MarshalTypeTokenAuthenticationStaticKeysValidationPolicy TokenAuthenticationStaticKeysValidationPolicy + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeTokenAuthenticationStaticKeysValidationPolicy + }{ + "STATIC_KEYS", + (MarshalTypeTokenAuthenticationStaticKeysValidationPolicy)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *TokenAuthenticationStaticKeysValidationPolicy) UnmarshalJSON(data []byte) (e error) { + model := struct { + AdditionalValidationPolicy *AdditionalValidationPolicy `json:"additionalValidationPolicy"` + Keys []staticpublickey `json:"keys"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.AdditionalValidationPolicy = model.AdditionalValidationPolicy + + m.Keys = make([]StaticPublicKey, len(model.Keys)) + for i, n := range model.Keys { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Keys[i] = nn.(StaticPublicKey) + } else { + m.Keys[i] = nil + } + } + + return +} diff --git a/apigateway/token_authentication_validation_policy.go b/apigateway/token_authentication_validation_policy.go new file mode 100644 index 0000000000..6ece154999 --- /dev/null +++ b/apigateway/token_authentication_validation_policy.go @@ -0,0 +1,140 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TokenAuthenticationValidationPolicy Authentication Policies for the Token Authentication types. +type TokenAuthenticationValidationPolicy interface { + GetAdditionalValidationPolicy() *AdditionalValidationPolicy +} + +type tokenauthenticationvalidationpolicy struct { + JsonData []byte + AdditionalValidationPolicy *AdditionalValidationPolicy `mandatory:"false" json:"additionalValidationPolicy"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *tokenauthenticationvalidationpolicy) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalertokenauthenticationvalidationpolicy tokenauthenticationvalidationpolicy + s := struct { + Model Unmarshalertokenauthenticationvalidationpolicy + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.AdditionalValidationPolicy = s.Model.AdditionalValidationPolicy + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *tokenauthenticationvalidationpolicy) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "REMOTE_JWKS": + mm := TokenAuthenticationRemoteJwksValidationPolicy{} + err = json.Unmarshal(data, &mm) + return mm, err + case "REMOTE_DISCOVERY": + mm := TokenAuthenticationRemoteDiscoveryValidationPolicy{} + err = json.Unmarshal(data, &mm) + return mm, err + case "STATIC_KEYS": + mm := TokenAuthenticationStaticKeysValidationPolicy{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetAdditionalValidationPolicy returns AdditionalValidationPolicy +func (m tokenauthenticationvalidationpolicy) GetAdditionalValidationPolicy() *AdditionalValidationPolicy { + return m.AdditionalValidationPolicy +} + +func (m tokenauthenticationvalidationpolicy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m tokenauthenticationvalidationpolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// TokenAuthenticationValidationPolicyTypeEnum Enum with underlying type: string +type TokenAuthenticationValidationPolicyTypeEnum string + +// Set of constants representing the allowable values for TokenAuthenticationValidationPolicyTypeEnum +const ( + TokenAuthenticationValidationPolicyTypeStaticKeys TokenAuthenticationValidationPolicyTypeEnum = "STATIC_KEYS" + TokenAuthenticationValidationPolicyTypeRemoteJwks TokenAuthenticationValidationPolicyTypeEnum = "REMOTE_JWKS" + TokenAuthenticationValidationPolicyTypeRemoteDiscovery TokenAuthenticationValidationPolicyTypeEnum = "REMOTE_DISCOVERY" +) + +var mappingTokenAuthenticationValidationPolicyTypeEnum = map[string]TokenAuthenticationValidationPolicyTypeEnum{ + "STATIC_KEYS": TokenAuthenticationValidationPolicyTypeStaticKeys, + "REMOTE_JWKS": TokenAuthenticationValidationPolicyTypeRemoteJwks, + "REMOTE_DISCOVERY": TokenAuthenticationValidationPolicyTypeRemoteDiscovery, +} + +var mappingTokenAuthenticationValidationPolicyTypeEnumLowerCase = map[string]TokenAuthenticationValidationPolicyTypeEnum{ + "static_keys": TokenAuthenticationValidationPolicyTypeStaticKeys, + "remote_jwks": TokenAuthenticationValidationPolicyTypeRemoteJwks, + "remote_discovery": TokenAuthenticationValidationPolicyTypeRemoteDiscovery, +} + +// GetTokenAuthenticationValidationPolicyTypeEnumValues Enumerates the set of values for TokenAuthenticationValidationPolicyTypeEnum +func GetTokenAuthenticationValidationPolicyTypeEnumValues() []TokenAuthenticationValidationPolicyTypeEnum { + values := make([]TokenAuthenticationValidationPolicyTypeEnum, 0) + for _, v := range mappingTokenAuthenticationValidationPolicyTypeEnum { + values = append(values, v) + } + return values +} + +// GetTokenAuthenticationValidationPolicyTypeEnumStringValues Enumerates the set of values in String for TokenAuthenticationValidationPolicyTypeEnum +func GetTokenAuthenticationValidationPolicyTypeEnumStringValues() []string { + return []string{ + "STATIC_KEYS", + "REMOTE_JWKS", + "REMOTE_DISCOVERY", + } +} + +// GetMappingTokenAuthenticationValidationPolicyTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTokenAuthenticationValidationPolicyTypeEnum(val string) (TokenAuthenticationValidationPolicyTypeEnum, bool) { + enum, ok := mappingTokenAuthenticationValidationPolicyTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/apigateway/validation_block_client_app_details.go b/apigateway/validation_block_client_app_details.go new file mode 100644 index 0000000000..8f541cf091 --- /dev/null +++ b/apigateway/validation_block_client_app_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValidationBlockClientAppDetails Client App Credentials to be used from validation block. +type ValidationBlockClientAppDetails struct { +} + +func (m ValidationBlockClientAppDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValidationBlockClientAppDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValidationBlockClientAppDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValidationBlockClientAppDetails ValidationBlockClientAppDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeValidationBlockClientAppDetails + }{ + "VALIDATION_BLOCK", + (MarshalTypeValidationBlockClientAppDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/apigateway/validation_block_source_uri_details.go b/apigateway/validation_block_source_uri_details.go new file mode 100644 index 0000000000..30a2ba99bb --- /dev/null +++ b/apigateway/validation_block_source_uri_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.cloud.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValidationBlockSourceUriDetails Source Uri information to be used from validation block. +type ValidationBlockSourceUriDetails struct { +} + +func (m ValidationBlockSourceUriDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValidationBlockSourceUriDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ValidationBlockSourceUriDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeValidationBlockSourceUriDetails ValidationBlockSourceUriDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeValidationBlockSourceUriDetails + }{ + "VALIDATION_BLOCK", + (MarshalTypeValidationBlockSourceUriDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/apigateway/validation_failure_policy.go b/apigateway/validation_failure_policy.go index 54ec6556fe..d5864b4902 100644 --- a/apigateway/validation_failure_policy.go +++ b/apigateway/validation_failure_policy.go @@ -56,6 +56,10 @@ func (m *validationfailurepolicy) UnmarshalPolymorphicJSON(data []byte) (interfa mm := ModifyResponseValidationFailurePolicy{} err = json.Unmarshal(data, &mm) return mm, err + case "OAUTH2": + mm := OAuth2ResponseValidationFailurePolicy{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } @@ -83,14 +87,17 @@ type ValidationFailurePolicyTypeEnum string // Set of constants representing the allowable values for ValidationFailurePolicyTypeEnum const ( ValidationFailurePolicyTypeModifyResponse ValidationFailurePolicyTypeEnum = "MODIFY_RESPONSE" + ValidationFailurePolicyTypeOauth2 ValidationFailurePolicyTypeEnum = "OAUTH2" ) var mappingValidationFailurePolicyTypeEnum = map[string]ValidationFailurePolicyTypeEnum{ "MODIFY_RESPONSE": ValidationFailurePolicyTypeModifyResponse, + "OAUTH2": ValidationFailurePolicyTypeOauth2, } var mappingValidationFailurePolicyTypeEnumLowerCase = map[string]ValidationFailurePolicyTypeEnum{ "modify_response": ValidationFailurePolicyTypeModifyResponse, + "oauth2": ValidationFailurePolicyTypeOauth2, } // GetValidationFailurePolicyTypeEnumValues Enumerates the set of values for ValidationFailurePolicyTypeEnum @@ -106,6 +113,7 @@ func GetValidationFailurePolicyTypeEnumValues() []ValidationFailurePolicyTypeEnu func GetValidationFailurePolicyTypeEnumStringValues() []string { return []string{ "MODIFY_RESPONSE", + "OAUTH2", } } diff --git a/apigateway/wildcard_selection_key.go b/apigateway/wildcard_selection_key.go index 2db50f9f60..92c1ff2074 100644 --- a/apigateway/wildcard_selection_key.go +++ b/apigateway/wildcard_selection_key.go @@ -18,16 +18,16 @@ import ( "strings" ) -// WildcardSelectionKey Information around the Wildcard expression matching the value for selector of a dynamic authentication/ routing branch. +// WildcardSelectionKey When dynamically routing and dynamically authenticating requests, the route or authentication server associated with a selection key containing a wildcard is used if the context variable in an incoming request matches that key. type WildcardSelectionKey struct { // Name assigned to the branch. Name *string `mandatory:"true" json:"name"` - // String describing the expression with wildcards. + // A selection key string containing a wildcard to match with the context variable in an incoming request. If the context variable matches the string, the request is sent to the route or authentication server associated with the selection key. Valid wildcards are '*' (zero or more characters) and '+' (one or more characters). The string can only contain one wildcard, and the wildcard must be at the start or the end of the string. Expression *string `mandatory:"true" json:"expression"` - // Information regarding whether this is the default branch. + // Specifies whether to use the route or authentication server associated with this selection key as the default. The default is used if the value of a context variable in an incoming request does not match any of the other selection key values when dynamically routing and dynamically authenticating requests. IsDefault *bool `mandatory:"false" json:"isDefault"` } diff --git a/common/version.go b/common/version.go index 29397519d0..322034e043 100644 --- a/common/version.go +++ b/common/version.go @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "26" - patch = "1" + minor = "27" + patch = "0" tag = "" ) diff --git a/containerinstances/action_type.go b/containerinstances/action_type.go new file mode 100644 index 0000000000..59a75c5a3a --- /dev/null +++ b/containerinstances/action_type.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeCreated ActionTypeEnum = "CREATED" + ActionTypeUpdated ActionTypeEnum = "UPDATED" + ActionTypeDeleted ActionTypeEnum = "DELETED" + ActionTypeInProgress ActionTypeEnum = "IN_PROGRESS" + ActionTypeRelated ActionTypeEnum = "RELATED" + ActionTypeFailed ActionTypeEnum = "FAILED" +) + +var mappingActionTypeEnum = map[string]ActionTypeEnum{ + "CREATED": ActionTypeCreated, + "UPDATED": ActionTypeUpdated, + "DELETED": ActionTypeDeleted, + "IN_PROGRESS": ActionTypeInProgress, + "RELATED": ActionTypeRelated, + "FAILED": ActionTypeFailed, +} + +var mappingActionTypeEnumLowerCase = map[string]ActionTypeEnum{ + "created": ActionTypeCreated, + "updated": ActionTypeUpdated, + "deleted": ActionTypeDeleted, + "in_progress": ActionTypeInProgress, + "related": ActionTypeRelated, + "failed": ActionTypeFailed, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionTypeEnumStringValues Enumerates the set of values in String for ActionTypeEnum +func GetActionTypeEnumStringValues() []string { + return []string{ + "CREATED", + "UPDATED", + "DELETED", + "IN_PROGRESS", + "RELATED", + "FAILED", + } +} + +// GetMappingActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionTypeEnum(val string) (ActionTypeEnum, bool) { + enum, ok := mappingActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/basic_image_pull_secret.go b/containerinstances/basic_image_pull_secret.go new file mode 100644 index 0000000000..0c26387c10 --- /dev/null +++ b/containerinstances/basic_image_pull_secret.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BasicImagePullSecret A BasicImagePullSecret is a ImagePullSecret which accepts username and password as credentials information. +type BasicImagePullSecret struct { + + // The registry endpoint of the container image. + RegistryEndpoint *string `mandatory:"true" json:"registryEndpoint"` +} + +//GetRegistryEndpoint returns RegistryEndpoint +func (m BasicImagePullSecret) GetRegistryEndpoint() *string { + return m.RegistryEndpoint +} + +func (m BasicImagePullSecret) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BasicImagePullSecret) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BasicImagePullSecret) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBasicImagePullSecret BasicImagePullSecret + s := struct { + DiscriminatorParam string `json:"secretType"` + MarshalTypeBasicImagePullSecret + }{ + "BASIC", + (MarshalTypeBasicImagePullSecret)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/change_container_instance_compartment_details.go b/containerinstances/change_container_instance_compartment_details.go new file mode 100644 index 0000000000..35fe39a817 --- /dev/null +++ b/containerinstances/change_container_instance_compartment_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeContainerInstanceCompartmentDetails The information to be updated. +type ChangeContainerInstanceCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment + // into which the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeContainerInstanceCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeContainerInstanceCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/change_container_instance_compartment_request_response.go b/containerinstances/change_container_instance_compartment_request_response.go new file mode 100644 index 0000000000..a17bf931a6 --- /dev/null +++ b/containerinstances/change_container_instance_compartment_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeContainerInstanceCompartmentRequest wrapper for the ChangeContainerInstanceCompartment operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ChangeContainerInstanceCompartment.go.html to see an example of how to use ChangeContainerInstanceCompartmentRequest. +type ChangeContainerInstanceCompartmentRequest struct { + + // The system-generated unique identifier for the ContainerInstance. + ContainerInstanceId *string `mandatory:"true" contributesTo:"path" name:"containerInstanceId"` + + // The information to be updated. + ChangeContainerInstanceCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeContainerInstanceCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeContainerInstanceCompartmentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ChangeContainerInstanceCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeContainerInstanceCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ChangeContainerInstanceCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeContainerInstanceCompartmentResponse wrapper for the ChangeContainerInstanceCompartment operation +type ChangeContainerInstanceCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeContainerInstanceCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeContainerInstanceCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/container.go b/containerinstances/container.go new file mode 100644 index 0000000000..1402173397 --- /dev/null +++ b/containerinstances/container.go @@ -0,0 +1,320 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Container A single container on a Container Instance. +// If this Container is DELETED, the record will remain visible for a short period +// of time before being permanently removed. +type Container struct { + + // Unique identifier that is immutable on creation + Id *string `mandatory:"true" json:"id"` + + // Display name for the Container. Can be renamed. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment Identifier + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Availability Domain where the Container's Instance is running. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The current state of the Container. + LifecycleState ContainerLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the the Container was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The identifier of the Container Instance on which this container is running. + ContainerInstanceId *string `mandatory:"true" json:"containerInstanceId"` + + // The container image information. Currently only support public docker registry. Can be either image name, + // e.g `containerImage`, image name with version, e.g `containerImage:v1` or complete docker image Url e.g + // `docker.io/library/containerImage:latest`. + // If no registry is provided, will default the registry to public docker hub `docker.io/library`. + // The registry used for container image must be reachable over the Container Instance's VNIC. + ImageUrl *string `mandatory:"true" json:"imageUrl"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Fault Domain where the Container's Instance is running. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // A message describing the current state in more detail. For example, can be used to provide + // actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The exit code of the container process if it has stopped executing. + ExitCode *int `mandatory:"false" json:"exitCode"` + + // Time at which the container last terminated. An RFC3339 formatted datetime string + TimeTerminated *common.SDKTime `mandatory:"false" json:"timeTerminated"` + + // The time the Container was updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // This command will override the container's entrypoint process. + // If not specified, the existing entrypoint process defined in the image will be used. + Command []string `mandatory:"false" json:"command"` + + // A list of string arguments for a Container's entrypoint process. + // Many containers use an entrypoint process pointing to a shell, + // for example /bin/bash. For such containers, this argument list + // can also be used to specify the main command in the container process. + Arguments []string `mandatory:"false" json:"arguments"` + + // A list of additional configurable container capabilities + AdditionalCapabilities []ContainerCapabilityEnum `mandatory:"false" json:"additionalCapabilities,omitempty"` + + // The working directory within the Container's filesystem for + // the Container process. If this is not present, the default + // working directory from the image will be used. + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // A map of additional environment variables to set in the environment of the container's + // entrypoint process. These variables are in addition to any variables already defined + // in the container's image. + EnvironmentVariables map[string]string `mandatory:"false" json:"environmentVariables"` + + // List of the volume mounts. + VolumeMounts []VolumeMount `mandatory:"false" json:"volumeMounts"` + + // List of container health checks + HealthChecks []ContainerHealthCheck `mandatory:"false" json:"healthChecks"` + + // Determines if the Container will have access to the Container Instance Resource Principal. + // This method utilizes resource principal version 2.2. Please refer to + // https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm#sdk_authentication_methods_resource_principal + // for detailed explanation of how to leverage the exposed resource principal elements. + IsResourcePrincipalDisabled *bool `mandatory:"false" json:"isResourcePrincipalDisabled"` + + ResourceConfig *ContainerResourceConfig `mandatory:"false" json:"resourceConfig"` + + // The number of container restart attempts. A restart may be attempted after a health check failure or a container exit, based on the restart policy. + ContainerRestartAttemptCount *int `mandatory:"false" json:"containerRestartAttemptCount"` +} + +func (m Container) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Container) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingContainerLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetContainerLifecycleStateEnumStringValues(), ","))) + } + + for _, val := range m.AdditionalCapabilities { + if _, ok := GetMappingContainerCapabilityEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdditionalCapabilities: %s. Supported values are: %s.", val, strings.Join(GetContainerCapabilityEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *Container) UnmarshalJSON(data []byte) (e error) { + model := struct { + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + FaultDomain *string `json:"faultDomain"` + LifecycleDetails *string `json:"lifecycleDetails"` + ExitCode *int `json:"exitCode"` + TimeTerminated *common.SDKTime `json:"timeTerminated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + Command []string `json:"command"` + Arguments []string `json:"arguments"` + AdditionalCapabilities []ContainerCapabilityEnum `json:"additionalCapabilities"` + WorkingDirectory *string `json:"workingDirectory"` + EnvironmentVariables map[string]string `json:"environmentVariables"` + VolumeMounts []VolumeMount `json:"volumeMounts"` + HealthChecks []containerhealthcheck `json:"healthChecks"` + IsResourcePrincipalDisabled *bool `json:"isResourcePrincipalDisabled"` + ResourceConfig *ContainerResourceConfig `json:"resourceConfig"` + ContainerRestartAttemptCount *int `json:"containerRestartAttemptCount"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + CompartmentId *string `json:"compartmentId"` + AvailabilityDomain *string `json:"availabilityDomain"` + LifecycleState ContainerLifecycleStateEnum `json:"lifecycleState"` + TimeCreated *common.SDKTime `json:"timeCreated"` + ContainerInstanceId *string `json:"containerInstanceId"` + ImageUrl *string `json:"imageUrl"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.FaultDomain = model.FaultDomain + + m.LifecycleDetails = model.LifecycleDetails + + m.ExitCode = model.ExitCode + + m.TimeTerminated = model.TimeTerminated + + m.TimeUpdated = model.TimeUpdated + + m.Command = make([]string, len(model.Command)) + for i, n := range model.Command { + m.Command[i] = n + } + + m.Arguments = make([]string, len(model.Arguments)) + for i, n := range model.Arguments { + m.Arguments[i] = n + } + + m.AdditionalCapabilities = make([]ContainerCapabilityEnum, len(model.AdditionalCapabilities)) + for i, n := range model.AdditionalCapabilities { + m.AdditionalCapabilities[i] = n + } + + m.WorkingDirectory = model.WorkingDirectory + + m.EnvironmentVariables = model.EnvironmentVariables + + m.VolumeMounts = make([]VolumeMount, len(model.VolumeMounts)) + for i, n := range model.VolumeMounts { + m.VolumeMounts[i] = n + } + + m.HealthChecks = make([]ContainerHealthCheck, len(model.HealthChecks)) + for i, n := range model.HealthChecks { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.HealthChecks[i] = nn.(ContainerHealthCheck) + } else { + m.HealthChecks[i] = nil + } + } + + m.IsResourcePrincipalDisabled = model.IsResourcePrincipalDisabled + + m.ResourceConfig = model.ResourceConfig + + m.ContainerRestartAttemptCount = model.ContainerRestartAttemptCount + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.CompartmentId = model.CompartmentId + + m.AvailabilityDomain = model.AvailabilityDomain + + m.LifecycleState = model.LifecycleState + + m.TimeCreated = model.TimeCreated + + m.ContainerInstanceId = model.ContainerInstanceId + + m.ImageUrl = model.ImageUrl + + return +} + +// ContainerLifecycleStateEnum Enum with underlying type: string +type ContainerLifecycleStateEnum string + +// Set of constants representing the allowable values for ContainerLifecycleStateEnum +const ( + ContainerLifecycleStateCreating ContainerLifecycleStateEnum = "CREATING" + ContainerLifecycleStateUpdating ContainerLifecycleStateEnum = "UPDATING" + ContainerLifecycleStateActive ContainerLifecycleStateEnum = "ACTIVE" + ContainerLifecycleStateInactive ContainerLifecycleStateEnum = "INACTIVE" + ContainerLifecycleStateDeleting ContainerLifecycleStateEnum = "DELETING" + ContainerLifecycleStateDeleted ContainerLifecycleStateEnum = "DELETED" + ContainerLifecycleStateFailed ContainerLifecycleStateEnum = "FAILED" +) + +var mappingContainerLifecycleStateEnum = map[string]ContainerLifecycleStateEnum{ + "CREATING": ContainerLifecycleStateCreating, + "UPDATING": ContainerLifecycleStateUpdating, + "ACTIVE": ContainerLifecycleStateActive, + "INACTIVE": ContainerLifecycleStateInactive, + "DELETING": ContainerLifecycleStateDeleting, + "DELETED": ContainerLifecycleStateDeleted, + "FAILED": ContainerLifecycleStateFailed, +} + +var mappingContainerLifecycleStateEnumLowerCase = map[string]ContainerLifecycleStateEnum{ + "creating": ContainerLifecycleStateCreating, + "updating": ContainerLifecycleStateUpdating, + "active": ContainerLifecycleStateActive, + "inactive": ContainerLifecycleStateInactive, + "deleting": ContainerLifecycleStateDeleting, + "deleted": ContainerLifecycleStateDeleted, + "failed": ContainerLifecycleStateFailed, +} + +// GetContainerLifecycleStateEnumValues Enumerates the set of values for ContainerLifecycleStateEnum +func GetContainerLifecycleStateEnumValues() []ContainerLifecycleStateEnum { + values := make([]ContainerLifecycleStateEnum, 0) + for _, v := range mappingContainerLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetContainerLifecycleStateEnumStringValues Enumerates the set of values in String for ContainerLifecycleStateEnum +func GetContainerLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "INACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingContainerLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerLifecycleStateEnum(val string) (ContainerLifecycleStateEnum, bool) { + enum, ok := mappingContainerLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/container_capability.go b/containerinstances/container_capability.go new file mode 100644 index 0000000000..f78f53bd34 --- /dev/null +++ b/containerinstances/container_capability.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// ContainerCapabilityEnum Enum with underlying type: string +type ContainerCapabilityEnum string + +// Set of constants representing the allowable values for ContainerCapabilityEnum +const ( + ContainerCapabilityCapNetAdmin ContainerCapabilityEnum = "CAP_NET_ADMIN" + ContainerCapabilityCapNetRaw ContainerCapabilityEnum = "CAP_NET_RAW" +) + +var mappingContainerCapabilityEnum = map[string]ContainerCapabilityEnum{ + "CAP_NET_ADMIN": ContainerCapabilityCapNetAdmin, + "CAP_NET_RAW": ContainerCapabilityCapNetRaw, +} + +var mappingContainerCapabilityEnumLowerCase = map[string]ContainerCapabilityEnum{ + "cap_net_admin": ContainerCapabilityCapNetAdmin, + "cap_net_raw": ContainerCapabilityCapNetRaw, +} + +// GetContainerCapabilityEnumValues Enumerates the set of values for ContainerCapabilityEnum +func GetContainerCapabilityEnumValues() []ContainerCapabilityEnum { + values := make([]ContainerCapabilityEnum, 0) + for _, v := range mappingContainerCapabilityEnum { + values = append(values, v) + } + return values +} + +// GetContainerCapabilityEnumStringValues Enumerates the set of values in String for ContainerCapabilityEnum +func GetContainerCapabilityEnumStringValues() []string { + return []string{ + "CAP_NET_ADMIN", + "CAP_NET_RAW", + } +} + +// GetMappingContainerCapabilityEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerCapabilityEnum(val string) (ContainerCapabilityEnum, bool) { + enum, ok := mappingContainerCapabilityEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/container_collection.go b/containerinstances/container_collection.go new file mode 100644 index 0000000000..38384b9e0a --- /dev/null +++ b/containerinstances/container_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerCollection A list of matching Containers. +type ContainerCollection struct { + + // List of Containers. + Items []ContainerSummary `mandatory:"true" json:"items"` +} + +func (m ContainerCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_command_health_check.go b/containerinstances/container_command_health_check.go new file mode 100644 index 0000000000..f7e1749cda --- /dev/null +++ b/containerinstances/container_command_health_check.go @@ -0,0 +1,133 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerCommandHealthCheck Container Health Check with command type. +type ContainerCommandHealthCheck struct { + + // The list of strings which will be concatenated to a single command for checking container's status. + Command []string `mandatory:"true" json:"command"` + + // Health check name. + Name *string `mandatory:"false" json:"name"` + + // The initial delay in seconds before start checking container health status. + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + + // Number of seconds between two consecutive runs for checking container health. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Number of consecutive failures at which we consider the check failed. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + + // Length of waiting time in seconds before marking health check failed. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + // A message describing the current status in more details. + StatusDetails *string `mandatory:"false" json:"statusDetails"` + + // Status of container + Status ContainerHealthCheckStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` +} + +//GetName returns Name +func (m ContainerCommandHealthCheck) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m ContainerCommandHealthCheck) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m ContainerCommandHealthCheck) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m ContainerCommandHealthCheck) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m ContainerCommandHealthCheck) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m ContainerCommandHealthCheck) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetStatus returns Status +func (m ContainerCommandHealthCheck) GetStatus() ContainerHealthCheckStatusEnum { + return m.Status +} + +//GetStatusDetails returns StatusDetails +func (m ContainerCommandHealthCheck) GetStatusDetails() *string { + return m.StatusDetails +} + +//GetFailureAction returns FailureAction +func (m ContainerCommandHealthCheck) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m ContainerCommandHealthCheck) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerCommandHealthCheck) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetContainerHealthCheckStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ContainerCommandHealthCheck) MarshalJSON() (buff []byte, e error) { + type MarshalTypeContainerCommandHealthCheck ContainerCommandHealthCheck + s := struct { + DiscriminatorParam string `json:"healthCheckType"` + MarshalTypeContainerCommandHealthCheck + }{ + "COMMAND", + (MarshalTypeContainerCommandHealthCheck)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/container_config_file.go b/containerinstances/container_config_file.go new file mode 100644 index 0000000000..ebcf844f19 --- /dev/null +++ b/containerinstances/container_config_file.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerConfigFile The file that is mounted on a container instance through a volume mount. +type ContainerConfigFile struct { + + // The name of the file. The fileName should be unique across the volume. + FileName *string `mandatory:"true" json:"fileName"` + + // The base64 encoded contents of the file. The contents are decoded to plain text before mounted as a file to a container inside container instance. + Data []byte `mandatory:"true" json:"data"` + + // (Optional) Relative path for this file inside the volume mount directory. By default, the file is presented at the root of the volume mount path. + Path *string `mandatory:"false" json:"path"` +} + +func (m ContainerConfigFile) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerConfigFile) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_config_file_volume.go b/containerinstances/container_config_file_volume.go new file mode 100644 index 0000000000..c37f23d630 --- /dev/null +++ b/containerinstances/container_config_file_volume.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerConfigFileVolume The volume based on configuration files received during container creation. +type ContainerConfigFileVolume struct { + + // The name of the volume. This has be unique cross single ContainerInstance. + Name *string `mandatory:"true" json:"name"` + + // Contains string key value pairs which can be mounted as individual files inside the container. The value needs to be base64 encoded. It is decoded to plain text before the mount. + Configs []ContainerConfigFile `mandatory:"false" json:"configs"` +} + +//GetName returns Name +func (m ContainerConfigFileVolume) GetName() *string { + return m.Name +} + +func (m ContainerConfigFileVolume) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerConfigFileVolume) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ContainerConfigFileVolume) MarshalJSON() (buff []byte, e error) { + type MarshalTypeContainerConfigFileVolume ContainerConfigFileVolume + s := struct { + DiscriminatorParam string `json:"volumeType"` + MarshalTypeContainerConfigFileVolume + }{ + "CONFIGFILE", + (MarshalTypeContainerConfigFileVolume)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/container_dns_config.go b/containerinstances/container_dns_config.go new file mode 100644 index 0000000000..3fd1bb3b48 --- /dev/null +++ b/containerinstances/container_dns_config.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerDnsConfig DNS settings for containers. +type ContainerDnsConfig struct { + + // Name server IP address + Nameservers []string `mandatory:"false" json:"nameservers"` + + // Search list for host-name lookup. + Searches []string `mandatory:"false" json:"searches"` + + // Options allows certain internal resolver variables to be modified. + Options []string `mandatory:"false" json:"options"` +} + +func (m ContainerDnsConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerDnsConfig) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_empty_dir_volume.go b/containerinstances/container_empty_dir_volume.go new file mode 100644 index 0000000000..b1b4b2d1f3 --- /dev/null +++ b/containerinstances/container_empty_dir_volume.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerEmptyDirVolume The empty director of container +type ContainerEmptyDirVolume struct { + + // The name of the volume. This has be unique cross single ContainerInstance. + Name *string `mandatory:"true" json:"name"` + + // Volume type that we are using for empty dir where it could be either File Storage or Memory + BackingStore ContainerEmptyDirVolumeBackingStoreEnum `mandatory:"false" json:"backingStore,omitempty"` +} + +//GetName returns Name +func (m ContainerEmptyDirVolume) GetName() *string { + return m.Name +} + +func (m ContainerEmptyDirVolume) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerEmptyDirVolume) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingContainerEmptyDirVolumeBackingStoreEnum(string(m.BackingStore)); !ok && m.BackingStore != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackingStore: %s. Supported values are: %s.", m.BackingStore, strings.Join(GetContainerEmptyDirVolumeBackingStoreEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ContainerEmptyDirVolume) MarshalJSON() (buff []byte, e error) { + type MarshalTypeContainerEmptyDirVolume ContainerEmptyDirVolume + s := struct { + DiscriminatorParam string `json:"volumeType"` + MarshalTypeContainerEmptyDirVolume + }{ + "EMPTYDIR", + (MarshalTypeContainerEmptyDirVolume)(m), + } + + return json.Marshal(&s) +} + +// ContainerEmptyDirVolumeBackingStoreEnum Enum with underlying type: string +type ContainerEmptyDirVolumeBackingStoreEnum string + +// Set of constants representing the allowable values for ContainerEmptyDirVolumeBackingStoreEnum +const ( + ContainerEmptyDirVolumeBackingStoreEphemeralStorage ContainerEmptyDirVolumeBackingStoreEnum = "EPHEMERAL_STORAGE" + ContainerEmptyDirVolumeBackingStoreMemory ContainerEmptyDirVolumeBackingStoreEnum = "MEMORY" +) + +var mappingContainerEmptyDirVolumeBackingStoreEnum = map[string]ContainerEmptyDirVolumeBackingStoreEnum{ + "EPHEMERAL_STORAGE": ContainerEmptyDirVolumeBackingStoreEphemeralStorage, + "MEMORY": ContainerEmptyDirVolumeBackingStoreMemory, +} + +var mappingContainerEmptyDirVolumeBackingStoreEnumLowerCase = map[string]ContainerEmptyDirVolumeBackingStoreEnum{ + "ephemeral_storage": ContainerEmptyDirVolumeBackingStoreEphemeralStorage, + "memory": ContainerEmptyDirVolumeBackingStoreMemory, +} + +// GetContainerEmptyDirVolumeBackingStoreEnumValues Enumerates the set of values for ContainerEmptyDirVolumeBackingStoreEnum +func GetContainerEmptyDirVolumeBackingStoreEnumValues() []ContainerEmptyDirVolumeBackingStoreEnum { + values := make([]ContainerEmptyDirVolumeBackingStoreEnum, 0) + for _, v := range mappingContainerEmptyDirVolumeBackingStoreEnum { + values = append(values, v) + } + return values +} + +// GetContainerEmptyDirVolumeBackingStoreEnumStringValues Enumerates the set of values in String for ContainerEmptyDirVolumeBackingStoreEnum +func GetContainerEmptyDirVolumeBackingStoreEnumStringValues() []string { + return []string{ + "EPHEMERAL_STORAGE", + "MEMORY", + } +} + +// GetMappingContainerEmptyDirVolumeBackingStoreEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerEmptyDirVolumeBackingStoreEnum(val string) (ContainerEmptyDirVolumeBackingStoreEnum, bool) { + enum, ok := mappingContainerEmptyDirVolumeBackingStoreEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/container_health_check.go b/containerinstances/container_health_check.go new file mode 100644 index 0000000000..57baca9315 --- /dev/null +++ b/containerinstances/container_health_check.go @@ -0,0 +1,227 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerHealthCheck Type of container health check which could be either HTTP, TCP or Command. +type ContainerHealthCheck interface { + + // Health check name. + GetName() *string + + // The initial delay in seconds before start checking container health status. + GetInitialDelayInSeconds() *int + + // Number of seconds between two consecutive runs for checking container health. + GetIntervalInSeconds() *int + + // Number of consecutive failures at which we consider the check failed. + GetFailureThreshold() *int + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + GetSuccessThreshold() *int + + // Length of waiting time in seconds before marking health check failed. + GetTimeoutInSeconds() *int + + // Status of container + GetStatus() ContainerHealthCheckStatusEnum + + // A message describing the current status in more details. + GetStatusDetails() *string + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + GetFailureAction() ContainerHealthCheckFailureActionEnum +} + +type containerhealthcheck struct { + JsonData []byte + Name *string `mandatory:"false" json:"name"` + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + Status ContainerHealthCheckStatusEnum `mandatory:"false" json:"status,omitempty"` + StatusDetails *string `mandatory:"false" json:"statusDetails"` + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` + HealthCheckType string `json:"healthCheckType"` +} + +// UnmarshalJSON unmarshals json +func (m *containerhealthcheck) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercontainerhealthcheck containerhealthcheck + s := struct { + Model Unmarshalercontainerhealthcheck + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.InitialDelayInSeconds = s.Model.InitialDelayInSeconds + m.IntervalInSeconds = s.Model.IntervalInSeconds + m.FailureThreshold = s.Model.FailureThreshold + m.SuccessThreshold = s.Model.SuccessThreshold + m.TimeoutInSeconds = s.Model.TimeoutInSeconds + m.Status = s.Model.Status + m.StatusDetails = s.Model.StatusDetails + m.FailureAction = s.Model.FailureAction + m.HealthCheckType = s.Model.HealthCheckType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *containerhealthcheck) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.HealthCheckType { + case "TCP": + mm := ContainerTcpHealthCheck{} + err = json.Unmarshal(data, &mm) + return mm, err + case "HTTP": + mm := ContainerHttpHealthCheck{} + err = json.Unmarshal(data, &mm) + return mm, err + case "COMMAND": + mm := ContainerCommandHealthCheck{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetName returns Name +func (m containerhealthcheck) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m containerhealthcheck) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m containerhealthcheck) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m containerhealthcheck) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m containerhealthcheck) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m containerhealthcheck) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetStatus returns Status +func (m containerhealthcheck) GetStatus() ContainerHealthCheckStatusEnum { + return m.Status +} + +//GetStatusDetails returns StatusDetails +func (m containerhealthcheck) GetStatusDetails() *string { + return m.StatusDetails +} + +//GetFailureAction returns FailureAction +func (m containerhealthcheck) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m containerhealthcheck) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m containerhealthcheck) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetContainerHealthCheckStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ContainerHealthCheckStatusEnum Enum with underlying type: string +type ContainerHealthCheckStatusEnum string + +// Set of constants representing the allowable values for ContainerHealthCheckStatusEnum +const ( + ContainerHealthCheckStatusHealthy ContainerHealthCheckStatusEnum = "HEALTHY" + ContainerHealthCheckStatusUnhealthy ContainerHealthCheckStatusEnum = "UNHEALTHY" + ContainerHealthCheckStatusUnknown ContainerHealthCheckStatusEnum = "UNKNOWN" +) + +var mappingContainerHealthCheckStatusEnum = map[string]ContainerHealthCheckStatusEnum{ + "HEALTHY": ContainerHealthCheckStatusHealthy, + "UNHEALTHY": ContainerHealthCheckStatusUnhealthy, + "UNKNOWN": ContainerHealthCheckStatusUnknown, +} + +var mappingContainerHealthCheckStatusEnumLowerCase = map[string]ContainerHealthCheckStatusEnum{ + "healthy": ContainerHealthCheckStatusHealthy, + "unhealthy": ContainerHealthCheckStatusUnhealthy, + "unknown": ContainerHealthCheckStatusUnknown, +} + +// GetContainerHealthCheckStatusEnumValues Enumerates the set of values for ContainerHealthCheckStatusEnum +func GetContainerHealthCheckStatusEnumValues() []ContainerHealthCheckStatusEnum { + values := make([]ContainerHealthCheckStatusEnum, 0) + for _, v := range mappingContainerHealthCheckStatusEnum { + values = append(values, v) + } + return values +} + +// GetContainerHealthCheckStatusEnumStringValues Enumerates the set of values in String for ContainerHealthCheckStatusEnum +func GetContainerHealthCheckStatusEnumStringValues() []string { + return []string{ + "HEALTHY", + "UNHEALTHY", + "UNKNOWN", + } +} + +// GetMappingContainerHealthCheckStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerHealthCheckStatusEnum(val string) (ContainerHealthCheckStatusEnum, bool) { + enum, ok := mappingContainerHealthCheckStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/container_health_check_failure_action.go b/containerinstances/container_health_check_failure_action.go new file mode 100644 index 0000000000..c14a3c6f97 --- /dev/null +++ b/containerinstances/container_health_check_failure_action.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// ContainerHealthCheckFailureActionEnum Enum with underlying type: string +type ContainerHealthCheckFailureActionEnum string + +// Set of constants representing the allowable values for ContainerHealthCheckFailureActionEnum +const ( + ContainerHealthCheckFailureActionKill ContainerHealthCheckFailureActionEnum = "KILL" + ContainerHealthCheckFailureActionNone ContainerHealthCheckFailureActionEnum = "NONE" +) + +var mappingContainerHealthCheckFailureActionEnum = map[string]ContainerHealthCheckFailureActionEnum{ + "KILL": ContainerHealthCheckFailureActionKill, + "NONE": ContainerHealthCheckFailureActionNone, +} + +var mappingContainerHealthCheckFailureActionEnumLowerCase = map[string]ContainerHealthCheckFailureActionEnum{ + "kill": ContainerHealthCheckFailureActionKill, + "none": ContainerHealthCheckFailureActionNone, +} + +// GetContainerHealthCheckFailureActionEnumValues Enumerates the set of values for ContainerHealthCheckFailureActionEnum +func GetContainerHealthCheckFailureActionEnumValues() []ContainerHealthCheckFailureActionEnum { + values := make([]ContainerHealthCheckFailureActionEnum, 0) + for _, v := range mappingContainerHealthCheckFailureActionEnum { + values = append(values, v) + } + return values +} + +// GetContainerHealthCheckFailureActionEnumStringValues Enumerates the set of values in String for ContainerHealthCheckFailureActionEnum +func GetContainerHealthCheckFailureActionEnumStringValues() []string { + return []string{ + "KILL", + "NONE", + } +} + +// GetMappingContainerHealthCheckFailureActionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerHealthCheckFailureActionEnum(val string) (ContainerHealthCheckFailureActionEnum, bool) { + enum, ok := mappingContainerHealthCheckFailureActionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/container_health_check_type.go b/containerinstances/container_health_check_type.go new file mode 100644 index 0000000000..fb50fcc178 --- /dev/null +++ b/containerinstances/container_health_check_type.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// ContainerHealthCheckTypeEnum Enum with underlying type: string +type ContainerHealthCheckTypeEnum string + +// Set of constants representing the allowable values for ContainerHealthCheckTypeEnum +const ( + ContainerHealthCheckTypeHttp ContainerHealthCheckTypeEnum = "HTTP" + ContainerHealthCheckTypeTcp ContainerHealthCheckTypeEnum = "TCP" + ContainerHealthCheckTypeCommand ContainerHealthCheckTypeEnum = "COMMAND" +) + +var mappingContainerHealthCheckTypeEnum = map[string]ContainerHealthCheckTypeEnum{ + "HTTP": ContainerHealthCheckTypeHttp, + "TCP": ContainerHealthCheckTypeTcp, + "COMMAND": ContainerHealthCheckTypeCommand, +} + +var mappingContainerHealthCheckTypeEnumLowerCase = map[string]ContainerHealthCheckTypeEnum{ + "http": ContainerHealthCheckTypeHttp, + "tcp": ContainerHealthCheckTypeTcp, + "command": ContainerHealthCheckTypeCommand, +} + +// GetContainerHealthCheckTypeEnumValues Enumerates the set of values for ContainerHealthCheckTypeEnum +func GetContainerHealthCheckTypeEnumValues() []ContainerHealthCheckTypeEnum { + values := make([]ContainerHealthCheckTypeEnum, 0) + for _, v := range mappingContainerHealthCheckTypeEnum { + values = append(values, v) + } + return values +} + +// GetContainerHealthCheckTypeEnumStringValues Enumerates the set of values in String for ContainerHealthCheckTypeEnum +func GetContainerHealthCheckTypeEnumStringValues() []string { + return []string{ + "HTTP", + "TCP", + "COMMAND", + } +} + +// GetMappingContainerHealthCheckTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerHealthCheckTypeEnum(val string) (ContainerHealthCheckTypeEnum, bool) { + enum, ok := mappingContainerHealthCheckTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/container_http_health_check.go b/containerinstances/container_http_health_check.go new file mode 100644 index 0000000000..10bb093bff --- /dev/null +++ b/containerinstances/container_http_health_check.go @@ -0,0 +1,139 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerHttpHealthCheck Container Health Check HTTP type. +type ContainerHttpHealthCheck struct { + + // Container health check Http's path + Path *string `mandatory:"true" json:"path"` + + // Container health check Http's port + Port *int `mandatory:"true" json:"port"` + + // Health check name. + Name *string `mandatory:"false" json:"name"` + + // The initial delay in seconds before start checking container health status. + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + + // Number of seconds between two consecutive runs for checking container health. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Number of consecutive failures at which we consider the check failed. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + + // Length of waiting time in seconds before marking health check failed. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + // A message describing the current status in more details. + StatusDetails *string `mandatory:"false" json:"statusDetails"` + + // Container health check Http's headers. + Headers []HealthCheckHttpHeader `mandatory:"false" json:"headers"` + + // Status of container + Status ContainerHealthCheckStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` +} + +//GetName returns Name +func (m ContainerHttpHealthCheck) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m ContainerHttpHealthCheck) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m ContainerHttpHealthCheck) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m ContainerHttpHealthCheck) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m ContainerHttpHealthCheck) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m ContainerHttpHealthCheck) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetStatus returns Status +func (m ContainerHttpHealthCheck) GetStatus() ContainerHealthCheckStatusEnum { + return m.Status +} + +//GetStatusDetails returns StatusDetails +func (m ContainerHttpHealthCheck) GetStatusDetails() *string { + return m.StatusDetails +} + +//GetFailureAction returns FailureAction +func (m ContainerHttpHealthCheck) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m ContainerHttpHealthCheck) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerHttpHealthCheck) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetContainerHealthCheckStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ContainerHttpHealthCheck) MarshalJSON() (buff []byte, e error) { + type MarshalTypeContainerHttpHealthCheck ContainerHttpHealthCheck + s := struct { + DiscriminatorParam string `json:"healthCheckType"` + MarshalTypeContainerHttpHealthCheck + }{ + "HTTP", + (MarshalTypeContainerHttpHealthCheck)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/container_instance.go b/containerinstances/container_instance.go new file mode 100644 index 0000000000..2641adfca0 --- /dev/null +++ b/containerinstances/container_instance.go @@ -0,0 +1,335 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerInstance A ContainerInstance for hosting Containers. +// If this ContainerInstance is DELETED, the record will remain visible for a short period +// of time before being permanently removed. +type ContainerInstance struct { + + // Unique identifier that is immutable on creation + Id *string `mandatory:"true" json:"id"` + + // Display name for the ContainerInstance. Can be renamed. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment Identifier + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Availability Domain where the ContainerInstance is running. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The current state of the ContainerInstance. + LifecycleState ContainerInstanceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The Containers on this Instance + Containers []ContainerInstanceContainer `mandatory:"true" json:"containers"` + + // The number of containers on this Instance + ContainerCount *int `mandatory:"true" json:"containerCount"` + + // The time the the ContainerInstance was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The shape of the Container Instance. The shape determines the resources available to the Container Instance. + Shape *string `mandatory:"true" json:"shape"` + + ShapeConfig *ContainerInstanceShapeConfig `mandatory:"true" json:"shapeConfig"` + + // The virtual networks available to containers running on this Container Instance. + Vnics []ContainerVnic `mandatory:"true" json:"vnics"` + + // The container restart policy is applied for all containers in container instance. + ContainerRestartPolicy ContainerInstanceContainerRestartPolicyEnum `mandatory:"true" json:"containerRestartPolicy"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Fault Domain where the ContainerInstance is running. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // A message describing the current state in more detail. For example, can be used to provide + // actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // A Volume represents a directory with data that is accessible across multiple containers in a + // ContainerInstance. + Volumes []ContainerVolume `mandatory:"false" json:"volumes"` + + // The number of volumes that attached to this Instance + VolumeCount *int `mandatory:"false" json:"volumeCount"` + + // The time the ContainerInstance was updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + DnsConfig *ContainerDnsConfig `mandatory:"false" json:"dnsConfig"` + + // Duration in seconds processes within a Container have to gracefully terminate. This applies whenever a Container must be halted, such as when the Container Instance is deleted. Processes will first be sent a termination signal. After this timeout is reached, the processes will be sent a termination signal. + GracefulShutdownTimeoutInSeconds *int64 `mandatory:"false" json:"gracefulShutdownTimeoutInSeconds"` + + // The image pull secrets for accessing private registry to pull images for containers + ImagePullSecrets []ImagePullSecret `mandatory:"false" json:"imagePullSecrets"` +} + +func (m ContainerInstance) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerInstance) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingContainerInstanceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetContainerInstanceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingContainerInstanceContainerRestartPolicyEnum(string(m.ContainerRestartPolicy)); !ok && m.ContainerRestartPolicy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ContainerRestartPolicy: %s. Supported values are: %s.", m.ContainerRestartPolicy, strings.Join(GetContainerInstanceContainerRestartPolicyEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ContainerInstance) UnmarshalJSON(data []byte) (e error) { + model := struct { + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + FaultDomain *string `json:"faultDomain"` + LifecycleDetails *string `json:"lifecycleDetails"` + Volumes []containervolume `json:"volumes"` + VolumeCount *int `json:"volumeCount"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + DnsConfig *ContainerDnsConfig `json:"dnsConfig"` + GracefulShutdownTimeoutInSeconds *int64 `json:"gracefulShutdownTimeoutInSeconds"` + ImagePullSecrets []imagepullsecret `json:"imagePullSecrets"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + CompartmentId *string `json:"compartmentId"` + AvailabilityDomain *string `json:"availabilityDomain"` + LifecycleState ContainerInstanceLifecycleStateEnum `json:"lifecycleState"` + Containers []ContainerInstanceContainer `json:"containers"` + ContainerCount *int `json:"containerCount"` + TimeCreated *common.SDKTime `json:"timeCreated"` + Shape *string `json:"shape"` + ShapeConfig *ContainerInstanceShapeConfig `json:"shapeConfig"` + Vnics []ContainerVnic `json:"vnics"` + ContainerRestartPolicy ContainerInstanceContainerRestartPolicyEnum `json:"containerRestartPolicy"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.FaultDomain = model.FaultDomain + + m.LifecycleDetails = model.LifecycleDetails + + m.Volumes = make([]ContainerVolume, len(model.Volumes)) + for i, n := range model.Volumes { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Volumes[i] = nn.(ContainerVolume) + } else { + m.Volumes[i] = nil + } + } + + m.VolumeCount = model.VolumeCount + + m.TimeUpdated = model.TimeUpdated + + m.DnsConfig = model.DnsConfig + + m.GracefulShutdownTimeoutInSeconds = model.GracefulShutdownTimeoutInSeconds + + m.ImagePullSecrets = make([]ImagePullSecret, len(model.ImagePullSecrets)) + for i, n := range model.ImagePullSecrets { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ImagePullSecrets[i] = nn.(ImagePullSecret) + } else { + m.ImagePullSecrets[i] = nil + } + } + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.CompartmentId = model.CompartmentId + + m.AvailabilityDomain = model.AvailabilityDomain + + m.LifecycleState = model.LifecycleState + + m.Containers = make([]ContainerInstanceContainer, len(model.Containers)) + for i, n := range model.Containers { + m.Containers[i] = n + } + + m.ContainerCount = model.ContainerCount + + m.TimeCreated = model.TimeCreated + + m.Shape = model.Shape + + m.ShapeConfig = model.ShapeConfig + + m.Vnics = make([]ContainerVnic, len(model.Vnics)) + for i, n := range model.Vnics { + m.Vnics[i] = n + } + + m.ContainerRestartPolicy = model.ContainerRestartPolicy + + return +} + +// ContainerInstanceLifecycleStateEnum Enum with underlying type: string +type ContainerInstanceLifecycleStateEnum string + +// Set of constants representing the allowable values for ContainerInstanceLifecycleStateEnum +const ( + ContainerInstanceLifecycleStateCreating ContainerInstanceLifecycleStateEnum = "CREATING" + ContainerInstanceLifecycleStateUpdating ContainerInstanceLifecycleStateEnum = "UPDATING" + ContainerInstanceLifecycleStateActive ContainerInstanceLifecycleStateEnum = "ACTIVE" + ContainerInstanceLifecycleStateInactive ContainerInstanceLifecycleStateEnum = "INACTIVE" + ContainerInstanceLifecycleStateDeleting ContainerInstanceLifecycleStateEnum = "DELETING" + ContainerInstanceLifecycleStateDeleted ContainerInstanceLifecycleStateEnum = "DELETED" + ContainerInstanceLifecycleStateFailed ContainerInstanceLifecycleStateEnum = "FAILED" +) + +var mappingContainerInstanceLifecycleStateEnum = map[string]ContainerInstanceLifecycleStateEnum{ + "CREATING": ContainerInstanceLifecycleStateCreating, + "UPDATING": ContainerInstanceLifecycleStateUpdating, + "ACTIVE": ContainerInstanceLifecycleStateActive, + "INACTIVE": ContainerInstanceLifecycleStateInactive, + "DELETING": ContainerInstanceLifecycleStateDeleting, + "DELETED": ContainerInstanceLifecycleStateDeleted, + "FAILED": ContainerInstanceLifecycleStateFailed, +} + +var mappingContainerInstanceLifecycleStateEnumLowerCase = map[string]ContainerInstanceLifecycleStateEnum{ + "creating": ContainerInstanceLifecycleStateCreating, + "updating": ContainerInstanceLifecycleStateUpdating, + "active": ContainerInstanceLifecycleStateActive, + "inactive": ContainerInstanceLifecycleStateInactive, + "deleting": ContainerInstanceLifecycleStateDeleting, + "deleted": ContainerInstanceLifecycleStateDeleted, + "failed": ContainerInstanceLifecycleStateFailed, +} + +// GetContainerInstanceLifecycleStateEnumValues Enumerates the set of values for ContainerInstanceLifecycleStateEnum +func GetContainerInstanceLifecycleStateEnumValues() []ContainerInstanceLifecycleStateEnum { + values := make([]ContainerInstanceLifecycleStateEnum, 0) + for _, v := range mappingContainerInstanceLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetContainerInstanceLifecycleStateEnumStringValues Enumerates the set of values in String for ContainerInstanceLifecycleStateEnum +func GetContainerInstanceLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "INACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingContainerInstanceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerInstanceLifecycleStateEnum(val string) (ContainerInstanceLifecycleStateEnum, bool) { + enum, ok := mappingContainerInstanceLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ContainerInstanceContainerRestartPolicyEnum Enum with underlying type: string +type ContainerInstanceContainerRestartPolicyEnum string + +// Set of constants representing the allowable values for ContainerInstanceContainerRestartPolicyEnum +const ( + ContainerInstanceContainerRestartPolicyAlways ContainerInstanceContainerRestartPolicyEnum = "ALWAYS" + ContainerInstanceContainerRestartPolicyNever ContainerInstanceContainerRestartPolicyEnum = "NEVER" + ContainerInstanceContainerRestartPolicyOnFailure ContainerInstanceContainerRestartPolicyEnum = "ON_FAILURE" +) + +var mappingContainerInstanceContainerRestartPolicyEnum = map[string]ContainerInstanceContainerRestartPolicyEnum{ + "ALWAYS": ContainerInstanceContainerRestartPolicyAlways, + "NEVER": ContainerInstanceContainerRestartPolicyNever, + "ON_FAILURE": ContainerInstanceContainerRestartPolicyOnFailure, +} + +var mappingContainerInstanceContainerRestartPolicyEnumLowerCase = map[string]ContainerInstanceContainerRestartPolicyEnum{ + "always": ContainerInstanceContainerRestartPolicyAlways, + "never": ContainerInstanceContainerRestartPolicyNever, + "on_failure": ContainerInstanceContainerRestartPolicyOnFailure, +} + +// GetContainerInstanceContainerRestartPolicyEnumValues Enumerates the set of values for ContainerInstanceContainerRestartPolicyEnum +func GetContainerInstanceContainerRestartPolicyEnumValues() []ContainerInstanceContainerRestartPolicyEnum { + values := make([]ContainerInstanceContainerRestartPolicyEnum, 0) + for _, v := range mappingContainerInstanceContainerRestartPolicyEnum { + values = append(values, v) + } + return values +} + +// GetContainerInstanceContainerRestartPolicyEnumStringValues Enumerates the set of values in String for ContainerInstanceContainerRestartPolicyEnum +func GetContainerInstanceContainerRestartPolicyEnumStringValues() []string { + return []string{ + "ALWAYS", + "NEVER", + "ON_FAILURE", + } +} + +// GetMappingContainerInstanceContainerRestartPolicyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerInstanceContainerRestartPolicyEnum(val string) (ContainerInstanceContainerRestartPolicyEnum, bool) { + enum, ok := mappingContainerInstanceContainerRestartPolicyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/container_instance_collection.go b/containerinstances/container_instance_collection.go new file mode 100644 index 0000000000..7eeefcc4a4 --- /dev/null +++ b/containerinstances/container_instance_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerInstanceCollection Results of a containerInstance search. Contains boh ContainerInstanceSummary items and other information, such as metadata. +type ContainerInstanceCollection struct { + + // List of containerInstances. + Items []ContainerInstanceSummary `mandatory:"true" json:"items"` +} + +func (m ContainerInstanceCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerInstanceCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_instance_container.go b/containerinstances/container_instance_container.go new file mode 100644 index 0000000000..8795c09f52 --- /dev/null +++ b/containerinstances/container_instance_container.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerInstanceContainer A container on a Container Instance. +type ContainerInstanceContainer struct { + + // The ID of the Container on this Instance. + ContainerId *string `mandatory:"true" json:"containerId"` + + // Display name for the Container. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m ContainerInstanceContainer) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerInstanceContainer) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_instance_shape_collection.go b/containerinstances/container_instance_shape_collection.go new file mode 100644 index 0000000000..207b981fea --- /dev/null +++ b/containerinstances/container_instance_shape_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerInstanceShapeCollection A collection of Container Instance Shapes. +type ContainerInstanceShapeCollection struct { + + // List of shapes. + Items []ContainerInstanceShapeSummary `mandatory:"true" json:"items"` +} + +func (m ContainerInstanceShapeCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerInstanceShapeCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_instance_shape_config.go b/containerinstances/container_instance_shape_config.go new file mode 100644 index 0000000000..5d085ab343 --- /dev/null +++ b/containerinstances/container_instance_shape_config.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerInstanceShapeConfig The shape configuration for a Container Instance. The shape configuration determines +// the resources allocated to the Instance and it's containers. +type ContainerInstanceShapeConfig struct { + + // The total number of OCPUs available to the instance. + Ocpus *float32 `mandatory:"true" json:"ocpus"` + + // The total amount of memory available to the instance, in gigabytes. + MemoryInGBs *float32 `mandatory:"true" json:"memoryInGBs"` + + // A short description of the instance's processor (CPU). + ProcessorDescription *string `mandatory:"true" json:"processorDescription"` + + // The networking bandwidth available to the instance, in gigabits per second. + NetworkingBandwidthInGbps *float32 `mandatory:"true" json:"networkingBandwidthInGbps"` +} + +func (m ContainerInstanceShapeConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerInstanceShapeConfig) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_instance_shape_summary.go b/containerinstances/container_instance_shape_summary.go new file mode 100644 index 0000000000..83d7775eed --- /dev/null +++ b/containerinstances/container_instance_shape_summary.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerInstanceShapeSummary Details about a shape for a container Instance. +type ContainerInstanceShapeSummary struct { + + // The name identifying the shape. + Name *string `mandatory:"true" json:"name"` + + // A short description of the Instance's processor (CPU). + ProcessorDescription *string `mandatory:"true" json:"processorDescription"` + + OcpuOptions *ShapeOcpuOptions `mandatory:"false" json:"ocpuOptions"` + + MemoryOptions *ShapeMemoryOptions `mandatory:"false" json:"memoryOptions"` + + NetworkingBandwidthOptions *ShapeNetworkingBandwidthOptions `mandatory:"false" json:"networkingBandwidthOptions"` +} + +func (m ContainerInstanceShapeSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerInstanceShapeSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_instance_summary.go b/containerinstances/container_instance_summary.go new file mode 100644 index 0000000000..8899b27682 --- /dev/null +++ b/containerinstances/container_instance_summary.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerInstanceSummary A reduced set of details about a single ContainerInstance returned by list APIs. +type ContainerInstanceSummary struct { + + // Unique identifier that is immutable on creation + Id *string `mandatory:"true" json:"id"` + + // Display name for the ContainerInstance. Can be renamed. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment Identifier + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Availability Domain where the ContainerInstance is running. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The current state of the ContainerInstance. + LifecycleState ContainerInstanceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the the ContainerInstance was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The shape of the Container Instance. The shape determines the resources available to the Container Instance. + Shape *string `mandatory:"true" json:"shape"` + + ShapeConfig *ContainerInstanceShapeConfig `mandatory:"true" json:"shapeConfig"` + + // The number of containers on this Instance + ContainerCount *int `mandatory:"true" json:"containerCount"` + + // Container Restart Policy + ContainerRestartPolicy ContainerInstanceContainerRestartPolicyEnum `mandatory:"true" json:"containerRestartPolicy"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Fault Domain where the ContainerInstance is running. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // A message describing the current state in more detail. For example, can be used to provide + // actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The time the ContainerInstance was updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Duration in seconds processes within a Container have to gracefully terminate. This applies whenever a Container must be halted, such as when the Container Instance is deleted. Processes will first be sent a termination signal. After this timeout is reached, the processes will be sent a termination signal. + GracefulShutdownTimeoutInSeconds *int64 `mandatory:"false" json:"gracefulShutdownTimeoutInSeconds"` + + // The number of volumes that attached to this Instance + VolumeCount *int `mandatory:"false" json:"volumeCount"` +} + +func (m ContainerInstanceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerInstanceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingContainerInstanceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetContainerInstanceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingContainerInstanceContainerRestartPolicyEnum(string(m.ContainerRestartPolicy)); !ok && m.ContainerRestartPolicy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ContainerRestartPolicy: %s. Supported values are: %s.", m.ContainerRestartPolicy, strings.Join(GetContainerInstanceContainerRestartPolicyEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_resource_config.go b/containerinstances/container_resource_config.go new file mode 100644 index 0000000000..e0225bf384 --- /dev/null +++ b/containerinstances/container_resource_config.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerResourceConfig The resource configuration for a Container. The resource configuration determines +// the guaranteed resources allocated to the container and the maximum allowed resources for a container. +type ContainerResourceConfig struct { + + // The maximum amount of CPU utilization which may be consumed by the Container's + // process. If no value is provided, then the process may consume + // all CPU resources on the Instance. + // CPU usage is defined in terms of logical CPUs. This means that the + // maximum possible value on an E3 ContainerInstance with 1 OCPU is 2.0. + VcpusLimit *float32 `mandatory:"false" json:"vcpusLimit"` + + // The maximum amount of memory which may be consumed by the Container's + // process. If no value is provided, then the process + // may use all available memory on the Instance. + MemoryLimitInGBs *float32 `mandatory:"false" json:"memoryLimitInGBs"` +} + +func (m ContainerResourceConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerResourceConfig) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_summary.go b/containerinstances/container_summary.go new file mode 100644 index 0000000000..b0e8771af6 --- /dev/null +++ b/containerinstances/container_summary.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerSummary A reduced set of details about a single Container returned by list APIs. +type ContainerSummary struct { + + // Unique identifier that is immutable on creation + Id *string `mandatory:"true" json:"id"` + + // Display name for the Container. Can be renamed. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment Identifier + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Availability Domain where the Container's Instance is running. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The current state of the Container. + LifecycleState ContainerLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The time the the Container was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The identifier of the Container Instance on which this container is running. + ContainerInstanceId *string `mandatory:"true" json:"containerInstanceId"` + + // The container image information. Currently only support public docker registry. Can be either image name, + // e.g `containerImage`, image name with version, e.g `containerImage:v1` or complete docker image Url e.g + // `docker.io/library/containerImage:latest`. + // If no registry is provided, will default the registry to public docker hub `docker.io/library`. + // The registry used for container image must be reachable over the Container Instance's VNIC. + ImageUrl *string `mandatory:"true" json:"imageUrl"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Fault Domain where the Container's Instance is running. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // A message describing the current state in more detail. For example, can be used to provide + // actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The time the Container was updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + ResourceConfig *ContainerResourceConfig `mandatory:"false" json:"resourceConfig"` + + // Determines if the Container will have access to the Container Instance Resource Principal. + // This method utilizes resource principal version 2.2. Please refer to + // https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm#sdk_authentication_methods_resource_principal + // for detailed explanation of how to leverage the exposed resource principal elements. + IsResourcePrincipalDisabled *bool `mandatory:"false" json:"isResourcePrincipalDisabled"` +} + +func (m ContainerSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingContainerLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetContainerLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_tcp_health_check.go b/containerinstances/container_tcp_health_check.go new file mode 100644 index 0000000000..8be3c84414 --- /dev/null +++ b/containerinstances/container_tcp_health_check.go @@ -0,0 +1,133 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerTcpHealthCheck Container Health Check with TCP type. +type ContainerTcpHealthCheck struct { + + // Container health check port. + Port *int `mandatory:"true" json:"port"` + + // Health check name. + Name *string `mandatory:"false" json:"name"` + + // The initial delay in seconds before start checking container health status. + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + + // Number of seconds between two consecutive runs for checking container health. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Number of consecutive failures at which we consider the check failed. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + + // Length of waiting time in seconds before marking health check failed. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + // A message describing the current status in more details. + StatusDetails *string `mandatory:"false" json:"statusDetails"` + + // Status of container + Status ContainerHealthCheckStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` +} + +//GetName returns Name +func (m ContainerTcpHealthCheck) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m ContainerTcpHealthCheck) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m ContainerTcpHealthCheck) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m ContainerTcpHealthCheck) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m ContainerTcpHealthCheck) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m ContainerTcpHealthCheck) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetStatus returns Status +func (m ContainerTcpHealthCheck) GetStatus() ContainerHealthCheckStatusEnum { + return m.Status +} + +//GetStatusDetails returns StatusDetails +func (m ContainerTcpHealthCheck) GetStatusDetails() *string { + return m.StatusDetails +} + +//GetFailureAction returns FailureAction +func (m ContainerTcpHealthCheck) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m ContainerTcpHealthCheck) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerTcpHealthCheck) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetContainerHealthCheckStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ContainerTcpHealthCheck) MarshalJSON() (buff []byte, e error) { + type MarshalTypeContainerTcpHealthCheck ContainerTcpHealthCheck + s := struct { + DiscriminatorParam string `json:"healthCheckType"` + MarshalTypeContainerTcpHealthCheck + }{ + "TCP", + (MarshalTypeContainerTcpHealthCheck)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/container_vnic.go b/containerinstances/container_vnic.go new file mode 100644 index 0000000000..fcae4d3e36 --- /dev/null +++ b/containerinstances/container_vnic.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerVnic An interface to a virtual network available to Containers on a Container Instance. +type ContainerVnic struct { + + // The ID of the Virtual Network Interface Card (VNIC) over which + // Containers accessing this network can communicate with the + // larger Virtual Client Network. + VnicId *string `mandatory:"false" json:"vnicId"` +} + +func (m ContainerVnic) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ContainerVnic) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_volume.go b/containerinstances/container_volume.go new file mode 100644 index 0000000000..65f0c1d713 --- /dev/null +++ b/containerinstances/container_volume.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ContainerVolume A Volume represents a directory with data that is accessible across multiple containers in a +// ContainerInstance. +type ContainerVolume interface { + + // The name of the volume. This has be unique cross single ContainerInstance. + GetName() *string +} + +type containervolume struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + VolumeType string `json:"volumeType"` +} + +// UnmarshalJSON unmarshals json +func (m *containervolume) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercontainervolume containervolume + s := struct { + Model Unmarshalercontainervolume + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.VolumeType = s.Model.VolumeType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *containervolume) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.VolumeType { + case "EMPTYDIR": + mm := ContainerEmptyDirVolume{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CONFIGFILE": + mm := ContainerConfigFileVolume{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetName returns Name +func (m containervolume) GetName() *string { + return m.Name +} + +func (m containervolume) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m containervolume) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/container_volume_type.go b/containerinstances/container_volume_type.go new file mode 100644 index 0000000000..25126448fe --- /dev/null +++ b/containerinstances/container_volume_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// ContainerVolumeTypeEnum Enum with underlying type: string +type ContainerVolumeTypeEnum string + +// Set of constants representing the allowable values for ContainerVolumeTypeEnum +const ( + ContainerVolumeTypeEmptydir ContainerVolumeTypeEnum = "EMPTYDIR" + ContainerVolumeTypeConfigfile ContainerVolumeTypeEnum = "CONFIGFILE" +) + +var mappingContainerVolumeTypeEnum = map[string]ContainerVolumeTypeEnum{ + "EMPTYDIR": ContainerVolumeTypeEmptydir, + "CONFIGFILE": ContainerVolumeTypeConfigfile, +} + +var mappingContainerVolumeTypeEnumLowerCase = map[string]ContainerVolumeTypeEnum{ + "emptydir": ContainerVolumeTypeEmptydir, + "configfile": ContainerVolumeTypeConfigfile, +} + +// GetContainerVolumeTypeEnumValues Enumerates the set of values for ContainerVolumeTypeEnum +func GetContainerVolumeTypeEnumValues() []ContainerVolumeTypeEnum { + values := make([]ContainerVolumeTypeEnum, 0) + for _, v := range mappingContainerVolumeTypeEnum { + values = append(values, v) + } + return values +} + +// GetContainerVolumeTypeEnumStringValues Enumerates the set of values in String for ContainerVolumeTypeEnum +func GetContainerVolumeTypeEnumStringValues() []string { + return []string{ + "EMPTYDIR", + "CONFIGFILE", + } +} + +// GetMappingContainerVolumeTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingContainerVolumeTypeEnum(val string) (ContainerVolumeTypeEnum, bool) { + enum, ok := mappingContainerVolumeTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/containerinstances_containerinstance_client.go b/containerinstances/containerinstances_containerinstance_client.go new file mode 100644 index 0000000000..c2c483db9a --- /dev/null +++ b/containerinstances/containerinstances_containerinstance_client.go @@ -0,0 +1,1136 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +//ContainerInstanceClient a client for ContainerInstance +type ContainerInstanceClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewContainerInstanceClientWithConfigurationProvider Creates a new default ContainerInstance client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewContainerInstanceClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ContainerInstanceClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newContainerInstanceClientFromBaseClient(baseClient, provider) +} + +// NewContainerInstanceClientWithOboToken Creates a new default ContainerInstance client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// as well as reading the region +func NewContainerInstanceClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ContainerInstanceClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newContainerInstanceClientFromBaseClient(baseClient, configProvider) +} + +func newContainerInstanceClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ContainerInstanceClient, err error) { + // ContainerInstance service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ContainerInstance")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ContainerInstanceClient{BaseClient: baseClient} + client.BasePath = "20210415" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ContainerInstanceClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("containerinstances", "https://compute-containers.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ContainerInstanceClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ContainerInstanceClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ChangeContainerInstanceCompartment Moves a ContainerInstance resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ChangeContainerInstanceCompartment.go.html to see an example of how to use ChangeContainerInstanceCompartment API. +// A default retry strategy applies to this operation ChangeContainerInstanceCompartment() +func (client ContainerInstanceClient) ChangeContainerInstanceCompartment(ctx context.Context, request ChangeContainerInstanceCompartmentRequest) (response ChangeContainerInstanceCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.changeContainerInstanceCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeContainerInstanceCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeContainerInstanceCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeContainerInstanceCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeContainerInstanceCompartmentResponse") + } + return +} + +// changeContainerInstanceCompartment implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) changeContainerInstanceCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/containerInstances/{containerInstanceId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeContainerInstanceCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "ChangeContainerInstanceCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateContainerInstance Creates a new ContainerInstance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/CreateContainerInstance.go.html to see an example of how to use CreateContainerInstance API. +// A default retry strategy applies to this operation CreateContainerInstance() +func (client ContainerInstanceClient) CreateContainerInstance(ctx context.Context, request CreateContainerInstanceRequest) (response CreateContainerInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createContainerInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateContainerInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateContainerInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateContainerInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateContainerInstanceResponse") + } + return +} + +// createContainerInstance implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) createContainerInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/containerInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateContainerInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "CreateContainerInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteContainerInstance Deletes a ContainerInstance resource by identifier +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/DeleteContainerInstance.go.html to see an example of how to use DeleteContainerInstance API. +// A default retry strategy applies to this operation DeleteContainerInstance() +func (client ContainerInstanceClient) DeleteContainerInstance(ctx context.Context, request DeleteContainerInstanceRequest) (response DeleteContainerInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteContainerInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteContainerInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteContainerInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteContainerInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteContainerInstanceResponse") + } + return +} + +// deleteContainerInstance implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) deleteContainerInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/containerInstances/{containerInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteContainerInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "DeleteContainerInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetContainer Get details about a single container by the container ID. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/GetContainer.go.html to see an example of how to use GetContainer API. +// A default retry strategy applies to this operation GetContainer() +func (client ContainerInstanceClient) GetContainer(ctx context.Context, request GetContainerRequest) (response GetContainerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getContainer, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetContainerResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetContainerResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetContainerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetContainerResponse") + } + return +} + +// getContainer implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) getContainer(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/containers/{containerId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetContainerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "GetContainer", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetContainerInstance Gets a ContainerInstance by identifier +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/GetContainerInstance.go.html to see an example of how to use GetContainerInstance API. +// A default retry strategy applies to this operation GetContainerInstance() +func (client ContainerInstanceClient) GetContainerInstance(ctx context.Context, request GetContainerInstanceRequest) (response GetContainerInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getContainerInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetContainerInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetContainerInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetContainerInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetContainerInstanceResponse") + } + return +} + +// getContainerInstance implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) getContainerInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/containerInstances/{containerInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetContainerInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "GetContainerInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the status of the work request with the given ID. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client ContainerInstanceClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListContainerInstanceShapes Get a list of shapes for creating Container Instances and their details. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListContainerInstanceShapes.go.html to see an example of how to use ListContainerInstanceShapes API. +// A default retry strategy applies to this operation ListContainerInstanceShapes() +func (client ContainerInstanceClient) ListContainerInstanceShapes(ctx context.Context, request ListContainerInstanceShapesRequest) (response ListContainerInstanceShapesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listContainerInstanceShapes, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListContainerInstanceShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListContainerInstanceShapesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListContainerInstanceShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListContainerInstanceShapesResponse") + } + return +} + +// listContainerInstanceShapes implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) listContainerInstanceShapes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/containerInstanceShapes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListContainerInstanceShapesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "ListContainerInstanceShapes", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListContainerInstances Returns a list of ContainerInstances. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListContainerInstances.go.html to see an example of how to use ListContainerInstances API. +// A default retry strategy applies to this operation ListContainerInstances() +func (client ContainerInstanceClient) ListContainerInstances(ctx context.Context, request ListContainerInstancesRequest) (response ListContainerInstancesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listContainerInstances, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListContainerInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListContainerInstancesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListContainerInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListContainerInstancesResponse") + } + return +} + +// listContainerInstances implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) listContainerInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/containerInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListContainerInstancesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "ListContainerInstances", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListContainers Return a list of Containers. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListContainers.go.html to see an example of how to use ListContainers API. +// A default retry strategy applies to this operation ListContainers() +func (client ContainerInstanceClient) ListContainers(ctx context.Context, request ListContainersRequest) (response ListContainersResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listContainers, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListContainersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListContainersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListContainersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListContainersResponse") + } + return +} + +// listContainers implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) listContainers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/containers", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListContainersResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "ListContainers", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Return a (paginated) list of errors for a given work request. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client ContainerInstanceClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Return a (paginated) list of logs for a given work request. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client ContainerInstanceClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in a compartment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client ContainerInstanceClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RestartContainerInstance Restarts a container instance. When provided, If-Match is checked against ETag values of the container instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/RestartContainerInstance.go.html to see an example of how to use RestartContainerInstance API. +// A default retry strategy applies to this operation RestartContainerInstance() +func (client ContainerInstanceClient) RestartContainerInstance(ctx context.Context, request RestartContainerInstanceRequest) (response RestartContainerInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.restartContainerInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RestartContainerInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RestartContainerInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RestartContainerInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RestartContainerInstanceResponse") + } + return +} + +// restartContainerInstance implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) restartContainerInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/containerInstances/{containerInstanceId}/actions/restart", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RestartContainerInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "RestartContainerInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RetrieveLogs Retrieve recent log from a single container by the container ID up to 256KB. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/RetrieveLogs.go.html to see an example of how to use RetrieveLogs API. +// A default retry strategy applies to this operation RetrieveLogs() +func (client ContainerInstanceClient) RetrieveLogs(ctx context.Context, request RetrieveLogsRequest) (response RetrieveLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.retrieveLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RetrieveLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RetrieveLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RetrieveLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RetrieveLogsResponse") + } + return +} + +// retrieveLogs implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) retrieveLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/containers/{containerId}/actions/retrieveLogs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RetrieveLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "RetrieveLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// StartContainerInstance Starts a container instance if it is "inactive". No effect otherwise. When provided, If-Match is checked against ETag values of the container instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/StartContainerInstance.go.html to see an example of how to use StartContainerInstance API. +// A default retry strategy applies to this operation StartContainerInstance() +func (client ContainerInstanceClient) StartContainerInstance(ctx context.Context, request StartContainerInstanceRequest) (response StartContainerInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.startContainerInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = StartContainerInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = StartContainerInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(StartContainerInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StartContainerInstanceResponse") + } + return +} + +// startContainerInstance implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) startContainerInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/containerInstances/{containerInstanceId}/actions/start", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response StartContainerInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "StartContainerInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// StopContainerInstance Stops a container instance if it is "active". No effect otherwise. When provided, If-Match is checked against ETag values of the container instance. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/StopContainerInstance.go.html to see an example of how to use StopContainerInstance API. +// A default retry strategy applies to this operation StopContainerInstance() +func (client ContainerInstanceClient) StopContainerInstance(ctx context.Context, request StopContainerInstanceRequest) (response StopContainerInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.stopContainerInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = StopContainerInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = StopContainerInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(StopContainerInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StopContainerInstanceResponse") + } + return +} + +// stopContainerInstance implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) stopContainerInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/containerInstances/{containerInstanceId}/actions/stop", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response StopContainerInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "StopContainerInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateContainer Update a Container. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/UpdateContainer.go.html to see an example of how to use UpdateContainer API. +// A default retry strategy applies to this operation UpdateContainer() +func (client ContainerInstanceClient) UpdateContainer(ctx context.Context, request UpdateContainerRequest) (response UpdateContainerResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateContainer, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateContainerResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateContainerResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateContainerResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateContainerResponse") + } + return +} + +// updateContainer implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) updateContainer(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/containers/{containerId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateContainerResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "UpdateContainer", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateContainerInstance Updates the ContainerInstance +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/UpdateContainerInstance.go.html to see an example of how to use UpdateContainerInstance API. +// A default retry strategy applies to this operation UpdateContainerInstance() +func (client ContainerInstanceClient) UpdateContainerInstance(ctx context.Context, request UpdateContainerInstanceRequest) (response UpdateContainerInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateContainerInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateContainerInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateContainerInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateContainerInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateContainerInstanceResponse") + } + return +} + +// updateContainerInstance implements the OCIOperation interface (enables retrying operations) +func (client ContainerInstanceClient) updateContainerInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/containerInstances/{containerInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateContainerInstanceResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ContainerInstance", "UpdateContainerInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/containerinstances/create_basic_image_pull_secret_details.go b/containerinstances/create_basic_image_pull_secret_details.go new file mode 100644 index 0000000000..78975b156d --- /dev/null +++ b/containerinstances/create_basic_image_pull_secret_details.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateBasicImagePullSecretDetails A CreateBasicImagePullSecretDetails is a ImagePullSecret which accepts username and password as credentials information. +type CreateBasicImagePullSecretDetails struct { + + // The registry endpoint of the container image. + RegistryEndpoint *string `mandatory:"true" json:"registryEndpoint"` + + // The username which should be used with the registry for authentication. The value is expected in base64 format. + Username *string `mandatory:"true" json:"username"` + + // The password which should be used with the registry for authentication. The value is expected in base64 format. + Password *string `mandatory:"true" json:"password"` +} + +//GetRegistryEndpoint returns RegistryEndpoint +func (m CreateBasicImagePullSecretDetails) GetRegistryEndpoint() *string { + return m.RegistryEndpoint +} + +func (m CreateBasicImagePullSecretDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateBasicImagePullSecretDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateBasicImagePullSecretDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateBasicImagePullSecretDetails CreateBasicImagePullSecretDetails + s := struct { + DiscriminatorParam string `json:"secretType"` + MarshalTypeCreateBasicImagePullSecretDetails + }{ + "BASIC", + (MarshalTypeCreateBasicImagePullSecretDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/create_container_command_health_check_details.go b/containerinstances/create_container_command_health_check_details.go new file mode 100644 index 0000000000..83bcb1a628 --- /dev/null +++ b/containerinstances/create_container_command_health_check_details.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerCommandHealthCheckDetails Container Health Check Command type. +type CreateContainerCommandHealthCheckDetails struct { + + // The list of strings which will be concatenated to a single command for checking container's status. + Command []string `mandatory:"true" json:"command"` + + // Health check name. + Name *string `mandatory:"false" json:"name"` + + // The initial delay in seconds before start checking container health status. + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + + // Number of seconds between two consecutive runs for checking container health. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Number of consecutive failures at which we consider the check failed. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + + // Length of waiting time in seconds before marking health check failed. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` +} + +//GetName returns Name +func (m CreateContainerCommandHealthCheckDetails) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m CreateContainerCommandHealthCheckDetails) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m CreateContainerCommandHealthCheckDetails) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m CreateContainerCommandHealthCheckDetails) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m CreateContainerCommandHealthCheckDetails) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m CreateContainerCommandHealthCheckDetails) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetFailureAction returns FailureAction +func (m CreateContainerCommandHealthCheckDetails) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m CreateContainerCommandHealthCheckDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerCommandHealthCheckDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateContainerCommandHealthCheckDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateContainerCommandHealthCheckDetails CreateContainerCommandHealthCheckDetails + s := struct { + DiscriminatorParam string `json:"healthCheckType"` + MarshalTypeCreateContainerCommandHealthCheckDetails + }{ + "COMMAND", + (MarshalTypeCreateContainerCommandHealthCheckDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/create_container_config_file_volume_details.go b/containerinstances/create_container_config_file_volume_details.go new file mode 100644 index 0000000000..b83f228020 --- /dev/null +++ b/containerinstances/create_container_config_file_volume_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerConfigFileVolumeDetails The configuration files to pass to the container using volume mounts. +type CreateContainerConfigFileVolumeDetails struct { + + // The name of the volume. This has be unique cross single ContainerInstance. + Name *string `mandatory:"true" json:"name"` + + // Contains key value pairs which can be mounted as individual files inside the container. The value needs to be base64 encoded. It is decoded to plain text before the mount. + Configs []ContainerConfigFile `mandatory:"false" json:"configs"` +} + +//GetName returns Name +func (m CreateContainerConfigFileVolumeDetails) GetName() *string { + return m.Name +} + +func (m CreateContainerConfigFileVolumeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerConfigFileVolumeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateContainerConfigFileVolumeDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateContainerConfigFileVolumeDetails CreateContainerConfigFileVolumeDetails + s := struct { + DiscriminatorParam string `json:"volumeType"` + MarshalTypeCreateContainerConfigFileVolumeDetails + }{ + "CONFIGFILE", + (MarshalTypeCreateContainerConfigFileVolumeDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/create_container_details.go b/containerinstances/create_container_details.go new file mode 100644 index 0000000000..0bac3c3085 --- /dev/null +++ b/containerinstances/create_container_details.go @@ -0,0 +1,181 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerDetails Information to create a new Container within a ContainerInstance. +// The Container created by this call will contain both the tags specified +// in this object as well as any tags specified in the parent ContainerInstance object. +// The Container will be created with the same `compartmentId`, `availabilityDomain`, +// and `faultDomain` as the parent ContainerInstance object. +type CreateContainerDetails struct { + + // The container image information. Currently only support public docker registry. Can be either image name, + // e.g `containerImage`, image name with version, e.g `containerImage:v1` or complete docker image Url e.g + // `docker.io/library/containerImage:latest`. + // If no registry is provided, will default the registry to public docker hub `docker.io/library`. + // The registry used for container image must be reachable over the Container Instance's VNIC. + ImageUrl *string `mandatory:"true" json:"imageUrl"` + + // Display name for the Container. There are no guarantees of uniqueness + // for this name. If none is provided, it will be calculated automatically. + DisplayName *string `mandatory:"false" json:"displayName"` + + // This command will override the container's entrypoint process. + // If not specified, the existing entrypoint process defined in the image will be used. + Command []string `mandatory:"false" json:"command"` + + // A list of string arguments for a container's entrypoint process. + // Many containers use an entrypoint process pointing to a shell, + // for example /bin/bash. For such containers, this argument list + // can also be used to specify the main command in the container process. + // All arguments together must be 64KB or smaller. + Arguments []string `mandatory:"false" json:"arguments"` + + // A list of additional capabilities for the container. + AdditionalCapabilities []ContainerCapabilityEnum `mandatory:"false" json:"additionalCapabilities,omitempty"` + + // The working directory within the Container's filesystem for + // the Container process. If none is set, the Container will run in the + // working directory set by the container image. + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // A map of additional environment variables to set in the environment of the container's + // entrypoint process. These variables are in addition to any variables already defined + // in the container's image. + // All environment variables together, name and values, must be 64KB or smaller. + EnvironmentVariables map[string]string `mandatory:"false" json:"environmentVariables"` + + // List of the volume mounts. + VolumeMounts []CreateVolumeMountDetails `mandatory:"false" json:"volumeMounts"` + + // Determines if the Container will have access to the Container Instance Resource Principal. + // This method utilizes resource principal version 2.2. Please refer to + // https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm#sdk_authentication_methods_resource_principal + // for detailed explanation of how to leverage the exposed resource principal elements. + IsResourcePrincipalDisabled *bool `mandatory:"false" json:"isResourcePrincipalDisabled"` + + ResourceConfig *CreateContainerResourceConfigDetails `mandatory:"false" json:"resourceConfig"` + + // list of container health checks to check container status and take appropriate action if container status is failed. + // There are three types of health checks that we currently support HTTP, TCP, and Command. + HealthChecks []CreateContainerHealthCheckDetails `mandatory:"false" json:"healthChecks"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateContainerDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.AdditionalCapabilities { + if _, ok := GetMappingContainerCapabilityEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AdditionalCapabilities: %s. Supported values are: %s.", val, strings.Join(GetContainerCapabilityEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *CreateContainerDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Command []string `json:"command"` + Arguments []string `json:"arguments"` + AdditionalCapabilities []ContainerCapabilityEnum `json:"additionalCapabilities"` + WorkingDirectory *string `json:"workingDirectory"` + EnvironmentVariables map[string]string `json:"environmentVariables"` + VolumeMounts []CreateVolumeMountDetails `json:"volumeMounts"` + IsResourcePrincipalDisabled *bool `json:"isResourcePrincipalDisabled"` + ResourceConfig *CreateContainerResourceConfigDetails `json:"resourceConfig"` + HealthChecks []createcontainerhealthcheckdetails `json:"healthChecks"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + ImageUrl *string `json:"imageUrl"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Command = make([]string, len(model.Command)) + for i, n := range model.Command { + m.Command[i] = n + } + + m.Arguments = make([]string, len(model.Arguments)) + for i, n := range model.Arguments { + m.Arguments[i] = n + } + + m.AdditionalCapabilities = make([]ContainerCapabilityEnum, len(model.AdditionalCapabilities)) + for i, n := range model.AdditionalCapabilities { + m.AdditionalCapabilities[i] = n + } + + m.WorkingDirectory = model.WorkingDirectory + + m.EnvironmentVariables = model.EnvironmentVariables + + m.VolumeMounts = make([]CreateVolumeMountDetails, len(model.VolumeMounts)) + for i, n := range model.VolumeMounts { + m.VolumeMounts[i] = n + } + + m.IsResourcePrincipalDisabled = model.IsResourcePrincipalDisabled + + m.ResourceConfig = model.ResourceConfig + + m.HealthChecks = make([]CreateContainerHealthCheckDetails, len(model.HealthChecks)) + for i, n := range model.HealthChecks { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.HealthChecks[i] = nn.(CreateContainerHealthCheckDetails) + } else { + m.HealthChecks[i] = nil + } + } + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.ImageUrl = model.ImageUrl + + return +} diff --git a/containerinstances/create_container_dns_config_details.go b/containerinstances/create_container_dns_config_details.go new file mode 100644 index 0000000000..06837cb54c --- /dev/null +++ b/containerinstances/create_container_dns_config_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerDnsConfigDetails Allow customers to define DNS settings for containers. If this is not provided, the containers will use +// the default DNS settings of the subnet. +type CreateContainerDnsConfigDetails struct { + + // IP address of a name server that the resolver should query, either an IPv4 address + // (in dot notation), or an IPv6 address in colon (and possibly dot) notation. If null, we will use + // nameservers from subnet dhcpDnsOptions. + Nameservers []string `mandatory:"false" json:"nameservers"` + + // Search list for host-name lookup. If null, we will use searches from subnet dhcpDnsOptios. + Searches []string `mandatory:"false" json:"searches"` + + // Options allows certain internal resolver variables to be modified. Options are a list of objects in + // https://man7.org/linux/man-pages/man5/resolv.conf.5.html. Examples: ["ndots:n", "edns0"] + Options []string `mandatory:"false" json:"options"` +} + +func (m CreateContainerDnsConfigDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerDnsConfigDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/create_container_empty_dir_volume_details.go b/containerinstances/create_container_empty_dir_volume_details.go new file mode 100644 index 0000000000..ef2137369a --- /dev/null +++ b/containerinstances/create_container_empty_dir_volume_details.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerEmptyDirVolumeDetails The empty directory for container instance +type CreateContainerEmptyDirVolumeDetails struct { + + // The name of the volume. This has be unique cross single ContainerInstance. + Name *string `mandatory:"true" json:"name"` + + // Volume type that we are using for empty dir where it could be either File Storage or Memory + BackingStore ContainerEmptyDirVolumeBackingStoreEnum `mandatory:"false" json:"backingStore,omitempty"` +} + +//GetName returns Name +func (m CreateContainerEmptyDirVolumeDetails) GetName() *string { + return m.Name +} + +func (m CreateContainerEmptyDirVolumeDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerEmptyDirVolumeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerEmptyDirVolumeBackingStoreEnum(string(m.BackingStore)); !ok && m.BackingStore != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BackingStore: %s. Supported values are: %s.", m.BackingStore, strings.Join(GetContainerEmptyDirVolumeBackingStoreEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateContainerEmptyDirVolumeDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateContainerEmptyDirVolumeDetails CreateContainerEmptyDirVolumeDetails + s := struct { + DiscriminatorParam string `json:"volumeType"` + MarshalTypeCreateContainerEmptyDirVolumeDetails + }{ + "EMPTYDIR", + (MarshalTypeCreateContainerEmptyDirVolumeDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/create_container_health_check_details.go b/containerinstances/create_container_health_check_details.go new file mode 100644 index 0000000000..830b86dab2 --- /dev/null +++ b/containerinstances/create_container_health_check_details.go @@ -0,0 +1,158 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerHealthCheckDetails Container Health Check is using for checking container status and taking appropriate actions on behalf of customers. +type CreateContainerHealthCheckDetails interface { + + // Health check name. + GetName() *string + + // The initial delay in seconds before start checking container health status. + GetInitialDelayInSeconds() *int + + // Number of seconds between two consecutive runs for checking container health. + GetIntervalInSeconds() *int + + // Number of consecutive failures at which we consider the check failed. + GetFailureThreshold() *int + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + GetSuccessThreshold() *int + + // Length of waiting time in seconds before marking health check failed. + GetTimeoutInSeconds() *int + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + GetFailureAction() ContainerHealthCheckFailureActionEnum +} + +type createcontainerhealthcheckdetails struct { + JsonData []byte + Name *string `mandatory:"false" json:"name"` + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` + HealthCheckType string `json:"healthCheckType"` +} + +// UnmarshalJSON unmarshals json +func (m *createcontainerhealthcheckdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatecontainerhealthcheckdetails createcontainerhealthcheckdetails + s := struct { + Model Unmarshalercreatecontainerhealthcheckdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.InitialDelayInSeconds = s.Model.InitialDelayInSeconds + m.IntervalInSeconds = s.Model.IntervalInSeconds + m.FailureThreshold = s.Model.FailureThreshold + m.SuccessThreshold = s.Model.SuccessThreshold + m.TimeoutInSeconds = s.Model.TimeoutInSeconds + m.FailureAction = s.Model.FailureAction + m.HealthCheckType = s.Model.HealthCheckType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createcontainerhealthcheckdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.HealthCheckType { + case "TCP": + mm := CreateContainerTcpHealthCheckDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "HTTP": + mm := CreateContainerHttpHealthCheckDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "COMMAND": + mm := CreateContainerCommandHealthCheckDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetName returns Name +func (m createcontainerhealthcheckdetails) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m createcontainerhealthcheckdetails) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m createcontainerhealthcheckdetails) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m createcontainerhealthcheckdetails) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m createcontainerhealthcheckdetails) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m createcontainerhealthcheckdetails) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetFailureAction returns FailureAction +func (m createcontainerhealthcheckdetails) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m createcontainerhealthcheckdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createcontainerhealthcheckdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/create_container_http_health_check_details.go b/containerinstances/create_container_http_health_check_details.go new file mode 100644 index 0000000000..52f0fefa3e --- /dev/null +++ b/containerinstances/create_container_http_health_check_details.go @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerHttpHealthCheckDetails Container Health Check HTTP type. +type CreateContainerHttpHealthCheckDetails struct { + + // Container health check Http's path. + Path *string `mandatory:"true" json:"path"` + + // Container health check Http's port. + Port *int `mandatory:"true" json:"port"` + + // Health check name. + Name *string `mandatory:"false" json:"name"` + + // The initial delay in seconds before start checking container health status. + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + + // Number of seconds between two consecutive runs for checking container health. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Number of consecutive failures at which we consider the check failed. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + + // Length of waiting time in seconds before marking health check failed. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + // Container health check Http's headers. + Headers []HealthCheckHttpHeader `mandatory:"false" json:"headers"` + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` +} + +//GetName returns Name +func (m CreateContainerHttpHealthCheckDetails) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m CreateContainerHttpHealthCheckDetails) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m CreateContainerHttpHealthCheckDetails) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m CreateContainerHttpHealthCheckDetails) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m CreateContainerHttpHealthCheckDetails) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m CreateContainerHttpHealthCheckDetails) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetFailureAction returns FailureAction +func (m CreateContainerHttpHealthCheckDetails) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m CreateContainerHttpHealthCheckDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerHttpHealthCheckDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateContainerHttpHealthCheckDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateContainerHttpHealthCheckDetails CreateContainerHttpHealthCheckDetails + s := struct { + DiscriminatorParam string `json:"healthCheckType"` + MarshalTypeCreateContainerHttpHealthCheckDetails + }{ + "HTTP", + (MarshalTypeCreateContainerHttpHealthCheckDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/create_container_instance_details.go b/containerinstances/create_container_instance_details.go new file mode 100644 index 0000000000..50249f6be2 --- /dev/null +++ b/containerinstances/create_container_instance_details.go @@ -0,0 +1,174 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerInstanceDetails The information about new ContainerInstance. +type CreateContainerInstanceDetails struct { + + // Compartment Identifier + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Availability Domain where the ContainerInstance should be created. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The shape of the Container Instance. The shape determines the resources available to the Container Instance. + Shape *string `mandatory:"true" json:"shape"` + + ShapeConfig *CreateContainerInstanceShapeConfigDetails `mandatory:"true" json:"shapeConfig"` + + // The Containers to create on this Instance. + Containers []CreateContainerDetails `mandatory:"true" json:"containers"` + + // The networks to make available to containers on this Instance. + Vnics []CreateContainerVnicDetails `mandatory:"true" json:"vnics"` + + // Human-readable name for the ContainerInstance. If none is provided, + // OCI will select one for you. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Fault Domain where the ContainerInstance should run. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // A Volume represents a directory with data that is accessible across multiple containers in a + // ContainerInstance. + // Up to 32 volumes can be attached to single container instance. + Volumes []CreateContainerVolumeDetails `mandatory:"false" json:"volumes"` + + DnsConfig *CreateContainerDnsConfigDetails `mandatory:"false" json:"dnsConfig"` + + // Duration in seconds processes within a Container have to gracefully terminate. This applies whenever a Container must be halted, such as when the Container Instance is deleted. Processes will first be sent a termination signal. After this timeout is reached, the processes will be sent a termination signal. + GracefulShutdownTimeoutInSeconds *int64 `mandatory:"false" json:"gracefulShutdownTimeoutInSeconds"` + + // The image pull secrets for accessing private registry to pull images for containers + ImagePullSecrets []CreateImagePullSecretDetails `mandatory:"false" json:"imagePullSecrets"` + + // Container restart policy + ContainerRestartPolicy ContainerInstanceContainerRestartPolicyEnum `mandatory:"false" json:"containerRestartPolicy,omitempty"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateContainerInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerInstanceContainerRestartPolicyEnum(string(m.ContainerRestartPolicy)); !ok && m.ContainerRestartPolicy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ContainerRestartPolicy: %s. Supported values are: %s.", m.ContainerRestartPolicy, strings.Join(GetContainerInstanceContainerRestartPolicyEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *CreateContainerInstanceDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + FaultDomain *string `json:"faultDomain"` + Volumes []createcontainervolumedetails `json:"volumes"` + DnsConfig *CreateContainerDnsConfigDetails `json:"dnsConfig"` + GracefulShutdownTimeoutInSeconds *int64 `json:"gracefulShutdownTimeoutInSeconds"` + ImagePullSecrets []createimagepullsecretdetails `json:"imagePullSecrets"` + ContainerRestartPolicy ContainerInstanceContainerRestartPolicyEnum `json:"containerRestartPolicy"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + CompartmentId *string `json:"compartmentId"` + AvailabilityDomain *string `json:"availabilityDomain"` + Shape *string `json:"shape"` + ShapeConfig *CreateContainerInstanceShapeConfigDetails `json:"shapeConfig"` + Containers []CreateContainerDetails `json:"containers"` + Vnics []CreateContainerVnicDetails `json:"vnics"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.FaultDomain = model.FaultDomain + + m.Volumes = make([]CreateContainerVolumeDetails, len(model.Volumes)) + for i, n := range model.Volumes { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Volumes[i] = nn.(CreateContainerVolumeDetails) + } else { + m.Volumes[i] = nil + } + } + + m.DnsConfig = model.DnsConfig + + m.GracefulShutdownTimeoutInSeconds = model.GracefulShutdownTimeoutInSeconds + + m.ImagePullSecrets = make([]CreateImagePullSecretDetails, len(model.ImagePullSecrets)) + for i, n := range model.ImagePullSecrets { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ImagePullSecrets[i] = nn.(CreateImagePullSecretDetails) + } else { + m.ImagePullSecrets[i] = nil + } + } + + m.ContainerRestartPolicy = model.ContainerRestartPolicy + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.CompartmentId = model.CompartmentId + + m.AvailabilityDomain = model.AvailabilityDomain + + m.Shape = model.Shape + + m.ShapeConfig = model.ShapeConfig + + m.Containers = make([]CreateContainerDetails, len(model.Containers)) + for i, n := range model.Containers { + m.Containers[i] = n + } + + m.Vnics = make([]CreateContainerVnicDetails, len(model.Vnics)) + for i, n := range model.Vnics { + m.Vnics[i] = n + } + + return +} diff --git a/containerinstances/create_container_instance_request_response.go b/containerinstances/create_container_instance_request_response.go new file mode 100644 index 0000000000..373b7273a9 --- /dev/null +++ b/containerinstances/create_container_instance_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateContainerInstanceRequest wrapper for the CreateContainerInstance operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/CreateContainerInstance.go.html to see an example of how to use CreateContainerInstanceRequest. +type CreateContainerInstanceRequest struct { + + // Details for the new ContainerInstance. + CreateContainerInstanceDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateContainerInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateContainerInstanceRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateContainerInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateContainerInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateContainerInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateContainerInstanceResponse wrapper for the CreateContainerInstance operation +type CreateContainerInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ContainerInstance instance + ContainerInstance `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateContainerInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateContainerInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/create_container_instance_shape_config_details.go b/containerinstances/create_container_instance_shape_config_details.go new file mode 100644 index 0000000000..0e467b97f0 --- /dev/null +++ b/containerinstances/create_container_instance_shape_config_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerInstanceShapeConfigDetails The size and amount of resources available to the Container Instance. +type CreateContainerInstanceShapeConfigDetails struct { + + // The total number of OCPUs available to the instance. + Ocpus *float32 `mandatory:"true" json:"ocpus"` + + // The total amount of memory available to the instance, in gigabytes. + MemoryInGBs *float32 `mandatory:"false" json:"memoryInGBs"` +} + +func (m CreateContainerInstanceShapeConfigDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerInstanceShapeConfigDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/create_container_resource_config_details.go b/containerinstances/create_container_resource_config_details.go new file mode 100644 index 0000000000..64e07fe1ea --- /dev/null +++ b/containerinstances/create_container_resource_config_details.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerResourceConfigDetails The size and amount of resources available to the Container. +type CreateContainerResourceConfigDetails struct { + + // The maximum amount of CPU utilization which may be consumed by the Container's process. + // If no value is provided, then the process may consume all CPU resources on the Instance. + // CPU usage is defined in terms of logical CPUs. This means that the maximum possible value on + // an E3 ContainerInstance with 1 OCPU is 2.0. + // A Container with that vcpusLimit could consume up to 100% of the CPU resources available on the Instance. + // Values may be fractional. A value of "1.5" means that the Container + // may consume at most the equivalent of 1 and a half logical CPUs worth of CPU capacity + VcpusLimit *float32 `mandatory:"false" json:"vcpusLimit"` + + // The maximum amount of memory which may be consumed by the Container's process. + // If no value is provided, then the process may use all available memory on the Instance. + MemoryLimitInGBs *float32 `mandatory:"false" json:"memoryLimitInGBs"` +} + +func (m CreateContainerResourceConfigDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerResourceConfigDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/create_container_tcp_health_check_details.go b/containerinstances/create_container_tcp_health_check_details.go new file mode 100644 index 0000000000..fd66fb59a2 --- /dev/null +++ b/containerinstances/create_container_tcp_health_check_details.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerTcpHealthCheckDetails Container Health Check TCP type. +type CreateContainerTcpHealthCheckDetails struct { + + // Container health check port. + Port *int `mandatory:"true" json:"port"` + + // Health check name. + Name *string `mandatory:"false" json:"name"` + + // The initial delay in seconds before start checking container health status. + InitialDelayInSeconds *int `mandatory:"false" json:"initialDelayInSeconds"` + + // Number of seconds between two consecutive runs for checking container health. + IntervalInSeconds *int `mandatory:"false" json:"intervalInSeconds"` + + // Number of consecutive failures at which we consider the check failed. + FailureThreshold *int `mandatory:"false" json:"failureThreshold"` + + // Number of consecutive successes at which we consider the check succeeded again after it was in failure state. + SuccessThreshold *int `mandatory:"false" json:"successThreshold"` + + // Length of waiting time in seconds before marking health check failed. + TimeoutInSeconds *int `mandatory:"false" json:"timeoutInSeconds"` + + // The action will be triggered when the container health check fails. There are two types of action: KILL or NONE. The default + // action is KILL. If failure action is KILL, the container will be subject to the container restart policy. + FailureAction ContainerHealthCheckFailureActionEnum `mandatory:"false" json:"failureAction,omitempty"` +} + +//GetName returns Name +func (m CreateContainerTcpHealthCheckDetails) GetName() *string { + return m.Name +} + +//GetInitialDelayInSeconds returns InitialDelayInSeconds +func (m CreateContainerTcpHealthCheckDetails) GetInitialDelayInSeconds() *int { + return m.InitialDelayInSeconds +} + +//GetIntervalInSeconds returns IntervalInSeconds +func (m CreateContainerTcpHealthCheckDetails) GetIntervalInSeconds() *int { + return m.IntervalInSeconds +} + +//GetFailureThreshold returns FailureThreshold +func (m CreateContainerTcpHealthCheckDetails) GetFailureThreshold() *int { + return m.FailureThreshold +} + +//GetSuccessThreshold returns SuccessThreshold +func (m CreateContainerTcpHealthCheckDetails) GetSuccessThreshold() *int { + return m.SuccessThreshold +} + +//GetTimeoutInSeconds returns TimeoutInSeconds +func (m CreateContainerTcpHealthCheckDetails) GetTimeoutInSeconds() *int { + return m.TimeoutInSeconds +} + +//GetFailureAction returns FailureAction +func (m CreateContainerTcpHealthCheckDetails) GetFailureAction() ContainerHealthCheckFailureActionEnum { + return m.FailureAction +} + +func (m CreateContainerTcpHealthCheckDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerTcpHealthCheckDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingContainerHealthCheckFailureActionEnum(string(m.FailureAction)); !ok && m.FailureAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateContainerTcpHealthCheckDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateContainerTcpHealthCheckDetails CreateContainerTcpHealthCheckDetails + s := struct { + DiscriminatorParam string `json:"healthCheckType"` + MarshalTypeCreateContainerTcpHealthCheckDetails + }{ + "TCP", + (MarshalTypeCreateContainerTcpHealthCheckDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/create_container_vnic_details.go b/containerinstances/create_container_vnic_details.go new file mode 100644 index 0000000000..a444cffb6d --- /dev/null +++ b/containerinstances/create_container_vnic_details.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerVnicDetails Create a Virtual Network Interface Card (VNIC) which gives +// Containers on this Container Instance access to a Virtual Client Network (VCN). +// This VNIC will be created in the same compartment as the specified subnet on +// behalf of the customer. +// The VNIC created by this call will contain both the tags specified +// in this object as well as any tags specified in the parent ContainerInstance object. +type CreateContainerVnicDetails struct { + + // The OCID of the subnet to create the VNIC in. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // A user-friendly name for the VNIC. Does not have to be unique. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The hostname for the VNIC's primary private IP. + HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` + + // Whether the VNIC should be assigned a public IP address. + IsPublicIpAssigned *bool `mandatory:"false" json:"isPublicIpAssigned"` + + // Whether the source/destination check is disabled on the VNIC. + SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` + + // A list of the OCIDs of the network security groups (NSGs) to add the VNIC to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // A private IP address of your choice to assign to the VNIC. Must be an + // available IP address within the subnet's CIDR. + PrivateIp *string `mandatory:"false" json:"privateIp"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateContainerVnicDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateContainerVnicDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/create_container_volume_details.go b/containerinstances/create_container_volume_details.go new file mode 100644 index 0000000000..5237039cb0 --- /dev/null +++ b/containerinstances/create_container_volume_details.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateContainerVolumeDetails A Volume represents a directory with data that is accessible across multiple containers in a +// ContainerInstance. +type CreateContainerVolumeDetails interface { + + // The name of the volume. This has be unique cross single ContainerInstance. + GetName() *string +} + +type createcontainervolumedetails struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + VolumeType string `json:"volumeType"` +} + +// UnmarshalJSON unmarshals json +func (m *createcontainervolumedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatecontainervolumedetails createcontainervolumedetails + s := struct { + Model Unmarshalercreatecontainervolumedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.VolumeType = s.Model.VolumeType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createcontainervolumedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.VolumeType { + case "CONFIGFILE": + mm := CreateContainerConfigFileVolumeDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "EMPTYDIR": + mm := CreateContainerEmptyDirVolumeDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetName returns Name +func (m createcontainervolumedetails) GetName() *string { + return m.Name +} + +func (m createcontainervolumedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createcontainervolumedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/create_image_pull_secret_details.go b/containerinstances/create_image_pull_secret_details.go new file mode 100644 index 0000000000..a33e3edb81 --- /dev/null +++ b/containerinstances/create_image_pull_secret_details.go @@ -0,0 +1,132 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateImagePullSecretDetails The image pull secrets for accessing private registry to pull images for containers +type CreateImagePullSecretDetails interface { + + // The registry endpoint of the container image. + GetRegistryEndpoint() *string +} + +type createimagepullsecretdetails struct { + JsonData []byte + RegistryEndpoint *string `mandatory:"true" json:"registryEndpoint"` + SecretType string `json:"secretType"` +} + +// UnmarshalJSON unmarshals json +func (m *createimagepullsecretdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateimagepullsecretdetails createimagepullsecretdetails + s := struct { + Model Unmarshalercreateimagepullsecretdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.RegistryEndpoint = s.Model.RegistryEndpoint + m.SecretType = s.Model.SecretType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createimagepullsecretdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SecretType { + case "VAULT": + mm := CreateVaultImagePullSecretDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BASIC": + mm := CreateBasicImagePullSecretDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetRegistryEndpoint returns RegistryEndpoint +func (m createimagepullsecretdetails) GetRegistryEndpoint() *string { + return m.RegistryEndpoint +} + +func (m createimagepullsecretdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createimagepullsecretdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateImagePullSecretDetailsSecretTypeEnum Enum with underlying type: string +type CreateImagePullSecretDetailsSecretTypeEnum string + +// Set of constants representing the allowable values for CreateImagePullSecretDetailsSecretTypeEnum +const ( + CreateImagePullSecretDetailsSecretTypeBasic CreateImagePullSecretDetailsSecretTypeEnum = "BASIC" + CreateImagePullSecretDetailsSecretTypeVault CreateImagePullSecretDetailsSecretTypeEnum = "VAULT" +) + +var mappingCreateImagePullSecretDetailsSecretTypeEnum = map[string]CreateImagePullSecretDetailsSecretTypeEnum{ + "BASIC": CreateImagePullSecretDetailsSecretTypeBasic, + "VAULT": CreateImagePullSecretDetailsSecretTypeVault, +} + +var mappingCreateImagePullSecretDetailsSecretTypeEnumLowerCase = map[string]CreateImagePullSecretDetailsSecretTypeEnum{ + "basic": CreateImagePullSecretDetailsSecretTypeBasic, + "vault": CreateImagePullSecretDetailsSecretTypeVault, +} + +// GetCreateImagePullSecretDetailsSecretTypeEnumValues Enumerates the set of values for CreateImagePullSecretDetailsSecretTypeEnum +func GetCreateImagePullSecretDetailsSecretTypeEnumValues() []CreateImagePullSecretDetailsSecretTypeEnum { + values := make([]CreateImagePullSecretDetailsSecretTypeEnum, 0) + for _, v := range mappingCreateImagePullSecretDetailsSecretTypeEnum { + values = append(values, v) + } + return values +} + +// GetCreateImagePullSecretDetailsSecretTypeEnumStringValues Enumerates the set of values in String for CreateImagePullSecretDetailsSecretTypeEnum +func GetCreateImagePullSecretDetailsSecretTypeEnumStringValues() []string { + return []string{ + "BASIC", + "VAULT", + } +} + +// GetMappingCreateImagePullSecretDetailsSecretTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateImagePullSecretDetailsSecretTypeEnum(val string) (CreateImagePullSecretDetailsSecretTypeEnum, bool) { + enum, ok := mappingCreateImagePullSecretDetailsSecretTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/create_vault_image_pull_secret_details.go b/containerinstances/create_vault_image_pull_secret_details.go new file mode 100644 index 0000000000..a7f4c88cc9 --- /dev/null +++ b/containerinstances/create_vault_image_pull_secret_details.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateVaultImagePullSecretDetails A CreateVaultImagePullSecretDetails is a ImagePullSecret which accepts secretId as credentials information. +// **Sample Format for username and password in Vault Secret** +// ``` +// { +// "username": "xxxxxxxxxx", +// "password": "xxxxxxxxxx" +// } +// ``` +type CreateVaultImagePullSecretDetails struct { + + // The registry endpoint of the container image. + RegistryEndpoint *string `mandatory:"true" json:"registryEndpoint"` + + // The OCID of the secret for registry credentials. + SecretId *string `mandatory:"true" json:"secretId"` +} + +//GetRegistryEndpoint returns RegistryEndpoint +func (m CreateVaultImagePullSecretDetails) GetRegistryEndpoint() *string { + return m.RegistryEndpoint +} + +func (m CreateVaultImagePullSecretDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateVaultImagePullSecretDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateVaultImagePullSecretDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateVaultImagePullSecretDetails CreateVaultImagePullSecretDetails + s := struct { + DiscriminatorParam string `json:"secretType"` + MarshalTypeCreateVaultImagePullSecretDetails + }{ + "VAULT", + (MarshalTypeCreateVaultImagePullSecretDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/create_volume_mount_details.go b/containerinstances/create_volume_mount_details.go new file mode 100644 index 0000000000..abd133a044 --- /dev/null +++ b/containerinstances/create_volume_mount_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateVolumeMountDetails Define the mapping from volume to a mount path in container. +type CreateVolumeMountDetails struct { + + // mountPath describes the volume access path. + MountPath *string `mandatory:"true" json:"mountPath"` + + // The name of the volume. + VolumeName *string `mandatory:"true" json:"volumeName"` + + // specifies a sub-path inside the referenced volume instead of its root + SubPath *string `mandatory:"false" json:"subPath"` + + // Whether the volume was mounted in read-only mode. Defaults to false if not specified. + IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + + // If there is more than 1 partitions in the volume, this is the number of partition which be referenced. + // Here is a example: + // Number Start End Size File system Name Flags + // 1 1049kB 106MB 105MB fat16 EFI System Partition boot, esp + // 2 106MB 1180MB 1074MB xfs + // 3 1180MB 50.0GB 48.8GB lvm + Partition *int `mandatory:"false" json:"partition"` +} + +func (m CreateVolumeMountDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateVolumeMountDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/delete_container_instance_request_response.go b/containerinstances/delete_container_instance_request_response.go new file mode 100644 index 0000000000..60c5e399cb --- /dev/null +++ b/containerinstances/delete_container_instance_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteContainerInstanceRequest wrapper for the DeleteContainerInstance operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/DeleteContainerInstance.go.html to see an example of how to use DeleteContainerInstanceRequest. +type DeleteContainerInstanceRequest struct { + + // The system-generated unique identifier for the ContainerInstance. + ContainerInstanceId *string `mandatory:"true" contributesTo:"path" name:"containerInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteContainerInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteContainerInstanceRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteContainerInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteContainerInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteContainerInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteContainerInstanceResponse wrapper for the DeleteContainerInstance operation +type DeleteContainerInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteContainerInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteContainerInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/get_container_instance_request_response.go b/containerinstances/get_container_instance_request_response.go new file mode 100644 index 0000000000..e1696d0a08 --- /dev/null +++ b/containerinstances/get_container_instance_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetContainerInstanceRequest wrapper for the GetContainerInstance operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/GetContainerInstance.go.html to see an example of how to use GetContainerInstanceRequest. +type GetContainerInstanceRequest struct { + + // The system-generated unique identifier for the ContainerInstance. + ContainerInstanceId *string `mandatory:"true" contributesTo:"path" name:"containerInstanceId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetContainerInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetContainerInstanceRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetContainerInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetContainerInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetContainerInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetContainerInstanceResponse wrapper for the GetContainerInstance operation +type GetContainerInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ContainerInstance instance + ContainerInstance `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetContainerInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetContainerInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/get_container_request_response.go b/containerinstances/get_container_request_response.go new file mode 100644 index 0000000000..d09017010f --- /dev/null +++ b/containerinstances/get_container_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetContainerRequest wrapper for the GetContainer operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/GetContainer.go.html to see an example of how to use GetContainerRequest. +type GetContainerRequest struct { + + // The unique identifier for the Container. + ContainerId *string `mandatory:"true" contributesTo:"path" name:"containerId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetContainerRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetContainerRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetContainerRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetContainerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetContainerRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetContainerResponse wrapper for the GetContainer operation +type GetContainerResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Container instance + Container `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetContainerResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetContainerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/get_work_request_request_response.go b/containerinstances/get_work_request_request_response.go new file mode 100644 index 0000000000..d225b484bd --- /dev/null +++ b/containerinstances/get_work_request_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/health_check_http_header.go b/containerinstances/health_check_http_header.go new file mode 100644 index 0000000000..dccf2cf69e --- /dev/null +++ b/containerinstances/health_check_http_header.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HealthCheckHttpHeader Container Http headers for Http health check. +type HealthCheckHttpHeader struct { + + // Container Http header Key. + Name *string `mandatory:"true" json:"name"` + + // Container Http header value. + Value *string `mandatory:"true" json:"value"` +} + +func (m HealthCheckHttpHeader) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HealthCheckHttpHeader) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/image_pull_secret.go b/containerinstances/image_pull_secret.go new file mode 100644 index 0000000000..e4088fa729 --- /dev/null +++ b/containerinstances/image_pull_secret.go @@ -0,0 +1,132 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ImagePullSecret The image pull secrets for accessing private registry to pull images for containers +type ImagePullSecret interface { + + // The registry endpoint of the container image. + GetRegistryEndpoint() *string +} + +type imagepullsecret struct { + JsonData []byte + RegistryEndpoint *string `mandatory:"true" json:"registryEndpoint"` + SecretType string `json:"secretType"` +} + +// UnmarshalJSON unmarshals json +func (m *imagepullsecret) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerimagepullsecret imagepullsecret + s := struct { + Model Unmarshalerimagepullsecret + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.RegistryEndpoint = s.Model.RegistryEndpoint + m.SecretType = s.Model.SecretType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *imagepullsecret) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SecretType { + case "VAULT": + mm := VaultImagePullSecret{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BASIC": + mm := BasicImagePullSecret{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetRegistryEndpoint returns RegistryEndpoint +func (m imagepullsecret) GetRegistryEndpoint() *string { + return m.RegistryEndpoint +} + +func (m imagepullsecret) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m imagepullsecret) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ImagePullSecretSecretTypeEnum Enum with underlying type: string +type ImagePullSecretSecretTypeEnum string + +// Set of constants representing the allowable values for ImagePullSecretSecretTypeEnum +const ( + ImagePullSecretSecretTypeBasic ImagePullSecretSecretTypeEnum = "BASIC" + ImagePullSecretSecretTypeVault ImagePullSecretSecretTypeEnum = "VAULT" +) + +var mappingImagePullSecretSecretTypeEnum = map[string]ImagePullSecretSecretTypeEnum{ + "BASIC": ImagePullSecretSecretTypeBasic, + "VAULT": ImagePullSecretSecretTypeVault, +} + +var mappingImagePullSecretSecretTypeEnumLowerCase = map[string]ImagePullSecretSecretTypeEnum{ + "basic": ImagePullSecretSecretTypeBasic, + "vault": ImagePullSecretSecretTypeVault, +} + +// GetImagePullSecretSecretTypeEnumValues Enumerates the set of values for ImagePullSecretSecretTypeEnum +func GetImagePullSecretSecretTypeEnumValues() []ImagePullSecretSecretTypeEnum { + values := make([]ImagePullSecretSecretTypeEnum, 0) + for _, v := range mappingImagePullSecretSecretTypeEnum { + values = append(values, v) + } + return values +} + +// GetImagePullSecretSecretTypeEnumStringValues Enumerates the set of values in String for ImagePullSecretSecretTypeEnum +func GetImagePullSecretSecretTypeEnumStringValues() []string { + return []string{ + "BASIC", + "VAULT", + } +} + +// GetMappingImagePullSecretSecretTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingImagePullSecretSecretTypeEnum(val string) (ImagePullSecretSecretTypeEnum, bool) { + enum, ok := mappingImagePullSecretSecretTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/list_container_instance_shapes_request_response.go b/containerinstances/list_container_instance_shapes_request_response.go new file mode 100644 index 0000000000..2ad41f183d --- /dev/null +++ b/containerinstances/list_container_instance_shapes_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListContainerInstanceShapesRequest wrapper for the ListContainerInstanceShapes operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListContainerInstanceShapes.go.html to see an example of how to use ListContainerInstanceShapesRequest. +type ListContainerInstanceShapesRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The name of the availability domain. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListContainerInstanceShapesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListContainerInstanceShapesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListContainerInstanceShapesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListContainerInstanceShapesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListContainerInstanceShapesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListContainerInstanceShapesResponse wrapper for the ListContainerInstanceShapes operation +type ListContainerInstanceShapesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ContainerInstanceShapeCollection instances + ContainerInstanceShapeCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListContainerInstanceShapesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListContainerInstanceShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/list_container_instances_request_response.go b/containerinstances/list_container_instances_request_response.go new file mode 100644 index 0000000000..2f4e3d7954 --- /dev/null +++ b/containerinstances/list_container_instances_request_response.go @@ -0,0 +1,210 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListContainerInstancesRequest wrapper for the ListContainerInstances operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListContainerInstances.go.html to see an example of how to use ListContainerInstancesRequest. +type ListContainerInstancesRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources whose lifecycleState matches the given lifecycleState. + LifecycleState ContainerInstanceLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The name of the availability domain. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListContainerInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListContainerInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListContainerInstancesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListContainerInstancesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListContainerInstancesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListContainerInstancesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListContainerInstancesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingContainerInstanceLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetContainerInstanceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListContainerInstancesSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListContainerInstancesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListContainerInstancesSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListContainerInstancesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListContainerInstancesResponse wrapper for the ListContainerInstances operation +type ListContainerInstancesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ContainerInstanceCollection instances + ContainerInstanceCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListContainerInstancesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListContainerInstancesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListContainerInstancesSortOrderEnum Enum with underlying type: string +type ListContainerInstancesSortOrderEnum string + +// Set of constants representing the allowable values for ListContainerInstancesSortOrderEnum +const ( + ListContainerInstancesSortOrderAsc ListContainerInstancesSortOrderEnum = "ASC" + ListContainerInstancesSortOrderDesc ListContainerInstancesSortOrderEnum = "DESC" +) + +var mappingListContainerInstancesSortOrderEnum = map[string]ListContainerInstancesSortOrderEnum{ + "ASC": ListContainerInstancesSortOrderAsc, + "DESC": ListContainerInstancesSortOrderDesc, +} + +var mappingListContainerInstancesSortOrderEnumLowerCase = map[string]ListContainerInstancesSortOrderEnum{ + "asc": ListContainerInstancesSortOrderAsc, + "desc": ListContainerInstancesSortOrderDesc, +} + +// GetListContainerInstancesSortOrderEnumValues Enumerates the set of values for ListContainerInstancesSortOrderEnum +func GetListContainerInstancesSortOrderEnumValues() []ListContainerInstancesSortOrderEnum { + values := make([]ListContainerInstancesSortOrderEnum, 0) + for _, v := range mappingListContainerInstancesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListContainerInstancesSortOrderEnumStringValues Enumerates the set of values in String for ListContainerInstancesSortOrderEnum +func GetListContainerInstancesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListContainerInstancesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListContainerInstancesSortOrderEnum(val string) (ListContainerInstancesSortOrderEnum, bool) { + enum, ok := mappingListContainerInstancesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListContainerInstancesSortByEnum Enum with underlying type: string +type ListContainerInstancesSortByEnum string + +// Set of constants representing the allowable values for ListContainerInstancesSortByEnum +const ( + ListContainerInstancesSortByTimecreated ListContainerInstancesSortByEnum = "timeCreated" + ListContainerInstancesSortByDisplayname ListContainerInstancesSortByEnum = "displayName" +) + +var mappingListContainerInstancesSortByEnum = map[string]ListContainerInstancesSortByEnum{ + "timeCreated": ListContainerInstancesSortByTimecreated, + "displayName": ListContainerInstancesSortByDisplayname, +} + +var mappingListContainerInstancesSortByEnumLowerCase = map[string]ListContainerInstancesSortByEnum{ + "timecreated": ListContainerInstancesSortByTimecreated, + "displayname": ListContainerInstancesSortByDisplayname, +} + +// GetListContainerInstancesSortByEnumValues Enumerates the set of values for ListContainerInstancesSortByEnum +func GetListContainerInstancesSortByEnumValues() []ListContainerInstancesSortByEnum { + values := make([]ListContainerInstancesSortByEnum, 0) + for _, v := range mappingListContainerInstancesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListContainerInstancesSortByEnumStringValues Enumerates the set of values in String for ListContainerInstancesSortByEnum +func GetListContainerInstancesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListContainerInstancesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListContainerInstancesSortByEnum(val string) (ListContainerInstancesSortByEnum, bool) { + enum, ok := mappingListContainerInstancesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/list_containers_request_response.go b/containerinstances/list_containers_request_response.go new file mode 100644 index 0000000000..d8add7d179 --- /dev/null +++ b/containerinstances/list_containers_request_response.go @@ -0,0 +1,213 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListContainersRequest wrapper for the ListContainers operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListContainers.go.html to see an example of how to use ListContainersRequest. +type ListContainersRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources whose lifecycleState matches the given lifecycleState. + LifecycleState ContainerLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // unique ContainerInstance identifier + ContainerInstanceId *string `mandatory:"false" contributesTo:"query" name:"containerInstanceId"` + + // The name of the availability domain. + // Example: `Uocm:PHX-AD-1` + AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListContainersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. + SortBy ListContainersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListContainersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListContainersRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListContainersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListContainersRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListContainersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingContainerLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetContainerLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListContainersSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListContainersSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListContainersSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListContainersSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListContainersResponse wrapper for the ListContainers operation +type ListContainersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ContainerCollection instances + ContainerCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListContainersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListContainersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListContainersSortOrderEnum Enum with underlying type: string +type ListContainersSortOrderEnum string + +// Set of constants representing the allowable values for ListContainersSortOrderEnum +const ( + ListContainersSortOrderAsc ListContainersSortOrderEnum = "ASC" + ListContainersSortOrderDesc ListContainersSortOrderEnum = "DESC" +) + +var mappingListContainersSortOrderEnum = map[string]ListContainersSortOrderEnum{ + "ASC": ListContainersSortOrderAsc, + "DESC": ListContainersSortOrderDesc, +} + +var mappingListContainersSortOrderEnumLowerCase = map[string]ListContainersSortOrderEnum{ + "asc": ListContainersSortOrderAsc, + "desc": ListContainersSortOrderDesc, +} + +// GetListContainersSortOrderEnumValues Enumerates the set of values for ListContainersSortOrderEnum +func GetListContainersSortOrderEnumValues() []ListContainersSortOrderEnum { + values := make([]ListContainersSortOrderEnum, 0) + for _, v := range mappingListContainersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListContainersSortOrderEnumStringValues Enumerates the set of values in String for ListContainersSortOrderEnum +func GetListContainersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListContainersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListContainersSortOrderEnum(val string) (ListContainersSortOrderEnum, bool) { + enum, ok := mappingListContainersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListContainersSortByEnum Enum with underlying type: string +type ListContainersSortByEnum string + +// Set of constants representing the allowable values for ListContainersSortByEnum +const ( + ListContainersSortByTimecreated ListContainersSortByEnum = "timeCreated" + ListContainersSortByDisplayname ListContainersSortByEnum = "displayName" +) + +var mappingListContainersSortByEnum = map[string]ListContainersSortByEnum{ + "timeCreated": ListContainersSortByTimecreated, + "displayName": ListContainersSortByDisplayname, +} + +var mappingListContainersSortByEnumLowerCase = map[string]ListContainersSortByEnum{ + "timecreated": ListContainersSortByTimecreated, + "displayname": ListContainersSortByDisplayname, +} + +// GetListContainersSortByEnumValues Enumerates the set of values for ListContainersSortByEnum +func GetListContainersSortByEnumValues() []ListContainersSortByEnum { + values := make([]ListContainersSortByEnum, 0) + for _, v := range mappingListContainersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListContainersSortByEnumStringValues Enumerates the set of values in String for ListContainersSortByEnum +func GetListContainersSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListContainersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListContainersSortByEnum(val string) (ListContainersSortByEnum, bool) { + enum, ok := mappingListContainersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/list_work_request_errors_request_response.go b/containerinstances/list_work_request_errors_request_response.go new file mode 100644 index 0000000000..11274d1d7d --- /dev/null +++ b/containerinstances/list_work_request_errors_request_response.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/list_work_request_logs_request_response.go b/containerinstances/list_work_request_logs_request_response.go new file mode 100644 index 0000000000..72af375004 --- /dev/null +++ b/containerinstances/list_work_request_logs_request_response.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/list_work_requests_request_response.go b/containerinstances/list_work_requests_request_response.go new file mode 100644 index 0000000000..5aae9a3b17 --- /dev/null +++ b/containerinstances/list_work_requests_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The ID of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/operation_status.go b/containerinstances/operation_status.go new file mode 100644 index 0000000000..f73c184401 --- /dev/null +++ b/containerinstances/operation_status.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/operation_type.go b/containerinstances/operation_type.go new file mode 100644 index 0000000000..f57aff7b2a --- /dev/null +++ b/containerinstances/operation_type.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypeCreateContainerInstance OperationTypeEnum = "CREATE_CONTAINER_INSTANCE" + OperationTypeUpdateContainerInstance OperationTypeEnum = "UPDATE_CONTAINER_INSTANCE" + OperationTypeDeleteContainerInstance OperationTypeEnum = "DELETE_CONTAINER_INSTANCE" + OperationTypeMoveContainerInstance OperationTypeEnum = "MOVE_CONTAINER_INSTANCE" + OperationTypeStartContainerInstance OperationTypeEnum = "START_CONTAINER_INSTANCE" + OperationTypeStopContainerInstance OperationTypeEnum = "STOP_CONTAINER_INSTANCE" + OperationTypeRestartContainerInstance OperationTypeEnum = "RESTART_CONTAINER_INSTANCE" + OperationTypeUpdateContainer OperationTypeEnum = "UPDATE_CONTAINER" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "CREATE_CONTAINER_INSTANCE": OperationTypeCreateContainerInstance, + "UPDATE_CONTAINER_INSTANCE": OperationTypeUpdateContainerInstance, + "DELETE_CONTAINER_INSTANCE": OperationTypeDeleteContainerInstance, + "MOVE_CONTAINER_INSTANCE": OperationTypeMoveContainerInstance, + "START_CONTAINER_INSTANCE": OperationTypeStartContainerInstance, + "STOP_CONTAINER_INSTANCE": OperationTypeStopContainerInstance, + "RESTART_CONTAINER_INSTANCE": OperationTypeRestartContainerInstance, + "UPDATE_CONTAINER": OperationTypeUpdateContainer, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "create_container_instance": OperationTypeCreateContainerInstance, + "update_container_instance": OperationTypeUpdateContainerInstance, + "delete_container_instance": OperationTypeDeleteContainerInstance, + "move_container_instance": OperationTypeMoveContainerInstance, + "start_container_instance": OperationTypeStartContainerInstance, + "stop_container_instance": OperationTypeStopContainerInstance, + "restart_container_instance": OperationTypeRestartContainerInstance, + "update_container": OperationTypeUpdateContainer, +} + +// GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum +func GetOperationTypeEnumValues() []OperationTypeEnum { + values := make([]OperationTypeEnum, 0) + for _, v := range mappingOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypeEnumStringValues Enumerates the set of values in String for OperationTypeEnum +func GetOperationTypeEnumStringValues() []string { + return []string{ + "CREATE_CONTAINER_INSTANCE", + "UPDATE_CONTAINER_INSTANCE", + "DELETE_CONTAINER_INSTANCE", + "MOVE_CONTAINER_INSTANCE", + "START_CONTAINER_INSTANCE", + "STOP_CONTAINER_INSTANCE", + "RESTART_CONTAINER_INSTANCE", + "UPDATE_CONTAINER", + } +} + +// GetMappingOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypeEnum(val string) (OperationTypeEnum, bool) { + enum, ok := mappingOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/restart_container_instance_request_response.go b/containerinstances/restart_container_instance_request_response.go new file mode 100644 index 0000000000..208f85a8bd --- /dev/null +++ b/containerinstances/restart_container_instance_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RestartContainerInstanceRequest wrapper for the RestartContainerInstance operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/RestartContainerInstance.go.html to see an example of how to use RestartContainerInstanceRequest. +type RestartContainerInstanceRequest struct { + + // The system-generated unique identifier for the ContainerInstance. + ContainerInstanceId *string `mandatory:"true" contributesTo:"path" name:"containerInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RestartContainerInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RestartContainerInstanceRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request RestartContainerInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RestartContainerInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request RestartContainerInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RestartContainerInstanceResponse wrapper for the RestartContainerInstance operation +type RestartContainerInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RestartContainerInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RestartContainerInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/retrieve_logs_request_response.go b/containerinstances/retrieve_logs_request_response.go new file mode 100644 index 0000000000..126abc67da --- /dev/null +++ b/containerinstances/retrieve_logs_request_response.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// RetrieveLogsRequest wrapper for the RetrieveLogs operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/RetrieveLogs.go.html to see an example of how to use RetrieveLogsRequest. +type RetrieveLogsRequest struct { + + // The unique identifier for the Container. + ContainerId *string `mandatory:"true" contributesTo:"path" name:"containerId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RetrieveLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RetrieveLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request RetrieveLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RetrieveLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request RetrieveLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RetrieveLogsResponse wrapper for the RetrieveLogs operation +type RetrieveLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RetrieveLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RetrieveLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/shape_memory_options.go b/containerinstances/shape_memory_options.go new file mode 100644 index 0000000000..6f8c128c9f --- /dev/null +++ b/containerinstances/shape_memory_options.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShapeMemoryOptions For a flexible shape, the amount of memory available for instances that use this shape. +type ShapeMemoryOptions struct { + + // The minimum amount of memory, in gigabytes. + MinInGBs *float32 `mandatory:"true" json:"minInGBs"` + + // The maximum amount of memory, in gigabytes. + MaxInGBs *float32 `mandatory:"true" json:"maxInGBs"` + + // The default amount of memory per OCPU available for this shape, in gigabytes. + DefaultPerOcpuInGBs *float32 `mandatory:"true" json:"defaultPerOcpuInGBs"` + + // The minimum amount of memory per OCPU available for this shape, in gigabytes. + MinPerOcpuInGBs *float32 `mandatory:"true" json:"minPerOcpuInGBs"` + + // The maximum amount of memory per OCPU available for this shape, in gigabytes. + MaxPerOcpuInGBs *float32 `mandatory:"true" json:"maxPerOcpuInGBs"` +} + +func (m ShapeMemoryOptions) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ShapeMemoryOptions) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/shape_networking_bandwidth_options.go b/containerinstances/shape_networking_bandwidth_options.go new file mode 100644 index 0000000000..8d5d89eb0c --- /dev/null +++ b/containerinstances/shape_networking_bandwidth_options.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShapeNetworkingBandwidthOptions For a flexible shape, the amount of networking bandwidth available for instances that use this shape. +type ShapeNetworkingBandwidthOptions struct { + + // The minimum amount of networking bandwidth, in gigabits per second. + MinInGbps *float32 `mandatory:"true" json:"minInGbps"` + + // The maximum amount of networking bandwidth, in gigabits per second. + MaxInGbps *float32 `mandatory:"true" json:"maxInGbps"` + + // The default amount of networking bandwidth per OCPU, in gigabits per second. + DefaultPerOcpuInGbps *float32 `mandatory:"true" json:"defaultPerOcpuInGbps"` +} + +func (m ShapeNetworkingBandwidthOptions) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ShapeNetworkingBandwidthOptions) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/shape_ocpu_options.go b/containerinstances/shape_ocpu_options.go new file mode 100644 index 0000000000..f550829f5f --- /dev/null +++ b/containerinstances/shape_ocpu_options.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShapeOcpuOptions For a flexible shape, the number of OCPUs available for instances that use this shape. +type ShapeOcpuOptions struct { + + // The minimum number of OCPUs. + Min *float32 `mandatory:"true" json:"min"` + + // The maximum number of OCPUs. + Max *float32 `mandatory:"true" json:"max"` +} + +func (m ShapeOcpuOptions) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ShapeOcpuOptions) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/sort_order.go b/containerinstances/sort_order.go new file mode 100644 index 0000000000..0d2bbd6a17 --- /dev/null +++ b/containerinstances/sort_order.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "strings" +) + +// SortOrderEnum Enum with underlying type: string +type SortOrderEnum string + +// Set of constants representing the allowable values for SortOrderEnum +const ( + SortOrderAsc SortOrderEnum = "ASC" + SortOrderDesc SortOrderEnum = "DESC" +) + +var mappingSortOrderEnum = map[string]SortOrderEnum{ + "ASC": SortOrderAsc, + "DESC": SortOrderDesc, +} + +var mappingSortOrderEnumLowerCase = map[string]SortOrderEnum{ + "asc": SortOrderAsc, + "desc": SortOrderDesc, +} + +// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum +func GetSortOrderEnumValues() []SortOrderEnum { + values := make([]SortOrderEnum, 0) + for _, v := range mappingSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSortOrderEnumStringValues Enumerates the set of values in String for SortOrderEnum +func GetSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrderEnum(val string) (SortOrderEnum, bool) { + enum, ok := mappingSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/containerinstances/start_container_instance_request_response.go b/containerinstances/start_container_instance_request_response.go new file mode 100644 index 0000000000..6728c2fe2d --- /dev/null +++ b/containerinstances/start_container_instance_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// StartContainerInstanceRequest wrapper for the StartContainerInstance operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/StartContainerInstance.go.html to see an example of how to use StartContainerInstanceRequest. +type StartContainerInstanceRequest struct { + + // The system-generated unique identifier for the ContainerInstance. + ContainerInstanceId *string `mandatory:"true" contributesTo:"path" name:"containerInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StartContainerInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StartContainerInstanceRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request StartContainerInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StartContainerInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request StartContainerInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StartContainerInstanceResponse wrapper for the StartContainerInstance operation +type StartContainerInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StartContainerInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StartContainerInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/stop_container_instance_request_response.go b/containerinstances/stop_container_instance_request_response.go new file mode 100644 index 0000000000..5b9e6a1290 --- /dev/null +++ b/containerinstances/stop_container_instance_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// StopContainerInstanceRequest wrapper for the StopContainerInstance operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/StopContainerInstance.go.html to see an example of how to use StopContainerInstanceRequest. +type StopContainerInstanceRequest struct { + + // The system-generated unique identifier for the ContainerInstance. + ContainerInstanceId *string `mandatory:"true" contributesTo:"path" name:"containerInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request StopContainerInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StopContainerInstanceRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request StopContainerInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StopContainerInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request StopContainerInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StopContainerInstanceResponse wrapper for the StopContainerInstance operation +type StopContainerInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StopContainerInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StopContainerInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/update_container_details.go b/containerinstances/update_container_details.go new file mode 100644 index 0000000000..1a443218d0 --- /dev/null +++ b/containerinstances/update_container_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerDetails The information to be updated. +type UpdateContainerDetails struct { + + // Display name for the Container. There are no guarantees of uniqueness + // for this name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateContainerDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/update_container_instance_details.go b/containerinstances/update_container_instance_details.go new file mode 100644 index 0000000000..c782c9d1cf --- /dev/null +++ b/containerinstances/update_container_instance_details.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateContainerInstanceDetails The information to be updated. +type UpdateContainerInstanceDetails struct { + + // ContainerInstance Identifier + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateContainerInstanceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateContainerInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/update_container_instance_request_response.go b/containerinstances/update_container_instance_request_response.go new file mode 100644 index 0000000000..b71137712c --- /dev/null +++ b/containerinstances/update_container_instance_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateContainerInstanceRequest wrapper for the UpdateContainerInstance operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/UpdateContainerInstance.go.html to see an example of how to use UpdateContainerInstanceRequest. +type UpdateContainerInstanceRequest struct { + + // The system-generated unique identifier for the ContainerInstance. + ContainerInstanceId *string `mandatory:"true" contributesTo:"path" name:"containerInstanceId"` + + // The information to be updated. + UpdateContainerInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateContainerInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateContainerInstanceRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateContainerInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateContainerInstanceRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateContainerInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateContainerInstanceResponse wrapper for the UpdateContainerInstance operation +type UpdateContainerInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateContainerInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateContainerInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/update_container_request_response.go b/containerinstances/update_container_request_response.go new file mode 100644 index 0000000000..0c8b91ba52 --- /dev/null +++ b/containerinstances/update_container_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateContainerRequest wrapper for the UpdateContainer operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerinstances/UpdateContainer.go.html to see an example of how to use UpdateContainerRequest. +type UpdateContainerRequest struct { + + // The unique identifier for the Container. + ContainerId *string `mandatory:"true" contributesTo:"path" name:"containerId"` + + // The information to be updated. + UpdateContainerDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateContainerRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateContainerRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateContainerRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateContainerRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateContainerRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateContainerResponse wrapper for the UpdateContainer operation +type UpdateContainerResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateContainerResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateContainerResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/containerinstances/vault_image_pull_secret.go b/containerinstances/vault_image_pull_secret.go new file mode 100644 index 0000000000..0df163e040 --- /dev/null +++ b/containerinstances/vault_image_pull_secret.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VaultImagePullSecret A VaultImagePullSecret is a ImagePullSecret which accepts secretId as credentials information. +type VaultImagePullSecret struct { + + // The registry endpoint of the container image. + RegistryEndpoint *string `mandatory:"true" json:"registryEndpoint"` + + // The OCID of the secret for registry credentials. + SecretId *string `mandatory:"true" json:"secretId"` +} + +//GetRegistryEndpoint returns RegistryEndpoint +func (m VaultImagePullSecret) GetRegistryEndpoint() *string { + return m.RegistryEndpoint +} + +func (m VaultImagePullSecret) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VaultImagePullSecret) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m VaultImagePullSecret) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVaultImagePullSecret VaultImagePullSecret + s := struct { + DiscriminatorParam string `json:"secretType"` + MarshalTypeVaultImagePullSecret + }{ + "VAULT", + (MarshalTypeVaultImagePullSecret)(m), + } + + return json.Marshal(&s) +} diff --git a/containerinstances/volume_mount.go b/containerinstances/volume_mount.go new file mode 100644 index 0000000000..731de5de70 --- /dev/null +++ b/containerinstances/volume_mount.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VolumeMount Define the mapping from volume to a mount path in container. +type VolumeMount struct { + + // mountPath describes the volume access path. + MountPath *string `mandatory:"true" json:"mountPath"` + + // The name of the volume. + VolumeName *string `mandatory:"true" json:"volumeName"` + + // specifies a sub-path inside the referenced volume instead of its root + SubPath *string `mandatory:"false" json:"subPath"` + + // Whether the volume was mounted in read-only mode. Defaults to false if not specified. + IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` + + // If there is more than 1 partitions in the volume, this is the number of partition which be referenced. + // Here is a example: + // Number Start End Size File system Name Flags + // 1 1049kB 106MB 105MB fat16 EFI System Partition boot, esp + // 2 106MB 1180MB 1074MB xfs + // 3 1180MB 50.0GB 48.8GB lvm + Partition *int `mandatory:"false" json:"partition"` +} + +func (m VolumeMount) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VolumeMount) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request.go b/containerinstances/work_request.go new file mode 100644 index 0000000000..e0825a10f5 --- /dev/null +++ b/containerinstances/work_request.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest A description of workrequest status +type WorkRequest struct { + + // Type of the work request + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The id of the work request. + Id *string `mandatory:"true" json:"id"` + + // The ocid of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Percentage of the request completed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the request was started, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), + // section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the object was finished, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request_error.go b/containerinstances/work_request_error.go new file mode 100644 index 0000000000..18bf5dd52a --- /dev/null +++ b/containerinstances/work_request_error.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestError An error encountered while executing a work request. +type WorkRequestError struct { + + // A machine-usable code for the error that occured. Error codes are listed on + // (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm) + Code *string `mandatory:"true" json:"code"` + + // A human readable description of the issue encountered. + Message *string `mandatory:"true" json:"message"` + + // The time the error occured. An RFC3339 formatted datetime string. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request_error_collection.go b/containerinstances/work_request_error_collection.go new file mode 100644 index 0000000000..0df88274f9 --- /dev/null +++ b/containerinstances/work_request_error_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection Results of a workRequestError search. Contains both WorkRequestError items and other information, such as metadata. +type WorkRequestErrorCollection struct { + + // List of workRequestError objects. + Items []WorkRequestError `mandatory:"true" json:"items"` +} + +func (m WorkRequestErrorCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestErrorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request_log_entry.go b/containerinstances/work_request_log_entry.go new file mode 100644 index 0000000000..ffd3f6f4c9 --- /dev/null +++ b/containerinstances/work_request_log_entry.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntry A log message from the execution of a work request. +type WorkRequestLogEntry struct { + + // Human-readable log message. + Message *string `mandatory:"true" json:"message"` + + // The time the log message was written. An RFC3339 formatted datetime string + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntry) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request_log_entry_collection.go b/containerinstances/work_request_log_entry_collection.go new file mode 100644 index 0000000000..b53b79e532 --- /dev/null +++ b/containerinstances/work_request_log_entry_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection Results of a workRequestLog search. Contains both workRequestLog items and other information, such as metadata. +type WorkRequestLogEntryCollection struct { + + // List of workRequestLogEntries. + Items []WorkRequestLogEntry `mandatory:"true" json:"items"` +} + +func (m WorkRequestLogEntryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request_resource.go b/containerinstances/work_request_resource.go new file mode 100644 index 0000000000..2b0fab642f --- /dev/null +++ b/containerinstances/work_request_resource.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestResource A resource created or operated on by a work request. +type WorkRequestResource struct { + + // The resource type the work request affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource is affected by the work tracked in the work request. + // A resource being created, updated, or deleted will remain in the IN_PROGRESS state until + // work is complete for that resource at which point it will transition to CREATED, UPDATED, + // or DELETED, respectively. + ActionType ActionTypeEnum `mandatory:"true" json:"actionType"` + + // The identifier of the resource the work request affects. + Identifier *string `mandatory:"true" json:"identifier"` + + // The URI path that the user can do a GET on to access the resource metadata + EntityUri *string `mandatory:"false" json:"entityUri"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request_summary.go b/containerinstances/work_request_summary.go new file mode 100644 index 0000000000..130853799f --- /dev/null +++ b/containerinstances/work_request_summary.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary A summary of the status of a work request. +type WorkRequestSummary struct { + + // Type of the work request + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The id of the work request. + Id *string `mandatory:"true" json:"id"` + + // The ocid of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Percentage of the request completed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the request was started, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), + // section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the object was finished, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/containerinstances/work_request_summary_collection.go b/containerinstances/work_request_summary_collection.go new file mode 100644 index 0000000000..66928232b5 --- /dev/null +++ b/containerinstances/work_request_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Instance API +// +// A description of the Container Instance API +// + +package containerinstances + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection Results of a workRequest search. Contains both WorkRequest items and other information, such as metadata. +type WorkRequestSummaryCollection struct { + + // List of workRequestSummary objects. + Items []WorkRequestSummary `mandatory:"true" json:"items"` +} + +func (m WorkRequestSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/datasafe/alerts_update_details.go b/datasafe/alerts_update_details.go new file mode 100644 index 0000000000..e0dcff64ab --- /dev/null +++ b/datasafe/alerts_update_details.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Safe API +// +// APIs for using Oracle Data Safe. +// + +package datasafe + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AlertsUpdateDetails Details to perform update all action on alerts. +type AlertsUpdateDetails struct { + + // The status of the alert. + Status AlertStatusEnum `mandatory:"true" json:"status"` + + // The OCID of the compartment that contains the alerts. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the target associated with alerts. + TargetId *string `mandatory:"false" json:"targetId"` +} + +func (m AlertsUpdateDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AlertsUpdateDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAlertStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetAlertStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/datasafe/alerts_update_request_response.go b/datasafe/alerts_update_request_response.go new file mode 100644 index 0000000000..1f4b111e66 --- /dev/null +++ b/datasafe/alerts_update_request_response.go @@ -0,0 +1,157 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datasafe + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AlertsUpdateRequest wrapper for the AlertsUpdate operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/AlertsUpdate.go.html to see an example of how to use AlertsUpdateRequest. +type AlertsUpdateRequest struct { + + // Details to update alerts within a given compartment. + AlertsUpdateDetails `contributesTo:"body"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the if-match parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Default is false. + // When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. + // Setting this to ACCESSIBLE returns only those compartments for which the + // user has INSPECT permissions directly or indirectly (permissions can be on a + // resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed. + AccessLevel AlertsUpdateAccessLevelEnum `mandatory:"false" contributesTo:"query" name:"accessLevel" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AlertsUpdateRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AlertsUpdateRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request AlertsUpdateRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AlertsUpdateRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request AlertsUpdateRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAlertsUpdateAccessLevelEnum(string(request.AccessLevel)); !ok && request.AccessLevel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AccessLevel: %s. Supported values are: %s.", request.AccessLevel, strings.Join(GetAlertsUpdateAccessLevelEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AlertsUpdateResponse wrapper for the AlertsUpdate operation +type AlertsUpdateResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request. Use GetWorkRequest with this OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response AlertsUpdateResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AlertsUpdateResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// AlertsUpdateAccessLevelEnum Enum with underlying type: string +type AlertsUpdateAccessLevelEnum string + +// Set of constants representing the allowable values for AlertsUpdateAccessLevelEnum +const ( + AlertsUpdateAccessLevelRestricted AlertsUpdateAccessLevelEnum = "RESTRICTED" + AlertsUpdateAccessLevelAccessible AlertsUpdateAccessLevelEnum = "ACCESSIBLE" +) + +var mappingAlertsUpdateAccessLevelEnum = map[string]AlertsUpdateAccessLevelEnum{ + "RESTRICTED": AlertsUpdateAccessLevelRestricted, + "ACCESSIBLE": AlertsUpdateAccessLevelAccessible, +} + +var mappingAlertsUpdateAccessLevelEnumLowerCase = map[string]AlertsUpdateAccessLevelEnum{ + "restricted": AlertsUpdateAccessLevelRestricted, + "accessible": AlertsUpdateAccessLevelAccessible, +} + +// GetAlertsUpdateAccessLevelEnumValues Enumerates the set of values for AlertsUpdateAccessLevelEnum +func GetAlertsUpdateAccessLevelEnumValues() []AlertsUpdateAccessLevelEnum { + values := make([]AlertsUpdateAccessLevelEnum, 0) + for _, v := range mappingAlertsUpdateAccessLevelEnum { + values = append(values, v) + } + return values +} + +// GetAlertsUpdateAccessLevelEnumStringValues Enumerates the set of values in String for AlertsUpdateAccessLevelEnum +func GetAlertsUpdateAccessLevelEnumStringValues() []string { + return []string{ + "RESTRICTED", + "ACCESSIBLE", + } +} + +// GetMappingAlertsUpdateAccessLevelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAlertsUpdateAccessLevelEnum(val string) (AlertsUpdateAccessLevelEnum, bool) { + enum, ok := mappingAlertsUpdateAccessLevelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datasafe/audit_event_summary.go b/datasafe/audit_event_summary.go index c849b2c5a2..4b2d18d9c3 100644 --- a/datasafe/audit_event_summary.go +++ b/datasafe/audit_event_summary.go @@ -84,7 +84,7 @@ type AuditEventSummary struct { // IP address of the host from which the session was spawned. ClientIp *string `mandatory:"false" json:"clientIp"` - // The OCID of the audit trail that generated this audit event. + // The OCID of the audit trail that generated this audit event. To be noted, this field has been deprecated. AuditTrailId *string `mandatory:"false" json:"auditTrailId"` // The action taken for this audit event. diff --git a/datasafe/audit_trail.go b/datasafe/audit_trail.go index 10665c92ab..828caa8293 100644 --- a/datasafe/audit_trail.go +++ b/datasafe/audit_trail.go @@ -69,6 +69,10 @@ type AuditTrail struct { // The OCID of the workrequest for audit trail which collects audit records. WorkRequestId *string `mandatory:"false" json:"workRequestId"` + // The date and time until which the audit events are collected from target database by Data Safe audit trail + // collection process, in the format defined by RFC3339. + TimeLastCollected *common.SDKTime `mandatory:"false" json:"timeLastCollected"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff --git a/datasafe/audit_trail_status.go b/datasafe/audit_trail_status.go index 368e9ff393..08b98ddd80 100644 --- a/datasafe/audit_trail_status.go +++ b/datasafe/audit_trail_status.go @@ -18,36 +18,45 @@ type AuditTrailStatusEnum string // Set of constants representing the allowable values for AuditTrailStatusEnum const ( - AuditTrailStatusStarting AuditTrailStatusEnum = "STARTING" - AuditTrailStatusCollecting AuditTrailStatusEnum = "COLLECTING" - AuditTrailStatusRecovering AuditTrailStatusEnum = "RECOVERING" - AuditTrailStatusIdle AuditTrailStatusEnum = "IDLE" - AuditTrailStatusStopping AuditTrailStatusEnum = "STOPPING" - AuditTrailStatusStopped AuditTrailStatusEnum = "STOPPED" - AuditTrailStatusResuming AuditTrailStatusEnum = "RESUMING" - AuditTrailStatusRetrying AuditTrailStatusEnum = "RETRYING" + AuditTrailStatusStarting AuditTrailStatusEnum = "STARTING" + AuditTrailStatusCollecting AuditTrailStatusEnum = "COLLECTING" + AuditTrailStatusRecovering AuditTrailStatusEnum = "RECOVERING" + AuditTrailStatusIdle AuditTrailStatusEnum = "IDLE" + AuditTrailStatusStopping AuditTrailStatusEnum = "STOPPING" + AuditTrailStatusStopped AuditTrailStatusEnum = "STOPPED" + AuditTrailStatusResuming AuditTrailStatusEnum = "RESUMING" + AuditTrailStatusRetrying AuditTrailStatusEnum = "RETRYING" + AuditTrailStatusNotStarted AuditTrailStatusEnum = "NOT_STARTED" + AuditTrailStatusStoppedNeedsAttn AuditTrailStatusEnum = "STOPPED_NEEDS_ATTN" + AuditTrailStatusStoppedFailed AuditTrailStatusEnum = "STOPPED_FAILED" ) var mappingAuditTrailStatusEnum = map[string]AuditTrailStatusEnum{ - "STARTING": AuditTrailStatusStarting, - "COLLECTING": AuditTrailStatusCollecting, - "RECOVERING": AuditTrailStatusRecovering, - "IDLE": AuditTrailStatusIdle, - "STOPPING": AuditTrailStatusStopping, - "STOPPED": AuditTrailStatusStopped, - "RESUMING": AuditTrailStatusResuming, - "RETRYING": AuditTrailStatusRetrying, + "STARTING": AuditTrailStatusStarting, + "COLLECTING": AuditTrailStatusCollecting, + "RECOVERING": AuditTrailStatusRecovering, + "IDLE": AuditTrailStatusIdle, + "STOPPING": AuditTrailStatusStopping, + "STOPPED": AuditTrailStatusStopped, + "RESUMING": AuditTrailStatusResuming, + "RETRYING": AuditTrailStatusRetrying, + "NOT_STARTED": AuditTrailStatusNotStarted, + "STOPPED_NEEDS_ATTN": AuditTrailStatusStoppedNeedsAttn, + "STOPPED_FAILED": AuditTrailStatusStoppedFailed, } var mappingAuditTrailStatusEnumLowerCase = map[string]AuditTrailStatusEnum{ - "starting": AuditTrailStatusStarting, - "collecting": AuditTrailStatusCollecting, - "recovering": AuditTrailStatusRecovering, - "idle": AuditTrailStatusIdle, - "stopping": AuditTrailStatusStopping, - "stopped": AuditTrailStatusStopped, - "resuming": AuditTrailStatusResuming, - "retrying": AuditTrailStatusRetrying, + "starting": AuditTrailStatusStarting, + "collecting": AuditTrailStatusCollecting, + "recovering": AuditTrailStatusRecovering, + "idle": AuditTrailStatusIdle, + "stopping": AuditTrailStatusStopping, + "stopped": AuditTrailStatusStopped, + "resuming": AuditTrailStatusResuming, + "retrying": AuditTrailStatusRetrying, + "not_started": AuditTrailStatusNotStarted, + "stopped_needs_attn": AuditTrailStatusStoppedNeedsAttn, + "stopped_failed": AuditTrailStatusStoppedFailed, } // GetAuditTrailStatusEnumValues Enumerates the set of values for AuditTrailStatusEnum @@ -70,6 +79,9 @@ func GetAuditTrailStatusEnumStringValues() []string { "STOPPED", "RESUMING", "RETRYING", + "NOT_STARTED", + "STOPPED_NEEDS_ATTN", + "STOPPED_FAILED", } } diff --git a/datasafe/autonomous_database_details.go b/datasafe/autonomous_database_details.go index d4205f1631..dbce53584c 100644 --- a/datasafe/autonomous_database_details.go +++ b/datasafe/autonomous_database_details.go @@ -20,7 +20,7 @@ import ( type AutonomousDatabaseDetails struct { // The OCID of the autonomous database registered as a target database in Data Safe. - AutonomousDatabaseId *string `mandatory:"false" json:"autonomousDatabaseId"` + AutonomousDatabaseId *string `mandatory:"true" json:"autonomousDatabaseId"` // The infrastructure type the database is running on. InfrastructureType InfrastructureTypeEnum `mandatory:"true" json:"infrastructureType"` diff --git a/datasafe/database_cloud_service_details.go b/datasafe/database_cloud_service_details.go index 9109a0386a..8f662c98ca 100644 --- a/datasafe/database_cloud_service_details.go +++ b/datasafe/database_cloud_service_details.go @@ -19,14 +19,17 @@ import ( // DatabaseCloudServiceDetails The details of the Oracle Database Cloud Service to be registered as a target database in Data Safe. type DatabaseCloudServiceDetails struct { + // The database service name. + ServiceName *string `mandatory:"true" json:"serviceName"` + // The OCID of the VM cluster in which the database is running. VmClusterId *string `mandatory:"false" json:"vmClusterId"` // The OCID of the cloud database system registered as a target database in Data Safe. DbSystemId *string `mandatory:"false" json:"dbSystemId"` - // The database service name. - ServiceName *string `mandatory:"false" json:"serviceName"` + // The port number of the database listener. + ListenerPort *int `mandatory:"false" json:"listenerPort"` // The infrastructure type the database is running on. InfrastructureType InfrastructureTypeEnum `mandatory:"true" json:"infrastructureType"` diff --git a/datasafe/datasafe_client.go b/datasafe/datasafe_client.go index 171d6e76a5..078df22297 100644 --- a/datasafe/datasafe_client.go +++ b/datasafe/datasafe_client.go @@ -211,6 +211,69 @@ func (client DataSafeClient) addMaskingColumnsFromSdm(ctx context.Context, reque return response, err } +// AlertsUpdate Update alerts within a given compartment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/AlertsUpdate.go.html to see an example of how to use AlertsUpdate API. +// A default retry strategy applies to this operation AlertsUpdate() +func (client DataSafeClient) AlertsUpdate(ctx context.Context, request AlertsUpdateRequest) (response AlertsUpdateResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.alertsUpdate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AlertsUpdateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AlertsUpdateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AlertsUpdateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AlertsUpdateResponse") + } + return +} + +// alertsUpdate implements the OCIOperation interface (enables retrying operations) +func (client DataSafeClient) alertsUpdate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/alerts/actions/updateAll", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AlertsUpdateResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-safe/20181201/Alert/AlertsUpdate" + err = common.PostProcessServiceError(err, "DataSafe", "AlertsUpdate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ApplyDiscoveryJobResults Applies the results of a discovery job to the specified sensitive data model. Note that the plannedAction attribute // of discovery results is used for processing them. You should first use PatchDiscoveryJobResults to set the plannedAction // attribute of the discovery results you want to process. ApplyDiscoveryJobResults automatically reads the plannedAction @@ -7634,6 +7697,8 @@ func (client DataSafeClient) listDataSafePrivateEndpoints(ctx context.Context, r } // ListDiscoveryAnalytics Gets consolidated discovery analytics data based on the specified query parameters. +// If CompartmentIdInSubtreeQueryParam is specified as true, the behaviour +// is equivalent to accessLevel "ACCESSIBLE" by default. // // See also // @@ -8043,6 +8108,8 @@ func (client DataSafeClient) listMaskedColumns(ctx context.Context, request comm } // ListMaskingAnalytics Gets consolidated masking analytics data based on the specified query parameters. +// If CompartmentIdInSubtreeQueryParam is specified as true, the behaviour +// is equivalent to accessLevel "ACCESSIBLE" by default. // // See also // @@ -9714,6 +9781,64 @@ func (client DataSafeClient) patchSensitiveColumns(ctx context.Context, request return response, err } +// PatchTargetAlertPolicyAssociation Creates new target-alert policy associations that will be applied on target. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/PatchTargetAlertPolicyAssociation.go.html to see an example of how to use PatchTargetAlertPolicyAssociation API. +// A default retry strategy applies to this operation PatchTargetAlertPolicyAssociation() +func (client DataSafeClient) PatchTargetAlertPolicyAssociation(ctx context.Context, request PatchTargetAlertPolicyAssociationRequest) (response PatchTargetAlertPolicyAssociationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.patchTargetAlertPolicyAssociation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PatchTargetAlertPolicyAssociationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PatchTargetAlertPolicyAssociationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PatchTargetAlertPolicyAssociationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PatchTargetAlertPolicyAssociationResponse") + } + return +} + +// patchTargetAlertPolicyAssociation implements the OCIOperation interface (enables retrying operations) +func (client DataSafeClient) patchTargetAlertPolicyAssociation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPatch, "/targetAlertPolicyAssociations", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PatchTargetAlertPolicyAssociationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-safe/20181201/TargetAlertPolicyAssociation/PatchTargetAlertPolicyAssociation" + err = common.PostProcessServiceError(err, "DataSafe", "PatchTargetAlertPolicyAssociation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ProvisionAuditPolicy Provision audit policy. // // See also @@ -9906,6 +10031,69 @@ func (client DataSafeClient) refreshUserAssessment(ctx context.Context, request return response, err } +// RemoveScheduleReport Deletes schedule of a PDF or XLS report. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/RemoveScheduleReport.go.html to see an example of how to use RemoveScheduleReport API. +// A default retry strategy applies to this operation RemoveScheduleReport() +func (client DataSafeClient) RemoveScheduleReport(ctx context.Context, request RemoveScheduleReportRequest) (response RemoveScheduleReportResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeScheduleReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveScheduleReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveScheduleReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveScheduleReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveScheduleReportResponse") + } + return +} + +// removeScheduleReport implements the OCIOperation interface (enables retrying operations) +func (client DataSafeClient) removeScheduleReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/reportDefinitions/{reportDefinitionId}/actions/removeScheduleReport", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveScheduleReportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-safe/20181201/ReportDefinition/RemoveScheduleReport" + err = common.PostProcessServiceError(err, "DataSafe", "RemoveScheduleReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ResumeAuditTrail Resumes the specified audit trail once it got stopped. // // See also @@ -10090,6 +10278,69 @@ func (client DataSafeClient) retrieveAuditPolicies(ctx context.Context, request return response, err } +// ScheduleReport Schedules a PDF or XLS report based on parameters and report definition. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/ScheduleReport.go.html to see an example of how to use ScheduleReport API. +// A default retry strategy applies to this operation ScheduleReport() +func (client DataSafeClient) ScheduleReport(ctx context.Context, request ScheduleReportRequest) (response ScheduleReportResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.scheduleReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ScheduleReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ScheduleReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ScheduleReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ScheduleReportResponse") + } + return +} + +// scheduleReport implements the OCIOperation interface (enables retrying operations) +func (client DataSafeClient) scheduleReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/reportDefinitions/{reportDefinitionId}/actions/scheduleReport", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ScheduleReportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-safe/20181201/ReportDefinition/ScheduleReport" + err = common.PostProcessServiceError(err, "DataSafe", "ScheduleReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // SetSecurityAssessmentBaseline Sets the saved security assessment as the baseline in the compartment where the the specified assessment resides. The security assessment needs to be of type 'SAVED'. // // See also diff --git a/datasafe/discovery_job_result.go b/datasafe/discovery_job_result.go index 9924422996..c76c92b4bf 100644 --- a/datasafe/discovery_job_result.go +++ b/datasafe/discovery_job_result.go @@ -64,6 +64,9 @@ type DiscoveryJobResult struct { // operation to track whether the discovery result has already been processed and applied to the sensitive data model. IsResultApplied *bool `mandatory:"true" json:"isResultApplied"` + // The OCID of the discovery job. + DiscoveryJobId *string `mandatory:"true" json:"discoveryJobId"` + // The unique key that identifies the sensitive column represented by the discovery result. SensitiveColumnkey *string `mandatory:"false" json:"sensitiveColumnkey"` diff --git a/datasafe/discovery_job_result_summary.go b/datasafe/discovery_job_result_summary.go index 7581bd7dc3..620f5f1254 100644 --- a/datasafe/discovery_job_result_summary.go +++ b/datasafe/discovery_job_result_summary.go @@ -61,6 +61,9 @@ type DiscoveryJobResultSummary struct { // operation to track whether the discovery result has already been processed and applied to the sensitive data model. IsResultApplied *bool `mandatory:"true" json:"isResultApplied"` + // The OCID of the discovery job. + DiscoveryJobId *string `mandatory:"true" json:"discoveryJobId"` + // The unique key that identifies the sensitive column represented by the discovery result. SensitiveColumnkey *string `mandatory:"false" json:"sensitiveColumnkey"` diff --git a/datasafe/download_masking_log_details.go b/datasafe/download_masking_log_details.go index 0e11bb07cb..51a02d03c6 100644 --- a/datasafe/download_masking_log_details.go +++ b/datasafe/download_masking_log_details.go @@ -20,6 +20,9 @@ type DownloadMaskingLogDetails struct { // The OCID of the target database for which the masking log is to be downloaded. TargetId *string `mandatory:"false" json:"targetId"` + + // The OCID of the masking work request that resulted in this masking log. + MaskingWorkRequestId *string `mandatory:"false" json:"maskingWorkRequestId"` } func (m DownloadMaskingLogDetails) String() string { diff --git a/datasafe/installed_database_details.go b/datasafe/installed_database_details.go index e540226fa6..84d06c38b2 100644 --- a/datasafe/installed_database_details.go +++ b/datasafe/installed_database_details.go @@ -19,18 +19,18 @@ import ( // InstalledDatabaseDetails The details of the database running on-premises or on a compute instance. type InstalledDatabaseDetails struct { + // The port number of the database listener. + ListenerPort *int `mandatory:"true" json:"listenerPort"` + + // The service name of the database registered as target database. + ServiceName *string `mandatory:"true" json:"serviceName"` + // The OCID of the compute instance on which the database is running. InstanceId *string `mandatory:"false" json:"instanceId"` // The list of database host IP Addresses. Fully qualified domain names can be used if connectionType is 'ONPREM_CONNECTOR'. IpAddresses []string `mandatory:"false" json:"ipAddresses"` - // The port number of the database listener. - ListenerPort *int `mandatory:"false" json:"listenerPort"` - - // The service name of the database registered as target database. - ServiceName *string `mandatory:"false" json:"serviceName"` - // The infrastructure type the database is running on. InfrastructureType InfrastructureTypeEnum `mandatory:"true" json:"infrastructureType"` } diff --git a/datasafe/list_audit_trails_request_response.go b/datasafe/list_audit_trails_request_response.go index 3801dec17f..5658f061e6 100644 --- a/datasafe/list_audit_trails_request_response.go +++ b/datasafe/list_audit_trails_request_response.go @@ -255,36 +255,45 @@ type ListAuditTrailsStatusEnum string // Set of constants representing the allowable values for ListAuditTrailsStatusEnum const ( - ListAuditTrailsStatusStarting ListAuditTrailsStatusEnum = "STARTING" - ListAuditTrailsStatusCollecting ListAuditTrailsStatusEnum = "COLLECTING" - ListAuditTrailsStatusRecovering ListAuditTrailsStatusEnum = "RECOVERING" - ListAuditTrailsStatusIdle ListAuditTrailsStatusEnum = "IDLE" - ListAuditTrailsStatusStopping ListAuditTrailsStatusEnum = "STOPPING" - ListAuditTrailsStatusStopped ListAuditTrailsStatusEnum = "STOPPED" - ListAuditTrailsStatusResuming ListAuditTrailsStatusEnum = "RESUMING" - ListAuditTrailsStatusRetrying ListAuditTrailsStatusEnum = "RETRYING" + ListAuditTrailsStatusStarting ListAuditTrailsStatusEnum = "STARTING" + ListAuditTrailsStatusCollecting ListAuditTrailsStatusEnum = "COLLECTING" + ListAuditTrailsStatusRecovering ListAuditTrailsStatusEnum = "RECOVERING" + ListAuditTrailsStatusIdle ListAuditTrailsStatusEnum = "IDLE" + ListAuditTrailsStatusStopping ListAuditTrailsStatusEnum = "STOPPING" + ListAuditTrailsStatusStopped ListAuditTrailsStatusEnum = "STOPPED" + ListAuditTrailsStatusResuming ListAuditTrailsStatusEnum = "RESUMING" + ListAuditTrailsStatusRetrying ListAuditTrailsStatusEnum = "RETRYING" + ListAuditTrailsStatusNotStarted ListAuditTrailsStatusEnum = "NOT_STARTED" + ListAuditTrailsStatusStoppedNeedsAttn ListAuditTrailsStatusEnum = "STOPPED_NEEDS_ATTN" + ListAuditTrailsStatusStoppedFailed ListAuditTrailsStatusEnum = "STOPPED_FAILED" ) var mappingListAuditTrailsStatusEnum = map[string]ListAuditTrailsStatusEnum{ - "STARTING": ListAuditTrailsStatusStarting, - "COLLECTING": ListAuditTrailsStatusCollecting, - "RECOVERING": ListAuditTrailsStatusRecovering, - "IDLE": ListAuditTrailsStatusIdle, - "STOPPING": ListAuditTrailsStatusStopping, - "STOPPED": ListAuditTrailsStatusStopped, - "RESUMING": ListAuditTrailsStatusResuming, - "RETRYING": ListAuditTrailsStatusRetrying, + "STARTING": ListAuditTrailsStatusStarting, + "COLLECTING": ListAuditTrailsStatusCollecting, + "RECOVERING": ListAuditTrailsStatusRecovering, + "IDLE": ListAuditTrailsStatusIdle, + "STOPPING": ListAuditTrailsStatusStopping, + "STOPPED": ListAuditTrailsStatusStopped, + "RESUMING": ListAuditTrailsStatusResuming, + "RETRYING": ListAuditTrailsStatusRetrying, + "NOT_STARTED": ListAuditTrailsStatusNotStarted, + "STOPPED_NEEDS_ATTN": ListAuditTrailsStatusStoppedNeedsAttn, + "STOPPED_FAILED": ListAuditTrailsStatusStoppedFailed, } var mappingListAuditTrailsStatusEnumLowerCase = map[string]ListAuditTrailsStatusEnum{ - "starting": ListAuditTrailsStatusStarting, - "collecting": ListAuditTrailsStatusCollecting, - "recovering": ListAuditTrailsStatusRecovering, - "idle": ListAuditTrailsStatusIdle, - "stopping": ListAuditTrailsStatusStopping, - "stopped": ListAuditTrailsStatusStopped, - "resuming": ListAuditTrailsStatusResuming, - "retrying": ListAuditTrailsStatusRetrying, + "starting": ListAuditTrailsStatusStarting, + "collecting": ListAuditTrailsStatusCollecting, + "recovering": ListAuditTrailsStatusRecovering, + "idle": ListAuditTrailsStatusIdle, + "stopping": ListAuditTrailsStatusStopping, + "stopped": ListAuditTrailsStatusStopped, + "resuming": ListAuditTrailsStatusResuming, + "retrying": ListAuditTrailsStatusRetrying, + "not_started": ListAuditTrailsStatusNotStarted, + "stopped_needs_attn": ListAuditTrailsStatusStoppedNeedsAttn, + "stopped_failed": ListAuditTrailsStatusStoppedFailed, } // GetListAuditTrailsStatusEnumValues Enumerates the set of values for ListAuditTrailsStatusEnum @@ -307,6 +316,9 @@ func GetListAuditTrailsStatusEnumStringValues() []string { "STOPPED", "RESUMING", "RETRYING", + "NOT_STARTED", + "STOPPED_NEEDS_ATTN", + "STOPPED_FAILED", } } diff --git a/datasafe/list_masking_columns_request_response.go b/datasafe/list_masking_columns_request_response.go index b7337cd092..7e8e1b99e1 100644 --- a/datasafe/list_masking_columns_request_response.go +++ b/datasafe/list_masking_columns_request_response.go @@ -241,18 +241,21 @@ const ( ListMaskingColumnsSortByTimecreated ListMaskingColumnsSortByEnum = "timeCreated" ListMaskingColumnsSortBySchemaname ListMaskingColumnsSortByEnum = "schemaName" ListMaskingColumnsSortByObjectname ListMaskingColumnsSortByEnum = "objectName" + ListMaskingColumnsSortByDatatype ListMaskingColumnsSortByEnum = "dataType" ) var mappingListMaskingColumnsSortByEnum = map[string]ListMaskingColumnsSortByEnum{ "timeCreated": ListMaskingColumnsSortByTimecreated, "schemaName": ListMaskingColumnsSortBySchemaname, "objectName": ListMaskingColumnsSortByObjectname, + "dataType": ListMaskingColumnsSortByDatatype, } var mappingListMaskingColumnsSortByEnumLowerCase = map[string]ListMaskingColumnsSortByEnum{ "timecreated": ListMaskingColumnsSortByTimecreated, "schemaname": ListMaskingColumnsSortBySchemaname, "objectname": ListMaskingColumnsSortByObjectname, + "datatype": ListMaskingColumnsSortByDatatype, } // GetListMaskingColumnsSortByEnumValues Enumerates the set of values for ListMaskingColumnsSortByEnum @@ -270,6 +273,7 @@ func GetListMaskingColumnsSortByEnumStringValues() []string { "timeCreated", "schemaName", "objectName", + "dataType", } } diff --git a/datasafe/list_on_prem_connectors_request_response.go b/datasafe/list_on_prem_connectors_request_response.go index 799d1fb95d..4f308c5a0b 100644 --- a/datasafe/list_on_prem_connectors_request_response.go +++ b/datasafe/list_on_prem_connectors_request_response.go @@ -141,33 +141,36 @@ type ListOnPremConnectorsOnPremConnectorLifecycleStateEnum string // Set of constants representing the allowable values for ListOnPremConnectorsOnPremConnectorLifecycleStateEnum const ( - ListOnPremConnectorsOnPremConnectorLifecycleStateCreating ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "CREATING" - ListOnPremConnectorsOnPremConnectorLifecycleStateUpdating ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "UPDATING" - ListOnPremConnectorsOnPremConnectorLifecycleStateActive ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "ACTIVE" - ListOnPremConnectorsOnPremConnectorLifecycleStateInactive ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "INACTIVE" - ListOnPremConnectorsOnPremConnectorLifecycleStateDeleting ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "DELETING" - ListOnPremConnectorsOnPremConnectorLifecycleStateDeleted ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "DELETED" - ListOnPremConnectorsOnPremConnectorLifecycleStateFailed ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "FAILED" + ListOnPremConnectorsOnPremConnectorLifecycleStateCreating ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "CREATING" + ListOnPremConnectorsOnPremConnectorLifecycleStateUpdating ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "UPDATING" + ListOnPremConnectorsOnPremConnectorLifecycleStateActive ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "ACTIVE" + ListOnPremConnectorsOnPremConnectorLifecycleStateInactive ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "INACTIVE" + ListOnPremConnectorsOnPremConnectorLifecycleStateDeleting ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "DELETING" + ListOnPremConnectorsOnPremConnectorLifecycleStateDeleted ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "DELETED" + ListOnPremConnectorsOnPremConnectorLifecycleStateFailed ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "FAILED" + ListOnPremConnectorsOnPremConnectorLifecycleStateNeedsAttention ListOnPremConnectorsOnPremConnectorLifecycleStateEnum = "NEEDS_ATTENTION" ) var mappingListOnPremConnectorsOnPremConnectorLifecycleStateEnum = map[string]ListOnPremConnectorsOnPremConnectorLifecycleStateEnum{ - "CREATING": ListOnPremConnectorsOnPremConnectorLifecycleStateCreating, - "UPDATING": ListOnPremConnectorsOnPremConnectorLifecycleStateUpdating, - "ACTIVE": ListOnPremConnectorsOnPremConnectorLifecycleStateActive, - "INACTIVE": ListOnPremConnectorsOnPremConnectorLifecycleStateInactive, - "DELETING": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleting, - "DELETED": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleted, - "FAILED": ListOnPremConnectorsOnPremConnectorLifecycleStateFailed, + "CREATING": ListOnPremConnectorsOnPremConnectorLifecycleStateCreating, + "UPDATING": ListOnPremConnectorsOnPremConnectorLifecycleStateUpdating, + "ACTIVE": ListOnPremConnectorsOnPremConnectorLifecycleStateActive, + "INACTIVE": ListOnPremConnectorsOnPremConnectorLifecycleStateInactive, + "DELETING": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleting, + "DELETED": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleted, + "FAILED": ListOnPremConnectorsOnPremConnectorLifecycleStateFailed, + "NEEDS_ATTENTION": ListOnPremConnectorsOnPremConnectorLifecycleStateNeedsAttention, } var mappingListOnPremConnectorsOnPremConnectorLifecycleStateEnumLowerCase = map[string]ListOnPremConnectorsOnPremConnectorLifecycleStateEnum{ - "creating": ListOnPremConnectorsOnPremConnectorLifecycleStateCreating, - "updating": ListOnPremConnectorsOnPremConnectorLifecycleStateUpdating, - "active": ListOnPremConnectorsOnPremConnectorLifecycleStateActive, - "inactive": ListOnPremConnectorsOnPremConnectorLifecycleStateInactive, - "deleting": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleting, - "deleted": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleted, - "failed": ListOnPremConnectorsOnPremConnectorLifecycleStateFailed, + "creating": ListOnPremConnectorsOnPremConnectorLifecycleStateCreating, + "updating": ListOnPremConnectorsOnPremConnectorLifecycleStateUpdating, + "active": ListOnPremConnectorsOnPremConnectorLifecycleStateActive, + "inactive": ListOnPremConnectorsOnPremConnectorLifecycleStateInactive, + "deleting": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleting, + "deleted": ListOnPremConnectorsOnPremConnectorLifecycleStateDeleted, + "failed": ListOnPremConnectorsOnPremConnectorLifecycleStateFailed, + "needs_attention": ListOnPremConnectorsOnPremConnectorLifecycleStateNeedsAttention, } // GetListOnPremConnectorsOnPremConnectorLifecycleStateEnumValues Enumerates the set of values for ListOnPremConnectorsOnPremConnectorLifecycleStateEnum @@ -189,6 +192,7 @@ func GetListOnPremConnectorsOnPremConnectorLifecycleStateEnumStringValues() []st "DELETING", "DELETED", "FAILED", + "NEEDS_ATTENTION", } } diff --git a/datasafe/list_reports_request_response.go b/datasafe/list_reports_request_response.go index c666f401e3..2a6dc3ffb5 100644 --- a/datasafe/list_reports_request_response.go +++ b/datasafe/list_reports_request_response.go @@ -55,6 +55,9 @@ type ListReportsRequest struct { // An optional filter to return only resources that match the specified lifecycle state. LifecycleState ListReportsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + // An optional filter to return only resources that match the specified type. + Type ListReportsTypeEnum `mandatory:"false" contributesTo:"query" name:"type" omitEmpty:"true"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata @@ -103,6 +106,9 @@ func (request ListReportsRequest) ValidateEnumValue() (bool, error) { if _, ok := GetMappingListReportsLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetListReportsLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingListReportsTypeEnum(string(request.Type)); !ok && request.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", request.Type, strings.Join(GetListReportsTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -301,3 +307,45 @@ func GetMappingListReportsLifecycleStateEnum(val string) (ListReportsLifecycleSt enum, ok := mappingListReportsLifecycleStateEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// ListReportsTypeEnum Enum with underlying type: string +type ListReportsTypeEnum string + +// Set of constants representing the allowable values for ListReportsTypeEnum +const ( + ListReportsTypeGenerated ListReportsTypeEnum = "GENERATED" + ListReportsTypeScheduled ListReportsTypeEnum = "SCHEDULED" +) + +var mappingListReportsTypeEnum = map[string]ListReportsTypeEnum{ + "GENERATED": ListReportsTypeGenerated, + "SCHEDULED": ListReportsTypeScheduled, +} + +var mappingListReportsTypeEnumLowerCase = map[string]ListReportsTypeEnum{ + "generated": ListReportsTypeGenerated, + "scheduled": ListReportsTypeScheduled, +} + +// GetListReportsTypeEnumValues Enumerates the set of values for ListReportsTypeEnum +func GetListReportsTypeEnumValues() []ListReportsTypeEnum { + values := make([]ListReportsTypeEnum, 0) + for _, v := range mappingListReportsTypeEnum { + values = append(values, v) + } + return values +} + +// GetListReportsTypeEnumStringValues Enumerates the set of values in String for ListReportsTypeEnum +func GetListReportsTypeEnumStringValues() []string { + return []string{ + "GENERATED", + "SCHEDULED", + } +} + +// GetMappingListReportsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListReportsTypeEnum(val string) (ListReportsTypeEnum, bool) { + enum, ok := mappingListReportsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datasafe/list_sensitive_columns_request_response.go b/datasafe/list_sensitive_columns_request_response.go index 80ad3c807a..3f575d3f93 100644 --- a/datasafe/list_sensitive_columns_request_response.go +++ b/datasafe/list_sensitive_columns_request_response.go @@ -439,6 +439,7 @@ const ( ListSensitiveColumnsSortBySchemaname ListSensitiveColumnsSortByEnum = "schemaName" ListSensitiveColumnsSortByObjectname ListSensitiveColumnsSortByEnum = "objectName" ListSensitiveColumnsSortByColumnname ListSensitiveColumnsSortByEnum = "columnName" + ListSensitiveColumnsSortByDatatype ListSensitiveColumnsSortByEnum = "dataType" ) var mappingListSensitiveColumnsSortByEnum = map[string]ListSensitiveColumnsSortByEnum{ @@ -446,6 +447,7 @@ var mappingListSensitiveColumnsSortByEnum = map[string]ListSensitiveColumnsSortB "schemaName": ListSensitiveColumnsSortBySchemaname, "objectName": ListSensitiveColumnsSortByObjectname, "columnName": ListSensitiveColumnsSortByColumnname, + "dataType": ListSensitiveColumnsSortByDatatype, } var mappingListSensitiveColumnsSortByEnumLowerCase = map[string]ListSensitiveColumnsSortByEnum{ @@ -453,6 +455,7 @@ var mappingListSensitiveColumnsSortByEnumLowerCase = map[string]ListSensitiveCol "schemaname": ListSensitiveColumnsSortBySchemaname, "objectname": ListSensitiveColumnsSortByObjectname, "columnname": ListSensitiveColumnsSortByColumnname, + "datatype": ListSensitiveColumnsSortByDatatype, } // GetListSensitiveColumnsSortByEnumValues Enumerates the set of values for ListSensitiveColumnsSortByEnum @@ -471,6 +474,7 @@ func GetListSensitiveColumnsSortByEnumStringValues() []string { "schemaName", "objectName", "columnName", + "dataType", } } diff --git a/datasafe/list_target_alert_policy_associations_request_response.go b/datasafe/list_target_alert_policy_associations_request_response.go index 1162f310ea..ad941aea95 100644 --- a/datasafe/list_target_alert_policy_associations_request_response.go +++ b/datasafe/list_target_alert_policy_associations_request_response.go @@ -42,9 +42,7 @@ type ListTargetAlertPolicyAssociationsRequest struct { // The sort order to use, either ascending (ASC) or descending (DESC). SortOrder ListTargetAlertPolicyAssociationsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` - // The field used for sorting. Only one sorting order (sortOrder) can be specified. - // The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending. - // The DISPLAYNAME sort order is case sensitive. + // The field to sort by. Only one sort order may be provided. SortBy ListTargetAlertPolicyAssociationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // Unique identifier for the request. @@ -265,18 +263,21 @@ type ListTargetAlertPolicyAssociationsSortByEnum string // Set of constants representing the allowable values for ListTargetAlertPolicyAssociationsSortByEnum const ( - ListTargetAlertPolicyAssociationsSortByTimecreated ListTargetAlertPolicyAssociationsSortByEnum = "TIMECREATED" ListTargetAlertPolicyAssociationsSortByDisplayname ListTargetAlertPolicyAssociationsSortByEnum = "DISPLAYNAME" + ListTargetAlertPolicyAssociationsSortByTimecreated ListTargetAlertPolicyAssociationsSortByEnum = "TIMECREATED" + ListTargetAlertPolicyAssociationsSortByTimeupdated ListTargetAlertPolicyAssociationsSortByEnum = "TIMEUPDATED" ) var mappingListTargetAlertPolicyAssociationsSortByEnum = map[string]ListTargetAlertPolicyAssociationsSortByEnum{ - "TIMECREATED": ListTargetAlertPolicyAssociationsSortByTimecreated, "DISPLAYNAME": ListTargetAlertPolicyAssociationsSortByDisplayname, + "TIMECREATED": ListTargetAlertPolicyAssociationsSortByTimecreated, + "TIMEUPDATED": ListTargetAlertPolicyAssociationsSortByTimeupdated, } var mappingListTargetAlertPolicyAssociationsSortByEnumLowerCase = map[string]ListTargetAlertPolicyAssociationsSortByEnum{ - "timecreated": ListTargetAlertPolicyAssociationsSortByTimecreated, "displayname": ListTargetAlertPolicyAssociationsSortByDisplayname, + "timecreated": ListTargetAlertPolicyAssociationsSortByTimecreated, + "timeupdated": ListTargetAlertPolicyAssociationsSortByTimeupdated, } // GetListTargetAlertPolicyAssociationsSortByEnumValues Enumerates the set of values for ListTargetAlertPolicyAssociationsSortByEnum @@ -291,8 +292,9 @@ func GetListTargetAlertPolicyAssociationsSortByEnumValues() []ListTargetAlertPol // GetListTargetAlertPolicyAssociationsSortByEnumStringValues Enumerates the set of values in String for ListTargetAlertPolicyAssociationsSortByEnum func GetListTargetAlertPolicyAssociationsSortByEnumStringValues() []string { return []string{ - "TIMECREATED", "DISPLAYNAME", + "TIMECREATED", + "TIMEUPDATED", } } diff --git a/datasafe/masking_report.go b/datasafe/masking_report.go index bf9c3c1d01..36d68c7903 100644 --- a/datasafe/masking_report.go +++ b/datasafe/masking_report.go @@ -54,6 +54,12 @@ type MaskingReport struct { // The date and time data masking finished, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339) TimeMaskingFinished *common.SDKTime `mandatory:"true" json:"timeMaskingFinished"` + + // The current state of the masking report. + LifecycleState MaskingLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the masking report was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m MaskingReport) String() string { @@ -65,6 +71,9 @@ func (m MaskingReport) String() string { // Not recommended for calling this function directly func (m MaskingReport) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingMaskingLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetMaskingLifecycleStateEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/datasafe/masking_report_summary.go b/datasafe/masking_report_summary.go index bf44587745..93ca5ddbfb 100644 --- a/datasafe/masking_report_summary.go +++ b/datasafe/masking_report_summary.go @@ -53,6 +53,12 @@ type MaskingReportSummary struct { // The date and time data masking finished, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339) TimeMaskingFinished *common.SDKTime `mandatory:"true" json:"timeMaskingFinished"` + + // The current state of the masking report. + LifecycleState MaskingLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the masking report was created, in the format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m MaskingReportSummary) String() string { @@ -64,6 +70,9 @@ func (m MaskingReportSummary) String() string { // Not recommended for calling this function directly func (m MaskingReportSummary) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingMaskingLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetMaskingLifecycleStateEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/datasafe/on_prem_connector_lifecycle_state.go b/datasafe/on_prem_connector_lifecycle_state.go index 3b0bfdc451..1023170290 100644 --- a/datasafe/on_prem_connector_lifecycle_state.go +++ b/datasafe/on_prem_connector_lifecycle_state.go @@ -18,33 +18,36 @@ type OnPremConnectorLifecycleStateEnum string // Set of constants representing the allowable values for OnPremConnectorLifecycleStateEnum const ( - OnPremConnectorLifecycleStateCreating OnPremConnectorLifecycleStateEnum = "CREATING" - OnPremConnectorLifecycleStateUpdating OnPremConnectorLifecycleStateEnum = "UPDATING" - OnPremConnectorLifecycleStateActive OnPremConnectorLifecycleStateEnum = "ACTIVE" - OnPremConnectorLifecycleStateInactive OnPremConnectorLifecycleStateEnum = "INACTIVE" - OnPremConnectorLifecycleStateDeleting OnPremConnectorLifecycleStateEnum = "DELETING" - OnPremConnectorLifecycleStateDeleted OnPremConnectorLifecycleStateEnum = "DELETED" - OnPremConnectorLifecycleStateFailed OnPremConnectorLifecycleStateEnum = "FAILED" + OnPremConnectorLifecycleStateCreating OnPremConnectorLifecycleStateEnum = "CREATING" + OnPremConnectorLifecycleStateUpdating OnPremConnectorLifecycleStateEnum = "UPDATING" + OnPremConnectorLifecycleStateActive OnPremConnectorLifecycleStateEnum = "ACTIVE" + OnPremConnectorLifecycleStateInactive OnPremConnectorLifecycleStateEnum = "INACTIVE" + OnPremConnectorLifecycleStateDeleting OnPremConnectorLifecycleStateEnum = "DELETING" + OnPremConnectorLifecycleStateDeleted OnPremConnectorLifecycleStateEnum = "DELETED" + OnPremConnectorLifecycleStateFailed OnPremConnectorLifecycleStateEnum = "FAILED" + OnPremConnectorLifecycleStateNeedsAttention OnPremConnectorLifecycleStateEnum = "NEEDS_ATTENTION" ) var mappingOnPremConnectorLifecycleStateEnum = map[string]OnPremConnectorLifecycleStateEnum{ - "CREATING": OnPremConnectorLifecycleStateCreating, - "UPDATING": OnPremConnectorLifecycleStateUpdating, - "ACTIVE": OnPremConnectorLifecycleStateActive, - "INACTIVE": OnPremConnectorLifecycleStateInactive, - "DELETING": OnPremConnectorLifecycleStateDeleting, - "DELETED": OnPremConnectorLifecycleStateDeleted, - "FAILED": OnPremConnectorLifecycleStateFailed, + "CREATING": OnPremConnectorLifecycleStateCreating, + "UPDATING": OnPremConnectorLifecycleStateUpdating, + "ACTIVE": OnPremConnectorLifecycleStateActive, + "INACTIVE": OnPremConnectorLifecycleStateInactive, + "DELETING": OnPremConnectorLifecycleStateDeleting, + "DELETED": OnPremConnectorLifecycleStateDeleted, + "FAILED": OnPremConnectorLifecycleStateFailed, + "NEEDS_ATTENTION": OnPremConnectorLifecycleStateNeedsAttention, } var mappingOnPremConnectorLifecycleStateEnumLowerCase = map[string]OnPremConnectorLifecycleStateEnum{ - "creating": OnPremConnectorLifecycleStateCreating, - "updating": OnPremConnectorLifecycleStateUpdating, - "active": OnPremConnectorLifecycleStateActive, - "inactive": OnPremConnectorLifecycleStateInactive, - "deleting": OnPremConnectorLifecycleStateDeleting, - "deleted": OnPremConnectorLifecycleStateDeleted, - "failed": OnPremConnectorLifecycleStateFailed, + "creating": OnPremConnectorLifecycleStateCreating, + "updating": OnPremConnectorLifecycleStateUpdating, + "active": OnPremConnectorLifecycleStateActive, + "inactive": OnPremConnectorLifecycleStateInactive, + "deleting": OnPremConnectorLifecycleStateDeleting, + "deleted": OnPremConnectorLifecycleStateDeleted, + "failed": OnPremConnectorLifecycleStateFailed, + "needs_attention": OnPremConnectorLifecycleStateNeedsAttention, } // GetOnPremConnectorLifecycleStateEnumValues Enumerates the set of values for OnPremConnectorLifecycleStateEnum @@ -66,6 +69,7 @@ func GetOnPremConnectorLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "NEEDS_ATTENTION", } } diff --git a/datasafe/on_premise_connector.go b/datasafe/on_premise_connector.go index 9251c7082d..ce8708c5a3 100644 --- a/datasafe/on_premise_connector.go +++ b/datasafe/on_premise_connector.go @@ -20,7 +20,7 @@ import ( type OnPremiseConnector struct { // The OCID of the on-premises connector. - OnPremConnectorId *string `mandatory:"false" json:"onPremConnectorId"` + OnPremConnectorId *string `mandatory:"true" json:"onPremConnectorId"` } func (m OnPremiseConnector) String() string { diff --git a/datasafe/patch_alerts_details.go b/datasafe/patch_alerts_details.go index f3aedfaf93..c0a426a414 100644 --- a/datasafe/patch_alerts_details.go +++ b/datasafe/patch_alerts_details.go @@ -20,7 +20,10 @@ import ( type PatchAlertsDetails struct { // Array of patch instructions. - Items []PatchInstruction `mandatory:"false" json:"items"` + Items []PatchInstruction `mandatory:"true" json:"items"` + + // The OCID of the compartment that contains the alerts. + CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m PatchAlertsDetails) String() string { @@ -42,7 +45,8 @@ func (m PatchAlertsDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *PatchAlertsDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Items []patchinstruction `json:"items"` + Items []patchinstruction `json:"items"` + CompartmentId *string `json:"compartmentId"` }{} e = json.Unmarshal(data, &model) @@ -63,5 +67,7 @@ func (m *PatchAlertsDetails) UnmarshalJSON(data []byte) (e error) { } } + m.CompartmentId = model.CompartmentId + return } diff --git a/datasafe/patch_alerts_request_response.go b/datasafe/patch_alerts_request_response.go index 51ccd1e418..00087d9137 100644 --- a/datasafe/patch_alerts_request_response.go +++ b/datasafe/patch_alerts_request_response.go @@ -31,6 +31,16 @@ type PatchAlertsRequest struct { // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + // Default is false. + // When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. + // Setting this to ACCESSIBLE returns only those compartments for which the + // user has INSPECT permissions directly or indirectly (permissions can be on a + // resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed. + AccessLevel PatchAlertsAccessLevelEnum `mandatory:"false" contributesTo:"query" name:"accessLevel" omitEmpty:"true"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata @@ -67,6 +77,9 @@ func (request PatchAlertsRequest) RetryPolicy() *common.RetryPolicy { // Not recommended for calling this function directly func (request PatchAlertsRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingPatchAlertsAccessLevelEnum(string(request.AccessLevel)); !ok && request.AccessLevel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AccessLevel: %s. Supported values are: %s.", request.AccessLevel, strings.Join(GetPatchAlertsAccessLevelEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -94,3 +107,45 @@ func (response PatchAlertsResponse) String() string { func (response PatchAlertsResponse) HTTPResponse() *http.Response { return response.RawResponse } + +// PatchAlertsAccessLevelEnum Enum with underlying type: string +type PatchAlertsAccessLevelEnum string + +// Set of constants representing the allowable values for PatchAlertsAccessLevelEnum +const ( + PatchAlertsAccessLevelRestricted PatchAlertsAccessLevelEnum = "RESTRICTED" + PatchAlertsAccessLevelAccessible PatchAlertsAccessLevelEnum = "ACCESSIBLE" +) + +var mappingPatchAlertsAccessLevelEnum = map[string]PatchAlertsAccessLevelEnum{ + "RESTRICTED": PatchAlertsAccessLevelRestricted, + "ACCESSIBLE": PatchAlertsAccessLevelAccessible, +} + +var mappingPatchAlertsAccessLevelEnumLowerCase = map[string]PatchAlertsAccessLevelEnum{ + "restricted": PatchAlertsAccessLevelRestricted, + "accessible": PatchAlertsAccessLevelAccessible, +} + +// GetPatchAlertsAccessLevelEnumValues Enumerates the set of values for PatchAlertsAccessLevelEnum +func GetPatchAlertsAccessLevelEnumValues() []PatchAlertsAccessLevelEnum { + values := make([]PatchAlertsAccessLevelEnum, 0) + for _, v := range mappingPatchAlertsAccessLevelEnum { + values = append(values, v) + } + return values +} + +// GetPatchAlertsAccessLevelEnumStringValues Enumerates the set of values in String for PatchAlertsAccessLevelEnum +func GetPatchAlertsAccessLevelEnumStringValues() []string { + return []string{ + "RESTRICTED", + "ACCESSIBLE", + } +} + +// GetMappingPatchAlertsAccessLevelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPatchAlertsAccessLevelEnum(val string) (PatchAlertsAccessLevelEnum, bool) { + enum, ok := mappingPatchAlertsAccessLevelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datasafe/patch_target_alert_policy_association_details.go b/datasafe/patch_target_alert_policy_association_details.go new file mode 100644 index 0000000000..a517ef4dfa --- /dev/null +++ b/datasafe/patch_target_alert_policy_association_details.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Safe API +// +// APIs for using Oracle Data Safe. +// + +package datasafe + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchTargetAlertPolicyAssociationDetails The details used to patch alert policy associations. +type PatchTargetAlertPolicyAssociationDetails struct { + + // An array of patch instructions. + Items []PatchInstruction `mandatory:"true" json:"items"` + + // The OCID of the compartment that contains the alerts. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m PatchTargetAlertPolicyAssociationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchTargetAlertPolicyAssociationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *PatchTargetAlertPolicyAssociationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []patchinstruction `json:"items"` + CompartmentId *string `json:"compartmentId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Items = make([]PatchInstruction, len(model.Items)) + for i, n := range model.Items { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Items[i] = nn.(PatchInstruction) + } else { + m.Items[i] = nil + } + } + + m.CompartmentId = model.CompartmentId + + return +} diff --git a/datasafe/patch_target_alert_policy_association_request_response.go b/datasafe/patch_target_alert_policy_association_request_response.go new file mode 100644 index 0000000000..71e83bd6ca --- /dev/null +++ b/datasafe/patch_target_alert_policy_association_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datasafe + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PatchTargetAlertPolicyAssociationRequest wrapper for the PatchTargetAlertPolicyAssociation operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/PatchTargetAlertPolicyAssociation.go.html to see an example of how to use PatchTargetAlertPolicyAssociationRequest. +type PatchTargetAlertPolicyAssociationRequest struct { + + // The details used to patch target-alert policy associations. + PatchTargetAlertPolicyAssociationDetails `contributesTo:"body"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the if-match parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PatchTargetAlertPolicyAssociationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PatchTargetAlertPolicyAssociationRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request PatchTargetAlertPolicyAssociationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PatchTargetAlertPolicyAssociationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request PatchTargetAlertPolicyAssociationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PatchTargetAlertPolicyAssociationResponse wrapper for the PatchTargetAlertPolicyAssociation operation +type PatchTargetAlertPolicyAssociationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request. Use GetWorkRequest with this OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PatchTargetAlertPolicyAssociationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PatchTargetAlertPolicyAssociationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/datasafe/private_endpoint.go b/datasafe/private_endpoint.go index 3b5922fb93..2633a46c89 100644 --- a/datasafe/private_endpoint.go +++ b/datasafe/private_endpoint.go @@ -20,7 +20,7 @@ import ( type PrivateEndpoint struct { // The OCID of the Data Safe private endpoint. - DatasafePrivateEndpointId *string `mandatory:"false" json:"datasafePrivateEndpointId"` + DatasafePrivateEndpointId *string `mandatory:"true" json:"datasafePrivateEndpointId"` } func (m PrivateEndpoint) String() string { diff --git a/datasafe/remove_schedule_report_request_response.go b/datasafe/remove_schedule_report_request_response.go new file mode 100644 index 0000000000..67e2818ea1 --- /dev/null +++ b/datasafe/remove_schedule_report_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datasafe + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveScheduleReportRequest wrapper for the RemoveScheduleReport operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/RemoveScheduleReport.go.html to see an example of how to use RemoveScheduleReportRequest. +type RemoveScheduleReportRequest struct { + + // Unique report definition identifier + ReportDefinitionId *string `mandatory:"true" contributesTo:"path" name:"reportDefinitionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the if-match parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveScheduleReportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveScheduleReportRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request RemoveScheduleReportRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveScheduleReportRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request RemoveScheduleReportRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveScheduleReportResponse wrapper for the RemoveScheduleReport operation +type RemoveScheduleReportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request. Use GetWorkRequest with this OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RemoveScheduleReportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveScheduleReportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/datasafe/report.go b/datasafe/report.go index 4678f02e3d..6df9a22b73 100644 --- a/datasafe/report.go +++ b/datasafe/report.go @@ -42,6 +42,9 @@ type Report struct { // Specifies the format of report to be excel or pdf MimeType ReportMimeTypeEnum `mandatory:"false" json:"mimeType,omitempty"` + // The type of the report. + Type ReportTypeEnum `mandatory:"false" json:"type,omitempty"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -71,6 +74,9 @@ func (m Report) ValidateEnumValue() (bool, error) { if _, ok := GetMappingReportMimeTypeEnum(string(m.MimeType)); !ok && m.MimeType != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MimeType: %s. Supported values are: %s.", m.MimeType, strings.Join(GetReportMimeTypeEnumStringValues(), ","))) } + if _, ok := GetMappingReportTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetReportTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/datasafe/report_definition.go b/datasafe/report_definition.go index 9535e1d37e..381735b3b9 100644 --- a/datasafe/report_definition.go +++ b/datasafe/report_definition.go @@ -69,6 +69,48 @@ type ReportDefinition struct { // An array of report summary objects in the order (left to right) displayed in the report. A report summary object stores all information about summary of report to be displayed, including the name displayed on UI, the display order, corresponding group by and count of values, summary visibility (if the summary is visible to user). Summary []Summary `mandatory:"false" json:"summary"` + // Schedule to generate the report periodically in the specified format: + // ; + // Allowed version strings - "v1" + // v1's version specific schedule - + // Each of the above fields potentially introduce constraints. A workrequest is created only + // when clock time satisfies all the constraints. Constraints introduced: + // 1. seconds = (So, the allowed range for is [0, 59]) + // 2. minutes = (So, the allowed range for is [0, 59]) + // 3. hours = (So, the allowed range for is [0, 23]) + // 4. can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) + // No constraint introduced when it is '*'. When not, day of week must equal the given value + // 5. can be either '*' (without quotes or a number between 1 and 28) + // No constraint introduced when it is '*'. When not, day of month must equal the given value + Schedule *string `mandatory:"false" json:"schedule"` + + // Specifies the format of report to be excel or pdf + ScheduledReportMimeType ReportDefinitionScheduledReportMimeTypeEnum `mandatory:"false" json:"scheduledReportMimeType,omitempty"` + + // Specifies the limit on number of rows in report. + ScheduledReportRowLimit *int `mandatory:"false" json:"scheduledReportRowLimit"` + + // The name of the report to be scheduled. + ScheduledReportName *string `mandatory:"false" json:"scheduledReportName"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment + // in which the scheduled resource should be created. + ScheduledReportCompartmentId *string `mandatory:"false" json:"scheduledReportCompartmentId"` + + // The time span of records in report to be scheduled. + // + // Allowed period strings - "H","D","M","Y" + // Each of the above fields potentially introduce constraints. A workRequest is created only + // when period-value satisfies all the constraints. Constraints introduced: + // 1. period = H (The allowed range for period-value is [1, 23]) + // 2. period = D (The allowed range for period-value is [1, 30]) + // 3. period = M (The allowed range for period-value is [1, 11]) + // 4. period = Y (The minimum period-value is 1) + RecordTimeSpan *string `mandatory:"false" json:"recordTimeSpan"` + + // The list of data protection regulations/standards used in the report that will help demonstrate compliance. + ComplianceStandards []string `mandatory:"false" json:"complianceStandards"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -101,6 +143,9 @@ func (m ReportDefinition) ValidateEnumValue() (bool, error) { if _, ok := GetMappingReportDefinitionDataSourceEnum(string(m.DataSource)); !ok && m.DataSource != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataSource: %s. Supported values are: %s.", m.DataSource, strings.Join(GetReportDefinitionDataSourceEnumStringValues(), ","))) } + if _, ok := GetMappingReportDefinitionScheduledReportMimeTypeEnum(string(m.ScheduledReportMimeType)); !ok && m.ScheduledReportMimeType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduledReportMimeType: %s. Supported values are: %s.", m.ScheduledReportMimeType, strings.Join(GetReportDefinitionScheduledReportMimeTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -152,3 +197,45 @@ func GetMappingReportDefinitionCategoryEnum(val string) (ReportDefinitionCategor enum, ok := mappingReportDefinitionCategoryEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// ReportDefinitionScheduledReportMimeTypeEnum Enum with underlying type: string +type ReportDefinitionScheduledReportMimeTypeEnum string + +// Set of constants representing the allowable values for ReportDefinitionScheduledReportMimeTypeEnum +const ( + ReportDefinitionScheduledReportMimeTypePdf ReportDefinitionScheduledReportMimeTypeEnum = "PDF" + ReportDefinitionScheduledReportMimeTypeXls ReportDefinitionScheduledReportMimeTypeEnum = "XLS" +) + +var mappingReportDefinitionScheduledReportMimeTypeEnum = map[string]ReportDefinitionScheduledReportMimeTypeEnum{ + "PDF": ReportDefinitionScheduledReportMimeTypePdf, + "XLS": ReportDefinitionScheduledReportMimeTypeXls, +} + +var mappingReportDefinitionScheduledReportMimeTypeEnumLowerCase = map[string]ReportDefinitionScheduledReportMimeTypeEnum{ + "pdf": ReportDefinitionScheduledReportMimeTypePdf, + "xls": ReportDefinitionScheduledReportMimeTypeXls, +} + +// GetReportDefinitionScheduledReportMimeTypeEnumValues Enumerates the set of values for ReportDefinitionScheduledReportMimeTypeEnum +func GetReportDefinitionScheduledReportMimeTypeEnumValues() []ReportDefinitionScheduledReportMimeTypeEnum { + values := make([]ReportDefinitionScheduledReportMimeTypeEnum, 0) + for _, v := range mappingReportDefinitionScheduledReportMimeTypeEnum { + values = append(values, v) + } + return values +} + +// GetReportDefinitionScheduledReportMimeTypeEnumStringValues Enumerates the set of values in String for ReportDefinitionScheduledReportMimeTypeEnum +func GetReportDefinitionScheduledReportMimeTypeEnumStringValues() []string { + return []string{ + "PDF", + "XLS", + } +} + +// GetMappingReportDefinitionScheduledReportMimeTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingReportDefinitionScheduledReportMimeTypeEnum(val string) (ReportDefinitionScheduledReportMimeTypeEnum, bool) { + enum, ok := mappingReportDefinitionScheduledReportMimeTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datasafe/report_definition_summary.go b/datasafe/report_definition_summary.go index 237cb177c5..8cd4c4dc1a 100644 --- a/datasafe/report_definition_summary.go +++ b/datasafe/report_definition_summary.go @@ -51,6 +51,24 @@ type ReportDefinitionSummary struct { // Specifies the name of a resource that provides data for the report. For example alerts, events. DataSource ReportDefinitionDataSourceEnum `mandatory:"false" json:"dataSource,omitempty"` + // Schedule to generate the report periodically in the specified format: + // ; + // Allowed version strings - "v1" + // v1's version specific schedule - + // Each of the above fields potentially introduce constraints. A workrequest is created only + // when clock time satisfies all the constraints. Constraints introduced: + // 1. seconds = (So, the allowed range for is [0, 59]) + // 2. minutes = (So, the allowed range for is [0, 59]) + // 3. hours = (So, the allowed range for is [0, 23]) + // 4. can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) + // No constraint introduced when it is '*'. When not, day of week must equal the given value + // 5. can be either '*' (without quotes or a number between 1 and 28) + // No constraint introduced when it is '*'. When not, day of month must equal the given value + Schedule *string `mandatory:"false" json:"schedule"` + + // The list of data protection regulations/standards used in the report that will help demonstrate compliance. + ComplianceStandards []string `mandatory:"false" json:"complianceStandards"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff --git a/datasafe/report_details.go b/datasafe/report_details.go new file mode 100644 index 0000000000..5864edbde4 --- /dev/null +++ b/datasafe/report_details.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Safe API +// +// APIs for using Oracle Data Safe. +// + +package datasafe + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReportDetails Details for the report schedule. +type ReportDetails interface { +} + +type reportdetails struct { + JsonData []byte + ReportType string `json:"reportType"` +} + +// UnmarshalJSON unmarshals json +func (m *reportdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerreportdetails reportdetails + s := struct { + Model Unmarshalerreportdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ReportType = s.Model.ReportType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *reportdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ReportType { + case "AUDIT": + mm := ScheduleAuditReportDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m reportdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m reportdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReportDetailsReportTypeEnum Enum with underlying type: string +type ReportDetailsReportTypeEnum string + +// Set of constants representing the allowable values for ReportDetailsReportTypeEnum +const ( + ReportDetailsReportTypeAudit ReportDetailsReportTypeEnum = "AUDIT" +) + +var mappingReportDetailsReportTypeEnum = map[string]ReportDetailsReportTypeEnum{ + "AUDIT": ReportDetailsReportTypeAudit, +} + +var mappingReportDetailsReportTypeEnumLowerCase = map[string]ReportDetailsReportTypeEnum{ + "audit": ReportDetailsReportTypeAudit, +} + +// GetReportDetailsReportTypeEnumValues Enumerates the set of values for ReportDetailsReportTypeEnum +func GetReportDetailsReportTypeEnumValues() []ReportDetailsReportTypeEnum { + values := make([]ReportDetailsReportTypeEnum, 0) + for _, v := range mappingReportDetailsReportTypeEnum { + values = append(values, v) + } + return values +} + +// GetReportDetailsReportTypeEnumStringValues Enumerates the set of values in String for ReportDetailsReportTypeEnum +func GetReportDetailsReportTypeEnumStringValues() []string { + return []string{ + "AUDIT", + } +} + +// GetMappingReportDetailsReportTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingReportDetailsReportTypeEnum(val string) (ReportDetailsReportTypeEnum, bool) { + enum, ok := mappingReportDetailsReportTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datasafe/report_summary.go b/datasafe/report_summary.go index 2ef0453c37..4f77aaa4d8 100644 --- a/datasafe/report_summary.go +++ b/datasafe/report_summary.go @@ -42,6 +42,9 @@ type ReportSummary struct { // Specifies the format of report to be excel or pdf MimeType ReportSummaryMimeTypeEnum `mandatory:"false" json:"mimeType,omitempty"` + // The type of the report. + Type ReportTypeEnum `mandatory:"false" json:"type,omitempty"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -67,6 +70,9 @@ func (m ReportSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingReportSummaryMimeTypeEnum(string(m.MimeType)); !ok && m.MimeType != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MimeType: %s. Supported values are: %s.", m.MimeType, strings.Join(GetReportSummaryMimeTypeEnumStringValues(), ","))) } + if _, ok := GetMappingReportTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetReportTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/datasafe/report_type.go b/datasafe/report_type.go new file mode 100644 index 0000000000..cdf82122cf --- /dev/null +++ b/datasafe/report_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Safe API +// +// APIs for using Oracle Data Safe. +// + +package datasafe + +import ( + "strings" +) + +// ReportTypeEnum Enum with underlying type: string +type ReportTypeEnum string + +// Set of constants representing the allowable values for ReportTypeEnum +const ( + ReportTypeGenerated ReportTypeEnum = "GENERATED" + ReportTypeScheduled ReportTypeEnum = "SCHEDULED" +) + +var mappingReportTypeEnum = map[string]ReportTypeEnum{ + "GENERATED": ReportTypeGenerated, + "SCHEDULED": ReportTypeScheduled, +} + +var mappingReportTypeEnumLowerCase = map[string]ReportTypeEnum{ + "generated": ReportTypeGenerated, + "scheduled": ReportTypeScheduled, +} + +// GetReportTypeEnumValues Enumerates the set of values for ReportTypeEnum +func GetReportTypeEnumValues() []ReportTypeEnum { + values := make([]ReportTypeEnum, 0) + for _, v := range mappingReportTypeEnum { + values = append(values, v) + } + return values +} + +// GetReportTypeEnumStringValues Enumerates the set of values in String for ReportTypeEnum +func GetReportTypeEnumStringValues() []string { + return []string{ + "GENERATED", + "SCHEDULED", + } +} + +// GetMappingReportTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingReportTypeEnum(val string) (ReportTypeEnum, bool) { + enum, ok := mappingReportTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datasafe/schedule_audit_report_details.go b/datasafe/schedule_audit_report_details.go new file mode 100644 index 0000000000..0166b356dc --- /dev/null +++ b/datasafe/schedule_audit_report_details.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Safe API +// +// APIs for using Oracle Data Safe. +// + +package datasafe + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduleAuditReportDetails Details for the audit report schedule. +type ScheduleAuditReportDetails struct { + + // The time span of records in report to be scheduled. + // + // Allowed period strings - "H","D","M","Y" + // Each of the above fields potentially introduce constraints. A workRequest is created only + // when period-value satisfies all the constraints. Constraints introduced: + // 1. period = H (The allowed range for period-value is [1, 23]) + // 2. period = D (The allowed range for period-value is [1, 30]) + // 3. period = M (The allowed range for period-value is [1, 11]) + // 4. period = Y (The minimum period-value is 1) + RecordTimeSpan *string `mandatory:"true" json:"recordTimeSpan"` + + // Specifies the limit on number of rows in report. + RowLimit *int `mandatory:"false" json:"rowLimit"` +} + +func (m ScheduleAuditReportDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduleAuditReportDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ScheduleAuditReportDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeScheduleAuditReportDetails ScheduleAuditReportDetails + s := struct { + DiscriminatorParam string `json:"reportType"` + MarshalTypeScheduleAuditReportDetails + }{ + "AUDIT", + (MarshalTypeScheduleAuditReportDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/datasafe/schedule_report_details.go b/datasafe/schedule_report_details.go new file mode 100644 index 0000000000..28abecb121 --- /dev/null +++ b/datasafe/schedule_report_details.go @@ -0,0 +1,145 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Safe API +// +// APIs for using Oracle Data Safe. +// + +package datasafe + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduleReportDetails Details for the report schedule. +type ScheduleReportDetails struct { + + // Schedule to generate the report periodically in the specified format: + // ; + // Allowed version strings - "v1" + // v1's version specific schedule - + // Each of the above fields potentially introduce constraints. A workrequest is created only + // when clock time satisfies all the constraints. Constraints introduced: + // 1. seconds = (So, the allowed range for is [0, 59]) + // 2. minutes = (So, the allowed range for is [0, 59]) + // 3. hours = (So, the allowed range for is [0, 23]) + // 4. can be either '*' (without quotes or a number between 1(Monday) and 7(Sunday)) + // No constraint introduced when it is '*'. When not, day of week must equal the given value + // 5. can be either '*' (without quotes or a number between 1 and 28) + // No constraint introduced when it is '*'. When not, day of month must equal the given value + Schedule *string `mandatory:"true" json:"schedule"` + + // Specifies the format of report to be excel or pdf + MimeType ScheduleReportDetailsMimeTypeEnum `mandatory:"true" json:"mimeType"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment + // in which the resource should be created. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + ReportDetails ReportDetails `mandatory:"true" json:"reportDetails"` + + // The name of the report to be scheduled + DisplayName *string `mandatory:"false" json:"displayName"` +} + +func (m ScheduleReportDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduleReportDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduleReportDetailsMimeTypeEnum(string(m.MimeType)); !ok && m.MimeType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for MimeType: %s. Supported values are: %s.", m.MimeType, strings.Join(GetScheduleReportDetailsMimeTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ScheduleReportDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Schedule *string `json:"schedule"` + MimeType ScheduleReportDetailsMimeTypeEnum `json:"mimeType"` + CompartmentId *string `json:"compartmentId"` + ReportDetails reportdetails `json:"reportDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Schedule = model.Schedule + + m.MimeType = model.MimeType + + m.CompartmentId = model.CompartmentId + + nn, e = model.ReportDetails.UnmarshalPolymorphicJSON(model.ReportDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ReportDetails = nn.(ReportDetails) + } else { + m.ReportDetails = nil + } + + return +} + +// ScheduleReportDetailsMimeTypeEnum Enum with underlying type: string +type ScheduleReportDetailsMimeTypeEnum string + +// Set of constants representing the allowable values for ScheduleReportDetailsMimeTypeEnum +const ( + ScheduleReportDetailsMimeTypePdf ScheduleReportDetailsMimeTypeEnum = "PDF" + ScheduleReportDetailsMimeTypeXls ScheduleReportDetailsMimeTypeEnum = "XLS" +) + +var mappingScheduleReportDetailsMimeTypeEnum = map[string]ScheduleReportDetailsMimeTypeEnum{ + "PDF": ScheduleReportDetailsMimeTypePdf, + "XLS": ScheduleReportDetailsMimeTypeXls, +} + +var mappingScheduleReportDetailsMimeTypeEnumLowerCase = map[string]ScheduleReportDetailsMimeTypeEnum{ + "pdf": ScheduleReportDetailsMimeTypePdf, + "xls": ScheduleReportDetailsMimeTypeXls, +} + +// GetScheduleReportDetailsMimeTypeEnumValues Enumerates the set of values for ScheduleReportDetailsMimeTypeEnum +func GetScheduleReportDetailsMimeTypeEnumValues() []ScheduleReportDetailsMimeTypeEnum { + values := make([]ScheduleReportDetailsMimeTypeEnum, 0) + for _, v := range mappingScheduleReportDetailsMimeTypeEnum { + values = append(values, v) + } + return values +} + +// GetScheduleReportDetailsMimeTypeEnumStringValues Enumerates the set of values in String for ScheduleReportDetailsMimeTypeEnum +func GetScheduleReportDetailsMimeTypeEnumStringValues() []string { + return []string{ + "PDF", + "XLS", + } +} + +// GetMappingScheduleReportDetailsMimeTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduleReportDetailsMimeTypeEnum(val string) (ScheduleReportDetailsMimeTypeEnum, bool) { + enum, ok := mappingScheduleReportDetailsMimeTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/datasafe/schedule_report_request_response.go b/datasafe/schedule_report_request_response.go new file mode 100644 index 0000000000..7cb66c1082 --- /dev/null +++ b/datasafe/schedule_report_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datasafe + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ScheduleReportRequest wrapper for the ScheduleReport operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datasafe/ScheduleReport.go.html to see an example of how to use ScheduleReportRequest. +type ScheduleReportRequest struct { + + // Unique report definition identifier + ReportDefinitionId *string `mandatory:"true" contributesTo:"path" name:"reportDefinitionId"` + + // Details for report schedule. It contains details such as schedule, PDF/XLS and number of rows. + ScheduleReportDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the if-match parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ScheduleReportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ScheduleReportRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ScheduleReportRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ScheduleReportRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ScheduleReportRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScheduleReportResponse wrapper for the ScheduleReport operation +type ScheduleReportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request. Use GetWorkRequest with this OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ScheduleReportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ScheduleReportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/datasafe/update_masking_column_details.go b/datasafe/update_masking_column_details.go index d947fdf41e..f1729fc6f0 100644 --- a/datasafe/update_masking_column_details.go +++ b/datasafe/update_masking_column_details.go @@ -28,7 +28,8 @@ type UpdateMaskingColumnDetails struct { // Group Masking in the Data Safe documentation. MaskingColumnGroup *string `mandatory:"false" json:"maskingColumnGroup"` - // The OCID of the sensitive type to be associated with the masking column. + // The OCID of the sensitive type to be associated with the masking column. Note that there will be no change in + // assigned masking format when sensitive type is changed. SensitiveTypeId *string `mandatory:"false" json:"sensitiveTypeId"` // Indicates if data masking is enabled for the masking column. Set it to false diff --git a/datasafe/user_assessment.go b/datasafe/user_assessment.go index fe7f680b54..938ae40da7 100644 --- a/datasafe/user_assessment.go +++ b/datasafe/user_assessment.go @@ -40,8 +40,8 @@ type UserAssessment struct { // LATEST: The most up-to-date assessment that is running automatically for a target. It is system generated. // SAVED: A saved user assessment. LATEST assessments will always be saved to maintain the history of runs. A SAVED assessment is also generated by a 'refresh' action (triggered by the user). // SAVE_SCHEDULE: A schedule to periodically save LATEST assessments. - // COMPARTMENT: An automatic managed assessment type that stores all details of targets in one compartment. This will keep an up-to-date status of all database risks in one compartment. - // It is automatically updated once the latest assessment or refresh action is executed, as well as when a target is deleted or move to a different compartment. + // COMPARTMENT: An automatic managed assessment type that stores all details of targets in one compartment. This will keep an up-to-date status of all potential risks identified in the compartment. + // It is automatically updated once the latest assessment or refresh action is executed, as well as when a target is deleted or moved to a different compartment. Type UserAssessmentTypeEnum `mandatory:"true" json:"type"` // The description of the user assessment. diff --git a/datasafe/user_assessment_summary.go b/datasafe/user_assessment_summary.go index 9ee9f26a35..d9313b478f 100644 --- a/datasafe/user_assessment_summary.go +++ b/datasafe/user_assessment_summary.go @@ -40,8 +40,8 @@ type UserAssessmentSummary struct { // LATEST: The most up-to-date assessment that is running automatically for a target. It is system generated. // SAVED: A saved user assessment. LATEST assessments are always saved to maintain the history of runs. A SAVED assessment is also generated by a 'refresh' action (triggered by the user). // SAVE_SCHEDULE: The schedule for periodic save of LATEST assessments. - // COMPARTMENT: An automatic managed assessment type that stores all details of targets in one compartment. This type keeps an up-to-date status of all database risks in one compartment. - // It is automatically updated when the latest assessment or refresh action is executed. It is also automatically updated when a target is deleted or move to a different compartment. + // COMPARTMENT: An automatic managed assessment type that stores all details of targets in one compartment. This will keep an up-to-date status of all potential risks identified in the compartment. + // It is automatically updated once the latest assessment or refresh action is executed, as well as when a target is deleted or moved to a different compartment. Type UserAssessmentSummaryTypeEnum `mandatory:"true" json:"type"` // The description of the user assessment. diff --git a/datasafe/work_request.go b/datasafe/work_request.go index c292206f88..3ad0e60138 100644 --- a/datasafe/work_request.go +++ b/datasafe/work_request.go @@ -165,6 +165,10 @@ const ( WorkRequestOperationTypeUpdateLibraryMaskingFormat WorkRequestOperationTypeEnum = "UPDATE_LIBRARY_MASKING_FORMAT" WorkRequestOperationTypeAddColumnsFromSdm WorkRequestOperationTypeEnum = "ADD_COLUMNS_FROM_SDM" WorkRequestOperationTypeMaskingJob WorkRequestOperationTypeEnum = "MASKING_JOB" + WorkRequestOperationTypeCreateSchedule WorkRequestOperationTypeEnum = "CREATE_SCHEDULE" + WorkRequestOperationTypeRemoveScheduleReport WorkRequestOperationTypeEnum = "REMOVE_SCHEDULE_REPORT" + WorkRequestOperationTypeUpdateAllAlert WorkRequestOperationTypeEnum = "UPDATE_ALL_ALERT" + WorkRequestOperationTypePatchTargetAlertPolicyAssociation WorkRequestOperationTypeEnum = "PATCH_TARGET_ALERT_POLICY_ASSOCIATION" ) var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnum{ @@ -260,6 +264,10 @@ var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnu "UPDATE_LIBRARY_MASKING_FORMAT": WorkRequestOperationTypeUpdateLibraryMaskingFormat, "ADD_COLUMNS_FROM_SDM": WorkRequestOperationTypeAddColumnsFromSdm, "MASKING_JOB": WorkRequestOperationTypeMaskingJob, + "CREATE_SCHEDULE": WorkRequestOperationTypeCreateSchedule, + "REMOVE_SCHEDULE_REPORT": WorkRequestOperationTypeRemoveScheduleReport, + "UPDATE_ALL_ALERT": WorkRequestOperationTypeUpdateAllAlert, + "PATCH_TARGET_ALERT_POLICY_ASSOCIATION": WorkRequestOperationTypePatchTargetAlertPolicyAssociation, } var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperationTypeEnum{ @@ -355,6 +363,10 @@ var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperati "update_library_masking_format": WorkRequestOperationTypeUpdateLibraryMaskingFormat, "add_columns_from_sdm": WorkRequestOperationTypeAddColumnsFromSdm, "masking_job": WorkRequestOperationTypeMaskingJob, + "create_schedule": WorkRequestOperationTypeCreateSchedule, + "remove_schedule_report": WorkRequestOperationTypeRemoveScheduleReport, + "update_all_alert": WorkRequestOperationTypeUpdateAllAlert, + "patch_target_alert_policy_association": WorkRequestOperationTypePatchTargetAlertPolicyAssociation, } // GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum @@ -461,6 +473,10 @@ func GetWorkRequestOperationTypeEnumStringValues() []string { "UPDATE_LIBRARY_MASKING_FORMAT", "ADD_COLUMNS_FROM_SDM", "MASKING_JOB", + "CREATE_SCHEDULE", + "REMOVE_SCHEDULE_REPORT", + "UPDATE_ALL_ALERT", + "PATCH_TARGET_ALERT_POLICY_ASSOCIATION", } } diff --git a/datasafe/work_request_summary.go b/datasafe/work_request_summary.go index 2300c91106..cc22f3eddf 100644 --- a/datasafe/work_request_summary.go +++ b/datasafe/work_request_summary.go @@ -164,6 +164,10 @@ const ( WorkRequestSummaryOperationTypeUpdateLibraryMaskingFormat WorkRequestSummaryOperationTypeEnum = "UPDATE_LIBRARY_MASKING_FORMAT" WorkRequestSummaryOperationTypeAddColumnsFromSdm WorkRequestSummaryOperationTypeEnum = "ADD_COLUMNS_FROM_SDM" WorkRequestSummaryOperationTypeMaskingJob WorkRequestSummaryOperationTypeEnum = "MASKING_JOB" + WorkRequestSummaryOperationTypeCreateSchedule WorkRequestSummaryOperationTypeEnum = "CREATE_SCHEDULE" + WorkRequestSummaryOperationTypeRemoveScheduleReport WorkRequestSummaryOperationTypeEnum = "REMOVE_SCHEDULE_REPORT" + WorkRequestSummaryOperationTypeUpdateAllAlert WorkRequestSummaryOperationTypeEnum = "UPDATE_ALL_ALERT" + WorkRequestSummaryOperationTypePatchTargetAlertPolicyAssociation WorkRequestSummaryOperationTypeEnum = "PATCH_TARGET_ALERT_POLICY_ASSOCIATION" ) var mappingWorkRequestSummaryOperationTypeEnum = map[string]WorkRequestSummaryOperationTypeEnum{ @@ -258,6 +262,10 @@ var mappingWorkRequestSummaryOperationTypeEnum = map[string]WorkRequestSummaryOp "UPDATE_LIBRARY_MASKING_FORMAT": WorkRequestSummaryOperationTypeUpdateLibraryMaskingFormat, "ADD_COLUMNS_FROM_SDM": WorkRequestSummaryOperationTypeAddColumnsFromSdm, "MASKING_JOB": WorkRequestSummaryOperationTypeMaskingJob, + "CREATE_SCHEDULE": WorkRequestSummaryOperationTypeCreateSchedule, + "REMOVE_SCHEDULE_REPORT": WorkRequestSummaryOperationTypeRemoveScheduleReport, + "UPDATE_ALL_ALERT": WorkRequestSummaryOperationTypeUpdateAllAlert, + "PATCH_TARGET_ALERT_POLICY_ASSOCIATION": WorkRequestSummaryOperationTypePatchTargetAlertPolicyAssociation, } var mappingWorkRequestSummaryOperationTypeEnumLowerCase = map[string]WorkRequestSummaryOperationTypeEnum{ @@ -352,6 +360,10 @@ var mappingWorkRequestSummaryOperationTypeEnumLowerCase = map[string]WorkRequest "update_library_masking_format": WorkRequestSummaryOperationTypeUpdateLibraryMaskingFormat, "add_columns_from_sdm": WorkRequestSummaryOperationTypeAddColumnsFromSdm, "masking_job": WorkRequestSummaryOperationTypeMaskingJob, + "create_schedule": WorkRequestSummaryOperationTypeCreateSchedule, + "remove_schedule_report": WorkRequestSummaryOperationTypeRemoveScheduleReport, + "update_all_alert": WorkRequestSummaryOperationTypeUpdateAllAlert, + "patch_target_alert_policy_association": WorkRequestSummaryOperationTypePatchTargetAlertPolicyAssociation, } // GetWorkRequestSummaryOperationTypeEnumValues Enumerates the set of values for WorkRequestSummaryOperationTypeEnum @@ -457,6 +469,10 @@ func GetWorkRequestSummaryOperationTypeEnumStringValues() []string { "UPDATE_LIBRARY_MASKING_FORMAT", "ADD_COLUMNS_FROM_SDM", "MASKING_JOB", + "CREATE_SCHEDULE", + "REMOVE_SCHEDULE_REPORT", + "UPDATE_ALL_ALERT", + "PATCH_TARGET_ALERT_POLICY_ASSOCIATION", } } diff --git a/devops/create_deploy_pipeline_deployment_details.go b/devops/create_deploy_pipeline_deployment_details.go index 84494af6b3..a73ccd408a 100644 --- a/devops/create_deploy_pipeline_deployment_details.go +++ b/devops/create_deploy_pipeline_deployment_details.go @@ -33,6 +33,8 @@ type CreateDeployPipelineDeploymentDetails struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` } diff --git a/devops/create_single_deploy_stage_deployment_details.go b/devops/create_single_deploy_stage_deployment_details.go index d166ef0bb4..f819426f9b 100644 --- a/devops/create_single_deploy_stage_deployment_details.go +++ b/devops/create_single_deploy_stage_deployment_details.go @@ -36,6 +36,8 @@ type CreateSingleDeployStageDeploymentDetails struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` } diff --git a/devops/deploy_pipeline_deployment.go b/devops/deploy_pipeline_deployment.go index 062c6b70d1..c18bb59f4b 100644 --- a/devops/deploy_pipeline_deployment.go +++ b/devops/deploy_pipeline_deployment.go @@ -49,6 +49,8 @@ type DeployPipelineDeployment struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` DeploymentExecutionProgress *DeploymentExecutionProgress `mandatory:"false" json:"deploymentExecutionProgress"` @@ -126,6 +128,11 @@ func (m DeployPipelineDeployment) GetDeploymentArguments() *DeploymentArgumentCo return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m DeployPipelineDeployment) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m DeployPipelineDeployment) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/deploy_pipeline_deployment_summary.go b/devops/deploy_pipeline_deployment_summary.go index 223557bc11..85b8b96052 100644 --- a/devops/deploy_pipeline_deployment_summary.go +++ b/devops/deploy_pipeline_deployment_summary.go @@ -42,6 +42,8 @@ type DeployPipelineDeploymentSummary struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. @@ -105,6 +107,11 @@ func (m DeployPipelineDeploymentSummary) GetDeploymentArguments() *DeploymentArg return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m DeployPipelineDeploymentSummary) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m DeployPipelineDeploymentSummary) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/deploy_pipeline_redeployment.go b/devops/deploy_pipeline_redeployment.go index 3da0a09e77..78a356205e 100644 --- a/devops/deploy_pipeline_redeployment.go +++ b/devops/deploy_pipeline_redeployment.go @@ -52,6 +52,8 @@ type DeployPipelineRedeployment struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` DeploymentExecutionProgress *DeploymentExecutionProgress `mandatory:"false" json:"deploymentExecutionProgress"` @@ -129,6 +131,11 @@ func (m DeployPipelineRedeployment) GetDeploymentArguments() *DeploymentArgument return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m DeployPipelineRedeployment) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m DeployPipelineRedeployment) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/deploy_pipeline_redeployment_summary.go b/devops/deploy_pipeline_redeployment_summary.go index c8c1c49c66..04629e1119 100644 --- a/devops/deploy_pipeline_redeployment_summary.go +++ b/devops/deploy_pipeline_redeployment_summary.go @@ -45,6 +45,8 @@ type DeployPipelineRedeploymentSummary struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. @@ -108,6 +110,11 @@ func (m DeployPipelineRedeploymentSummary) GetDeploymentArguments() *DeploymentA return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m DeployPipelineRedeploymentSummary) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m DeployPipelineRedeploymentSummary) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/deploy_stage_override_argument.go b/devops/deploy_stage_override_argument.go new file mode 100644 index 0000000000..18a82bfd57 --- /dev/null +++ b/devops/deploy_stage_override_argument.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// DevOps API +// +// Use the DevOps API to create DevOps projects, configure code repositories, add artifacts to deploy, build and test software applications, configure target deployment environments, and deploy software applications. For more information, see DevOps (https://docs.cloud.oracle.com/Content/devops/using/home.htm). +// + +package devops + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DeployStageOverrideArgument Values for stage override of the pipeline parameters to be supplied at the time of deployment. +type DeployStageOverrideArgument struct { + + // The OCID of the stage. + DeployStageId *string `mandatory:"true" json:"deployStageId"` + + // Name of the parameter (case-sensitive). + Name *string `mandatory:"true" json:"name"` + + // Value of the parameter. + Value *string `mandatory:"true" json:"value"` +} + +func (m DeployStageOverrideArgument) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DeployStageOverrideArgument) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/devops/deploy_stage_override_argument_collection.go b/devops/deploy_stage_override_argument_collection.go new file mode 100644 index 0000000000..406c916997 --- /dev/null +++ b/devops/deploy_stage_override_argument_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// DevOps API +// +// Use the DevOps API to create DevOps projects, configure code repositories, add artifacts to deploy, build and test software applications, configure target deployment environments, and deploy software applications. For more information, see DevOps (https://docs.cloud.oracle.com/Content/devops/using/home.htm). +// + +package devops + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DeployStageOverrideArgumentCollection Specifies the list of arguments to be overriden per Stage at the time of deployment. +type DeployStageOverrideArgumentCollection struct { + + // List of artifact override arguments at the time of deployment. + Items []DeployStageOverrideArgument `mandatory:"true" json:"items"` +} + +func (m DeployStageOverrideArgumentCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DeployStageOverrideArgumentCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/devops/deployment.go b/devops/deployment.go index 8bf18a805f..177f35e026 100644 --- a/devops/deployment.go +++ b/devops/deployment.go @@ -52,6 +52,8 @@ type Deployment interface { GetDeploymentArguments() *DeploymentArgumentCollection + GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection + GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection GetDeploymentExecutionProgress() *DeploymentExecutionProgress @@ -80,6 +82,7 @@ type deployment struct { LifecycleState DeploymentLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` DeploymentExecutionProgress *DeploymentExecutionProgress `mandatory:"false" json:"deploymentExecutionProgress"` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -111,6 +114,7 @@ func (m *deployment) UnmarshalJSON(data []byte) error { m.LifecycleState = s.Model.LifecycleState m.LifecycleDetails = s.Model.LifecycleDetails m.DeploymentArguments = s.Model.DeploymentArguments + m.DeployStageOverrideArguments = s.Model.DeployStageOverrideArguments m.DeployArtifactOverrideArguments = s.Model.DeployArtifactOverrideArguments m.DeploymentExecutionProgress = s.Model.DeploymentExecutionProgress m.FreeformTags = s.Model.FreeformTags @@ -211,6 +215,11 @@ func (m deployment) GetDeploymentArguments() *DeploymentArgumentCollection { return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m deployment) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m deployment) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/deployment_summary.go b/devops/deployment_summary.go index 0dd5f0ef3c..a1e01c04a3 100644 --- a/devops/deployment_summary.go +++ b/devops/deployment_summary.go @@ -45,6 +45,8 @@ type DeploymentSummary interface { GetDeploymentArguments() *DeploymentArgumentCollection + GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection + GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. @@ -71,6 +73,7 @@ type deploymentsummary struct { TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` LifecycleState DeploymentLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -99,6 +102,7 @@ func (m *deploymentsummary) UnmarshalJSON(data []byte) error { m.TimeUpdated = s.Model.TimeUpdated m.LifecycleState = s.Model.LifecycleState m.DeploymentArguments = s.Model.DeploymentArguments + m.DeployStageOverrideArguments = s.Model.DeployStageOverrideArguments m.DeployArtifactOverrideArguments = s.Model.DeployArtifactOverrideArguments m.LifecycleDetails = s.Model.LifecycleDetails m.FreeformTags = s.Model.FreeformTags @@ -184,6 +188,11 @@ func (m deploymentsummary) GetDeploymentArguments() *DeploymentArgumentCollectio return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m deploymentsummary) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m deploymentsummary) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/list_work_requests_request_response.go b/devops/list_work_requests_request_response.go index 949bec104b..d23b6d734b 100644 --- a/devops/list_work_requests_request_response.go +++ b/devops/list_work_requests_request_response.go @@ -126,30 +126,36 @@ type ListWorkRequestsStatusEnum string // Set of constants representing the allowable values for ListWorkRequestsStatusEnum const ( - ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" - ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" - ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" - ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" - ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" - ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" ) var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ - "ACCEPTED": ListWorkRequestsStatusAccepted, - "IN_PROGRESS": ListWorkRequestsStatusInProgress, - "FAILED": ListWorkRequestsStatusFailed, - "SUCCEEDED": ListWorkRequestsStatusSucceeded, - "CANCELING": ListWorkRequestsStatusCanceling, - "CANCELED": ListWorkRequestsStatusCanceled, + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, + "WAITING": ListWorkRequestsStatusWaiting, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, } var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ - "accepted": ListWorkRequestsStatusAccepted, - "in_progress": ListWorkRequestsStatusInProgress, - "failed": ListWorkRequestsStatusFailed, - "succeeded": ListWorkRequestsStatusSucceeded, - "canceling": ListWorkRequestsStatusCanceling, - "canceled": ListWorkRequestsStatusCanceled, + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, + "waiting": ListWorkRequestsStatusWaiting, + "needs_attention": ListWorkRequestsStatusNeedsAttention, } // GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum @@ -170,6 +176,8 @@ func GetListWorkRequestsStatusEnumStringValues() []string { "SUCCEEDED", "CANCELING", "CANCELED", + "WAITING", + "NEEDS_ATTENTION", } } diff --git a/devops/operation_status.go b/devops/operation_status.go index d9e4029741..cf4006375e 100644 --- a/devops/operation_status.go +++ b/devops/operation_status.go @@ -18,30 +18,36 @@ type OperationStatusEnum string // Set of constants representing the allowable values for OperationStatusEnum const ( - OperationStatusAccepted OperationStatusEnum = "ACCEPTED" - OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" - OperationStatusFailed OperationStatusEnum = "FAILED" - OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" - OperationStatusCanceling OperationStatusEnum = "CANCELING" - OperationStatusCanceled OperationStatusEnum = "CANCELED" + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" ) var mappingOperationStatusEnum = map[string]OperationStatusEnum{ - "ACCEPTED": OperationStatusAccepted, - "IN_PROGRESS": OperationStatusInProgress, - "FAILED": OperationStatusFailed, - "SUCCEEDED": OperationStatusSucceeded, - "CANCELING": OperationStatusCanceling, - "CANCELED": OperationStatusCanceled, + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, + "WAITING": OperationStatusWaiting, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, } var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ - "accepted": OperationStatusAccepted, - "in_progress": OperationStatusInProgress, - "failed": OperationStatusFailed, - "succeeded": OperationStatusSucceeded, - "canceling": OperationStatusCanceling, - "canceled": OperationStatusCanceled, + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, + "waiting": OperationStatusWaiting, + "needs_attention": OperationStatusNeedsAttention, } // GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum @@ -62,6 +68,8 @@ func GetOperationStatusEnumStringValues() []string { "SUCCEEDED", "CANCELING", "CANCELED", + "WAITING", + "NEEDS_ATTENTION", } } diff --git a/devops/single_deploy_stage_deployment.go b/devops/single_deploy_stage_deployment.go index 03a1921f34..8a7a7367d2 100644 --- a/devops/single_deploy_stage_deployment.go +++ b/devops/single_deploy_stage_deployment.go @@ -52,6 +52,8 @@ type SingleDeployStageDeployment struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` DeploymentExecutionProgress *DeploymentExecutionProgress `mandatory:"false" json:"deploymentExecutionProgress"` @@ -129,6 +131,11 @@ func (m SingleDeployStageDeployment) GetDeploymentArguments() *DeploymentArgumen return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m SingleDeployStageDeployment) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m SingleDeployStageDeployment) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/single_deploy_stage_deployment_summary.go b/devops/single_deploy_stage_deployment_summary.go index 4b72a2fbd9..6b8a1d0e28 100644 --- a/devops/single_deploy_stage_deployment_summary.go +++ b/devops/single_deploy_stage_deployment_summary.go @@ -45,6 +45,8 @@ type SingleDeployStageDeploymentSummary struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. @@ -108,6 +110,11 @@ func (m SingleDeployStageDeploymentSummary) GetDeploymentArguments() *Deployment return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m SingleDeployStageDeploymentSummary) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m SingleDeployStageDeploymentSummary) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/single_deploy_stage_redeployment.go b/devops/single_deploy_stage_redeployment.go index 051a686fb3..864df5f34e 100644 --- a/devops/single_deploy_stage_redeployment.go +++ b/devops/single_deploy_stage_redeployment.go @@ -52,6 +52,8 @@ type SingleDeployStageRedeployment struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` DeploymentExecutionProgress *DeploymentExecutionProgress `mandatory:"false" json:"deploymentExecutionProgress"` @@ -132,6 +134,11 @@ func (m SingleDeployStageRedeployment) GetDeploymentArguments() *DeploymentArgum return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m SingleDeployStageRedeployment) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m SingleDeployStageRedeployment) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/devops/single_deploy_stage_redeployment_summary.go b/devops/single_deploy_stage_redeployment_summary.go index 0bcf6d60eb..dbe2677f73 100644 --- a/devops/single_deploy_stage_redeployment_summary.go +++ b/devops/single_deploy_stage_redeployment_summary.go @@ -45,6 +45,8 @@ type SingleDeployStageRedeploymentSummary struct { DeploymentArguments *DeploymentArgumentCollection `mandatory:"false" json:"deploymentArguments"` + DeployStageOverrideArguments *DeployStageOverrideArgumentCollection `mandatory:"false" json:"deployStageOverrideArguments"` + DeployArtifactOverrideArguments *DeployArtifactOverrideArgumentCollection `mandatory:"false" json:"deployArtifactOverrideArguments"` // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. @@ -111,6 +113,11 @@ func (m SingleDeployStageRedeploymentSummary) GetDeploymentArguments() *Deployme return m.DeploymentArguments } +//GetDeployStageOverrideArguments returns DeployStageOverrideArguments +func (m SingleDeployStageRedeploymentSummary) GetDeployStageOverrideArguments() *DeployStageOverrideArgumentCollection { + return m.DeployStageOverrideArguments +} + //GetDeployArtifactOverrideArguments returns DeployArtifactOverrideArguments func (m SingleDeployStageRedeploymentSummary) GetDeployArtifactOverrideArguments() *DeployArtifactOverrideArgumentCollection { return m.DeployArtifactOverrideArguments diff --git a/goldengate/collect_deployment_diagnostic_details.go b/goldengate/collect_deployment_diagnostic_details.go new file mode 100644 index 0000000000..bae76911de --- /dev/null +++ b/goldengate/collect_deployment_diagnostic_details.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CollectDeploymentDiagnosticDetails Details for collecting deployment diagnostic +type CollectDeploymentDiagnosticDetails struct { + + // Name of namespace that serves as a container for all of your buckets + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // Name of the bucket where the object is to be uploaded in the object storage + BucketName *string `mandatory:"true" json:"bucketName"` + + // Prefix of the diagnostic collected and uploaded to object storage + DiagnosticNamePrefix *string `mandatory:"true" json:"diagnosticNamePrefix"` + + // The time from which the diagnostic collection should collect the logs. The format is defined by RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeDiagnosticStart *common.SDKTime `mandatory:"false" json:"timeDiagnosticStart"` + + // The time until which the diagnostic collection should collect the logs. The format is defined by RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeDiagnosticEnd *common.SDKTime `mandatory:"false" json:"timeDiagnosticEnd"` +} + +func (m CollectDeploymentDiagnosticDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CollectDeploymentDiagnosticDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/goldengate/collect_deployment_diagnostic_request_response.go b/goldengate/collect_deployment_diagnostic_request_response.go new file mode 100644 index 0000000000..e8a145c23d --- /dev/null +++ b/goldengate/collect_deployment_diagnostic_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CollectDeploymentDiagnosticRequest wrapper for the CollectDeploymentDiagnostic operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/CollectDeploymentDiagnostic.go.html to see an example of how to use CollectDeploymentDiagnosticRequest. +type CollectDeploymentDiagnosticRequest struct { + + // A unique Deployment identifier. + DeploymentId *string `mandatory:"true" contributesTo:"path" name:"deploymentId"` + + // Metadata about the deployment diagnostic. This also includes the Object storage information where the diagnostic will be uploaded + CollectDeploymentDiagnosticDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for that + // resource. The resource is updated or deleted only if the etag you provide matches the + // resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried, in case of a timeout or + // server error, without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a + // resource has been deleted and purged from the system, then a retry of the original creation + // request is rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CollectDeploymentDiagnosticRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CollectDeploymentDiagnosticRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CollectDeploymentDiagnosticRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CollectDeploymentDiagnosticRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CollectDeploymentDiagnosticRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CollectDeploymentDiagnosticResponse wrapper for the CollectDeploymentDiagnostic operation +type CollectDeploymentDiagnosticResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for an asynchronous request. You can use this to query + // status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please include the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CollectDeploymentDiagnosticResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CollectDeploymentDiagnosticResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/goldengate/deployment.go b/goldengate/deployment.go index add9079f11..aae357f38d 100644 --- a/goldengate/deployment.go +++ b/goldengate/deployment.go @@ -121,6 +121,8 @@ type Deployment struct { IsStorageUtilizationLimitExceeded *bool `mandatory:"false" json:"isStorageUtilizationLimitExceeded"` OggData *OggDeployment `mandatory:"false" json:"oggData"` + + DeploymentDiagnosticData *DeploymentDiagnosticData `mandatory:"false" json:"deploymentDiagnosticData"` } func (m Deployment) String() string { diff --git a/goldengate/deployment_diagnostic_data.go b/goldengate/deployment_diagnostic_data.go new file mode 100644 index 0000000000..6706b92e02 --- /dev/null +++ b/goldengate/deployment_diagnostic_data.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DeploymentDiagnosticData Information regarding the deployment diagnostic collection +type DeploymentDiagnosticData struct { + + // Name of namespace that serves as a container for all of your buckets + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // Name of the bucket where the object is to be uploaded in the object storage + BucketName *string `mandatory:"true" json:"bucketName"` + + // Name of the diagnostic collected and uploaded to object storage + ObjectName *string `mandatory:"true" json:"objectName"` + + // The state of the deployment diagnostic collection. + DiagnosticState DeploymentDiagnosticStateEnum `mandatory:"true" json:"diagnosticState"` + + // The time from which the diagnostic collection should collect the logs. The format is defined by RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeDiagnosticStart *common.SDKTime `mandatory:"false" json:"timeDiagnosticStart"` + + // The time until which the diagnostic collection should collect the logs. The format is defined by RFC3339 (https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`. + TimeDiagnosticEnd *common.SDKTime `mandatory:"false" json:"timeDiagnosticEnd"` +} + +func (m DeploymentDiagnosticData) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DeploymentDiagnosticData) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDeploymentDiagnosticStateEnum(string(m.DiagnosticState)); !ok && m.DiagnosticState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DiagnosticState: %s. Supported values are: %s.", m.DiagnosticState, strings.Join(GetDeploymentDiagnosticStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/goldengate/deployment_diagnostic_state.go b/goldengate/deployment_diagnostic_state.go new file mode 100644 index 0000000000..ac10fe87b0 --- /dev/null +++ b/goldengate/deployment_diagnostic_state.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "strings" +) + +// DeploymentDiagnosticStateEnum Enum with underlying type: string +type DeploymentDiagnosticStateEnum string + +// Set of constants representing the allowable values for DeploymentDiagnosticStateEnum +const ( + DeploymentDiagnosticStateInProgress DeploymentDiagnosticStateEnum = "IN_PROGRESS" + DeploymentDiagnosticStateSucceeded DeploymentDiagnosticStateEnum = "SUCCEEDED" + DeploymentDiagnosticStateFailed DeploymentDiagnosticStateEnum = "FAILED" +) + +var mappingDeploymentDiagnosticStateEnum = map[string]DeploymentDiagnosticStateEnum{ + "IN_PROGRESS": DeploymentDiagnosticStateInProgress, + "SUCCEEDED": DeploymentDiagnosticStateSucceeded, + "FAILED": DeploymentDiagnosticStateFailed, +} + +var mappingDeploymentDiagnosticStateEnumLowerCase = map[string]DeploymentDiagnosticStateEnum{ + "in_progress": DeploymentDiagnosticStateInProgress, + "succeeded": DeploymentDiagnosticStateSucceeded, + "failed": DeploymentDiagnosticStateFailed, +} + +// GetDeploymentDiagnosticStateEnumValues Enumerates the set of values for DeploymentDiagnosticStateEnum +func GetDeploymentDiagnosticStateEnumValues() []DeploymentDiagnosticStateEnum { + values := make([]DeploymentDiagnosticStateEnum, 0) + for _, v := range mappingDeploymentDiagnosticStateEnum { + values = append(values, v) + } + return values +} + +// GetDeploymentDiagnosticStateEnumStringValues Enumerates the set of values in String for DeploymentDiagnosticStateEnum +func GetDeploymentDiagnosticStateEnumStringValues() []string { + return []string{ + "IN_PROGRESS", + "SUCCEEDED", + "FAILED", + } +} + +// GetMappingDeploymentDiagnosticStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDeploymentDiagnosticStateEnum(val string) (DeploymentDiagnosticStateEnum, bool) { + enum, ok := mappingDeploymentDiagnosticStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/goldengate/goldengate_client.go b/goldengate/goldengate_client.go index cdefbc1de7..d7912f1bd5 100644 --- a/goldengate/goldengate_client.go +++ b/goldengate/goldengate_client.go @@ -410,6 +410,69 @@ func (client GoldenGateClient) changeDeploymentCompartment(ctx context.Context, return response, err } +// CollectDeploymentDiagnostic Collects the diagnostic of a Deployment. When provided, If-Match is checked against ETag values of the resource. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/CollectDeploymentDiagnostic.go.html to see an example of how to use CollectDeploymentDiagnostic API. +// A default retry strategy applies to this operation CollectDeploymentDiagnostic() +func (client GoldenGateClient) CollectDeploymentDiagnostic(ctx context.Context, request CollectDeploymentDiagnosticRequest) (response CollectDeploymentDiagnosticResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.collectDeploymentDiagnostic, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CollectDeploymentDiagnosticResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CollectDeploymentDiagnosticResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CollectDeploymentDiagnosticResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CollectDeploymentDiagnosticResponse") + } + return +} + +// collectDeploymentDiagnostic implements the OCIOperation interface (enables retrying operations) +func (client GoldenGateClient) collectDeploymentDiagnostic(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/deployments/{deploymentId}/actions/collectDiagnostics", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CollectDeploymentDiagnosticResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/goldengate/20200407/Deployment/CollectDeploymentDiagnostic" + err = common.PostProcessServiceError(err, "GoldenGate", "CollectDeploymentDiagnostic", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateConnection Creates a new Connection. // // See also diff --git a/jms/add_fleet_installation_sites_details.go b/jms/add_fleet_installation_sites_details.go index f193165f1e..972d43ad87 100644 --- a/jms/add_fleet_installation_sites_details.go +++ b/jms/add_fleet_installation_sites_details.go @@ -20,6 +20,9 @@ type AddFleetInstallationSitesDetails struct { // The list of installation sites to add. InstallationSites []NewInstallationSite `mandatory:"true" json:"installationSites"` + + // Optional list of post java installation actions + PostInstallationActions []PostInstallationActionsEnum `mandatory:"false" json:"postInstallationActions"` } func (m AddFleetInstallationSitesDetails) String() string { diff --git a/jms/advanced_usage_tracking.go b/jms/advanced_usage_tracking.go new file mode 100644 index 0000000000..ba6e314b28 --- /dev/null +++ b/jms/advanced_usage_tracking.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AdvancedUsageTracking AdvancedUsageTracking configuration +type AdvancedUsageTracking struct { + + // AdvancedUsageTracking flag to store enabled or disabled status + IsEnabled *bool `mandatory:"false" json:"isEnabled"` +} + +func (m AdvancedUsageTracking) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AdvancedUsageTracking) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/algorithms.go b/jms/algorithms.go new file mode 100644 index 0000000000..8611cf4cac --- /dev/null +++ b/jms/algorithms.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// AlgorithmsEnum Enum with underlying type: string +type AlgorithmsEnum string + +// Set of constants representing the allowable values for AlgorithmsEnum +const ( + AlgorithmsRsa AlgorithmsEnum = "RSA" + AlgorithmsDsa AlgorithmsEnum = "DSA" + AlgorithmsEc AlgorithmsEnum = "EC" + AlgorithmsDh AlgorithmsEnum = "DH" +) + +var mappingAlgorithmsEnum = map[string]AlgorithmsEnum{ + "RSA": AlgorithmsRsa, + "DSA": AlgorithmsDsa, + "EC": AlgorithmsEc, + "DH": AlgorithmsDh, +} + +var mappingAlgorithmsEnumLowerCase = map[string]AlgorithmsEnum{ + "rsa": AlgorithmsRsa, + "dsa": AlgorithmsDsa, + "ec": AlgorithmsEc, + "dh": AlgorithmsDh, +} + +// GetAlgorithmsEnumValues Enumerates the set of values for AlgorithmsEnum +func GetAlgorithmsEnumValues() []AlgorithmsEnum { + values := make([]AlgorithmsEnum, 0) + for _, v := range mappingAlgorithmsEnum { + values = append(values, v) + } + return values +} + +// GetAlgorithmsEnumStringValues Enumerates the set of values in String for AlgorithmsEnum +func GetAlgorithmsEnumStringValues() []string { + return []string{ + "RSA", + "DSA", + "EC", + "DH", + } +} + +// GetMappingAlgorithmsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAlgorithmsEnum(val string) (AlgorithmsEnum, bool) { + enum, ok := mappingAlgorithmsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/create_fleet_details.go b/jms/create_fleet_details.go index 1d2dfe24f3..bdf024dacd 100644 --- a/jms/create_fleet_details.go +++ b/jms/create_fleet_details.go @@ -31,7 +31,8 @@ type CreateFleetDetails struct { OperationLog *CustomLog `mandatory:"false" json:"operationLog"` - // Whether or not advanced features are enabled in this fleet. By default, this is set to false. + // Whether or not advanced features are enabled in this fleet. + // Deprecated, use `/fleets/{fleetId}/advanceFeatureConfiguration` api instead. IsAdvancedFeaturesEnabled *bool `mandatory:"false" json:"isAdvancedFeaturesEnabled"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. diff --git a/jms/crypto_analysis_result.go b/jms/crypto_analysis_result.go new file mode 100644 index 0000000000..82520ddaa6 --- /dev/null +++ b/jms/crypto_analysis_result.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CryptoAnalysisResult Metadata of a Crypto Event Analysis result. The analysis result is stored as the Object Storage object. +type CryptoAnalysisResult struct { + + // The OCID to identify this analysis results. + Id *string `mandatory:"true" json:"id"` + + // The result aggregation mode + AggregationMode CryptoAnalysisResultModeEnum `mandatory:"true" json:"aggregationMode"` + + // The fleet OCID. + FleetId *string `mandatory:"true" json:"fleetId"` + + // Total number of events in the analysis. + TotalEventCount *int `mandatory:"true" json:"totalEventCount"` + + // Total number of summarized events. Summarized events are deduplicated events of interest. + SummarizedEventCount *int `mandatory:"true" json:"summarizedEventCount"` + + // Total number of findings with the analysis. + FindingCount *int `mandatory:"true" json:"findingCount"` + + // Total number of non-compliant findings with the analysis. A non-compliant finding means the + // application won't work properly with the changes introduced by the crypto roadmap version + // used the the analysis. + NonCompliantFindingCount *int `mandatory:"true" json:"nonCompliantFindingCount"` + + // The Crypto Roadmap version used to perform the analysis. + CryptoRoadmapVersion *string `mandatory:"true" json:"cryptoRoadmapVersion"` + + // The Object Storage namespace of this analysis result. + Namespace *string `mandatory:"true" json:"namespace"` + + // The Object Storage bucket name of this analysis result. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The Object Storage object name of this analysis result. + ObjectName *string `mandatory:"true" json:"objectName"` + + // The OCID of the work request to start the analysis. + WorkRequestId *string `mandatory:"false" json:"workRequestId"` + + // The managed instance OCID. + ManagedInstanceId *string `mandatory:"false" json:"managedInstanceId"` + + // The hostname of the managed instance. + HostName *string `mandatory:"false" json:"hostName"` + + // Time of the first event in the analysis. + TimeFirstEvent *common.SDKTime `mandatory:"false" json:"timeFirstEvent"` + + // Time of the last event in the analysis. + TimeLastEvent *common.SDKTime `mandatory:"false" json:"timeLastEvent"` + + // The time the result is compiled. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m CryptoAnalysisResult) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CryptoAnalysisResult) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCryptoAnalysisResultModeEnum(string(m.AggregationMode)); !ok && m.AggregationMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AggregationMode: %s. Supported values are: %s.", m.AggregationMode, strings.Join(GetCryptoAnalysisResultModeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/crypto_analysis_result_collection.go b/jms/crypto_analysis_result_collection.go new file mode 100644 index 0000000000..554edcb608 --- /dev/null +++ b/jms/crypto_analysis_result_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CryptoAnalysisResultCollection List of Crypto Event Analysis results. +type CryptoAnalysisResultCollection struct { + + // A list of Crypto Event Analysis results. + Items []CryptoAnalysisResultSummary `mandatory:"true" json:"items"` +} + +func (m CryptoAnalysisResultCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CryptoAnalysisResultCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/crypto_analysis_result_mode.go b/jms/crypto_analysis_result_mode.go new file mode 100644 index 0000000000..572dbbec1e --- /dev/null +++ b/jms/crypto_analysis_result_mode.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// CryptoAnalysisResultModeEnum Enum with underlying type: string +type CryptoAnalysisResultModeEnum string + +// Set of constants representing the allowable values for CryptoAnalysisResultModeEnum +const ( + CryptoAnalysisResultModeJfr CryptoAnalysisResultModeEnum = "JFR" + CryptoAnalysisResultModeManagedInstance CryptoAnalysisResultModeEnum = "MANAGED_INSTANCE" +) + +var mappingCryptoAnalysisResultModeEnum = map[string]CryptoAnalysisResultModeEnum{ + "JFR": CryptoAnalysisResultModeJfr, + "MANAGED_INSTANCE": CryptoAnalysisResultModeManagedInstance, +} + +var mappingCryptoAnalysisResultModeEnumLowerCase = map[string]CryptoAnalysisResultModeEnum{ + "jfr": CryptoAnalysisResultModeJfr, + "managed_instance": CryptoAnalysisResultModeManagedInstance, +} + +// GetCryptoAnalysisResultModeEnumValues Enumerates the set of values for CryptoAnalysisResultModeEnum +func GetCryptoAnalysisResultModeEnumValues() []CryptoAnalysisResultModeEnum { + values := make([]CryptoAnalysisResultModeEnum, 0) + for _, v := range mappingCryptoAnalysisResultModeEnum { + values = append(values, v) + } + return values +} + +// GetCryptoAnalysisResultModeEnumStringValues Enumerates the set of values in String for CryptoAnalysisResultModeEnum +func GetCryptoAnalysisResultModeEnumStringValues() []string { + return []string{ + "JFR", + "MANAGED_INSTANCE", + } +} + +// GetMappingCryptoAnalysisResultModeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCryptoAnalysisResultModeEnum(val string) (CryptoAnalysisResultModeEnum, bool) { + enum, ok := mappingCryptoAnalysisResultModeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/crypto_analysis_result_sort_by.go b/jms/crypto_analysis_result_sort_by.go new file mode 100644 index 0000000000..783efdf0d0 --- /dev/null +++ b/jms/crypto_analysis_result_sort_by.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// CryptoAnalysisResultSortByEnum Enum with underlying type: string +type CryptoAnalysisResultSortByEnum string + +// Set of constants representing the allowable values for CryptoAnalysisResultSortByEnum +const ( + CryptoAnalysisResultSortByTimeCreated CryptoAnalysisResultSortByEnum = "timeCreated" + CryptoAnalysisResultSortByManagedInstanceId CryptoAnalysisResultSortByEnum = "managedInstanceId" + CryptoAnalysisResultSortByWorkRequestId CryptoAnalysisResultSortByEnum = "workRequestId" +) + +var mappingCryptoAnalysisResultSortByEnum = map[string]CryptoAnalysisResultSortByEnum{ + "timeCreated": CryptoAnalysisResultSortByTimeCreated, + "managedInstanceId": CryptoAnalysisResultSortByManagedInstanceId, + "workRequestId": CryptoAnalysisResultSortByWorkRequestId, +} + +var mappingCryptoAnalysisResultSortByEnumLowerCase = map[string]CryptoAnalysisResultSortByEnum{ + "timecreated": CryptoAnalysisResultSortByTimeCreated, + "managedinstanceid": CryptoAnalysisResultSortByManagedInstanceId, + "workrequestid": CryptoAnalysisResultSortByWorkRequestId, +} + +// GetCryptoAnalysisResultSortByEnumValues Enumerates the set of values for CryptoAnalysisResultSortByEnum +func GetCryptoAnalysisResultSortByEnumValues() []CryptoAnalysisResultSortByEnum { + values := make([]CryptoAnalysisResultSortByEnum, 0) + for _, v := range mappingCryptoAnalysisResultSortByEnum { + values = append(values, v) + } + return values +} + +// GetCryptoAnalysisResultSortByEnumStringValues Enumerates the set of values in String for CryptoAnalysisResultSortByEnum +func GetCryptoAnalysisResultSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "managedInstanceId", + "workRequestId", + } +} + +// GetMappingCryptoAnalysisResultSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCryptoAnalysisResultSortByEnum(val string) (CryptoAnalysisResultSortByEnum, bool) { + enum, ok := mappingCryptoAnalysisResultSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/crypto_analysis_result_summary.go b/jms/crypto_analysis_result_summary.go new file mode 100644 index 0000000000..13bd6150bf --- /dev/null +++ b/jms/crypto_analysis_result_summary.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CryptoAnalysisResultSummary Summary of a crypto analysis result. The actual output of the analysis is stored in the Object Storage object. +type CryptoAnalysisResultSummary struct { + + // The OCID to identify this analysis results. + Id *string `mandatory:"true" json:"id"` + + // The result aggregation mode + AggregationMode CryptoAnalysisResultModeEnum `mandatory:"true" json:"aggregationMode"` + + // The fleet OCID. + FleetId *string `mandatory:"true" json:"fleetId"` + + // Total number of events in the analysis. + TotalEventCount *int `mandatory:"true" json:"totalEventCount"` + + // Total number of summarized events. Summarized events are deduplicated events of interest. + SummarizedEventCount *int `mandatory:"true" json:"summarizedEventCount"` + + // Total number of findings with the analysis. + FindingCount *int `mandatory:"true" json:"findingCount"` + + // Total number of non-compliant findings with the analysis. A non-compliant finding means the + // application won't work properly with the changes introduced by the crypto roadmap version + // used the the analysis. + NonCompliantFindingCount *int `mandatory:"true" json:"nonCompliantFindingCount"` + + // The Crypto Roadmap version used to perform the analysis. + CryptoRoadmapVersion *string `mandatory:"true" json:"cryptoRoadmapVersion"` + + // The Object Storage namespace of this analysis result. + Namespace *string `mandatory:"true" json:"namespace"` + + // The Object Storage bucket name of this analysis result. + BucketName *string `mandatory:"true" json:"bucketName"` + + // The Object Storage object name of this analysis result. + ObjectName *string `mandatory:"true" json:"objectName"` + + // The OCID of the work request to start the analysis. + WorkRequestId *string `mandatory:"false" json:"workRequestId"` + + // The managed instance OCID. + ManagedInstanceId *string `mandatory:"false" json:"managedInstanceId"` + + // The hostname of the managed instance. + HostName *string `mandatory:"false" json:"hostName"` + + // Time of the first event in the analysis. + TimeFirstEvent *common.SDKTime `mandatory:"false" json:"timeFirstEvent"` + + // Time of the last event in the analysis. + TimeLastEvent *common.SDKTime `mandatory:"false" json:"timeLastEvent"` + + // The time the result is compiled. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m CryptoAnalysisResultSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CryptoAnalysisResultSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCryptoAnalysisResultModeEnum(string(m.AggregationMode)); !ok && m.AggregationMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AggregationMode: %s. Supported values are: %s.", m.AggregationMode, strings.Join(GetCryptoAnalysisResultModeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/crypto_event_analysis.go b/jms/crypto_event_analysis.go new file mode 100644 index 0000000000..19e457aed5 --- /dev/null +++ b/jms/crypto_event_analysis.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CryptoEventAnalysis CryptoEventAnalysis configuration +type CryptoEventAnalysis struct { + + // CryptoEventAnalysis flag to store enabled or disabled status + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + SummarizedEventsLog *SummarizedEventsLog `mandatory:"false" json:"summarizedEventsLog"` +} + +func (m CryptoEventAnalysis) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CryptoEventAnalysis) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/delete_crypto_analysis_result_request_response.go b/jms/delete_crypto_analysis_result_request_response.go new file mode 100644 index 0000000000..b466b8f2cb --- /dev/null +++ b/jms/delete_crypto_analysis_result_request_response.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteCryptoAnalysisResultRequest wrapper for the DeleteCryptoAnalysisResult operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/DeleteCryptoAnalysisResult.go.html to see an example of how to use DeleteCryptoAnalysisResultRequest. +type DeleteCryptoAnalysisResultRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // The OCID of the analysis result. + CryptoAnalysisResultId *string `mandatory:"true" contributesTo:"path" name:"cryptoAnalysisResultId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // ETag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the ETag you + // provide matches the resource's current ETag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteCryptoAnalysisResultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCryptoAnalysisResultRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteCryptoAnalysisResultRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCryptoAnalysisResultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteCryptoAnalysisResultRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteCryptoAnalysisResultResponse wrapper for the DeleteCryptoAnalysisResult operation +type DeleteCryptoAnalysisResultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. + // You can use this to query the status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteCryptoAnalysisResultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCryptoAnalysisResultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/deployed_application_sort_by.go b/jms/deployed_application_sort_by.go new file mode 100644 index 0000000000..6123bd8d29 --- /dev/null +++ b/jms/deployed_application_sort_by.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// DeployedApplicationSortByEnum Enum with underlying type: string +type DeployedApplicationSortByEnum string + +// Set of constants representing the allowable values for DeployedApplicationSortByEnum +const ( + DeployedApplicationSortByApplicationName DeployedApplicationSortByEnum = "applicationName" + DeployedApplicationSortByApplicationType DeployedApplicationSortByEnum = "applicationType" + DeployedApplicationSortByIsClustered DeployedApplicationSortByEnum = "isClustered" + DeployedApplicationSortByJavaServerInstanceCount DeployedApplicationSortByEnum = "javaServerInstanceCount" + DeployedApplicationSortByTimeFirstSeen DeployedApplicationSortByEnum = "timeFirstSeen" + DeployedApplicationSortByTimeLastSeen DeployedApplicationSortByEnum = "timeLastSeen" +) + +var mappingDeployedApplicationSortByEnum = map[string]DeployedApplicationSortByEnum{ + "applicationName": DeployedApplicationSortByApplicationName, + "applicationType": DeployedApplicationSortByApplicationType, + "isClustered": DeployedApplicationSortByIsClustered, + "javaServerInstanceCount": DeployedApplicationSortByJavaServerInstanceCount, + "timeFirstSeen": DeployedApplicationSortByTimeFirstSeen, + "timeLastSeen": DeployedApplicationSortByTimeLastSeen, +} + +var mappingDeployedApplicationSortByEnumLowerCase = map[string]DeployedApplicationSortByEnum{ + "applicationname": DeployedApplicationSortByApplicationName, + "applicationtype": DeployedApplicationSortByApplicationType, + "isclustered": DeployedApplicationSortByIsClustered, + "javaserverinstancecount": DeployedApplicationSortByJavaServerInstanceCount, + "timefirstseen": DeployedApplicationSortByTimeFirstSeen, + "timelastseen": DeployedApplicationSortByTimeLastSeen, +} + +// GetDeployedApplicationSortByEnumValues Enumerates the set of values for DeployedApplicationSortByEnum +func GetDeployedApplicationSortByEnumValues() []DeployedApplicationSortByEnum { + values := make([]DeployedApplicationSortByEnum, 0) + for _, v := range mappingDeployedApplicationSortByEnum { + values = append(values, v) + } + return values +} + +// GetDeployedApplicationSortByEnumStringValues Enumerates the set of values in String for DeployedApplicationSortByEnum +func GetDeployedApplicationSortByEnumStringValues() []string { + return []string{ + "applicationName", + "applicationType", + "isClustered", + "javaServerInstanceCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingDeployedApplicationSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDeployedApplicationSortByEnum(val string) (DeployedApplicationSortByEnum, bool) { + enum, ok := mappingDeployedApplicationSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/deployed_application_usage.go b/jms/deployed_application_usage.go new file mode 100644 index 0000000000..311596dea3 --- /dev/null +++ b/jms/deployed_application_usage.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DeployedApplicationUsage Deployed application usage during a specified time period. +type DeployedApplicationUsage struct { + + // The internal identifier of the deployed application. + ApplicationKey *string `mandatory:"true" json:"applicationKey"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the related fleet. + FleetId *string `mandatory:"true" json:"fleetId"` + + // The name of the deployed application. + ApplicationName *string `mandatory:"true" json:"applicationName"` + + // The type of the deployed application. + ApplicationType *string `mandatory:"false" json:"applicationType"` + + // Whether or not deployed application is clustered. + IsClustered *bool `mandatory:"false" json:"isClustered"` + + // The approximate count of Java server instances running the deployed application. + ApproximateJavaServerInstanceCount *int `mandatory:"false" json:"approximateJavaServerInstanceCount"` + + // Lower bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeStart *common.SDKTime `mandatory:"false" json:"timeStart"` + + // Upper bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` + + // The date and time the resource was _first_ reported to JMS. + // This is potentially _before_ the specified time period provided by the filters. + // For example, a resource can be first reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeFirstSeen *common.SDKTime `mandatory:"false" json:"timeFirstSeen"` + + // The date and time the resource was _last_ reported to JMS. + // This is potentially _after_ the specified time period provided by the filters. + // For example, a resource can be last reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeLastSeen *common.SDKTime `mandatory:"false" json:"timeLastSeen"` +} + +func (m DeployedApplicationUsage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DeployedApplicationUsage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/deployed_application_usage_collection.go b/jms/deployed_application_usage_collection.go new file mode 100644 index 0000000000..5c13c07ba2 --- /dev/null +++ b/jms/deployed_application_usage_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DeployedApplicationUsageCollection Results of a deployed application usage search. Contains deployed application usage items. +type DeployedApplicationUsageCollection struct { + + // A list of deployed application usages. + Items []DeployedApplicationUsage `mandatory:"true" json:"items"` +} + +func (m DeployedApplicationUsageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DeployedApplicationUsageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/fleet.go b/jms/fleet.go index bda4f62a4d..e11aff3b9c 100644 --- a/jms/fleet.go +++ b/jms/fleet.go @@ -46,6 +46,10 @@ type Fleet struct { // This metric is provided on a best-effort manner, and is not taken into account when computing the resource ETag. ApproximateManagedInstanceCount *int `mandatory:"true" json:"approximateManagedInstanceCount"` + // The approximate count of all unique Java servers in the Fleet in the past seven days. + // This metric is provided on a best-effort manner, and is not taken into account when computing the resource ETag. + ApproximateJavaServerCount *int `mandatory:"true" json:"approximateJavaServerCount"` + // The creation date and time of the Fleet (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` @@ -56,7 +60,8 @@ type Fleet struct { OperationLog *CustomLog `mandatory:"false" json:"operationLog"` - // Whether or not advanced features are enabled in this fleet. By default, this is set to false. + // Whether or not advanced features are enabled in this fleet. + // Deprecated, use `/fleets/{fleetId}/advanceFeatureConfiguration` api instead. IsAdvancedFeaturesEnabled *bool `mandatory:"false" json:"isAdvancedFeaturesEnabled"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. diff --git a/jms/fleet_advanced_feature_configuration.go b/jms/fleet_advanced_feature_configuration.go new file mode 100644 index 0000000000..dd504b058a --- /dev/null +++ b/jms/fleet_advanced_feature_configuration.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FleetAdvancedFeatureConfiguration Advanced feature metadata for the fleet +type FleetAdvancedFeatureConfiguration struct { + + // Namespace for the fleet advanced feature + AnalyticNamespace *string `mandatory:"true" json:"analyticNamespace"` + + // Bucket name required to store jfr and related data + AnalyticBucketName *string `mandatory:"true" json:"analyticBucketName"` + + Lcm *Lcm `mandatory:"true" json:"lcm"` + + CryptoEventAnalysis *CryptoEventAnalysis `mandatory:"true" json:"cryptoEventAnalysis"` + + AdvancedUsageTracking *AdvancedUsageTracking `mandatory:"true" json:"advancedUsageTracking"` + + JfrRecording *JfrRecording `mandatory:"true" json:"jfrRecording"` + + // The date and time of the last modification to the Fleet Agent Configuration (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeLastModified *common.SDKTime `mandatory:"true" json:"timeLastModified"` +} + +func (m FleetAdvancedFeatureConfiguration) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m FleetAdvancedFeatureConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/fleet_agent_configuration.go b/jms/fleet_agent_configuration.go index 3674bfcc0d..ae6f862191 100644 --- a/jms/fleet_agent_configuration.go +++ b/jms/fleet_agent_configuration.go @@ -30,6 +30,12 @@ type FleetAgentConfiguration struct { // The date and time of the last modification to the Fleet Agent Configuration (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeLastModified *common.SDKTime `mandatory:"true" json:"timeLastModified"` + + // The validity period in days for work requests. + WorkRequestValidityPeriodInDays *int `mandatory:"false" json:"workRequestValidityPeriodInDays"` + + // Agent polling interval in minutes + AgentPollingIntervalInMinutes *int `mandatory:"false" json:"agentPollingIntervalInMinutes"` } func (m FleetAgentConfiguration) String() string { diff --git a/jms/fleet_summary.go b/jms/fleet_summary.go index b0f5bac6d3..24dd379ec9 100644 --- a/jms/fleet_summary.go +++ b/jms/fleet_summary.go @@ -47,6 +47,10 @@ type FleetSummary struct { // This metric is provided on a best-effort manner, and is not taken into account when computing the resource ETag. ApproximateManagedInstanceCount *int `mandatory:"true" json:"approximateManagedInstanceCount"` + // The approximate count of all unique Java servers in the Fleet in the past seven days. + // This metric is provided on a best-effort manner, and is not taken into account when computing the resource ETag. + ApproximateJavaServerCount *int `mandatory:"true" json:"approximateJavaServerCount"` + // The creation date and time of the Fleet (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` @@ -57,7 +61,8 @@ type FleetSummary struct { OperationLog *CustomLog `mandatory:"false" json:"operationLog"` - // Whether or not advanced features are enabled in this fleet. By default, this is set to false. + // Whether or not advanced features are enabled in this fleet. + // This flag is true if any one of the advanced features is turned on. IsAdvancedFeaturesEnabled *bool `mandatory:"false" json:"isAdvancedFeaturesEnabled"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. diff --git a/jms/get_crypto_analysis_result_request_response.go b/jms/get_crypto_analysis_result_request_response.go new file mode 100644 index 0000000000..69d3a4f712 --- /dev/null +++ b/jms/get_crypto_analysis_result_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCryptoAnalysisResultRequest wrapper for the GetCryptoAnalysisResult operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/GetCryptoAnalysisResult.go.html to see an example of how to use GetCryptoAnalysisResultRequest. +type GetCryptoAnalysisResultRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // The OCID of the analysis result. + CryptoAnalysisResultId *string `mandatory:"true" contributesTo:"path" name:"cryptoAnalysisResultId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetCryptoAnalysisResultRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCryptoAnalysisResultRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetCryptoAnalysisResultRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCryptoAnalysisResultRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetCryptoAnalysisResultRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCryptoAnalysisResultResponse wrapper for the GetCryptoAnalysisResult operation +type GetCryptoAnalysisResultResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CryptoAnalysisResult instance + CryptoAnalysisResult `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetCryptoAnalysisResultResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCryptoAnalysisResultResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/get_fleet_advanced_feature_configuration_request_response.go b/jms/get_fleet_advanced_feature_configuration_request_response.go new file mode 100644 index 0000000000..4a1c5f42e7 --- /dev/null +++ b/jms/get_fleet_advanced_feature_configuration_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetFleetAdvancedFeatureConfigurationRequest wrapper for the GetFleetAdvancedFeatureConfiguration operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/GetFleetAdvancedFeatureConfiguration.go.html to see an example of how to use GetFleetAdvancedFeatureConfigurationRequest. +type GetFleetAdvancedFeatureConfigurationRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // ETag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the ETag you + // provide matches the resource's current ETag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetFleetAdvancedFeatureConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetFleetAdvancedFeatureConfigurationRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetFleetAdvancedFeatureConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetFleetAdvancedFeatureConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetFleetAdvancedFeatureConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetFleetAdvancedFeatureConfigurationResponse wrapper for the GetFleetAdvancedFeatureConfiguration operation +type GetFleetAdvancedFeatureConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FleetAdvancedFeatureConfiguration instance + FleetAdvancedFeatureConfiguration `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response GetFleetAdvancedFeatureConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetFleetAdvancedFeatureConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/java_family.go b/jms/java_family.go index 51b0f6409f..7e4172032d 100644 --- a/jms/java_family.go +++ b/jms/java_family.go @@ -15,7 +15,8 @@ import ( "strings" ) -// JavaFamily Complete information of a specific Java release family. +// JavaFamily Metadata associated with a specific Java release family. +// A Java release family is typically a major version in the Java version identifier. type JavaFamily struct { // The Java release family identifier. diff --git a/jms/java_family_collection.go b/jms/java_family_collection.go index 774656669b..4ee51196d9 100644 --- a/jms/java_family_collection.go +++ b/jms/java_family_collection.go @@ -15,10 +15,11 @@ import ( "strings" ) -// JavaFamilyCollection Contains summary of the Java release family details. +// JavaFamilyCollection Collection of the Java release family summary. +// A Java release family is typically a major version in the Java version identifier. type JavaFamilyCollection struct { - // A list of the Java Release family details. + // A list of the Java Release family summary. Items []JavaFamilySummary `mandatory:"true" json:"items"` } diff --git a/jms/java_family_summary.go b/jms/java_family_summary.go index 8f91a404bc..a83a94be91 100644 --- a/jms/java_family_summary.go +++ b/jms/java_family_summary.go @@ -16,6 +16,7 @@ import ( ) // JavaFamilySummary A summary of the Java release family information. +// A Java release family is typically a major version in the Java version identifier. type JavaFamilySummary struct { // The Java release family identifier. diff --git a/jms/java_release.go b/jms/java_release.go index ca665061c8..0a77c47106 100644 --- a/jms/java_release.go +++ b/jms/java_release.go @@ -15,7 +15,7 @@ import ( "strings" ) -// JavaRelease Complete information of a specific release of Java. Includes the artifact details. +// JavaRelease Metadata associated with a specific release of Java. Includes the artifact details. type JavaRelease struct { // Java release version identifier. @@ -39,6 +39,9 @@ type JavaRelease struct { // Release notes associated with the Java version. ReleaseNotesUrl *string `mandatory:"true" json:"releaseNotesUrl"` + // Artifact content types for the Java version. + ArtifactContentTypes []ArtifactContentTypeEnum `mandatory:"true" json:"artifactContentTypes"` + // Parent Java release version identifier. This is applicable for BPR releases. ParentReleaseVersion *string `mandatory:"false" json:"parentReleaseVersion"` @@ -68,6 +71,11 @@ func (m JavaRelease) ValidateEnumValue() (bool, error) { if _, ok := GetMappingLicenseTypeEnum(string(m.LicenseType)); !ok && m.LicenseType != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LicenseType: %s. Supported values are: %s.", m.LicenseType, strings.Join(GetLicenseTypeEnumStringValues(), ","))) } + for _, val := range m.ArtifactContentTypes { + if _, ok := GetMappingArtifactContentTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArtifactContentTypes: %s. Supported values are: %s.", val, strings.Join(GetArtifactContentTypeEnumStringValues(), ","))) + } + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/jms/java_release_collection.go b/jms/java_release_collection.go index 4ab18749eb..68e6b1ee12 100644 --- a/jms/java_release_collection.go +++ b/jms/java_release_collection.go @@ -15,7 +15,7 @@ import ( "strings" ) -// JavaReleaseCollection Collection of information about the Java releases. +// JavaReleaseCollection Collection of Java releases information. type JavaReleaseCollection struct { // A list of the Java release information. diff --git a/jms/java_release_summary.go b/jms/java_release_summary.go index 8dbb77652f..b8b891b53d 100644 --- a/jms/java_release_summary.go +++ b/jms/java_release_summary.go @@ -39,6 +39,9 @@ type JavaReleaseSummary struct { // Release notes associated with the Java version. ReleaseNotesUrl *string `mandatory:"true" json:"releaseNotesUrl"` + // Artifact content types for the Java version. + ArtifactContentTypes []ArtifactContentTypeEnum `mandatory:"true" json:"artifactContentTypes"` + // Parent Java release version identifier. This is applicable for BPR releases. ParentReleaseVersion *string `mandatory:"false" json:"parentReleaseVersion"` @@ -65,6 +68,11 @@ func (m JavaReleaseSummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingLicenseTypeEnum(string(m.LicenseType)); !ok && m.LicenseType != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LicenseType: %s. Supported values are: %s.", m.LicenseType, strings.Join(GetLicenseTypeEnumStringValues(), ","))) } + for _, val := range m.ArtifactContentTypes { + if _, ok := GetMappingArtifactContentTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArtifactContentTypes: %s. Supported values are: %s.", val, strings.Join(GetArtifactContentTypeEnumStringValues(), ","))) + } + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) diff --git a/jms/java_server_instance_sort_by.go b/jms/java_server_instance_sort_by.go new file mode 100644 index 0000000000..efe15969d6 --- /dev/null +++ b/jms/java_server_instance_sort_by.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// JavaServerInstanceSortByEnum Enum with underlying type: string +type JavaServerInstanceSortByEnum string + +// Set of constants representing the allowable values for JavaServerInstanceSortByEnum +const ( + JavaServerInstanceSortByServerInstanceName JavaServerInstanceSortByEnum = "serverInstanceName" + JavaServerInstanceSortByManagedInstanceName JavaServerInstanceSortByEnum = "managedInstanceName" + JavaServerInstanceSortByApproximateDeployedApplicationCount JavaServerInstanceSortByEnum = "approximateDeployedApplicationCount" + JavaServerInstanceSortByTimeFirstSeen JavaServerInstanceSortByEnum = "timeFirstSeen" + JavaServerInstanceSortByTimeLastSeen JavaServerInstanceSortByEnum = "timeLastSeen" +) + +var mappingJavaServerInstanceSortByEnum = map[string]JavaServerInstanceSortByEnum{ + "serverInstanceName": JavaServerInstanceSortByServerInstanceName, + "managedInstanceName": JavaServerInstanceSortByManagedInstanceName, + "approximateDeployedApplicationCount": JavaServerInstanceSortByApproximateDeployedApplicationCount, + "timeFirstSeen": JavaServerInstanceSortByTimeFirstSeen, + "timeLastSeen": JavaServerInstanceSortByTimeLastSeen, +} + +var mappingJavaServerInstanceSortByEnumLowerCase = map[string]JavaServerInstanceSortByEnum{ + "serverinstancename": JavaServerInstanceSortByServerInstanceName, + "managedinstancename": JavaServerInstanceSortByManagedInstanceName, + "approximatedeployedapplicationcount": JavaServerInstanceSortByApproximateDeployedApplicationCount, + "timefirstseen": JavaServerInstanceSortByTimeFirstSeen, + "timelastseen": JavaServerInstanceSortByTimeLastSeen, +} + +// GetJavaServerInstanceSortByEnumValues Enumerates the set of values for JavaServerInstanceSortByEnum +func GetJavaServerInstanceSortByEnumValues() []JavaServerInstanceSortByEnum { + values := make([]JavaServerInstanceSortByEnum, 0) + for _, v := range mappingJavaServerInstanceSortByEnum { + values = append(values, v) + } + return values +} + +// GetJavaServerInstanceSortByEnumStringValues Enumerates the set of values in String for JavaServerInstanceSortByEnum +func GetJavaServerInstanceSortByEnumStringValues() []string { + return []string{ + "serverInstanceName", + "managedInstanceName", + "approximateDeployedApplicationCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingJavaServerInstanceSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingJavaServerInstanceSortByEnum(val string) (JavaServerInstanceSortByEnum, bool) { + enum, ok := mappingJavaServerInstanceSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/java_server_instance_usage.go b/jms/java_server_instance_usage.go new file mode 100644 index 0000000000..256169564a --- /dev/null +++ b/jms/java_server_instance_usage.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JavaServerInstanceUsage Java Server instance usage during a specified time period. +type JavaServerInstanceUsage struct { + + // The internal identifier of the Java Server instance. + ServerInstanceKey *string `mandatory:"true" json:"serverInstanceKey"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the related fleet. + FleetId *string `mandatory:"true" json:"fleetId"` + + // The name of the Java Server instance. + ServerInstanceName *string `mandatory:"true" json:"serverInstanceName"` + + // The internal identifier of the related Java Server. + ServerKey *string `mandatory:"true" json:"serverKey"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the related managed instance. + ManagedInstanceId *string `mandatory:"true" json:"managedInstanceId"` + + // The name of the Java Server. + ServerName *string `mandatory:"false" json:"serverName"` + + // The version of the Java Server. + ServerVersion *string `mandatory:"false" json:"serverVersion"` + + // The host name of the related managed instance. + HostName *string `mandatory:"false" json:"hostName"` + + // The internal identifier of the related Java Runtime. + JvmKey *string `mandatory:"false" json:"jvmKey"` + + // The vendor of the Java Runtime. + JvmVendor *string `mandatory:"false" json:"jvmVendor"` + + // The distribution of the Java Runtime. + JvmDistribution *string `mandatory:"false" json:"jvmDistribution"` + + // The version of the Java Runtime. + JvmVersion *string `mandatory:"false" json:"jvmVersion"` + + // The security status of the Java Runtime. + JvmSecurityStatus JreSecurityStatusEnum `mandatory:"false" json:"jvmSecurityStatus,omitempty"` + + // The approximate count of deployed applications in the Java Server instance. + ApproximateDeployedApplicationCount *int `mandatory:"false" json:"approximateDeployedApplicationCount"` + + // Lower bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeStart *common.SDKTime `mandatory:"false" json:"timeStart"` + + // Upper bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` + + // The date and time the resource was _first_ reported to JMS. + // This is potentially _before_ the specified time period provided by the filters. + // For example, a resource can be first reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeFirstSeen *common.SDKTime `mandatory:"false" json:"timeFirstSeen"` + + // The date and time the resource was _last_ reported to JMS. + // This is potentially _after_ the specified time period provided by the filters. + // For example, a resource can be last reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeLastSeen *common.SDKTime `mandatory:"false" json:"timeLastSeen"` +} + +func (m JavaServerInstanceUsage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JavaServerInstanceUsage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingJreSecurityStatusEnum(string(m.JvmSecurityStatus)); !ok && m.JvmSecurityStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for JvmSecurityStatus: %s. Supported values are: %s.", m.JvmSecurityStatus, strings.Join(GetJreSecurityStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/java_server_instance_usage_collection.go b/jms/java_server_instance_usage_collection.go new file mode 100644 index 0000000000..aa1516b60c --- /dev/null +++ b/jms/java_server_instance_usage_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JavaServerInstanceUsageCollection Results of an Java Server instance usage search. Contains Java Server usage items. +type JavaServerInstanceUsageCollection struct { + + // A list of Java Server instance usages. + Items []JavaServerInstanceUsage `mandatory:"true" json:"items"` +} + +func (m JavaServerInstanceUsageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JavaServerInstanceUsageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/java_server_sort_by.go b/jms/java_server_sort_by.go new file mode 100644 index 0000000000..cc776868c2 --- /dev/null +++ b/jms/java_server_sort_by.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// JavaServerSortByEnum Enum with underlying type: string +type JavaServerSortByEnum string + +// Set of constants representing the allowable values for JavaServerSortByEnum +const ( + JavaServerSortByServerName JavaServerSortByEnum = "serverName" + JavaServerSortByServerVersion JavaServerSortByEnum = "serverVersion" + JavaServerSortByServerInstanceCount JavaServerSortByEnum = "serverInstanceCount" + JavaServerSortByApproximateDeployedApplicationCount JavaServerSortByEnum = "approximateDeployedApplicationCount" + JavaServerSortByTimeFirstSeen JavaServerSortByEnum = "timeFirstSeen" + JavaServerSortByTimeLastSeen JavaServerSortByEnum = "timeLastSeen" +) + +var mappingJavaServerSortByEnum = map[string]JavaServerSortByEnum{ + "serverName": JavaServerSortByServerName, + "serverVersion": JavaServerSortByServerVersion, + "serverInstanceCount": JavaServerSortByServerInstanceCount, + "approximateDeployedApplicationCount": JavaServerSortByApproximateDeployedApplicationCount, + "timeFirstSeen": JavaServerSortByTimeFirstSeen, + "timeLastSeen": JavaServerSortByTimeLastSeen, +} + +var mappingJavaServerSortByEnumLowerCase = map[string]JavaServerSortByEnum{ + "servername": JavaServerSortByServerName, + "serverversion": JavaServerSortByServerVersion, + "serverinstancecount": JavaServerSortByServerInstanceCount, + "approximatedeployedapplicationcount": JavaServerSortByApproximateDeployedApplicationCount, + "timefirstseen": JavaServerSortByTimeFirstSeen, + "timelastseen": JavaServerSortByTimeLastSeen, +} + +// GetJavaServerSortByEnumValues Enumerates the set of values for JavaServerSortByEnum +func GetJavaServerSortByEnumValues() []JavaServerSortByEnum { + values := make([]JavaServerSortByEnum, 0) + for _, v := range mappingJavaServerSortByEnum { + values = append(values, v) + } + return values +} + +// GetJavaServerSortByEnumStringValues Enumerates the set of values in String for JavaServerSortByEnum +func GetJavaServerSortByEnumStringValues() []string { + return []string{ + "serverName", + "serverVersion", + "serverInstanceCount", + "approximateDeployedApplicationCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingJavaServerSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingJavaServerSortByEnum(val string) (JavaServerSortByEnum, bool) { + enum, ok := mappingJavaServerSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/java_server_usage.go b/jms/java_server_usage.go new file mode 100644 index 0000000000..b4d93a477c --- /dev/null +++ b/jms/java_server_usage.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JavaServerUsage Java Server usage during a specified time period. +type JavaServerUsage struct { + + // The internal identifier of the Java Server. + ServerKey *string `mandatory:"true" json:"serverKey"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the related fleet. + FleetId *string `mandatory:"true" json:"fleetId"` + + // The name of the Java Server. + ServerName *string `mandatory:"true" json:"serverName"` + + // The version of the Java Server. + ServerVersion *string `mandatory:"false" json:"serverVersion"` + + // The count of server instances of the Java Server. + ServerInstanceCount *int `mandatory:"false" json:"serverInstanceCount"` + + // The approximate count of deployed applications in the Java Server. + ApproximateDeployedApplicationCount *int `mandatory:"false" json:"approximateDeployedApplicationCount"` + + // Lower bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeStart *common.SDKTime `mandatory:"false" json:"timeStart"` + + // Upper bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` + + // The date and time the resource was _first_ reported to JMS. + // This is potentially _before_ the specified time period provided by the filters. + // For example, a resource can be first reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeFirstSeen *common.SDKTime `mandatory:"false" json:"timeFirstSeen"` + + // The date and time the resource was _last_ reported to JMS. + // This is potentially _after_ the specified time period provided by the filters. + // For example, a resource can be last reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeLastSeen *common.SDKTime `mandatory:"false" json:"timeLastSeen"` +} + +func (m JavaServerUsage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JavaServerUsage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/java_server_usage_collection.go b/jms/java_server_usage_collection.go new file mode 100644 index 0000000000..756429bde4 --- /dev/null +++ b/jms/java_server_usage_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JavaServerUsageCollection Results of an Java Server usage search. Contains Java Server usage items. +type JavaServerUsageCollection struct { + + // A list of Java Server usages. + Items []JavaServerUsage `mandatory:"true" json:"items"` +} + +func (m JavaServerUsageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JavaServerUsageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/jfr_attachment_target.go b/jms/jfr_attachment_target.go new file mode 100644 index 0000000000..b10d9c2836 --- /dev/null +++ b/jms/jfr_attachment_target.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JfrAttachmentTarget The target to collect JFR data. A target is a managed instance, with options to further limit to specific application and/or Java runtime. +// When the applicationKey isn't specified, then all applications are selected. +// When the jreKey isn't specified, then all supported Java runtime versions are selected. +type JfrAttachmentTarget struct { + + // OCID of the Managed Instance to collect JFR data. + ManagedInstanceId *string `mandatory:"true" json:"managedInstanceId"` + + // Unique key that identify the application for JFR data collection. + ApplicationKey *string `mandatory:"false" json:"applicationKey"` + + // Unique key that identify the JVM for JFR data collection. + JreKey *string `mandatory:"false" json:"jreKey"` +} + +func (m JfrAttachmentTarget) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JfrAttachmentTarget) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/jfr_recording.go b/jms/jfr_recording.go new file mode 100644 index 0000000000..bee59ac870 --- /dev/null +++ b/jms/jfr_recording.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// JfrRecording JfrRecording configuration +type JfrRecording struct { + + // JfrRecording flag to store enabled or disabled status + IsEnabled *bool `mandatory:"false" json:"isEnabled"` +} + +func (m JfrRecording) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m JfrRecording) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/jms_javamanagementservice_client.go b/jms/jms_javamanagementservice_client.go index a8cf855101..3b44d9d999 100644 --- a/jms/jms_javamanagementservice_client.go +++ b/jms/jms_javamanagementservice_client.go @@ -460,6 +460,64 @@ func (client JavaManagementServiceClient) deleteBlocklist(ctx context.Context, r return response, err } +// DeleteCryptoAnalysisResult Deletes only the metadata of the Crypto Event Analysis result, but the file remains in the object storage. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/DeleteCryptoAnalysisResult.go.html to see an example of how to use DeleteCryptoAnalysisResult API. +// A default retry strategy applies to this operation DeleteCryptoAnalysisResult() +func (client JavaManagementServiceClient) DeleteCryptoAnalysisResult(ctx context.Context, request DeleteCryptoAnalysisResultRequest) (response DeleteCryptoAnalysisResultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteCryptoAnalysisResult, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteCryptoAnalysisResultResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteCryptoAnalysisResultResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteCryptoAnalysisResultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCryptoAnalysisResultResponse") + } + return +} + +// deleteCryptoAnalysisResult implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) deleteCryptoAnalysisResult(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/fleets/{fleetId}/cryptoAnalysisResults/{cryptoAnalysisResultId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteCryptoAnalysisResultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/CryptoAnalysisResult/DeleteCryptoAnalysisResult" + err = common.PostProcessServiceError(err, "JavaManagementService", "DeleteCryptoAnalysisResult", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteFleet Deletes the Fleet specified by an identifier. // // See also @@ -575,6 +633,64 @@ func (client JavaManagementServiceClient) generateAgentDeployScript(ctx context. return response, err } +// GetCryptoAnalysisResult Retrieve metadata of the Crypto Event Analysis result. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/GetCryptoAnalysisResult.go.html to see an example of how to use GetCryptoAnalysisResult API. +// A default retry strategy applies to this operation GetCryptoAnalysisResult() +func (client JavaManagementServiceClient) GetCryptoAnalysisResult(ctx context.Context, request GetCryptoAnalysisResultRequest) (response GetCryptoAnalysisResultResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getCryptoAnalysisResult, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCryptoAnalysisResultResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCryptoAnalysisResultResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCryptoAnalysisResultResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCryptoAnalysisResultResponse") + } + return +} + +// getCryptoAnalysisResult implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) getCryptoAnalysisResult(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/cryptoAnalysisResults/{cryptoAnalysisResultId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCryptoAnalysisResultResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/CryptoAnalysisResult/GetCryptoAnalysisResult" + err = common.PostProcessServiceError(err, "JavaManagementService", "GetCryptoAnalysisResult", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetFleet Retrieve a Fleet with the specified identifier. // // See also @@ -633,6 +749,64 @@ func (client JavaManagementServiceClient) getFleet(ctx context.Context, request return response, err } +// GetFleetAdvancedFeatureConfiguration Returns fleet level advanced feature configuration +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/GetFleetAdvancedFeatureConfiguration.go.html to see an example of how to use GetFleetAdvancedFeatureConfiguration API. +// A default retry strategy applies to this operation GetFleetAdvancedFeatureConfiguration() +func (client JavaManagementServiceClient) GetFleetAdvancedFeatureConfiguration(ctx context.Context, request GetFleetAdvancedFeatureConfigurationRequest) (response GetFleetAdvancedFeatureConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getFleetAdvancedFeatureConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetFleetAdvancedFeatureConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetFleetAdvancedFeatureConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetFleetAdvancedFeatureConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetFleetAdvancedFeatureConfigurationResponse") + } + return +} + +// getFleetAdvancedFeatureConfiguration implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) getFleetAdvancedFeatureConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/advancedFeatureConfiguration", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetFleetAdvancedFeatureConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/FleetAdvancedFeatureConfiguration/GetFleetAdvancedFeatureConfiguration" + err = common.PostProcessServiceError(err, "JavaManagementService", "GetFleetAdvancedFeatureConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetFleetAgentConfiguration Retrieve a Fleet Agent Configuration for the specified Fleet. // // See also @@ -691,7 +865,7 @@ func (client JavaManagementServiceClient) getFleetAgentConfiguration(ctx context return response, err } -// GetJavaFamily Returns details of a Java release family based on specified version. +// GetJavaFamily Returns metadata associated with a specific Java release family. // // See also // @@ -923,6 +1097,64 @@ func (client JavaManagementServiceClient) listBlocklists(ctx context.Context, re return response, err } +// ListCryptoAnalysisResults List Crypto Event Analysis results. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/ListCryptoAnalysisResults.go.html to see an example of how to use ListCryptoAnalysisResults API. +// A default retry strategy applies to this operation ListCryptoAnalysisResults() +func (client JavaManagementServiceClient) ListCryptoAnalysisResults(ctx context.Context, request ListCryptoAnalysisResultsRequest) (response ListCryptoAnalysisResultsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listCryptoAnalysisResults, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCryptoAnalysisResultsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCryptoAnalysisResultsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCryptoAnalysisResultsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCryptoAnalysisResultsResponse") + } + return +} + +// listCryptoAnalysisResults implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) listCryptoAnalysisResults(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/cryptoAnalysisResults", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCryptoAnalysisResultsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/CryptoAnalysisResult/ListCryptoAnalysisResults" + err = common.PostProcessServiceError(err, "JavaManagementService", "ListCryptoAnalysisResults", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListFleets Returns a list of all the Fleets contained by a compartment. The query parameter `compartmentId` // is required unless the query parameter `id` is specified. // @@ -1090,7 +1322,7 @@ func (client JavaManagementServiceClient) listJavaFamilies(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/JavaFamilyCollection/ListJavaFamilies" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/JavaFamily/ListJavaFamilies" err = common.PostProcessServiceError(err, "JavaManagementService", "ListJavaFamilies", apiReferenceLink) return response, err } @@ -1510,13 +1742,14 @@ func (client JavaManagementServiceClient) removeFleetInstallationSites(ctx conte return response, err } -// SummarizeApplicationUsage List application usage in a Fleet filtered by query parameters. +// RequestCryptoAnalyses Request to perform crypto analyses. The result of crypto analysis will be uploaded to the +// object storage bucket desiginated when enable Crypto Event Analysis feature. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeApplicationUsage.go.html to see an example of how to use SummarizeApplicationUsage API. -// A default retry strategy applies to this operation SummarizeApplicationUsage() -func (client JavaManagementServiceClient) SummarizeApplicationUsage(ctx context.Context, request SummarizeApplicationUsageRequest) (response SummarizeApplicationUsageResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/RequestCryptoAnalyses.go.html to see an example of how to use RequestCryptoAnalyses API. +// A default retry strategy applies to this operation RequestCryptoAnalyses() +func (client JavaManagementServiceClient) RequestCryptoAnalyses(ctx context.Context, request RequestCryptoAnalysesRequest) (response RequestCryptoAnalysesResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1525,42 +1758,42 @@ func (client JavaManagementServiceClient) SummarizeApplicationUsage(ctx context. if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.summarizeApplicationUsage, policy) + ociResponse, err = common.Retry(ctx, request, client.requestCryptoAnalyses, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = SummarizeApplicationUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RequestCryptoAnalysesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = SummarizeApplicationUsageResponse{} + response = RequestCryptoAnalysesResponse{} } } return } - if convertedResponse, ok := ociResponse.(SummarizeApplicationUsageResponse); ok { + if convertedResponse, ok := ociResponse.(RequestCryptoAnalysesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into SummarizeApplicationUsageResponse") + err = fmt.Errorf("failed to convert OCIResponse into RequestCryptoAnalysesResponse") } return } -// summarizeApplicationUsage implements the OCIOperation interface (enables retrying operations) -func (client JavaManagementServiceClient) summarizeApplicationUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// requestCryptoAnalyses implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) requestCryptoAnalyses(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeApplicationUsage", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/fleets/{fleetId}/actions/requestCryptoAnalyses", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response SummarizeApplicationUsageResponse + var response RequestCryptoAnalysesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/ApplicationUsage/SummarizeApplicationUsage" - err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeApplicationUsage", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/Fleet/RequestCryptoAnalyses" + err = common.PostProcessServiceError(err, "JavaManagementService", "RequestCryptoAnalyses", apiReferenceLink) return response, err } @@ -1568,13 +1801,14 @@ func (client JavaManagementServiceClient) summarizeApplicationUsage(ctx context. return response, err } -// SummarizeInstallationUsage List Java installation usage in a Fleet filtered by query parameters. +// RequestJfrRecordings Request to collect the JFR recordings on the selected target. The JFR files are uploaded +// to the object storage bucket that you designated when you enabled the recording feature. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeInstallationUsage.go.html to see an example of how to use SummarizeInstallationUsage API. -// A default retry strategy applies to this operation SummarizeInstallationUsage() -func (client JavaManagementServiceClient) SummarizeInstallationUsage(ctx context.Context, request SummarizeInstallationUsageRequest) (response SummarizeInstallationUsageResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/RequestJfrRecordings.go.html to see an example of how to use RequestJfrRecordings API. +// A default retry strategy applies to this operation RequestJfrRecordings() +func (client JavaManagementServiceClient) RequestJfrRecordings(ctx context.Context, request RequestJfrRecordingsRequest) (response RequestJfrRecordingsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1583,42 +1817,42 @@ func (client JavaManagementServiceClient) SummarizeInstallationUsage(ctx context if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.summarizeInstallationUsage, policy) + ociResponse, err = common.Retry(ctx, request, client.requestJfrRecordings, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = SummarizeInstallationUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RequestJfrRecordingsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = SummarizeInstallationUsageResponse{} + response = RequestJfrRecordingsResponse{} } } return } - if convertedResponse, ok := ociResponse.(SummarizeInstallationUsageResponse); ok { + if convertedResponse, ok := ociResponse.(RequestJfrRecordingsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into SummarizeInstallationUsageResponse") + err = fmt.Errorf("failed to convert OCIResponse into RequestJfrRecordingsResponse") } return } -// summarizeInstallationUsage implements the OCIOperation interface (enables retrying operations) -func (client JavaManagementServiceClient) summarizeInstallationUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// requestJfrRecordings implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) requestJfrRecordings(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeInstallationUsage", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/fleets/{fleetId}/actions/requestJfrRecordings", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response SummarizeInstallationUsageResponse + var response RequestJfrRecordingsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/InstallationUsage/SummarizeInstallationUsage" - err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeInstallationUsage", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/Fleet/RequestJfrRecordings" + err = common.PostProcessServiceError(err, "JavaManagementService", "RequestJfrRecordings", apiReferenceLink) return response, err } @@ -1626,13 +1860,13 @@ func (client JavaManagementServiceClient) summarizeInstallationUsage(ctx context return response, err } -// SummarizeJreUsage List Java Runtime usage in a specified Fleet filtered by query parameters. +// ScanJavaServerUsage Scan Java server usage in a fleet. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeJreUsage.go.html to see an example of how to use SummarizeJreUsage API. -// A default retry strategy applies to this operation SummarizeJreUsage() -func (client JavaManagementServiceClient) SummarizeJreUsage(ctx context.Context, request SummarizeJreUsageRequest) (response SummarizeJreUsageResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/ScanJavaServerUsage.go.html to see an example of how to use ScanJavaServerUsage API. +// A default retry strategy applies to this operation ScanJavaServerUsage() +func (client JavaManagementServiceClient) ScanJavaServerUsage(ctx context.Context, request ScanJavaServerUsageRequest) (response ScanJavaServerUsageResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1641,42 +1875,47 @@ func (client JavaManagementServiceClient) SummarizeJreUsage(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.summarizeJreUsage, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.scanJavaServerUsage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = SummarizeJreUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ScanJavaServerUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = SummarizeJreUsageResponse{} + response = ScanJavaServerUsageResponse{} } } return } - if convertedResponse, ok := ociResponse.(SummarizeJreUsageResponse); ok { + if convertedResponse, ok := ociResponse.(ScanJavaServerUsageResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into SummarizeJreUsageResponse") + err = fmt.Errorf("failed to convert OCIResponse into ScanJavaServerUsageResponse") } return } -// summarizeJreUsage implements the OCIOperation interface (enables retrying operations) -func (client JavaManagementServiceClient) summarizeJreUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// scanJavaServerUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) scanJavaServerUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeJreUsage", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/fleets/{fleetId}/actions/scanJavaServerUsage", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response SummarizeJreUsageResponse + var response ScanJavaServerUsageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/JreUsage/SummarizeJreUsage" - err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeJreUsage", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/JavaServerUsage/ScanJavaServerUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "ScanJavaServerUsage", apiReferenceLink) return response, err } @@ -1684,13 +1923,13 @@ func (client JavaManagementServiceClient) summarizeJreUsage(ctx context.Context, return response, err } -// SummarizeManagedInstanceUsage List managed instance usage in a Fleet filtered by query parameters. +// ScanLibraryUsage Scan library usage in a fleet. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeManagedInstanceUsage.go.html to see an example of how to use SummarizeManagedInstanceUsage API. -// A default retry strategy applies to this operation SummarizeManagedInstanceUsage() -func (client JavaManagementServiceClient) SummarizeManagedInstanceUsage(ctx context.Context, request SummarizeManagedInstanceUsageRequest) (response SummarizeManagedInstanceUsageResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/ScanLibraryUsage.go.html to see an example of how to use ScanLibraryUsage API. +// A default retry strategy applies to this operation ScanLibraryUsage() +func (client JavaManagementServiceClient) ScanLibraryUsage(ctx context.Context, request ScanLibraryUsageRequest) (response ScanLibraryUsageResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1699,42 +1938,47 @@ func (client JavaManagementServiceClient) SummarizeManagedInstanceUsage(ctx cont if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.summarizeManagedInstanceUsage, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.scanLibraryUsage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = SummarizeManagedInstanceUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ScanLibraryUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = SummarizeManagedInstanceUsageResponse{} + response = ScanLibraryUsageResponse{} } } return } - if convertedResponse, ok := ociResponse.(SummarizeManagedInstanceUsageResponse); ok { + if convertedResponse, ok := ociResponse.(ScanLibraryUsageResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into SummarizeManagedInstanceUsageResponse") + err = fmt.Errorf("failed to convert OCIResponse into ScanLibraryUsageResponse") } return } -// summarizeManagedInstanceUsage implements the OCIOperation interface (enables retrying operations) -func (client JavaManagementServiceClient) summarizeManagedInstanceUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// scanLibraryUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) scanLibraryUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeManagedInstanceUsage", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/fleets/{fleetId}/actions/scanLibraryUsage", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response SummarizeManagedInstanceUsageResponse + var response ScanLibraryUsageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/ManagedInstanceUsage/SummarizeManagedInstanceUsage" - err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeManagedInstanceUsage", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/LibraryUsage/ScanLibraryUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "ScanLibraryUsage", apiReferenceLink) return response, err } @@ -1742,13 +1986,13 @@ func (client JavaManagementServiceClient) summarizeManagedInstanceUsage(ctx cont return response, err } -// SummarizeResourceInventory Retrieve the inventory of JMS resources in the specified compartment: a list of the number of _active_ fleets, managed instances, Java Runtimes, Java installations, and applications. +// SummarizeApplicationUsage List application usage in a Fleet filtered by query parameters. // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeResourceInventory.go.html to see an example of how to use SummarizeResourceInventory API. -// A default retry strategy applies to this operation SummarizeResourceInventory() -func (client JavaManagementServiceClient) SummarizeResourceInventory(ctx context.Context, request SummarizeResourceInventoryRequest) (response SummarizeResourceInventoryResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeApplicationUsage.go.html to see an example of how to use SummarizeApplicationUsage API. +// A default retry strategy applies to this operation SummarizeApplicationUsage() +func (client JavaManagementServiceClient) SummarizeApplicationUsage(ctx context.Context, request SummarizeApplicationUsageRequest) (response SummarizeApplicationUsageResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1757,14 +2001,478 @@ func (client JavaManagementServiceClient) SummarizeResourceInventory(ctx context if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.summarizeResourceInventory, policy) + ociResponse, err = common.Retry(ctx, request, client.summarizeApplicationUsage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = SummarizeResourceInventoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = SummarizeApplicationUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = SummarizeResourceInventoryResponse{} + response = SummarizeApplicationUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeApplicationUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeApplicationUsageResponse") + } + return +} + +// summarizeApplicationUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeApplicationUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeApplicationUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeApplicationUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/ApplicationUsage/SummarizeApplicationUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeApplicationUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeDeployedApplicationUsage List deployed applications in a fleet filtered by query parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeDeployedApplicationUsage.go.html to see an example of how to use SummarizeDeployedApplicationUsage API. +// A default retry strategy applies to this operation SummarizeDeployedApplicationUsage() +func (client JavaManagementServiceClient) SummarizeDeployedApplicationUsage(ctx context.Context, request SummarizeDeployedApplicationUsageRequest) (response SummarizeDeployedApplicationUsageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeDeployedApplicationUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeDeployedApplicationUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeDeployedApplicationUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeDeployedApplicationUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeDeployedApplicationUsageResponse") + } + return +} + +// summarizeDeployedApplicationUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeDeployedApplicationUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeDeployedApplicationUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeDeployedApplicationUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/DeployedApplicationUsage/SummarizeDeployedApplicationUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeDeployedApplicationUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeInstallationUsage List Java installation usage in a Fleet filtered by query parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeInstallationUsage.go.html to see an example of how to use SummarizeInstallationUsage API. +// A default retry strategy applies to this operation SummarizeInstallationUsage() +func (client JavaManagementServiceClient) SummarizeInstallationUsage(ctx context.Context, request SummarizeInstallationUsageRequest) (response SummarizeInstallationUsageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeInstallationUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeInstallationUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeInstallationUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeInstallationUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeInstallationUsageResponse") + } + return +} + +// summarizeInstallationUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeInstallationUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeInstallationUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeInstallationUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/InstallationUsage/SummarizeInstallationUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeInstallationUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeJavaServerInstanceUsage List Java server instances in a fleet filtered by query parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeJavaServerInstanceUsage.go.html to see an example of how to use SummarizeJavaServerInstanceUsage API. +// A default retry strategy applies to this operation SummarizeJavaServerInstanceUsage() +func (client JavaManagementServiceClient) SummarizeJavaServerInstanceUsage(ctx context.Context, request SummarizeJavaServerInstanceUsageRequest) (response SummarizeJavaServerInstanceUsageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeJavaServerInstanceUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeJavaServerInstanceUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeJavaServerInstanceUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeJavaServerInstanceUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeJavaServerInstanceUsageResponse") + } + return +} + +// summarizeJavaServerInstanceUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeJavaServerInstanceUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeJavaServerInstanceUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeJavaServerInstanceUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/JavaServerInstanceUsage/SummarizeJavaServerInstanceUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeJavaServerInstanceUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeJavaServerUsage List Java servers in a fleet filtered by query parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeJavaServerUsage.go.html to see an example of how to use SummarizeJavaServerUsage API. +// A default retry strategy applies to this operation SummarizeJavaServerUsage() +func (client JavaManagementServiceClient) SummarizeJavaServerUsage(ctx context.Context, request SummarizeJavaServerUsageRequest) (response SummarizeJavaServerUsageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeJavaServerUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeJavaServerUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeJavaServerUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeJavaServerUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeJavaServerUsageResponse") + } + return +} + +// summarizeJavaServerUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeJavaServerUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeJavaServerUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeJavaServerUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/JavaServerUsage/SummarizeJavaServerUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeJavaServerUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeJreUsage List Java Runtime usage in a specified Fleet filtered by query parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeJreUsage.go.html to see an example of how to use SummarizeJreUsage API. +// A default retry strategy applies to this operation SummarizeJreUsage() +func (client JavaManagementServiceClient) SummarizeJreUsage(ctx context.Context, request SummarizeJreUsageRequest) (response SummarizeJreUsageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeJreUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeJreUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeJreUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeJreUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeJreUsageResponse") + } + return +} + +// summarizeJreUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeJreUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeJreUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeJreUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/JreUsage/SummarizeJreUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeJreUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeLibraryUsage List libraries in a fleet filtered by query parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeLibraryUsage.go.html to see an example of how to use SummarizeLibraryUsage API. +// A default retry strategy applies to this operation SummarizeLibraryUsage() +func (client JavaManagementServiceClient) SummarizeLibraryUsage(ctx context.Context, request SummarizeLibraryUsageRequest) (response SummarizeLibraryUsageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeLibraryUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeLibraryUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeLibraryUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeLibraryUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeLibraryUsageResponse") + } + return +} + +// summarizeLibraryUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeLibraryUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeLibraryUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeLibraryUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/LibraryUsage/SummarizeLibraryUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeLibraryUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeManagedInstanceUsage List managed instance usage in a Fleet filtered by query parameters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeManagedInstanceUsage.go.html to see an example of how to use SummarizeManagedInstanceUsage API. +// A default retry strategy applies to this operation SummarizeManagedInstanceUsage() +func (client JavaManagementServiceClient) SummarizeManagedInstanceUsage(ctx context.Context, request SummarizeManagedInstanceUsageRequest) (response SummarizeManagedInstanceUsageResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeManagedInstanceUsage, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeManagedInstanceUsageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeManagedInstanceUsageResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(SummarizeManagedInstanceUsageResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into SummarizeManagedInstanceUsageResponse") + } + return +} + +// summarizeManagedInstanceUsage implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) summarizeManagedInstanceUsage(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/fleets/{fleetId}/actions/summarizeManagedInstanceUsage", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response SummarizeManagedInstanceUsageResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/ManagedInstanceUsage/SummarizeManagedInstanceUsage" + err = common.PostProcessServiceError(err, "JavaManagementService", "SummarizeManagedInstanceUsage", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// SummarizeResourceInventory Retrieve the inventory of JMS resources in the specified compartment: a list of the number of _active_ fleets, managed instances, Java Runtimes, Java installations, and applications. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeResourceInventory.go.html to see an example of how to use SummarizeResourceInventory API. +// A default retry strategy applies to this operation SummarizeResourceInventory() +func (client JavaManagementServiceClient) SummarizeResourceInventory(ctx context.Context, request SummarizeResourceInventoryRequest) (response SummarizeResourceInventoryResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.summarizeResourceInventory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = SummarizeResourceInventoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = SummarizeResourceInventoryResponse{} } } return @@ -1858,6 +2566,70 @@ func (client JavaManagementServiceClient) updateFleet(ctx context.Context, reque return response, err } +// UpdateFleetAdvancedFeatureConfiguration Update advanced feature configurations for the fleet +// Ensure that the namespace and bucket storage are created prior to turning on the JfrRecording or CryptoEventAnalysis feature +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/UpdateFleetAdvancedFeatureConfiguration.go.html to see an example of how to use UpdateFleetAdvancedFeatureConfiguration API. +// A default retry strategy applies to this operation UpdateFleetAdvancedFeatureConfiguration() +func (client JavaManagementServiceClient) UpdateFleetAdvancedFeatureConfiguration(ctx context.Context, request UpdateFleetAdvancedFeatureConfigurationRequest) (response UpdateFleetAdvancedFeatureConfigurationResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.updateFleetAdvancedFeatureConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateFleetAdvancedFeatureConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateFleetAdvancedFeatureConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateFleetAdvancedFeatureConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateFleetAdvancedFeatureConfigurationResponse") + } + return +} + +// updateFleetAdvancedFeatureConfiguration implements the OCIOperation interface (enables retrying operations) +func (client JavaManagementServiceClient) updateFleetAdvancedFeatureConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/fleets/{fleetId}/advancedFeatureConfiguration", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateFleetAdvancedFeatureConfigurationResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms/20210610/FleetAdvancedFeatureConfiguration/UpdateFleetAdvancedFeatureConfiguration" + err = common.PostProcessServiceError(err, "JavaManagementService", "UpdateFleetAdvancedFeatureConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateFleetAgentConfiguration Update the Fleet Agent Configuration for the specified Fleet. // // See also diff --git a/jms/key_size_algorithm.go b/jms/key_size_algorithm.go new file mode 100644 index 0000000000..3c57c098cb --- /dev/null +++ b/jms/key_size_algorithm.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// KeySizeAlgorithm The algorithm object with name and key size properties. +type KeySizeAlgorithm struct { + + // The algorithm name. + Name AlgorithmsEnum `mandatory:"false" json:"name,omitempty"` + + // Key size for the encryption algorithm. + // Allowed values: 256 for EC, 2048 for DH/DSA/RSA + KeySize *int `mandatory:"false" json:"keySize"` +} + +func (m KeySizeAlgorithm) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m KeySizeAlgorithm) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingAlgorithmsEnum(string(m.Name)); !ok && m.Name != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Name: %s. Supported values are: %s.", m.Name, strings.Join(GetAlgorithmsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/lcm.go b/jms/lcm.go new file mode 100644 index 0000000000..a9b75b351d --- /dev/null +++ b/jms/lcm.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Lcm Enable lifecycle management and set post action configurations +type Lcm struct { + + // Lcm flag to store enabled or disabled status + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + PostInstallationActions *PostInstallationActionSettings `mandatory:"false" json:"postInstallationActions"` +} + +func (m Lcm) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Lcm) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/library_sort_by.go b/jms/library_sort_by.go new file mode 100644 index 0000000000..224656f0bc --- /dev/null +++ b/jms/library_sort_by.go @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// LibrarySortByEnum Enum with underlying type: string +type LibrarySortByEnum string + +// Set of constants representing the allowable values for LibrarySortByEnum +const ( + LibrarySortByApplicationCount LibrarySortByEnum = "applicationCount" + LibrarySortByJavaServerInstanceCount LibrarySortByEnum = "javaServerInstanceCount" + LibrarySortByCvssScore LibrarySortByEnum = "cvssScore" + LibrarySortByDeployedApplicationCount LibrarySortByEnum = "deployedApplicationCount" + LibrarySortByLibraryName LibrarySortByEnum = "libraryName" + LibrarySortByLibraryVersion LibrarySortByEnum = "libraryVersion" + LibrarySortByManagedInstanceCount LibrarySortByEnum = "managedInstanceCount" + LibrarySortByTimeFirstSeen LibrarySortByEnum = "timeFirstSeen" + LibrarySortByTimeLastSeen LibrarySortByEnum = "timeLastSeen" +) + +var mappingLibrarySortByEnum = map[string]LibrarySortByEnum{ + "applicationCount": LibrarySortByApplicationCount, + "javaServerInstanceCount": LibrarySortByJavaServerInstanceCount, + "cvssScore": LibrarySortByCvssScore, + "deployedApplicationCount": LibrarySortByDeployedApplicationCount, + "libraryName": LibrarySortByLibraryName, + "libraryVersion": LibrarySortByLibraryVersion, + "managedInstanceCount": LibrarySortByManagedInstanceCount, + "timeFirstSeen": LibrarySortByTimeFirstSeen, + "timeLastSeen": LibrarySortByTimeLastSeen, +} + +var mappingLibrarySortByEnumLowerCase = map[string]LibrarySortByEnum{ + "applicationcount": LibrarySortByApplicationCount, + "javaserverinstancecount": LibrarySortByJavaServerInstanceCount, + "cvssscore": LibrarySortByCvssScore, + "deployedapplicationcount": LibrarySortByDeployedApplicationCount, + "libraryname": LibrarySortByLibraryName, + "libraryversion": LibrarySortByLibraryVersion, + "managedinstancecount": LibrarySortByManagedInstanceCount, + "timefirstseen": LibrarySortByTimeFirstSeen, + "timelastseen": LibrarySortByTimeLastSeen, +} + +// GetLibrarySortByEnumValues Enumerates the set of values for LibrarySortByEnum +func GetLibrarySortByEnumValues() []LibrarySortByEnum { + values := make([]LibrarySortByEnum, 0) + for _, v := range mappingLibrarySortByEnum { + values = append(values, v) + } + return values +} + +// GetLibrarySortByEnumStringValues Enumerates the set of values in String for LibrarySortByEnum +func GetLibrarySortByEnumStringValues() []string { + return []string{ + "applicationCount", + "javaServerInstanceCount", + "cvssScore", + "deployedApplicationCount", + "libraryName", + "libraryVersion", + "managedInstanceCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingLibrarySortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingLibrarySortByEnum(val string) (LibrarySortByEnum, bool) { + enum, ok := mappingLibrarySortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/library_usage.go b/jms/library_usage.go new file mode 100644 index 0000000000..7301f4ed94 --- /dev/null +++ b/jms/library_usage.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LibraryUsage Library usage during a specified time period. +type LibraryUsage struct { + + // The internal identifier of the library. + LibraryKey *string `mandatory:"true" json:"libraryKey"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the related fleet. + FleetId *string `mandatory:"true" json:"fleetId"` + + // The name of the library. + LibraryName *string `mandatory:"true" json:"libraryName"` + + // The version of the library. + LibraryVersion *string `mandatory:"false" json:"libraryVersion"` + + // The Common Vulnerability Scoring System (CVSS) score. + CvssScore *float32 `mandatory:"false" json:"cvssScore"` + + // The approximate count of applications using the library. + ApproximateApplicationCount *int `mandatory:"false" json:"approximateApplicationCount"` + + // The approximate count of Java server instances using the library. + ApproximateJavaServerInstanceCount *int `mandatory:"false" json:"approximateJavaServerInstanceCount"` + + // The approximate count of deployed applications using the library. + ApproximateDeployedApplicationCount *int `mandatory:"false" json:"approximateDeployedApplicationCount"` + + // The approximate count of managed instances using the library. + ApproximateManagedInstanceCount *int `mandatory:"false" json:"approximateManagedInstanceCount"` + + // Lower bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeStart *common.SDKTime `mandatory:"false" json:"timeStart"` + + // Upper bound of the specified time period filter. JMS provides a view of the data that is _per day_. The query uses only the date element of the parameter. + TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` + + // The date and time the resource was _first_ reported to JMS. + // This is potentially _before_ the specified time period provided by the filters. + // For example, a resource can be first reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeFirstSeen *common.SDKTime `mandatory:"false" json:"timeFirstSeen"` + + // The date and time the resource was _last_ reported to JMS. + // This is potentially _after_ the specified time period provided by the filters. + // For example, a resource can be last reported to JMS before the start of a specified time period, + // if it is also reported during the time period. + TimeLastSeen *common.SDKTime `mandatory:"false" json:"timeLastSeen"` +} + +func (m LibraryUsage) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LibraryUsage) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/library_usage_collection.go b/jms/library_usage_collection.go new file mode 100644 index 0000000000..3e7bf12630 --- /dev/null +++ b/jms/library_usage_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LibraryUsageCollection Results of a library usage search. Contains library usage items. +type LibraryUsageCollection struct { + + // A list of library usages. + Items []LibraryUsage `mandatory:"true" json:"items"` +} + +func (m LibraryUsageCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LibraryUsageCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/list_blocklists_request_response.go b/jms/list_blocklists_request_response.go index 2f4a3e3512..7578438c5f 100644 --- a/jms/list_blocklists_request_response.go +++ b/jms/list_blocklists_request_response.go @@ -135,6 +135,10 @@ const ( ListBlocklistsOperationUpdateFleetAgentConfiguration ListBlocklistsOperationEnum = "UPDATE_FLEET_AGENT_CONFIGURATION" ListBlocklistsOperationDeleteJavaInstallation ListBlocklistsOperationEnum = "DELETE_JAVA_INSTALLATION" ListBlocklistsOperationCreateJavaInstallation ListBlocklistsOperationEnum = "CREATE_JAVA_INSTALLATION" + ListBlocklistsOperationCollectJfr ListBlocklistsOperationEnum = "COLLECT_JFR" + ListBlocklistsOperationRequestCryptoEventAnalysis ListBlocklistsOperationEnum = "REQUEST_CRYPTO_EVENT_ANALYSIS" + ListBlocklistsOperationScanJavaServerUsage ListBlocklistsOperationEnum = "SCAN_JAVA_SERVER_USAGE" + ListBlocklistsOperationScanLibraryUsage ListBlocklistsOperationEnum = "SCAN_LIBRARY_USAGE" ) var mappingListBlocklistsOperationEnum = map[string]ListBlocklistsOperationEnum{ @@ -145,6 +149,10 @@ var mappingListBlocklistsOperationEnum = map[string]ListBlocklistsOperationEnum{ "UPDATE_FLEET_AGENT_CONFIGURATION": ListBlocklistsOperationUpdateFleetAgentConfiguration, "DELETE_JAVA_INSTALLATION": ListBlocklistsOperationDeleteJavaInstallation, "CREATE_JAVA_INSTALLATION": ListBlocklistsOperationCreateJavaInstallation, + "COLLECT_JFR": ListBlocklistsOperationCollectJfr, + "REQUEST_CRYPTO_EVENT_ANALYSIS": ListBlocklistsOperationRequestCryptoEventAnalysis, + "SCAN_JAVA_SERVER_USAGE": ListBlocklistsOperationScanJavaServerUsage, + "SCAN_LIBRARY_USAGE": ListBlocklistsOperationScanLibraryUsage, } var mappingListBlocklistsOperationEnumLowerCase = map[string]ListBlocklistsOperationEnum{ @@ -155,6 +163,10 @@ var mappingListBlocklistsOperationEnumLowerCase = map[string]ListBlocklistsOpera "update_fleet_agent_configuration": ListBlocklistsOperationUpdateFleetAgentConfiguration, "delete_java_installation": ListBlocklistsOperationDeleteJavaInstallation, "create_java_installation": ListBlocklistsOperationCreateJavaInstallation, + "collect_jfr": ListBlocklistsOperationCollectJfr, + "request_crypto_event_analysis": ListBlocklistsOperationRequestCryptoEventAnalysis, + "scan_java_server_usage": ListBlocklistsOperationScanJavaServerUsage, + "scan_library_usage": ListBlocklistsOperationScanLibraryUsage, } // GetListBlocklistsOperationEnumValues Enumerates the set of values for ListBlocklistsOperationEnum @@ -176,6 +188,10 @@ func GetListBlocklistsOperationEnumStringValues() []string { "UPDATE_FLEET_AGENT_CONFIGURATION", "DELETE_JAVA_INSTALLATION", "CREATE_JAVA_INSTALLATION", + "COLLECT_JFR", + "REQUEST_CRYPTO_EVENT_ANALYSIS", + "SCAN_JAVA_SERVER_USAGE", + "SCAN_LIBRARY_USAGE", } } diff --git a/jms/list_crypto_analysis_results_request_response.go b/jms/list_crypto_analysis_results_request_response.go new file mode 100644 index 0000000000..9f468339d4 --- /dev/null +++ b/jms/list_crypto_analysis_results_request_response.go @@ -0,0 +1,261 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCryptoAnalysisResultsRequest wrapper for the ListCryptoAnalysisResults operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/ListCryptoAnalysisResults.go.html to see an example of how to use ListCryptoAnalysisResultsRequest. +type ListCryptoAnalysisResultsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // The aggregation mode of the crypto event analysis result. + AggregationMode ListCryptoAnalysisResultsAggregationModeEnum `mandatory:"false" contributesTo:"query" name:"aggregationMode" omitEmpty:"true"` + + // The Fleet-unique identifier of the related managed instance. + ManagedInstanceId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. The token is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order, either 'asc' or 'desc'. + SortOrder ListCryptoAnalysisResultsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort crypto event analysis results. Only one sort order may be provided. + // Default order for _timeCreated_, and _jreVersion_ is **descending**. + // Default order for _managedInstanceId_, _jreDistribution_, _jreVendor_ and _osName_ is **ascending**. + // If no value is specified _timeCreated_ is default. + SortBy ListCryptoAnalysisResultsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The start of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeStart"` + + // The end of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeEnd"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListCryptoAnalysisResultsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCryptoAnalysisResultsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListCryptoAnalysisResultsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCryptoAnalysisResultsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListCryptoAnalysisResultsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCryptoAnalysisResultsAggregationModeEnum(string(request.AggregationMode)); !ok && request.AggregationMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AggregationMode: %s. Supported values are: %s.", request.AggregationMode, strings.Join(GetListCryptoAnalysisResultsAggregationModeEnumStringValues(), ","))) + } + if _, ok := GetMappingListCryptoAnalysisResultsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListCryptoAnalysisResultsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListCryptoAnalysisResultsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListCryptoAnalysisResultsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCryptoAnalysisResultsResponse wrapper for the ListCryptoAnalysisResults operation +type ListCryptoAnalysisResultsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CryptoAnalysisResultCollection instances + CryptoAnalysisResultCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // Include this value as the `page` parameter for the subsequent GET request to get the next batch of items. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListCryptoAnalysisResultsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCryptoAnalysisResultsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCryptoAnalysisResultsAggregationModeEnum Enum with underlying type: string +type ListCryptoAnalysisResultsAggregationModeEnum string + +// Set of constants representing the allowable values for ListCryptoAnalysisResultsAggregationModeEnum +const ( + ListCryptoAnalysisResultsAggregationModeJfr ListCryptoAnalysisResultsAggregationModeEnum = "JFR" + ListCryptoAnalysisResultsAggregationModeManagedInstance ListCryptoAnalysisResultsAggregationModeEnum = "MANAGED_INSTANCE" +) + +var mappingListCryptoAnalysisResultsAggregationModeEnum = map[string]ListCryptoAnalysisResultsAggregationModeEnum{ + "JFR": ListCryptoAnalysisResultsAggregationModeJfr, + "MANAGED_INSTANCE": ListCryptoAnalysisResultsAggregationModeManagedInstance, +} + +var mappingListCryptoAnalysisResultsAggregationModeEnumLowerCase = map[string]ListCryptoAnalysisResultsAggregationModeEnum{ + "jfr": ListCryptoAnalysisResultsAggregationModeJfr, + "managed_instance": ListCryptoAnalysisResultsAggregationModeManagedInstance, +} + +// GetListCryptoAnalysisResultsAggregationModeEnumValues Enumerates the set of values for ListCryptoAnalysisResultsAggregationModeEnum +func GetListCryptoAnalysisResultsAggregationModeEnumValues() []ListCryptoAnalysisResultsAggregationModeEnum { + values := make([]ListCryptoAnalysisResultsAggregationModeEnum, 0) + for _, v := range mappingListCryptoAnalysisResultsAggregationModeEnum { + values = append(values, v) + } + return values +} + +// GetListCryptoAnalysisResultsAggregationModeEnumStringValues Enumerates the set of values in String for ListCryptoAnalysisResultsAggregationModeEnum +func GetListCryptoAnalysisResultsAggregationModeEnumStringValues() []string { + return []string{ + "JFR", + "MANAGED_INSTANCE", + } +} + +// GetMappingListCryptoAnalysisResultsAggregationModeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCryptoAnalysisResultsAggregationModeEnum(val string) (ListCryptoAnalysisResultsAggregationModeEnum, bool) { + enum, ok := mappingListCryptoAnalysisResultsAggregationModeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCryptoAnalysisResultsSortOrderEnum Enum with underlying type: string +type ListCryptoAnalysisResultsSortOrderEnum string + +// Set of constants representing the allowable values for ListCryptoAnalysisResultsSortOrderEnum +const ( + ListCryptoAnalysisResultsSortOrderAsc ListCryptoAnalysisResultsSortOrderEnum = "ASC" + ListCryptoAnalysisResultsSortOrderDesc ListCryptoAnalysisResultsSortOrderEnum = "DESC" +) + +var mappingListCryptoAnalysisResultsSortOrderEnum = map[string]ListCryptoAnalysisResultsSortOrderEnum{ + "ASC": ListCryptoAnalysisResultsSortOrderAsc, + "DESC": ListCryptoAnalysisResultsSortOrderDesc, +} + +var mappingListCryptoAnalysisResultsSortOrderEnumLowerCase = map[string]ListCryptoAnalysisResultsSortOrderEnum{ + "asc": ListCryptoAnalysisResultsSortOrderAsc, + "desc": ListCryptoAnalysisResultsSortOrderDesc, +} + +// GetListCryptoAnalysisResultsSortOrderEnumValues Enumerates the set of values for ListCryptoAnalysisResultsSortOrderEnum +func GetListCryptoAnalysisResultsSortOrderEnumValues() []ListCryptoAnalysisResultsSortOrderEnum { + values := make([]ListCryptoAnalysisResultsSortOrderEnum, 0) + for _, v := range mappingListCryptoAnalysisResultsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCryptoAnalysisResultsSortOrderEnumStringValues Enumerates the set of values in String for ListCryptoAnalysisResultsSortOrderEnum +func GetListCryptoAnalysisResultsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCryptoAnalysisResultsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCryptoAnalysisResultsSortOrderEnum(val string) (ListCryptoAnalysisResultsSortOrderEnum, bool) { + enum, ok := mappingListCryptoAnalysisResultsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCryptoAnalysisResultsSortByEnum Enum with underlying type: string +type ListCryptoAnalysisResultsSortByEnum string + +// Set of constants representing the allowable values for ListCryptoAnalysisResultsSortByEnum +const ( + ListCryptoAnalysisResultsSortByTimecreated ListCryptoAnalysisResultsSortByEnum = "timeCreated" + ListCryptoAnalysisResultsSortByManagedinstanceid ListCryptoAnalysisResultsSortByEnum = "managedInstanceId" + ListCryptoAnalysisResultsSortByWorkrequestid ListCryptoAnalysisResultsSortByEnum = "workRequestId" +) + +var mappingListCryptoAnalysisResultsSortByEnum = map[string]ListCryptoAnalysisResultsSortByEnum{ + "timeCreated": ListCryptoAnalysisResultsSortByTimecreated, + "managedInstanceId": ListCryptoAnalysisResultsSortByManagedinstanceid, + "workRequestId": ListCryptoAnalysisResultsSortByWorkrequestid, +} + +var mappingListCryptoAnalysisResultsSortByEnumLowerCase = map[string]ListCryptoAnalysisResultsSortByEnum{ + "timecreated": ListCryptoAnalysisResultsSortByTimecreated, + "managedinstanceid": ListCryptoAnalysisResultsSortByManagedinstanceid, + "workrequestid": ListCryptoAnalysisResultsSortByWorkrequestid, +} + +// GetListCryptoAnalysisResultsSortByEnumValues Enumerates the set of values for ListCryptoAnalysisResultsSortByEnum +func GetListCryptoAnalysisResultsSortByEnumValues() []ListCryptoAnalysisResultsSortByEnum { + values := make([]ListCryptoAnalysisResultsSortByEnum, 0) + for _, v := range mappingListCryptoAnalysisResultsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCryptoAnalysisResultsSortByEnumStringValues Enumerates the set of values in String for ListCryptoAnalysisResultsSortByEnum +func GetListCryptoAnalysisResultsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "managedInstanceId", + "workRequestId", + } +} + +// GetMappingListCryptoAnalysisResultsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCryptoAnalysisResultsSortByEnum(val string) (ListCryptoAnalysisResultsSortByEnum, bool) { + enum, ok := mappingListCryptoAnalysisResultsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/minimum_key_size_settings.go b/jms/minimum_key_size_settings.go new file mode 100644 index 0000000000..0d3cfee23e --- /dev/null +++ b/jms/minimum_key_size_settings.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MinimumKeySizeSettings test +type MinimumKeySizeSettings struct { + + // Updates the minimum key size for the specified encryption algorithm. + // The JDK property jdk.tls.disabledAlgorithms will be updated with the following supported actions: + // - Changing minimum key length for Diffie-Hellman + Tls []KeySizeAlgorithm `mandatory:"false" json:"tls"` + + // Updates the minimum key size for the specified encryption algorithm. + // The JDK property jdk.jar.disabledAlgorithms will be updated with the following supported actions: + // - Changing minimum key length for RSA signed jars + // - Changing minimum key length for EC + // - Changing minimum key length for DSA + Jar []KeySizeAlgorithm `mandatory:"false" json:"jar"` + + // Updates the minimum key size for the specified encryption algorithm. + // The JDK property jdk.certpath.disabledAlgorithms will be updated with the following supported actions: + // - Changing minimum key length for RSA signed jars + // - Changing minimum key length for EC + // - Changing minimum key length for DSA + Certpath []KeySizeAlgorithm `mandatory:"false" json:"certpath"` +} + +func (m MinimumKeySizeSettings) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MinimumKeySizeSettings) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/new_installation_site.go b/jms/new_installation_site.go index 1c567995a5..827865adef 100644 --- a/jms/new_installation_site.go +++ b/jms/new_installation_site.go @@ -23,6 +23,9 @@ type NewInstallationSite struct { // The release version of the Java Runtime. ReleaseVersion *string `mandatory:"true" json:"releaseVersion"` + + // Artifact content type for the Java version. + ArtifactContentType ArtifactContentTypeEnum `mandatory:"false" json:"artifactContentType,omitempty"` } func (m NewInstallationSite) String() string { @@ -35,6 +38,9 @@ func (m NewInstallationSite) String() string { func (m NewInstallationSite) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingArtifactContentTypeEnum(string(m.ArtifactContentType)); !ok && m.ArtifactContentType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ArtifactContentType: %s. Supported values are: %s.", m.ArtifactContentType, strings.Join(GetArtifactContentTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/jms/operation_type.go b/jms/operation_type.go index dd069a6c7b..95f79cd433 100644 --- a/jms/operation_type.go +++ b/jms/operation_type.go @@ -25,6 +25,10 @@ const ( OperationTypeUpdateFleetAgentConfiguration OperationTypeEnum = "UPDATE_FLEET_AGENT_CONFIGURATION" OperationTypeDeleteJavaInstallation OperationTypeEnum = "DELETE_JAVA_INSTALLATION" OperationTypeCreateJavaInstallation OperationTypeEnum = "CREATE_JAVA_INSTALLATION" + OperationTypeCollectJfr OperationTypeEnum = "COLLECT_JFR" + OperationTypeRequestCryptoEventAnalysis OperationTypeEnum = "REQUEST_CRYPTO_EVENT_ANALYSIS" + OperationTypeScanJavaServerUsage OperationTypeEnum = "SCAN_JAVA_SERVER_USAGE" + OperationTypeScanLibraryUsage OperationTypeEnum = "SCAN_LIBRARY_USAGE" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ @@ -35,6 +39,10 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "UPDATE_FLEET_AGENT_CONFIGURATION": OperationTypeUpdateFleetAgentConfiguration, "DELETE_JAVA_INSTALLATION": OperationTypeDeleteJavaInstallation, "CREATE_JAVA_INSTALLATION": OperationTypeCreateJavaInstallation, + "COLLECT_JFR": OperationTypeCollectJfr, + "REQUEST_CRYPTO_EVENT_ANALYSIS": OperationTypeRequestCryptoEventAnalysis, + "SCAN_JAVA_SERVER_USAGE": OperationTypeScanJavaServerUsage, + "SCAN_LIBRARY_USAGE": OperationTypeScanLibraryUsage, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ @@ -45,6 +53,10 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "update_fleet_agent_configuration": OperationTypeUpdateFleetAgentConfiguration, "delete_java_installation": OperationTypeDeleteJavaInstallation, "create_java_installation": OperationTypeCreateJavaInstallation, + "collect_jfr": OperationTypeCollectJfr, + "request_crypto_event_analysis": OperationTypeRequestCryptoEventAnalysis, + "scan_java_server_usage": OperationTypeScanJavaServerUsage, + "scan_library_usage": OperationTypeScanLibraryUsage, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -66,6 +78,10 @@ func GetOperationTypeEnumStringValues() []string { "UPDATE_FLEET_AGENT_CONFIGURATION", "DELETE_JAVA_INSTALLATION", "CREATE_JAVA_INSTALLATION", + "COLLECT_JFR", + "REQUEST_CRYPTO_EVENT_ANALYSIS", + "SCAN_JAVA_SERVER_USAGE", + "SCAN_LIBRARY_USAGE", } } diff --git a/jms/post_installation_action_settings.go b/jms/post_installation_action_settings.go new file mode 100644 index 0000000000..61ed52a9cd --- /dev/null +++ b/jms/post_installation_action_settings.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PostInstallationActionSettings List of available post actions you can execute after the successful Java installation. +type PostInstallationActionSettings struct { + + // The following post JRE installation actions are supported by the field: + // - Disable TLS 1.0 , TLS 1.1 + DisabledTlsVersions []TlsVersionsEnum `mandatory:"false" json:"disabledTlsVersions"` + + // Restores JDK root certificates with the certificates that are available in the operating system. + // The following action is supported by the field: + // - Replace JDK root certificates with a list provided by the operating system + ShouldReplaceCertificatesOperatingSystem *bool `mandatory:"false" json:"shouldReplaceCertificatesOperatingSystem"` + + MinimumKeySizeSettings *MinimumKeySizeSettings `mandatory:"false" json:"minimumKeySizeSettings"` +} + +func (m PostInstallationActionSettings) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PostInstallationActionSettings) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/post_installation_actions.go b/jms/post_installation_actions.go new file mode 100644 index 0000000000..fd71dba537 --- /dev/null +++ b/jms/post_installation_actions.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// PostInstallationActionsEnum Enum with underlying type: string +type PostInstallationActionsEnum string + +// Set of constants representing the allowable values for PostInstallationActionsEnum +const ( + PostInstallationActionsChangeMinimumKeyLengthForEc PostInstallationActionsEnum = "CHANGE_MINIMUM_KEY_LENGTH_FOR_EC" + PostInstallationActionsChangeMinimumKeyLengthForDsa PostInstallationActionsEnum = "CHANGE_MINIMUM_KEY_LENGTH_FOR_DSA" + PostInstallationActionsChangeMinimumKeyLengthForDiffieHellman PostInstallationActionsEnum = "CHANGE_MINIMUM_KEY_LENGTH_FOR_DIFFIE_HELLMAN" + PostInstallationActionsChangeMinimumKeyLengthForRsaSignedJars PostInstallationActionsEnum = "CHANGE_MINIMUM_KEY_LENGTH_FOR_RSA_SIGNED_JARS" + PostInstallationActionsDisableTls PostInstallationActionsEnum = "DISABLE_TLS" + PostInstallationActionsUseOsCacerts PostInstallationActionsEnum = "USE_OS_CACERTS" +) + +var mappingPostInstallationActionsEnum = map[string]PostInstallationActionsEnum{ + "CHANGE_MINIMUM_KEY_LENGTH_FOR_EC": PostInstallationActionsChangeMinimumKeyLengthForEc, + "CHANGE_MINIMUM_KEY_LENGTH_FOR_DSA": PostInstallationActionsChangeMinimumKeyLengthForDsa, + "CHANGE_MINIMUM_KEY_LENGTH_FOR_DIFFIE_HELLMAN": PostInstallationActionsChangeMinimumKeyLengthForDiffieHellman, + "CHANGE_MINIMUM_KEY_LENGTH_FOR_RSA_SIGNED_JARS": PostInstallationActionsChangeMinimumKeyLengthForRsaSignedJars, + "DISABLE_TLS": PostInstallationActionsDisableTls, + "USE_OS_CACERTS": PostInstallationActionsUseOsCacerts, +} + +var mappingPostInstallationActionsEnumLowerCase = map[string]PostInstallationActionsEnum{ + "change_minimum_key_length_for_ec": PostInstallationActionsChangeMinimumKeyLengthForEc, + "change_minimum_key_length_for_dsa": PostInstallationActionsChangeMinimumKeyLengthForDsa, + "change_minimum_key_length_for_diffie_hellman": PostInstallationActionsChangeMinimumKeyLengthForDiffieHellman, + "change_minimum_key_length_for_rsa_signed_jars": PostInstallationActionsChangeMinimumKeyLengthForRsaSignedJars, + "disable_tls": PostInstallationActionsDisableTls, + "use_os_cacerts": PostInstallationActionsUseOsCacerts, +} + +// GetPostInstallationActionsEnumValues Enumerates the set of values for PostInstallationActionsEnum +func GetPostInstallationActionsEnumValues() []PostInstallationActionsEnum { + values := make([]PostInstallationActionsEnum, 0) + for _, v := range mappingPostInstallationActionsEnum { + values = append(values, v) + } + return values +} + +// GetPostInstallationActionsEnumStringValues Enumerates the set of values in String for PostInstallationActionsEnum +func GetPostInstallationActionsEnumStringValues() []string { + return []string{ + "CHANGE_MINIMUM_KEY_LENGTH_FOR_EC", + "CHANGE_MINIMUM_KEY_LENGTH_FOR_DSA", + "CHANGE_MINIMUM_KEY_LENGTH_FOR_DIFFIE_HELLMAN", + "CHANGE_MINIMUM_KEY_LENGTH_FOR_RSA_SIGNED_JARS", + "DISABLE_TLS", + "USE_OS_CACERTS", + } +} + +// GetMappingPostInstallationActionsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPostInstallationActionsEnum(val string) (PostInstallationActionsEnum, bool) { + enum, ok := mappingPostInstallationActionsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/request_crypto_analyses_details.go b/jms/request_crypto_analyses_details.go new file mode 100644 index 0000000000..2fc8d16c88 --- /dev/null +++ b/jms/request_crypto_analyses_details.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RequestCryptoAnalysesDetails Details of the request to start a JFR analysis. +// When the targets aren't specified, then all managed instances currently in the fleet are selected. +type RequestCryptoAnalysesDetails struct { + + // The attachment targets to start JFR. + Targets []JfrAttachmentTarget `mandatory:"false" json:"targets"` + + // Duration of the JFR recording in minutes. + RecordingDurationInMinutes *int `mandatory:"false" json:"recordingDurationInMinutes"` +} + +func (m RequestCryptoAnalysesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RequestCryptoAnalysesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/request_crypto_analyses_request_response.go b/jms/request_crypto_analyses_request_response.go new file mode 100644 index 0000000000..97a51cbb7d --- /dev/null +++ b/jms/request_crypto_analyses_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RequestCryptoAnalysesRequest wrapper for the RequestCryptoAnalyses operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/RequestCryptoAnalyses.go.html to see an example of how to use RequestCryptoAnalysesRequest. +type RequestCryptoAnalysesRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // Detail information to start Crypto Analyses + RequestCryptoAnalysesDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RequestCryptoAnalysesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RequestCryptoAnalysesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request RequestCryptoAnalysesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RequestCryptoAnalysesRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request RequestCryptoAnalysesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RequestCryptoAnalysesResponse wrapper for the RequestCryptoAnalyses operation +type RequestCryptoAnalysesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. + // You can use this to query the status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RequestCryptoAnalysesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RequestCryptoAnalysesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/request_jfr_recordings_details.go b/jms/request_jfr_recordings_details.go new file mode 100644 index 0000000000..1da0720458 --- /dev/null +++ b/jms/request_jfr_recordings_details.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RequestJfrRecordingsDetails Details of the request to start JFR recordings. +// When the targets aren't specified, then all managed instances currently in the fleet are selected. +type RequestJfrRecordingsDetails struct { + + // The profile used for JFR events selection. If the name isn't recognized, the settings from jfcV1 or jfcV2 + // will be used depending on the JVM version. + // Both jfcV2 and jfcV1 should be provided to ensure JFR collection on different JVM versions. + JfcProfileName *string `mandatory:"true" json:"jfcProfileName"` + + // The attachment targets to start JFR. + Targets []JfrAttachmentTarget `mandatory:"false" json:"targets"` + + // The BASE64 encoded string of JFR settings XML with schema used by JDK 8. + JfcV1 *string `mandatory:"false" json:"jfcV1"` + + // The BASE64 encoded string of JFR settings XML with schema used by JDK 9 and after (https://raw.githubusercontent.com/openjdk/jdk/master/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd). + JfcV2 *string `mandatory:"false" json:"jfcV2"` + + // Duration of the JFR recording in minutes. + RecordingDurationInMinutes *int `mandatory:"false" json:"recordingDurationInMinutes"` + + // The maximum size limit for the JFR file collected. + RecordingSizeInMb *int `mandatory:"false" json:"recordingSizeInMb"` +} + +func (m RequestJfrRecordingsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RequestJfrRecordingsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/request_jfr_recordings_request_response.go b/jms/request_jfr_recordings_request_response.go new file mode 100644 index 0000000000..16d361ef17 --- /dev/null +++ b/jms/request_jfr_recordings_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RequestJfrRecordingsRequest wrapper for the RequestJfrRecordings operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/RequestJfrRecordings.go.html to see an example of how to use RequestJfrRecordingsRequest. +type RequestJfrRecordingsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // Detail information to start JFR recordings. + RequestJfrRecordingsDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RequestJfrRecordingsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RequestJfrRecordingsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request RequestJfrRecordingsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RequestJfrRecordingsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request RequestJfrRecordingsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RequestJfrRecordingsResponse wrapper for the RequestJfrRecordings operation +type RequestJfrRecordingsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. + // You can use this to query the status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RequestJfrRecordingsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RequestJfrRecordingsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/scan_java_server_usage_details.go b/jms/scan_java_server_usage_details.go new file mode 100644 index 0000000000..91b8fb63ae --- /dev/null +++ b/jms/scan_java_server_usage_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScanJavaServerUsageDetails The list of managed instances to scan. +type ScanJavaServerUsageDetails struct { + + // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of managed instances to scan. + ManagedInstanceIds []string `mandatory:"false" json:"managedInstanceIds"` +} + +func (m ScanJavaServerUsageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScanJavaServerUsageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/scan_java_server_usage_request_response.go b/jms/scan_java_server_usage_request_response.go new file mode 100644 index 0000000000..405ba05698 --- /dev/null +++ b/jms/scan_java_server_usage_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ScanJavaServerUsageRequest wrapper for the ScanJavaServerUsage operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/ScanJavaServerUsage.go.html to see an example of how to use ScanJavaServerUsageRequest. +type ScanJavaServerUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // List of managed instances to be scanned. + ScanJavaServerUsageDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // ETag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the ETag you + // provide matches the resource's current ETag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ScanJavaServerUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ScanJavaServerUsageRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ScanJavaServerUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ScanJavaServerUsageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ScanJavaServerUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScanJavaServerUsageResponse wrapper for the ScanJavaServerUsage operation +type ScanJavaServerUsageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. + // You can use this to query the status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ScanJavaServerUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ScanJavaServerUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/scan_library_usage_details.go b/jms/scan_library_usage_details.go new file mode 100644 index 0000000000..24ff3f5a52 --- /dev/null +++ b/jms/scan_library_usage_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScanLibraryUsageDetails The list of managed instances to scan. +type ScanLibraryUsageDetails struct { + + // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of managed instances to scan. + ManagedInstanceIds []string `mandatory:"false" json:"managedInstanceIds"` +} + +func (m ScanLibraryUsageDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScanLibraryUsageDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/scan_library_usage_request_response.go b/jms/scan_library_usage_request_response.go new file mode 100644 index 0000000000..8a27c062e5 --- /dev/null +++ b/jms/scan_library_usage_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ScanLibraryUsageRequest wrapper for the ScanLibraryUsage operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/ScanLibraryUsage.go.html to see an example of how to use ScanLibraryUsageRequest. +type ScanLibraryUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // List of managed instances to be scanned. + ScanLibraryUsageDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // ETag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the ETag you + // provide matches the resource's current ETag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ScanLibraryUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ScanLibraryUsageRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ScanLibraryUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ScanLibraryUsageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ScanLibraryUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScanLibraryUsageResponse wrapper for the ScanLibraryUsage operation +type ScanLibraryUsageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. + // You can use this to query the status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ScanLibraryUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ScanLibraryUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/summarize_application_usage_request_response.go b/jms/summarize_application_usage_request_response.go index de4cae4885..560d847e12 100644 --- a/jms/summarize_application_usage_request_response.go +++ b/jms/summarize_application_usage_request_response.go @@ -81,6 +81,9 @@ type SummarizeApplicationUsageRequest struct { // Filter the list with displayName contains the given value. DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + // The library key. + LibraryKey *string `mandatory:"false" contributesTo:"query" name:"libraryKey"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/jms/summarize_deployed_application_usage_request_response.go b/jms/summarize_deployed_application_usage_request_response.go new file mode 100644 index 0000000000..de4b03af15 --- /dev/null +++ b/jms/summarize_deployed_application_usage_request_response.go @@ -0,0 +1,241 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SummarizeDeployedApplicationUsageRequest wrapper for the SummarizeDeployedApplicationUsage operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeDeployedApplicationUsage.go.html to see an example of how to use SummarizeDeployedApplicationUsageRequest. +type SummarizeDeployedApplicationUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // The server key. + ServerKey *string `mandatory:"false" contributesTo:"query" name:"serverKey"` + + // The Java server instance key. + ServerInstanceKey *string `mandatory:"false" contributesTo:"query" name:"serverInstanceKey"` + + // The Fleet-unique identifier of the managed instance. + ManagedInstanceId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceId"` + + // The library key. + LibraryKey *string `mandatory:"false" contributesTo:"query" name:"libraryKey"` + + // The deployed application key. + ApplicationKey *string `mandatory:"false" contributesTo:"query" name:"applicationKey"` + + // Filter the list with deployed application name contains the given value. + ApplicationNameContains *string `mandatory:"false" contributesTo:"query" name:"applicationNameContains"` + + // The deployed application name. + ApplicationName *string `mandatory:"false" contributesTo:"query" name:"applicationName"` + + // The start of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeStart"` + + // The end of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeEnd"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. The token is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order, either 'asc' or 'desc'. + SortOrder SummarizeDeployedApplicationUsageSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort deployed applications. Only one sort order may be provided. + // If no value is specified _timeLastSeen_ is default. + SortBy SummarizeDeployedApplicationUsageSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeDeployedApplicationUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeDeployedApplicationUsageRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request SummarizeDeployedApplicationUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeDeployedApplicationUsageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request SummarizeDeployedApplicationUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSummarizeDeployedApplicationUsageSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetSummarizeDeployedApplicationUsageSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSummarizeDeployedApplicationUsageSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetSummarizeDeployedApplicationUsageSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SummarizeDeployedApplicationUsageResponse wrapper for the SummarizeDeployedApplicationUsage operation +type SummarizeDeployedApplicationUsageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DeployedApplicationUsageCollection instances + DeployedApplicationUsageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // Include this value as the `page` parameter for the subsequent GET request to get the next batch of items. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SummarizeDeployedApplicationUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeDeployedApplicationUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// SummarizeDeployedApplicationUsageSortOrderEnum Enum with underlying type: string +type SummarizeDeployedApplicationUsageSortOrderEnum string + +// Set of constants representing the allowable values for SummarizeDeployedApplicationUsageSortOrderEnum +const ( + SummarizeDeployedApplicationUsageSortOrderAsc SummarizeDeployedApplicationUsageSortOrderEnum = "ASC" + SummarizeDeployedApplicationUsageSortOrderDesc SummarizeDeployedApplicationUsageSortOrderEnum = "DESC" +) + +var mappingSummarizeDeployedApplicationUsageSortOrderEnum = map[string]SummarizeDeployedApplicationUsageSortOrderEnum{ + "ASC": SummarizeDeployedApplicationUsageSortOrderAsc, + "DESC": SummarizeDeployedApplicationUsageSortOrderDesc, +} + +var mappingSummarizeDeployedApplicationUsageSortOrderEnumLowerCase = map[string]SummarizeDeployedApplicationUsageSortOrderEnum{ + "asc": SummarizeDeployedApplicationUsageSortOrderAsc, + "desc": SummarizeDeployedApplicationUsageSortOrderDesc, +} + +// GetSummarizeDeployedApplicationUsageSortOrderEnumValues Enumerates the set of values for SummarizeDeployedApplicationUsageSortOrderEnum +func GetSummarizeDeployedApplicationUsageSortOrderEnumValues() []SummarizeDeployedApplicationUsageSortOrderEnum { + values := make([]SummarizeDeployedApplicationUsageSortOrderEnum, 0) + for _, v := range mappingSummarizeDeployedApplicationUsageSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeDeployedApplicationUsageSortOrderEnumStringValues Enumerates the set of values in String for SummarizeDeployedApplicationUsageSortOrderEnum +func GetSummarizeDeployedApplicationUsageSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSummarizeDeployedApplicationUsageSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeDeployedApplicationUsageSortOrderEnum(val string) (SummarizeDeployedApplicationUsageSortOrderEnum, bool) { + enum, ok := mappingSummarizeDeployedApplicationUsageSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SummarizeDeployedApplicationUsageSortByEnum Enum with underlying type: string +type SummarizeDeployedApplicationUsageSortByEnum string + +// Set of constants representing the allowable values for SummarizeDeployedApplicationUsageSortByEnum +const ( + SummarizeDeployedApplicationUsageSortByApplicationname SummarizeDeployedApplicationUsageSortByEnum = "applicationName" + SummarizeDeployedApplicationUsageSortByApplicationtype SummarizeDeployedApplicationUsageSortByEnum = "applicationType" + SummarizeDeployedApplicationUsageSortByIsclustered SummarizeDeployedApplicationUsageSortByEnum = "isClustered" + SummarizeDeployedApplicationUsageSortByJavaserverinstancecount SummarizeDeployedApplicationUsageSortByEnum = "javaServerInstanceCount" + SummarizeDeployedApplicationUsageSortByTimefirstseen SummarizeDeployedApplicationUsageSortByEnum = "timeFirstSeen" + SummarizeDeployedApplicationUsageSortByTimelastseen SummarizeDeployedApplicationUsageSortByEnum = "timeLastSeen" +) + +var mappingSummarizeDeployedApplicationUsageSortByEnum = map[string]SummarizeDeployedApplicationUsageSortByEnum{ + "applicationName": SummarizeDeployedApplicationUsageSortByApplicationname, + "applicationType": SummarizeDeployedApplicationUsageSortByApplicationtype, + "isClustered": SummarizeDeployedApplicationUsageSortByIsclustered, + "javaServerInstanceCount": SummarizeDeployedApplicationUsageSortByJavaserverinstancecount, + "timeFirstSeen": SummarizeDeployedApplicationUsageSortByTimefirstseen, + "timeLastSeen": SummarizeDeployedApplicationUsageSortByTimelastseen, +} + +var mappingSummarizeDeployedApplicationUsageSortByEnumLowerCase = map[string]SummarizeDeployedApplicationUsageSortByEnum{ + "applicationname": SummarizeDeployedApplicationUsageSortByApplicationname, + "applicationtype": SummarizeDeployedApplicationUsageSortByApplicationtype, + "isclustered": SummarizeDeployedApplicationUsageSortByIsclustered, + "javaserverinstancecount": SummarizeDeployedApplicationUsageSortByJavaserverinstancecount, + "timefirstseen": SummarizeDeployedApplicationUsageSortByTimefirstseen, + "timelastseen": SummarizeDeployedApplicationUsageSortByTimelastseen, +} + +// GetSummarizeDeployedApplicationUsageSortByEnumValues Enumerates the set of values for SummarizeDeployedApplicationUsageSortByEnum +func GetSummarizeDeployedApplicationUsageSortByEnumValues() []SummarizeDeployedApplicationUsageSortByEnum { + values := make([]SummarizeDeployedApplicationUsageSortByEnum, 0) + for _, v := range mappingSummarizeDeployedApplicationUsageSortByEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeDeployedApplicationUsageSortByEnumStringValues Enumerates the set of values in String for SummarizeDeployedApplicationUsageSortByEnum +func GetSummarizeDeployedApplicationUsageSortByEnumStringValues() []string { + return []string{ + "applicationName", + "applicationType", + "isClustered", + "javaServerInstanceCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingSummarizeDeployedApplicationUsageSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeDeployedApplicationUsageSortByEnum(val string) (SummarizeDeployedApplicationUsageSortByEnum, bool) { + enum, ok := mappingSummarizeDeployedApplicationUsageSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/summarize_java_server_instance_usage_request_response.go b/jms/summarize_java_server_instance_usage_request_response.go new file mode 100644 index 0000000000..72b18ea228 --- /dev/null +++ b/jms/summarize_java_server_instance_usage_request_response.go @@ -0,0 +1,237 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SummarizeJavaServerInstanceUsageRequest wrapper for the SummarizeJavaServerInstanceUsage operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeJavaServerInstanceUsage.go.html to see an example of how to use SummarizeJavaServerInstanceUsageRequest. +type SummarizeJavaServerInstanceUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // The server key. + ServerKey *string `mandatory:"false" contributesTo:"query" name:"serverKey"` + + // The Java server instance key. + ServerInstanceKey *string `mandatory:"false" contributesTo:"query" name:"serverInstanceKey"` + + // The Fleet-unique identifier of the managed instance. + ManagedInstanceId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceId"` + + // The deployed application key. + ApplicationKey *string `mandatory:"false" contributesTo:"query" name:"applicationKey"` + + // The library key. + LibraryKey *string `mandatory:"false" contributesTo:"query" name:"libraryKey"` + + // Filter the list with Java server instance name contains the given value. + ServerInstanceNameContains *string `mandatory:"false" contributesTo:"query" name:"serverInstanceNameContains"` + + // The Java server instance name. + ServerInstanceName *string `mandatory:"false" contributesTo:"query" name:"serverInstanceName"` + + // The start of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeStart"` + + // The end of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeEnd"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. The token is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order, either 'asc' or 'desc'. + SortOrder SummarizeJavaServerInstanceUsageSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort Java server instances. Only one sort order may be provided. + // If no value is specified _timeLastSeen_ is default. + SortBy SummarizeJavaServerInstanceUsageSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeJavaServerInstanceUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeJavaServerInstanceUsageRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request SummarizeJavaServerInstanceUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeJavaServerInstanceUsageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request SummarizeJavaServerInstanceUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSummarizeJavaServerInstanceUsageSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetSummarizeJavaServerInstanceUsageSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSummarizeJavaServerInstanceUsageSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetSummarizeJavaServerInstanceUsageSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SummarizeJavaServerInstanceUsageResponse wrapper for the SummarizeJavaServerInstanceUsage operation +type SummarizeJavaServerInstanceUsageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of JavaServerInstanceUsageCollection instances + JavaServerInstanceUsageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // Include this value as the `page` parameter for the subsequent GET request to get the next batch of items. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SummarizeJavaServerInstanceUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeJavaServerInstanceUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// SummarizeJavaServerInstanceUsageSortOrderEnum Enum with underlying type: string +type SummarizeJavaServerInstanceUsageSortOrderEnum string + +// Set of constants representing the allowable values for SummarizeJavaServerInstanceUsageSortOrderEnum +const ( + SummarizeJavaServerInstanceUsageSortOrderAsc SummarizeJavaServerInstanceUsageSortOrderEnum = "ASC" + SummarizeJavaServerInstanceUsageSortOrderDesc SummarizeJavaServerInstanceUsageSortOrderEnum = "DESC" +) + +var mappingSummarizeJavaServerInstanceUsageSortOrderEnum = map[string]SummarizeJavaServerInstanceUsageSortOrderEnum{ + "ASC": SummarizeJavaServerInstanceUsageSortOrderAsc, + "DESC": SummarizeJavaServerInstanceUsageSortOrderDesc, +} + +var mappingSummarizeJavaServerInstanceUsageSortOrderEnumLowerCase = map[string]SummarizeJavaServerInstanceUsageSortOrderEnum{ + "asc": SummarizeJavaServerInstanceUsageSortOrderAsc, + "desc": SummarizeJavaServerInstanceUsageSortOrderDesc, +} + +// GetSummarizeJavaServerInstanceUsageSortOrderEnumValues Enumerates the set of values for SummarizeJavaServerInstanceUsageSortOrderEnum +func GetSummarizeJavaServerInstanceUsageSortOrderEnumValues() []SummarizeJavaServerInstanceUsageSortOrderEnum { + values := make([]SummarizeJavaServerInstanceUsageSortOrderEnum, 0) + for _, v := range mappingSummarizeJavaServerInstanceUsageSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeJavaServerInstanceUsageSortOrderEnumStringValues Enumerates the set of values in String for SummarizeJavaServerInstanceUsageSortOrderEnum +func GetSummarizeJavaServerInstanceUsageSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSummarizeJavaServerInstanceUsageSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeJavaServerInstanceUsageSortOrderEnum(val string) (SummarizeJavaServerInstanceUsageSortOrderEnum, bool) { + enum, ok := mappingSummarizeJavaServerInstanceUsageSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SummarizeJavaServerInstanceUsageSortByEnum Enum with underlying type: string +type SummarizeJavaServerInstanceUsageSortByEnum string + +// Set of constants representing the allowable values for SummarizeJavaServerInstanceUsageSortByEnum +const ( + SummarizeJavaServerInstanceUsageSortByServerinstancename SummarizeJavaServerInstanceUsageSortByEnum = "serverInstanceName" + SummarizeJavaServerInstanceUsageSortByManagedinstancename SummarizeJavaServerInstanceUsageSortByEnum = "managedInstanceName" + SummarizeJavaServerInstanceUsageSortByApproximatedeployedapplicationcount SummarizeJavaServerInstanceUsageSortByEnum = "approximateDeployedApplicationCount" + SummarizeJavaServerInstanceUsageSortByTimefirstseen SummarizeJavaServerInstanceUsageSortByEnum = "timeFirstSeen" + SummarizeJavaServerInstanceUsageSortByTimelastseen SummarizeJavaServerInstanceUsageSortByEnum = "timeLastSeen" +) + +var mappingSummarizeJavaServerInstanceUsageSortByEnum = map[string]SummarizeJavaServerInstanceUsageSortByEnum{ + "serverInstanceName": SummarizeJavaServerInstanceUsageSortByServerinstancename, + "managedInstanceName": SummarizeJavaServerInstanceUsageSortByManagedinstancename, + "approximateDeployedApplicationCount": SummarizeJavaServerInstanceUsageSortByApproximatedeployedapplicationcount, + "timeFirstSeen": SummarizeJavaServerInstanceUsageSortByTimefirstseen, + "timeLastSeen": SummarizeJavaServerInstanceUsageSortByTimelastseen, +} + +var mappingSummarizeJavaServerInstanceUsageSortByEnumLowerCase = map[string]SummarizeJavaServerInstanceUsageSortByEnum{ + "serverinstancename": SummarizeJavaServerInstanceUsageSortByServerinstancename, + "managedinstancename": SummarizeJavaServerInstanceUsageSortByManagedinstancename, + "approximatedeployedapplicationcount": SummarizeJavaServerInstanceUsageSortByApproximatedeployedapplicationcount, + "timefirstseen": SummarizeJavaServerInstanceUsageSortByTimefirstseen, + "timelastseen": SummarizeJavaServerInstanceUsageSortByTimelastseen, +} + +// GetSummarizeJavaServerInstanceUsageSortByEnumValues Enumerates the set of values for SummarizeJavaServerInstanceUsageSortByEnum +func GetSummarizeJavaServerInstanceUsageSortByEnumValues() []SummarizeJavaServerInstanceUsageSortByEnum { + values := make([]SummarizeJavaServerInstanceUsageSortByEnum, 0) + for _, v := range mappingSummarizeJavaServerInstanceUsageSortByEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeJavaServerInstanceUsageSortByEnumStringValues Enumerates the set of values in String for SummarizeJavaServerInstanceUsageSortByEnum +func GetSummarizeJavaServerInstanceUsageSortByEnumStringValues() []string { + return []string{ + "serverInstanceName", + "managedInstanceName", + "approximateDeployedApplicationCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingSummarizeJavaServerInstanceUsageSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeJavaServerInstanceUsageSortByEnum(val string) (SummarizeJavaServerInstanceUsageSortByEnum, bool) { + enum, ok := mappingSummarizeJavaServerInstanceUsageSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/summarize_java_server_usage_request_response.go b/jms/summarize_java_server_usage_request_response.go new file mode 100644 index 0000000000..74a3c602f8 --- /dev/null +++ b/jms/summarize_java_server_usage_request_response.go @@ -0,0 +1,232 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SummarizeJavaServerUsageRequest wrapper for the SummarizeJavaServerUsage operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeJavaServerUsage.go.html to see an example of how to use SummarizeJavaServerUsageRequest. +type SummarizeJavaServerUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // The server key. + ServerKey *string `mandatory:"false" contributesTo:"query" name:"serverKey"` + + // Filter the list with server name contains the given value. + ServerNameContains *string `mandatory:"false" contributesTo:"query" name:"serverNameContains"` + + // The server name. + ServerName *string `mandatory:"false" contributesTo:"query" name:"serverName"` + + // The server version. + ServerVersion *string `mandatory:"false" contributesTo:"query" name:"serverVersion"` + + // The start of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeStart"` + + // The end of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeEnd"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. The token is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order, either 'asc' or 'desc'. + SortOrder SummarizeJavaServerUsageSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort Java servers. Only one sort order may be provided. + // If no value is specified _timeLastSeen_ is default. + SortBy SummarizeJavaServerUsageSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeJavaServerUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeJavaServerUsageRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request SummarizeJavaServerUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeJavaServerUsageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request SummarizeJavaServerUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSummarizeJavaServerUsageSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetSummarizeJavaServerUsageSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSummarizeJavaServerUsageSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetSummarizeJavaServerUsageSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SummarizeJavaServerUsageResponse wrapper for the SummarizeJavaServerUsage operation +type SummarizeJavaServerUsageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of JavaServerUsageCollection instances + JavaServerUsageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // Include this value as the `page` parameter for the subsequent GET request to get the next batch of items. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SummarizeJavaServerUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeJavaServerUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// SummarizeJavaServerUsageSortOrderEnum Enum with underlying type: string +type SummarizeJavaServerUsageSortOrderEnum string + +// Set of constants representing the allowable values for SummarizeJavaServerUsageSortOrderEnum +const ( + SummarizeJavaServerUsageSortOrderAsc SummarizeJavaServerUsageSortOrderEnum = "ASC" + SummarizeJavaServerUsageSortOrderDesc SummarizeJavaServerUsageSortOrderEnum = "DESC" +) + +var mappingSummarizeJavaServerUsageSortOrderEnum = map[string]SummarizeJavaServerUsageSortOrderEnum{ + "ASC": SummarizeJavaServerUsageSortOrderAsc, + "DESC": SummarizeJavaServerUsageSortOrderDesc, +} + +var mappingSummarizeJavaServerUsageSortOrderEnumLowerCase = map[string]SummarizeJavaServerUsageSortOrderEnum{ + "asc": SummarizeJavaServerUsageSortOrderAsc, + "desc": SummarizeJavaServerUsageSortOrderDesc, +} + +// GetSummarizeJavaServerUsageSortOrderEnumValues Enumerates the set of values for SummarizeJavaServerUsageSortOrderEnum +func GetSummarizeJavaServerUsageSortOrderEnumValues() []SummarizeJavaServerUsageSortOrderEnum { + values := make([]SummarizeJavaServerUsageSortOrderEnum, 0) + for _, v := range mappingSummarizeJavaServerUsageSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeJavaServerUsageSortOrderEnumStringValues Enumerates the set of values in String for SummarizeJavaServerUsageSortOrderEnum +func GetSummarizeJavaServerUsageSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSummarizeJavaServerUsageSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeJavaServerUsageSortOrderEnum(val string) (SummarizeJavaServerUsageSortOrderEnum, bool) { + enum, ok := mappingSummarizeJavaServerUsageSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SummarizeJavaServerUsageSortByEnum Enum with underlying type: string +type SummarizeJavaServerUsageSortByEnum string + +// Set of constants representing the allowable values for SummarizeJavaServerUsageSortByEnum +const ( + SummarizeJavaServerUsageSortByServername SummarizeJavaServerUsageSortByEnum = "serverName" + SummarizeJavaServerUsageSortByServerversion SummarizeJavaServerUsageSortByEnum = "serverVersion" + SummarizeJavaServerUsageSortByServerinstancecount SummarizeJavaServerUsageSortByEnum = "serverInstanceCount" + SummarizeJavaServerUsageSortByApproximatedeployedapplicationcount SummarizeJavaServerUsageSortByEnum = "approximateDeployedApplicationCount" + SummarizeJavaServerUsageSortByTimefirstseen SummarizeJavaServerUsageSortByEnum = "timeFirstSeen" + SummarizeJavaServerUsageSortByTimelastseen SummarizeJavaServerUsageSortByEnum = "timeLastSeen" +) + +var mappingSummarizeJavaServerUsageSortByEnum = map[string]SummarizeJavaServerUsageSortByEnum{ + "serverName": SummarizeJavaServerUsageSortByServername, + "serverVersion": SummarizeJavaServerUsageSortByServerversion, + "serverInstanceCount": SummarizeJavaServerUsageSortByServerinstancecount, + "approximateDeployedApplicationCount": SummarizeJavaServerUsageSortByApproximatedeployedapplicationcount, + "timeFirstSeen": SummarizeJavaServerUsageSortByTimefirstseen, + "timeLastSeen": SummarizeJavaServerUsageSortByTimelastseen, +} + +var mappingSummarizeJavaServerUsageSortByEnumLowerCase = map[string]SummarizeJavaServerUsageSortByEnum{ + "servername": SummarizeJavaServerUsageSortByServername, + "serverversion": SummarizeJavaServerUsageSortByServerversion, + "serverinstancecount": SummarizeJavaServerUsageSortByServerinstancecount, + "approximatedeployedapplicationcount": SummarizeJavaServerUsageSortByApproximatedeployedapplicationcount, + "timefirstseen": SummarizeJavaServerUsageSortByTimefirstseen, + "timelastseen": SummarizeJavaServerUsageSortByTimelastseen, +} + +// GetSummarizeJavaServerUsageSortByEnumValues Enumerates the set of values for SummarizeJavaServerUsageSortByEnum +func GetSummarizeJavaServerUsageSortByEnumValues() []SummarizeJavaServerUsageSortByEnum { + values := make([]SummarizeJavaServerUsageSortByEnum, 0) + for _, v := range mappingSummarizeJavaServerUsageSortByEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeJavaServerUsageSortByEnumStringValues Enumerates the set of values in String for SummarizeJavaServerUsageSortByEnum +func GetSummarizeJavaServerUsageSortByEnumStringValues() []string { + return []string{ + "serverName", + "serverVersion", + "serverInstanceCount", + "approximateDeployedApplicationCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingSummarizeJavaServerUsageSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeJavaServerUsageSortByEnum(val string) (SummarizeJavaServerUsageSortByEnum, bool) { + enum, ok := mappingSummarizeJavaServerUsageSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/summarize_jre_usage_request_response.go b/jms/summarize_jre_usage_request_response.go index 3b7eb5a28b..7a864b00dc 100644 --- a/jms/summarize_jre_usage_request_response.go +++ b/jms/summarize_jre_usage_request_response.go @@ -21,6 +21,9 @@ type SummarizeJreUsageRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + // The Fleet-unique identifier of the related Java Runtime. + JreId *string `mandatory:"false" contributesTo:"query" name:"jreId"` + // The vendor of the Java Runtime. JreVendor *string `mandatory:"false" contributesTo:"query" name:"jreVendor"` diff --git a/jms/summarize_library_usage_request_response.go b/jms/summarize_library_usage_request_response.go new file mode 100644 index 0000000000..07abd6587a --- /dev/null +++ b/jms/summarize_library_usage_request_response.go @@ -0,0 +1,250 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// SummarizeLibraryUsageRequest wrapper for the SummarizeLibraryUsage operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/SummarizeLibraryUsage.go.html to see an example of how to use SummarizeLibraryUsageRequest. +type SummarizeLibraryUsageRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // The Java server instance key. + ServerInstanceKey *string `mandatory:"false" contributesTo:"query" name:"serverInstanceKey"` + + // The Fleet-unique identifier of the managed instance. + ManagedInstanceId *string `mandatory:"false" contributesTo:"query" name:"managedInstanceId"` + + // The deployed application key. + ApplicationKey *string `mandatory:"false" contributesTo:"query" name:"applicationKey"` + + // The library key. + LibraryKey *string `mandatory:"false" contributesTo:"query" name:"libraryKey"` + + // Filter the list with library name contains the given value. + LibraryNameContains *string `mandatory:"false" contributesTo:"query" name:"libraryNameContains"` + + // The library name. + LibraryName *string `mandatory:"false" contributesTo:"query" name:"libraryName"` + + // The start of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeStart"` + + // The end of the time period during which resources are searched (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeEnd"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. The token is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order, either 'asc' or 'desc'. + SortOrder SummarizeLibraryUsageSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort libraries. Only one sort order may be provided. + // If no value is specified _timeLastSeen_ is default. + SortBy SummarizeLibraryUsageSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request SummarizeLibraryUsageRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request SummarizeLibraryUsageRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request SummarizeLibraryUsageRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request SummarizeLibraryUsageRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request SummarizeLibraryUsageRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSummarizeLibraryUsageSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetSummarizeLibraryUsageSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSummarizeLibraryUsageSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetSummarizeLibraryUsageSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SummarizeLibraryUsageResponse wrapper for the SummarizeLibraryUsage operation +type SummarizeLibraryUsageResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of LibraryUsageCollection instances + LibraryUsageCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. + // Include this value as the `page` parameter for the subsequent GET request to get the next batch of items. + // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response SummarizeLibraryUsageResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response SummarizeLibraryUsageResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// SummarizeLibraryUsageSortOrderEnum Enum with underlying type: string +type SummarizeLibraryUsageSortOrderEnum string + +// Set of constants representing the allowable values for SummarizeLibraryUsageSortOrderEnum +const ( + SummarizeLibraryUsageSortOrderAsc SummarizeLibraryUsageSortOrderEnum = "ASC" + SummarizeLibraryUsageSortOrderDesc SummarizeLibraryUsageSortOrderEnum = "DESC" +) + +var mappingSummarizeLibraryUsageSortOrderEnum = map[string]SummarizeLibraryUsageSortOrderEnum{ + "ASC": SummarizeLibraryUsageSortOrderAsc, + "DESC": SummarizeLibraryUsageSortOrderDesc, +} + +var mappingSummarizeLibraryUsageSortOrderEnumLowerCase = map[string]SummarizeLibraryUsageSortOrderEnum{ + "asc": SummarizeLibraryUsageSortOrderAsc, + "desc": SummarizeLibraryUsageSortOrderDesc, +} + +// GetSummarizeLibraryUsageSortOrderEnumValues Enumerates the set of values for SummarizeLibraryUsageSortOrderEnum +func GetSummarizeLibraryUsageSortOrderEnumValues() []SummarizeLibraryUsageSortOrderEnum { + values := make([]SummarizeLibraryUsageSortOrderEnum, 0) + for _, v := range mappingSummarizeLibraryUsageSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeLibraryUsageSortOrderEnumStringValues Enumerates the set of values in String for SummarizeLibraryUsageSortOrderEnum +func GetSummarizeLibraryUsageSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSummarizeLibraryUsageSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeLibraryUsageSortOrderEnum(val string) (SummarizeLibraryUsageSortOrderEnum, bool) { + enum, ok := mappingSummarizeLibraryUsageSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SummarizeLibraryUsageSortByEnum Enum with underlying type: string +type SummarizeLibraryUsageSortByEnum string + +// Set of constants representing the allowable values for SummarizeLibraryUsageSortByEnum +const ( + SummarizeLibraryUsageSortByApplicationcount SummarizeLibraryUsageSortByEnum = "applicationCount" + SummarizeLibraryUsageSortByJavaserverinstancecount SummarizeLibraryUsageSortByEnum = "javaServerInstanceCount" + SummarizeLibraryUsageSortByCvssscore SummarizeLibraryUsageSortByEnum = "cvssScore" + SummarizeLibraryUsageSortByDeployedapplicationcount SummarizeLibraryUsageSortByEnum = "deployedApplicationCount" + SummarizeLibraryUsageSortByLibraryname SummarizeLibraryUsageSortByEnum = "libraryName" + SummarizeLibraryUsageSortByLibraryversion SummarizeLibraryUsageSortByEnum = "libraryVersion" + SummarizeLibraryUsageSortByManagedinstancecount SummarizeLibraryUsageSortByEnum = "managedInstanceCount" + SummarizeLibraryUsageSortByTimefirstseen SummarizeLibraryUsageSortByEnum = "timeFirstSeen" + SummarizeLibraryUsageSortByTimelastseen SummarizeLibraryUsageSortByEnum = "timeLastSeen" +) + +var mappingSummarizeLibraryUsageSortByEnum = map[string]SummarizeLibraryUsageSortByEnum{ + "applicationCount": SummarizeLibraryUsageSortByApplicationcount, + "javaServerInstanceCount": SummarizeLibraryUsageSortByJavaserverinstancecount, + "cvssScore": SummarizeLibraryUsageSortByCvssscore, + "deployedApplicationCount": SummarizeLibraryUsageSortByDeployedapplicationcount, + "libraryName": SummarizeLibraryUsageSortByLibraryname, + "libraryVersion": SummarizeLibraryUsageSortByLibraryversion, + "managedInstanceCount": SummarizeLibraryUsageSortByManagedinstancecount, + "timeFirstSeen": SummarizeLibraryUsageSortByTimefirstseen, + "timeLastSeen": SummarizeLibraryUsageSortByTimelastseen, +} + +var mappingSummarizeLibraryUsageSortByEnumLowerCase = map[string]SummarizeLibraryUsageSortByEnum{ + "applicationcount": SummarizeLibraryUsageSortByApplicationcount, + "javaserverinstancecount": SummarizeLibraryUsageSortByJavaserverinstancecount, + "cvssscore": SummarizeLibraryUsageSortByCvssscore, + "deployedapplicationcount": SummarizeLibraryUsageSortByDeployedapplicationcount, + "libraryname": SummarizeLibraryUsageSortByLibraryname, + "libraryversion": SummarizeLibraryUsageSortByLibraryversion, + "managedinstancecount": SummarizeLibraryUsageSortByManagedinstancecount, + "timefirstseen": SummarizeLibraryUsageSortByTimefirstseen, + "timelastseen": SummarizeLibraryUsageSortByTimelastseen, +} + +// GetSummarizeLibraryUsageSortByEnumValues Enumerates the set of values for SummarizeLibraryUsageSortByEnum +func GetSummarizeLibraryUsageSortByEnumValues() []SummarizeLibraryUsageSortByEnum { + values := make([]SummarizeLibraryUsageSortByEnum, 0) + for _, v := range mappingSummarizeLibraryUsageSortByEnum { + values = append(values, v) + } + return values +} + +// GetSummarizeLibraryUsageSortByEnumStringValues Enumerates the set of values in String for SummarizeLibraryUsageSortByEnum +func GetSummarizeLibraryUsageSortByEnumStringValues() []string { + return []string{ + "applicationCount", + "javaServerInstanceCount", + "cvssScore", + "deployedApplicationCount", + "libraryName", + "libraryVersion", + "managedInstanceCount", + "timeFirstSeen", + "timeLastSeen", + } +} + +// GetMappingSummarizeLibraryUsageSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSummarizeLibraryUsageSortByEnum(val string) (SummarizeLibraryUsageSortByEnum, bool) { + enum, ok := mappingSummarizeLibraryUsageSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/summarize_managed_instance_usage_request_response.go b/jms/summarize_managed_instance_usage_request_response.go index 7937d23370..354f9ad2db 100644 --- a/jms/summarize_managed_instance_usage_request_response.go +++ b/jms/summarize_managed_instance_usage_request_response.go @@ -78,6 +78,9 @@ type SummarizeManagedInstanceUsageRequest struct { // Filter the list with hostname contains the given value. HostnameContains *string `mandatory:"false" contributesTo:"query" name:"hostnameContains"` + // The library key. + LibraryKey *string `mandatory:"false" contributesTo:"query" name:"libraryKey"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/jms/summarized_events_log.go b/jms/summarized_events_log.go new file mode 100644 index 0000000000..cf2008dfcc --- /dev/null +++ b/jms/summarized_events_log.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SummarizedEventsLog Summarized events log for advanced feature. +type SummarizedEventsLog struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the log group. + LogGroupId *string `mandatory:"true" json:"logGroupId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the log. + LogId *string `mandatory:"true" json:"logId"` +} + +func (m SummarizedEventsLog) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SummarizedEventsLog) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/tls_versions.go b/jms/tls_versions.go new file mode 100644 index 0000000000..d486713aad --- /dev/null +++ b/jms/tls_versions.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "strings" +) + +// TlsVersionsEnum Enum with underlying type: string +type TlsVersionsEnum string + +// Set of constants representing the allowable values for TlsVersionsEnum +const ( + TlsVersionsTls10 TlsVersionsEnum = "TLS_1_0" + TlsVersionsTls11 TlsVersionsEnum = "TLS_1_1" +) + +var mappingTlsVersionsEnum = map[string]TlsVersionsEnum{ + "TLS_1_0": TlsVersionsTls10, + "TLS_1_1": TlsVersionsTls11, +} + +var mappingTlsVersionsEnumLowerCase = map[string]TlsVersionsEnum{ + "tls_1_0": TlsVersionsTls10, + "tls_1_1": TlsVersionsTls11, +} + +// GetTlsVersionsEnumValues Enumerates the set of values for TlsVersionsEnum +func GetTlsVersionsEnumValues() []TlsVersionsEnum { + values := make([]TlsVersionsEnum, 0) + for _, v := range mappingTlsVersionsEnum { + values = append(values, v) + } + return values +} + +// GetTlsVersionsEnumStringValues Enumerates the set of values in String for TlsVersionsEnum +func GetTlsVersionsEnumStringValues() []string { + return []string{ + "TLS_1_0", + "TLS_1_1", + } +} + +// GetMappingTlsVersionsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTlsVersionsEnum(val string) (TlsVersionsEnum, bool) { + enum, ok := mappingTlsVersionsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/jms/update_fleet_advanced_feature_configuration_details.go b/jms/update_fleet_advanced_feature_configuration_details.go new file mode 100644 index 0000000000..0939a81665 --- /dev/null +++ b/jms/update_fleet_advanced_feature_configuration_details.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Java Management Service API +// +// API for the Java Management Service. Use this API to view, create, and manage Fleets. +// + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateFleetAdvancedFeatureConfigurationDetails Details object containing advanced feature configurations to be updated +// Ensure that the namespace and bucket storage are created prior to turning on the JfrRecording or CryptoEventAnalysis feature +type UpdateFleetAdvancedFeatureConfigurationDetails struct { + + // Namespace for the fleet advanced feature + AnalyticNamespace *string `mandatory:"false" json:"analyticNamespace"` + + // Bucket name required to store jfr and related data + AnalyticBucketName *string `mandatory:"false" json:"analyticBucketName"` + + Lcm *Lcm `mandatory:"false" json:"lcm"` + + CryptoEventAnalysis *CryptoEventAnalysis `mandatory:"false" json:"cryptoEventAnalysis"` + + AdvancedUsageTracking *AdvancedUsageTracking `mandatory:"false" json:"advancedUsageTracking"` + + JfrRecording *JfrRecording `mandatory:"false" json:"jfrRecording"` +} + +func (m UpdateFleetAdvancedFeatureConfigurationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateFleetAdvancedFeatureConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/jms/update_fleet_advanced_feature_configuration_request_response.go b/jms/update_fleet_advanced_feature_configuration_request_response.go new file mode 100644 index 0000000000..44cd03b0ef --- /dev/null +++ b/jms/update_fleet_advanced_feature_configuration_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package jms + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateFleetAdvancedFeatureConfigurationRequest wrapper for the UpdateFleetAdvancedFeatureConfiguration operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/jms/UpdateFleetAdvancedFeatureConfiguration.go.html to see an example of how to use UpdateFleetAdvancedFeatureConfigurationRequest. +type UpdateFleetAdvancedFeatureConfigurationRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Fleet. + FleetId *string `mandatory:"true" contributesTo:"path" name:"fleetId"` + + // Update advanced feature configurations with new fields + UpdateFleetAdvancedFeatureConfigurationDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // ETag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the ETag you + // provide matches the resource's current ETag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateFleetAdvancedFeatureConfigurationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateFleetAdvancedFeatureConfigurationRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateFleetAdvancedFeatureConfigurationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateFleetAdvancedFeatureConfigurationRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateFleetAdvancedFeatureConfigurationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateFleetAdvancedFeatureConfigurationResponse wrapper for the UpdateFleetAdvancedFeatureConfiguration operation +type UpdateFleetAdvancedFeatureConfigurationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The FleetAdvancedFeatureConfiguration instance + FleetAdvancedFeatureConfiguration `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateFleetAdvancedFeatureConfigurationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateFleetAdvancedFeatureConfigurationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jms/update_fleet_agent_configuration_details.go b/jms/update_fleet_agent_configuration_details.go index 96a74aa36c..3a91514cad 100644 --- a/jms/update_fleet_agent_configuration_details.go +++ b/jms/update_fleet_agent_configuration_details.go @@ -24,6 +24,12 @@ type UpdateFleetAgentConfigurationDetails struct { // The frequency (in minutes) of Java Usage Tracker processing. (That is, how often should JMS process data from the Java Usage Tracker.) JavaUsageTrackerProcessingFrequencyInMinutes *int `mandatory:"false" json:"javaUsageTrackerProcessingFrequencyInMinutes"` + // The validity period in days for work requests. + WorkRequestValidityPeriodInDays *int `mandatory:"false" json:"workRequestValidityPeriodInDays"` + + // Agent polling interval in minutes + AgentPollingIntervalInMinutes *int `mandatory:"false" json:"agentPollingIntervalInMinutes"` + LinuxConfiguration *FleetAgentOsConfiguration `mandatory:"false" json:"linuxConfiguration"` WindowsConfiguration *FleetAgentOsConfiguration `mandatory:"false" json:"windowsConfiguration"` diff --git a/jms/update_fleet_details.go b/jms/update_fleet_details.go index 1ebac73220..04f9de3651 100644 --- a/jms/update_fleet_details.go +++ b/jms/update_fleet_details.go @@ -28,7 +28,8 @@ type UpdateFleetDetails struct { OperationLog *CustomLog `mandatory:"false" json:"operationLog"` - // Whether or not advanced features are enabled in this fleet. By default, this is set to false. + // Whether or not advanced features are enabled in this fleet. + // Deprecated, use `/fleets/{fleetId}/advanceFeatureConfiguration` api instead. IsAdvancedFeaturesEnabled *bool `mandatory:"false" json:"isAdvancedFeaturesEnabled"` // Defined tags for this resource. Each key is predefined and scoped to a namespace. diff --git a/mysql/anonymous_transactions_handling.go b/mysql/anonymous_transactions_handling.go new file mode 100644 index 0000000000..5137bd325f --- /dev/null +++ b/mysql/anonymous_transactions_handling.go @@ -0,0 +1,131 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AnonymousTransactionsHandling Specifies how the replication channel handles replicated transactions without an identifier, enabling replication +// from a source that does not use transaction-id-based replication to a replica that does. +type AnonymousTransactionsHandling interface { +} + +type anonymoustransactionshandling struct { + JsonData []byte + Policy string `json:"policy"` +} + +// UnmarshalJSON unmarshals json +func (m *anonymoustransactionshandling) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshaleranonymoustransactionshandling anonymoustransactionshandling + s := struct { + Model Unmarshaleranonymoustransactionshandling + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Policy = s.Model.Policy + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *anonymoustransactionshandling) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Policy { + case "ERROR_ON_ANONYMOUS": + mm := ErrorOnAnonymousHandling{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ASSIGN_MANUAL_UUID": + mm := AssignManualUuidHandling{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ASSIGN_TARGET_UUID": + mm := AssignTargetUuidHandling{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +func (m anonymoustransactionshandling) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m anonymoustransactionshandling) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AnonymousTransactionsHandlingPolicyEnum Enum with underlying type: string +type AnonymousTransactionsHandlingPolicyEnum string + +// Set of constants representing the allowable values for AnonymousTransactionsHandlingPolicyEnum +const ( + AnonymousTransactionsHandlingPolicyErrorOnAnonymous AnonymousTransactionsHandlingPolicyEnum = "ERROR_ON_ANONYMOUS" + AnonymousTransactionsHandlingPolicyAssignTargetUuid AnonymousTransactionsHandlingPolicyEnum = "ASSIGN_TARGET_UUID" + AnonymousTransactionsHandlingPolicyAssignManualUuid AnonymousTransactionsHandlingPolicyEnum = "ASSIGN_MANUAL_UUID" +) + +var mappingAnonymousTransactionsHandlingPolicyEnum = map[string]AnonymousTransactionsHandlingPolicyEnum{ + "ERROR_ON_ANONYMOUS": AnonymousTransactionsHandlingPolicyErrorOnAnonymous, + "ASSIGN_TARGET_UUID": AnonymousTransactionsHandlingPolicyAssignTargetUuid, + "ASSIGN_MANUAL_UUID": AnonymousTransactionsHandlingPolicyAssignManualUuid, +} + +var mappingAnonymousTransactionsHandlingPolicyEnumLowerCase = map[string]AnonymousTransactionsHandlingPolicyEnum{ + "error_on_anonymous": AnonymousTransactionsHandlingPolicyErrorOnAnonymous, + "assign_target_uuid": AnonymousTransactionsHandlingPolicyAssignTargetUuid, + "assign_manual_uuid": AnonymousTransactionsHandlingPolicyAssignManualUuid, +} + +// GetAnonymousTransactionsHandlingPolicyEnumValues Enumerates the set of values for AnonymousTransactionsHandlingPolicyEnum +func GetAnonymousTransactionsHandlingPolicyEnumValues() []AnonymousTransactionsHandlingPolicyEnum { + values := make([]AnonymousTransactionsHandlingPolicyEnum, 0) + for _, v := range mappingAnonymousTransactionsHandlingPolicyEnum { + values = append(values, v) + } + return values +} + +// GetAnonymousTransactionsHandlingPolicyEnumStringValues Enumerates the set of values in String for AnonymousTransactionsHandlingPolicyEnum +func GetAnonymousTransactionsHandlingPolicyEnumStringValues() []string { + return []string{ + "ERROR_ON_ANONYMOUS", + "ASSIGN_TARGET_UUID", + "ASSIGN_MANUAL_UUID", + } +} + +// GetMappingAnonymousTransactionsHandlingPolicyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAnonymousTransactionsHandlingPolicyEnum(val string) (AnonymousTransactionsHandlingPolicyEnum, bool) { + enum, ok := mappingAnonymousTransactionsHandlingPolicyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/assign_manual_uuid_handling.go b/mysql/assign_manual_uuid_handling.go new file mode 100644 index 0000000000..cc7b4ef10b --- /dev/null +++ b/mysql/assign_manual_uuid_handling.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AssignManualUuidHandling Enables assignment of IDs on the target to anonymous transactions coming from the source. A manually defined UUID +// is added as a prefix to the ID. +type AssignManualUuidHandling struct { + + // Specifies one of the coordinates (file) at which the replica should begin + // reading the source's log. As this value specifies the point where replication + // starts from, it is only used once, when it starts. It is never used again, + // unless a new UpdateChannel operation modifies it. + LastConfiguredLogFilename *string `mandatory:"false" json:"lastConfiguredLogFilename"` + + // Specifies one of the coordinates (offset) at which the replica should begin + // reading the source's log. As this value specifies the point where replication + // starts from, it is only used once, when it starts. It is never used again, + // unless a new UpdateChannel operation modifies it. + LastConfiguredLogOffset *int64 `mandatory:"false" json:"lastConfiguredLogOffset"` + + // The UUID that is used as a prefix when generating transaction identifiers for anonymous transactions + // coming from the source. You can change the UUID later. + Uuid *string `mandatory:"false" json:"uuid"` +} + +func (m AssignManualUuidHandling) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AssignManualUuidHandling) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m AssignManualUuidHandling) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAssignManualUuidHandling AssignManualUuidHandling + s := struct { + DiscriminatorParam string `json:"policy"` + MarshalTypeAssignManualUuidHandling + }{ + "ASSIGN_MANUAL_UUID", + (MarshalTypeAssignManualUuidHandling)(m), + } + + return json.Marshal(&s) +} diff --git a/mysql/assign_target_uuid_handling.go b/mysql/assign_target_uuid_handling.go new file mode 100644 index 0000000000..2897c0ae8b --- /dev/null +++ b/mysql/assign_target_uuid_handling.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AssignTargetUuidHandling Enables assignment of IDs on the target to anonymous transactions coming from the source. The target server UUID +// is added as a prefix to the ID. +type AssignTargetUuidHandling struct { + + // Specifies one of the coordinates (file) at which the replica should begin + // reading the source's log. As this value specifies the point where replication + // starts from, it is only used once, when it starts. It is never used again, + // unless a new UpdateChannel operation modifies it. + LastConfiguredLogFilename *string `mandatory:"false" json:"lastConfiguredLogFilename"` + + // Specifies one of the coordinates (offset) at which the replica should begin + // reading the source's log. As this value specifies the point where replication + // starts from, it is only used once, when it starts. It is never used again, + // unless a new UpdateChannel operation modifies it. + LastConfiguredLogOffset *int64 `mandatory:"false" json:"lastConfiguredLogOffset"` +} + +func (m AssignTargetUuidHandling) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AssignTargetUuidHandling) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m AssignTargetUuidHandling) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAssignTargetUuidHandling AssignTargetUuidHandling + s := struct { + DiscriminatorParam string `json:"policy"` + MarshalTypeAssignTargetUuidHandling + }{ + "ASSIGN_TARGET_UUID", + (MarshalTypeAssignTargetUuidHandling)(m), + } + + return json.Marshal(&s) +} diff --git a/mysql/backup_summary.go b/mysql/backup_summary.go index 163952bdb6..3131640a97 100644 --- a/mysql/backup_summary.go +++ b/mysql/backup_summary.go @@ -40,6 +40,9 @@ type BackupSummary struct { // The OCID of the DB System the Backup is associated with. DbSystemId *string `mandatory:"true" json:"dbSystemId"` + // The OCID of the compartment the backup exists in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + // A user-supplied display name for the backup. DisplayName *string `mandatory:"false" json:"displayName"` diff --git a/mysql/channel_filter.go b/mysql/channel_filter.go new file mode 100644 index 0000000000..426c5f40e6 --- /dev/null +++ b/mysql/channel_filter.go @@ -0,0 +1,111 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChannelFilter Replication filter rule for a channel. +type ChannelFilter struct { + + // The type of the filter rule. + // For details on each type, see + // Replication Filtering Rules (https://dev.mysql.com/doc/refman/8.0/en/replication-rules.html) + Type ChannelFilterTypeEnum `mandatory:"true" json:"type"` + + // The body of the filter rule. This can represent a database, a table, or a database pair (represented as + // "db1->db2"). For more information, see + // Replication Filtering Rules (https://dev.mysql.com/doc/refman/8.0/en/replication-rules.html). + Value *string `mandatory:"true" json:"value"` +} + +func (m ChannelFilter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChannelFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingChannelFilterTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetChannelFilterTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChannelFilterTypeEnum Enum with underlying type: string +type ChannelFilterTypeEnum string + +// Set of constants representing the allowable values for ChannelFilterTypeEnum +const ( + ChannelFilterTypeDoDb ChannelFilterTypeEnum = "REPLICATE_DO_DB" + ChannelFilterTypeIgnoreDb ChannelFilterTypeEnum = "REPLICATE_IGNORE_DB" + ChannelFilterTypeDoTable ChannelFilterTypeEnum = "REPLICATE_DO_TABLE" + ChannelFilterTypeIgnoreTable ChannelFilterTypeEnum = "REPLICATE_IGNORE_TABLE" + ChannelFilterTypeWildDoTable ChannelFilterTypeEnum = "REPLICATE_WILD_DO_TABLE" + ChannelFilterTypeWildIgnoreTable ChannelFilterTypeEnum = "REPLICATE_WILD_IGNORE_TABLE" + ChannelFilterTypeRewriteDb ChannelFilterTypeEnum = "REPLICATE_REWRITE_DB" +) + +var mappingChannelFilterTypeEnum = map[string]ChannelFilterTypeEnum{ + "REPLICATE_DO_DB": ChannelFilterTypeDoDb, + "REPLICATE_IGNORE_DB": ChannelFilterTypeIgnoreDb, + "REPLICATE_DO_TABLE": ChannelFilterTypeDoTable, + "REPLICATE_IGNORE_TABLE": ChannelFilterTypeIgnoreTable, + "REPLICATE_WILD_DO_TABLE": ChannelFilterTypeWildDoTable, + "REPLICATE_WILD_IGNORE_TABLE": ChannelFilterTypeWildIgnoreTable, + "REPLICATE_REWRITE_DB": ChannelFilterTypeRewriteDb, +} + +var mappingChannelFilterTypeEnumLowerCase = map[string]ChannelFilterTypeEnum{ + "replicate_do_db": ChannelFilterTypeDoDb, + "replicate_ignore_db": ChannelFilterTypeIgnoreDb, + "replicate_do_table": ChannelFilterTypeDoTable, + "replicate_ignore_table": ChannelFilterTypeIgnoreTable, + "replicate_wild_do_table": ChannelFilterTypeWildDoTable, + "replicate_wild_ignore_table": ChannelFilterTypeWildIgnoreTable, + "replicate_rewrite_db": ChannelFilterTypeRewriteDb, +} + +// GetChannelFilterTypeEnumValues Enumerates the set of values for ChannelFilterTypeEnum +func GetChannelFilterTypeEnumValues() []ChannelFilterTypeEnum { + values := make([]ChannelFilterTypeEnum, 0) + for _, v := range mappingChannelFilterTypeEnum { + values = append(values, v) + } + return values +} + +// GetChannelFilterTypeEnumStringValues Enumerates the set of values in String for ChannelFilterTypeEnum +func GetChannelFilterTypeEnumStringValues() []string { + return []string{ + "REPLICATE_DO_DB", + "REPLICATE_IGNORE_DB", + "REPLICATE_DO_TABLE", + "REPLICATE_IGNORE_TABLE", + "REPLICATE_WILD_DO_TABLE", + "REPLICATE_WILD_IGNORE_TABLE", + "REPLICATE_REWRITE_DB", + } +} + +// GetMappingChannelFilterTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingChannelFilterTypeEnum(val string) (ChannelFilterTypeEnum, bool) { + enum, ok := mappingChannelFilterTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/channel_source_mysql.go b/mysql/channel_source_mysql.go index a088afc0e0..8a1a3d67c1 100644 --- a/mysql/channel_source_mysql.go +++ b/mysql/channel_source_mysql.go @@ -32,6 +32,8 @@ type ChannelSourceMysql struct { SslCaCertificate CaCertificate `mandatory:"false" json:"sslCaCertificate"` + AnonymousTransactionsHandling AnonymousTransactionsHandling `mandatory:"false" json:"anonymousTransactionsHandling"` + // The SSL mode of the Channel. SslMode ChannelSourceMysqlSslModeEnum `mandatory:"true" json:"sslMode"` } @@ -72,11 +74,12 @@ func (m ChannelSourceMysql) MarshalJSON() (buff []byte, e error) { // UnmarshalJSON unmarshals from json func (m *ChannelSourceMysql) UnmarshalJSON(data []byte) (e error) { model := struct { - SslCaCertificate cacertificate `json:"sslCaCertificate"` - Hostname *string `json:"hostname"` - Port *int `json:"port"` - Username *string `json:"username"` - SslMode ChannelSourceMysqlSslModeEnum `json:"sslMode"` + SslCaCertificate cacertificate `json:"sslCaCertificate"` + AnonymousTransactionsHandling anonymoustransactionshandling `json:"anonymousTransactionsHandling"` + Hostname *string `json:"hostname"` + Port *int `json:"port"` + Username *string `json:"username"` + SslMode ChannelSourceMysqlSslModeEnum `json:"sslMode"` }{} e = json.Unmarshal(data, &model) @@ -94,6 +97,16 @@ func (m *ChannelSourceMysql) UnmarshalJSON(data []byte) (e error) { m.SslCaCertificate = nil } + nn, e = model.AnonymousTransactionsHandling.UnmarshalPolymorphicJSON(model.AnonymousTransactionsHandling.JsonData) + if e != nil { + return + } + if nn != nil { + m.AnonymousTransactionsHandling = nn.(AnonymousTransactionsHandling) + } else { + m.AnonymousTransactionsHandling = nil + } + m.Hostname = model.Hostname m.Port = model.Port diff --git a/mysql/channel_target_db_system.go b/mysql/channel_target_db_system.go index d1d25ff511..c00ac7f2b1 100644 --- a/mysql/channel_target_db_system.go +++ b/mysql/channel_target_db_system.go @@ -29,6 +29,9 @@ type ChannelTargetDbSystem struct { // The username for the replication applier of the target MySQL DB System. ApplierUsername *string `mandatory:"true" json:"applierUsername"` + + // Replication filter rules to be applied at the DB System Channel target. + Filters []ChannelFilter `mandatory:"false" json:"filters"` } func (m ChannelTargetDbSystem) String() string { diff --git a/mysql/create_channel_source_from_mysql_details.go b/mysql/create_channel_source_from_mysql_details.go index 9bd54563ac..f104efea38 100644 --- a/mysql/create_channel_source_from_mysql_details.go +++ b/mysql/create_channel_source_from_mysql_details.go @@ -39,6 +39,8 @@ type CreateChannelSourceFromMysqlDetails struct { SslCaCertificate CaCertificate `mandatory:"false" json:"sslCaCertificate"` + AnonymousTransactionsHandling AnonymousTransactionsHandling `mandatory:"false" json:"anonymousTransactionsHandling"` + // The SSL mode of the Channel. SslMode ChannelSourceMysqlSslModeEnum `mandatory:"true" json:"sslMode"` } @@ -79,12 +81,13 @@ func (m CreateChannelSourceFromMysqlDetails) MarshalJSON() (buff []byte, e error // UnmarshalJSON unmarshals from json func (m *CreateChannelSourceFromMysqlDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Port *int `json:"port"` - SslCaCertificate cacertificate `json:"sslCaCertificate"` - Hostname *string `json:"hostname"` - Username *string `json:"username"` - Password *string `json:"password"` - SslMode ChannelSourceMysqlSslModeEnum `json:"sslMode"` + Port *int `json:"port"` + SslCaCertificate cacertificate `json:"sslCaCertificate"` + AnonymousTransactionsHandling anonymoustransactionshandling `json:"anonymousTransactionsHandling"` + Hostname *string `json:"hostname"` + Username *string `json:"username"` + Password *string `json:"password"` + SslMode ChannelSourceMysqlSslModeEnum `json:"sslMode"` }{} e = json.Unmarshal(data, &model) @@ -104,6 +107,16 @@ func (m *CreateChannelSourceFromMysqlDetails) UnmarshalJSON(data []byte) (e erro m.SslCaCertificate = nil } + nn, e = model.AnonymousTransactionsHandling.UnmarshalPolymorphicJSON(model.AnonymousTransactionsHandling.JsonData) + if e != nil { + return + } + if nn != nil { + m.AnonymousTransactionsHandling = nn.(AnonymousTransactionsHandling) + } else { + m.AnonymousTransactionsHandling = nil + } + m.Hostname = model.Hostname m.Username = model.Username diff --git a/mysql/create_channel_target_from_db_system_details.go b/mysql/create_channel_target_from_db_system_details.go index fffc440eac..159c8b883f 100644 --- a/mysql/create_channel_target_from_db_system_details.go +++ b/mysql/create_channel_target_from_db_system_details.go @@ -29,6 +29,9 @@ type CreateChannelTargetFromDbSystemDetails struct { // The username for the replication applier of the target MySQL DB System. ApplierUsername *string `mandatory:"false" json:"applierUsername"` + + // Replication filter rules to be applied at the DB System Channel target. + Filters []ChannelFilter `mandatory:"false" json:"filters"` } func (m CreateChannelTargetFromDbSystemDetails) String() string { diff --git a/mysql/create_maintenance_details.go b/mysql/create_maintenance_details.go index a08f587944..d436ead17f 100644 --- a/mysql/create_maintenance_details.go +++ b/mysql/create_maintenance_details.go @@ -15,13 +15,14 @@ import ( "strings" ) -// CreateMaintenanceDetails The Maintenance Policy for the DB System. +// CreateMaintenanceDetails The Maintenance Policy for the DB System or Read Replica that this model is included in. type CreateMaintenanceDetails struct { // The start of the 2 hour maintenance window. // This string is of the format: "{day-of-week} {time-of-day}". // "{day-of-week}" is a case-insensitive string like "mon", "tue", &c. // "{time-of-day}" is the "Time" portion of an RFC3339-formatted timestamp. Any second or sub-second time data will be truncated to zero. + // If you set the read replica maintenance window to "" or if not specified, the read replica is set same as the DB system maintenance window. WindowStartTime *string `mandatory:"true" json:"windowStartTime"` } diff --git a/mysql/create_replica_details.go b/mysql/create_replica_details.go new file mode 100644 index 0000000000..516743f9d6 --- /dev/null +++ b/mysql/create_replica_details.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateReplicaDetails Details required to create a read replica. +type CreateReplicaDetails struct { + + // The OCID of the DB System the read replica is associated with. + DbSystemId *string `mandatory:"true" json:"dbSystemId"` + + // The user-friendly name for the read replica. It does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // User provided description of the read replica. + Description *string `mandatory:"false" json:"description"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. + // Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If + // the DB System is delete protected, read replicas can still be deleted individually if they are not delete + // protected themselves. + IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` +} + +func (m CreateReplicaDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateReplicaDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/mysql/create_replica_request_response.go b/mysql/create_replica_request_response.go new file mode 100644 index 0000000000..62cb681d1c --- /dev/null +++ b/mysql/create_replica_request_response.go @@ -0,0 +1,109 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateReplicaRequest wrapper for the CreateReplica operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/CreateReplica.go.html to see an example of how to use CreateReplicaRequest. +type CreateReplicaRequest struct { + + // The parameters of the request to create the read replica. + CreateReplicaDetails `contributesTo:"body"` + + // Customer-defined unique identifier for the request. If you need to + // contact Oracle about a specific request, please provide the request + // ID that you supplied in this header with the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case + // of a timeout or server error without risk of executing that same action + // again. Retry tokens expire after 24 hours, but can be invalidated before + // then due to conflicting operations (for example, if a resource has been + // deleted and purged from the system, then a retry of the original + // creation request may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateReplicaRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateReplicaRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateReplicaRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateReplicaRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateReplicaRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateReplicaResponse wrapper for the CreateReplica operation +type CreateReplicaResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Replica instance + Replica `presentIn:"body"` + + // The URI for the entity being described in the response body. + Location *string `presentIn:"header" name:"location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response CreateReplicaResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateReplicaResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mysql/db_system_endpoint.go b/mysql/db_system_endpoint.go index c6defa2dd8..047b418a34 100644 --- a/mysql/db_system_endpoint.go +++ b/mysql/db_system_endpoint.go @@ -39,6 +39,12 @@ type DbSystemEndpoint struct { // Additional information about the current endpoint status. StatusDetails *string `mandatory:"false" json:"statusDetails"` + + // The type of endpoint that clients and connectors can connect to. + ResourceType DbSystemEndpointResourceTypeEnum `mandatory:"false" json:"resourceType,omitempty"` + + // The OCID of the resource that this endpoint is attached to. + ResourceId *string `mandatory:"false" json:"resourceId"` } func (m DbSystemEndpoint) String() string { @@ -60,6 +66,9 @@ func (m DbSystemEndpoint) ValidateEnumValue() (bool, error) { if _, ok := GetMappingDbSystemEndpointStatusEnum(string(m.Status)); !ok && m.Status != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetDbSystemEndpointStatusEnumStringValues(), ","))) } + if _, ok := GetMappingDbSystemEndpointResourceTypeEnum(string(m.ResourceType)); !ok && m.ResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceType: %s. Supported values are: %s.", m.ResourceType, strings.Join(GetDbSystemEndpointResourceTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -153,3 +162,49 @@ func GetMappingDbSystemEndpointStatusEnum(val string) (DbSystemEndpointStatusEnu enum, ok := mappingDbSystemEndpointStatusEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// DbSystemEndpointResourceTypeEnum Enum with underlying type: string +type DbSystemEndpointResourceTypeEnum string + +// Set of constants representing the allowable values for DbSystemEndpointResourceTypeEnum +const ( + DbSystemEndpointResourceTypeDbsystem DbSystemEndpointResourceTypeEnum = "DBSYSTEM" + DbSystemEndpointResourceTypeReadReplica DbSystemEndpointResourceTypeEnum = "READ_REPLICA" + DbSystemEndpointResourceTypeLoadBalancer DbSystemEndpointResourceTypeEnum = "LOAD_BALANCER" +) + +var mappingDbSystemEndpointResourceTypeEnum = map[string]DbSystemEndpointResourceTypeEnum{ + "DBSYSTEM": DbSystemEndpointResourceTypeDbsystem, + "READ_REPLICA": DbSystemEndpointResourceTypeReadReplica, + "LOAD_BALANCER": DbSystemEndpointResourceTypeLoadBalancer, +} + +var mappingDbSystemEndpointResourceTypeEnumLowerCase = map[string]DbSystemEndpointResourceTypeEnum{ + "dbsystem": DbSystemEndpointResourceTypeDbsystem, + "read_replica": DbSystemEndpointResourceTypeReadReplica, + "load_balancer": DbSystemEndpointResourceTypeLoadBalancer, +} + +// GetDbSystemEndpointResourceTypeEnumValues Enumerates the set of values for DbSystemEndpointResourceTypeEnum +func GetDbSystemEndpointResourceTypeEnumValues() []DbSystemEndpointResourceTypeEnum { + values := make([]DbSystemEndpointResourceTypeEnum, 0) + for _, v := range mappingDbSystemEndpointResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetDbSystemEndpointResourceTypeEnumStringValues Enumerates the set of values in String for DbSystemEndpointResourceTypeEnum +func GetDbSystemEndpointResourceTypeEnumStringValues() []string { + return []string{ + "DBSYSTEM", + "READ_REPLICA", + "LOAD_BALANCER", + } +} + +// GetMappingDbSystemEndpointResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDbSystemEndpointResourceTypeEnum(val string) (DbSystemEndpointResourceTypeEnum, bool) { + enum, ok := mappingDbSystemEndpointResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/delete_replica_request_response.go b/mysql/delete_replica_request_response.go new file mode 100644 index 0000000000..52d0b43b19 --- /dev/null +++ b/mysql/delete_replica_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteReplicaRequest wrapper for the DeleteReplica operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/DeleteReplica.go.html to see an example of how to use DeleteReplicaRequest. +type DeleteReplicaRequest struct { + + // The Replica OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ReplicaId *string `mandatory:"true" contributesTo:"path" name:"replicaId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `If-Match` header to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Customer-defined unique identifier for the request. If you need to + // contact Oracle about a specific request, please provide the request + // ID that you supplied in this header with the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteReplicaRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteReplicaRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteReplicaRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteReplicaRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteReplicaRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteReplicaResponse wrapper for the DeleteReplica operation +type DeleteReplicaResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteReplicaResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteReplicaResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mysql/error_on_anonymous_handling.go b/mysql/error_on_anonymous_handling.go new file mode 100644 index 0000000000..99e90ffc8d --- /dev/null +++ b/mysql/error_on_anonymous_handling.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ErrorOnAnonymousHandling Disables assignment of IDs to anonymous transactions coming from the source. Use this policy when the transaction +// identifiers are enabled in the source of the replication channel. +type ErrorOnAnonymousHandling struct { +} + +func (m ErrorOnAnonymousHandling) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ErrorOnAnonymousHandling) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ErrorOnAnonymousHandling) MarshalJSON() (buff []byte, e error) { + type MarshalTypeErrorOnAnonymousHandling ErrorOnAnonymousHandling + s := struct { + DiscriminatorParam string `json:"policy"` + MarshalTypeErrorOnAnonymousHandling + }{ + "ERROR_ON_ANONYMOUS", + (MarshalTypeErrorOnAnonymousHandling)(m), + } + + return json.Marshal(&s) +} diff --git a/mysql/get_replica_request_response.go b/mysql/get_replica_request_response.go new file mode 100644 index 0000000000..df687c4e6d --- /dev/null +++ b/mysql/get_replica_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetReplicaRequest wrapper for the GetReplica operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/GetReplica.go.html to see an example of how to use GetReplicaRequest. +type GetReplicaRequest struct { + + // The Replica OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ReplicaId *string `mandatory:"true" contributesTo:"path" name:"replicaId"` + + // Customer-defined unique identifier for the request. If you need to + // contact Oracle about a specific request, please provide the request + // ID that you supplied in this header with the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For conditional requests. In the GET call for a resource, set the + // `If-None-Match` header to the value of the ETag from a previous GET (or + // POST or PUT) response for that resource. The server will return with + // either a 304 Not Modified response if the resource has not changed, or a + // 200 OK response with the updated representation. + IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetReplicaRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetReplicaRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetReplicaRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetReplicaRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetReplicaRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetReplicaResponse wrapper for the GetReplica operation +type GetReplicaResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Replica instance + Replica `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response GetReplicaResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetReplicaResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mysql/list_replicas_request_response.go b/mysql/list_replicas_request_response.go new file mode 100644 index 0000000000..315f497738 --- /dev/null +++ b/mysql/list_replicas_request_response.go @@ -0,0 +1,217 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListReplicasRequest wrapper for the ListReplicas operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/ListReplicas.go.html to see an example of how to use ListReplicasRequest. +type ListReplicasRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Customer-defined unique identifier for the request. If you need to + // contact Oracle about a specific request, please provide the request + // ID that you supplied in this header with the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return in a paginated list call. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.comAPI/Concepts/usingapi.htm#List_Pagination). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` or `opc-prev-page` response header from + // the previous list call. For information about pagination, see List + // Pagination (https://docs.cloud.oracle.comAPI/Concepts/usingapi.htm#List_Pagination). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // A filter to return only the resource matching the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The DB System OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + DbSystemId *string `mandatory:"false" contributesTo:"query" name:"dbSystemId"` + + // The LifecycleState of the read replica. + LifecycleState ReplicaSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The read replica OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ReplicaId *string `mandatory:"false" contributesTo:"query" name:"replicaId"` + + // The field to sort by. You can sort by one field only. By default, the Time field is sorted in descending order and the Display Name field in ascending order. + SortBy ListReplicasSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use (ASC or DESC). + SortOrder ListReplicasSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListReplicasRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListReplicasRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListReplicasRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListReplicasRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListReplicasRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingReplicaSummaryLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetReplicaSummaryLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListReplicasSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListReplicasSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListReplicasSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListReplicasSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListReplicasResponse wrapper for the ListReplicas operation +type ListReplicasResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ReplicaSummary instances + Items []ReplicaSummary `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListReplicasResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListReplicasResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListReplicasSortByEnum Enum with underlying type: string +type ListReplicasSortByEnum string + +// Set of constants representing the allowable values for ListReplicasSortByEnum +const ( + ListReplicasSortByTimecreated ListReplicasSortByEnum = "timeCreated" + ListReplicasSortByDisplayname ListReplicasSortByEnum = "displayName" +) + +var mappingListReplicasSortByEnum = map[string]ListReplicasSortByEnum{ + "timeCreated": ListReplicasSortByTimecreated, + "displayName": ListReplicasSortByDisplayname, +} + +var mappingListReplicasSortByEnumLowerCase = map[string]ListReplicasSortByEnum{ + "timecreated": ListReplicasSortByTimecreated, + "displayname": ListReplicasSortByDisplayname, +} + +// GetListReplicasSortByEnumValues Enumerates the set of values for ListReplicasSortByEnum +func GetListReplicasSortByEnumValues() []ListReplicasSortByEnum { + values := make([]ListReplicasSortByEnum, 0) + for _, v := range mappingListReplicasSortByEnum { + values = append(values, v) + } + return values +} + +// GetListReplicasSortByEnumStringValues Enumerates the set of values in String for ListReplicasSortByEnum +func GetListReplicasSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListReplicasSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListReplicasSortByEnum(val string) (ListReplicasSortByEnum, bool) { + enum, ok := mappingListReplicasSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListReplicasSortOrderEnum Enum with underlying type: string +type ListReplicasSortOrderEnum string + +// Set of constants representing the allowable values for ListReplicasSortOrderEnum +const ( + ListReplicasSortOrderAsc ListReplicasSortOrderEnum = "ASC" + ListReplicasSortOrderDesc ListReplicasSortOrderEnum = "DESC" +) + +var mappingListReplicasSortOrderEnum = map[string]ListReplicasSortOrderEnum{ + "ASC": ListReplicasSortOrderAsc, + "DESC": ListReplicasSortOrderDesc, +} + +var mappingListReplicasSortOrderEnumLowerCase = map[string]ListReplicasSortOrderEnum{ + "asc": ListReplicasSortOrderAsc, + "desc": ListReplicasSortOrderDesc, +} + +// GetListReplicasSortOrderEnumValues Enumerates the set of values for ListReplicasSortOrderEnum +func GetListReplicasSortOrderEnumValues() []ListReplicasSortOrderEnum { + values := make([]ListReplicasSortOrderEnum, 0) + for _, v := range mappingListReplicasSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListReplicasSortOrderEnumStringValues Enumerates the set of values in String for ListReplicasSortOrderEnum +func GetListReplicasSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListReplicasSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListReplicasSortOrderEnum(val string) (ListReplicasSortOrderEnum, bool) { + enum, ok := mappingListReplicasSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/maintenance_details.go b/mysql/maintenance_details.go index c7ba4fc8df..035a4c0313 100644 --- a/mysql/maintenance_details.go +++ b/mysql/maintenance_details.go @@ -15,13 +15,14 @@ import ( "strings" ) -// MaintenanceDetails The Maintenance Policy for the DB System. +// MaintenanceDetails The Maintenance Policy for the DB System or Read Replica that this model is included in. type MaintenanceDetails struct { // The start time of the maintenance window. // This string is of the format: "{day-of-week} {time-of-day}". // "{day-of-week}" is a case-insensitive string like "mon", "tue", &c. // "{time-of-day}" is the "Time" portion of an RFC3339-formatted timestamp. Any second or sub-second time data will be truncated to zero. + // If you set the read replica maintenance window to "" or if not specified, the read replica is set same as the DB system maintenance window. WindowStartTime *string `mandatory:"false" json:"windowStartTime"` } diff --git a/mysql/mysql_replicas_client.go b/mysql/mysql_replicas_client.go new file mode 100644 index 0000000000..cc1863fa72 --- /dev/null +++ b/mysql/mysql_replicas_client.go @@ -0,0 +1,383 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +//ReplicasClient a client for Replicas +type ReplicasClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewReplicasClientWithConfigurationProvider Creates a new default Replicas client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewReplicasClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ReplicasClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newReplicasClientFromBaseClient(baseClient, provider) +} + +// NewReplicasClientWithOboToken Creates a new default Replicas client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// as well as reading the region +func NewReplicasClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ReplicasClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newReplicasClientFromBaseClient(baseClient, configProvider) +} + +func newReplicasClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ReplicasClient, err error) { + // Replicas service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Replicas")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ReplicasClient{BaseClient: baseClient} + client.BasePath = "20190415" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ReplicasClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("mysql", "https://mysql.{region}.ocp.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ReplicasClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("Invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ReplicasClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateReplica Creates a DB System read replica. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/CreateReplica.go.html to see an example of how to use CreateReplica API. +// A default retry strategy applies to this operation CreateReplica() +func (client ReplicasClient) CreateReplica(ctx context.Context, request CreateReplicaRequest) (response CreateReplicaResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createReplica, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateReplicaResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateReplicaResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateReplicaResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateReplicaResponse") + } + return +} + +// createReplica implements the OCIOperation interface (enables retrying operations) +func (client ReplicasClient) createReplica(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/replicas", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateReplicaResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Replicas", "CreateReplica", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteReplica Deletes the specified read replica. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/DeleteReplica.go.html to see an example of how to use DeleteReplica API. +// A default retry strategy applies to this operation DeleteReplica() +func (client ReplicasClient) DeleteReplica(ctx context.Context, request DeleteReplicaRequest) (response DeleteReplicaResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteReplica, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteReplicaResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteReplicaResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteReplicaResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteReplicaResponse") + } + return +} + +// deleteReplica implements the OCIOperation interface (enables retrying operations) +func (client ReplicasClient) deleteReplica(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/replicas/{replicaId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteReplicaResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/mysql/20190415/Replica/DeleteReplica" + err = common.PostProcessServiceError(err, "Replicas", "DeleteReplica", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetReplica Gets the full details of the specified read replica. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/GetReplica.go.html to see an example of how to use GetReplica API. +// A default retry strategy applies to this operation GetReplica() +func (client ReplicasClient) GetReplica(ctx context.Context, request GetReplicaRequest) (response GetReplicaResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getReplica, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetReplicaResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetReplicaResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetReplicaResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetReplicaResponse") + } + return +} + +// getReplica implements the OCIOperation interface (enables retrying operations) +func (client ReplicasClient) getReplica(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/replicas/{replicaId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetReplicaResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/mysql/20190415/Replica/GetReplica" + err = common.PostProcessServiceError(err, "Replicas", "GetReplica", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListReplicas Lists all the read replicas that match the specified filters. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/ListReplicas.go.html to see an example of how to use ListReplicas API. +// A default retry strategy applies to this operation ListReplicas() +func (client ReplicasClient) ListReplicas(ctx context.Context, request ListReplicasRequest) (response ListReplicasResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listReplicas, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListReplicasResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListReplicasResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListReplicasResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListReplicasResponse") + } + return +} + +// listReplicas implements the OCIOperation interface (enables retrying operations) +func (client ReplicasClient) listReplicas(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/replicas", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListReplicasResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/mysql/20190415/ReplicaSummary/ListReplicas" + err = common.PostProcessServiceError(err, "Replicas", "ListReplicas", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateReplica Updates the properties of the specified read replica. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/UpdateReplica.go.html to see an example of how to use UpdateReplica API. +// A default retry strategy applies to this operation UpdateReplica() +func (client ReplicasClient) UpdateReplica(ctx context.Context, request UpdateReplicaRequest) (response UpdateReplicaResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateReplica, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateReplicaResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateReplicaResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateReplicaResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateReplicaResponse") + } + return +} + +// updateReplica implements the OCIOperation interface (enables retrying operations) +func (client ReplicasClient) updateReplica(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/replicas/{replicaId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateReplicaResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/mysql/20190415/Replica/UpdateReplica" + err = common.PostProcessServiceError(err, "Replicas", "UpdateReplica", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/mysql/replica.go b/mysql/replica.go new file mode 100644 index 0000000000..b4d02d6642 --- /dev/null +++ b/mysql/replica.go @@ -0,0 +1,164 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Replica A DB System read replica. +type Replica struct { + + // The OCID of the read replica. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the DB System the read replica is associated with. + DbSystemId *string `mandatory:"true" json:"dbSystemId"` + + // The OCID of the compartment that contains the read replica. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the read replica. It does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The state of the read replica. + LifecycleState ReplicaLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the read replica was created, as described by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The MySQL version used by the read replica. + MysqlVersion *string `mandatory:"true" json:"mysqlVersion"` + + // The IP address the read replica is configured to listen on. + IpAddress *string `mandatory:"true" json:"ipAddress"` + + // The port the read replica is configured to listen on. + Port *int `mandatory:"true" json:"port"` + + // The TCP network port on which X Plugin listens for connections. This is the X Plugin equivalent of port. + PortX *int `mandatory:"true" json:"portX"` + + // User provided description of the read replica. + Description *string `mandatory:"false" json:"description"` + + // A message describing the state of the read replica. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The time the read replica was last updated, as described by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The name of the Availability Domain the read replica is located in. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // The name of the Fault Domain the read replica is located in. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. + // Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If + // the DB System is delete protected, read replicas can still be deleted individually if they are not delete + // protected themselves. + IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` +} + +func (m Replica) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Replica) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingReplicaLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetReplicaLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReplicaLifecycleStateEnum Enum with underlying type: string +type ReplicaLifecycleStateEnum string + +// Set of constants representing the allowable values for ReplicaLifecycleStateEnum +const ( + ReplicaLifecycleStateCreating ReplicaLifecycleStateEnum = "CREATING" + ReplicaLifecycleStateActive ReplicaLifecycleStateEnum = "ACTIVE" + ReplicaLifecycleStateInactive ReplicaLifecycleStateEnum = "INACTIVE" + ReplicaLifecycleStateUpdating ReplicaLifecycleStateEnum = "UPDATING" + ReplicaLifecycleStateDeleting ReplicaLifecycleStateEnum = "DELETING" + ReplicaLifecycleStateDeleted ReplicaLifecycleStateEnum = "DELETED" + ReplicaLifecycleStateNeedsAttention ReplicaLifecycleStateEnum = "NEEDS_ATTENTION" + ReplicaLifecycleStateFailed ReplicaLifecycleStateEnum = "FAILED" +) + +var mappingReplicaLifecycleStateEnum = map[string]ReplicaLifecycleStateEnum{ + "CREATING": ReplicaLifecycleStateCreating, + "ACTIVE": ReplicaLifecycleStateActive, + "INACTIVE": ReplicaLifecycleStateInactive, + "UPDATING": ReplicaLifecycleStateUpdating, + "DELETING": ReplicaLifecycleStateDeleting, + "DELETED": ReplicaLifecycleStateDeleted, + "NEEDS_ATTENTION": ReplicaLifecycleStateNeedsAttention, + "FAILED": ReplicaLifecycleStateFailed, +} + +var mappingReplicaLifecycleStateEnumLowerCase = map[string]ReplicaLifecycleStateEnum{ + "creating": ReplicaLifecycleStateCreating, + "active": ReplicaLifecycleStateActive, + "inactive": ReplicaLifecycleStateInactive, + "updating": ReplicaLifecycleStateUpdating, + "deleting": ReplicaLifecycleStateDeleting, + "deleted": ReplicaLifecycleStateDeleted, + "needs_attention": ReplicaLifecycleStateNeedsAttention, + "failed": ReplicaLifecycleStateFailed, +} + +// GetReplicaLifecycleStateEnumValues Enumerates the set of values for ReplicaLifecycleStateEnum +func GetReplicaLifecycleStateEnumValues() []ReplicaLifecycleStateEnum { + values := make([]ReplicaLifecycleStateEnum, 0) + for _, v := range mappingReplicaLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetReplicaLifecycleStateEnumStringValues Enumerates the set of values in String for ReplicaLifecycleStateEnum +func GetReplicaLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "INACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "NEEDS_ATTENTION", + "FAILED", + } +} + +// GetMappingReplicaLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingReplicaLifecycleStateEnum(val string) (ReplicaLifecycleStateEnum, bool) { + enum, ok := mappingReplicaLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/replica_summary.go b/mysql/replica_summary.go new file mode 100644 index 0000000000..6e991424ec --- /dev/null +++ b/mysql/replica_summary.go @@ -0,0 +1,164 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplicaSummary Summary of the read replica. +type ReplicaSummary struct { + + // The OCID of the read replica. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the DB System the read replica is associated with. + DbSystemId *string `mandatory:"true" json:"dbSystemId"` + + // The OCID of the compartment that contains the read replica. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the read replica. It does not have to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The state of the read replica. + LifecycleState ReplicaSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the read replica was created, as described by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The MySQL version used by the read replica. + MysqlVersion *string `mandatory:"true" json:"mysqlVersion"` + + // The IP address the read replica is configured to listen on. + IpAddress *string `mandatory:"true" json:"ipAddress"` + + // The port the read replica is configured to listen on. + Port *int `mandatory:"true" json:"port"` + + // The TCP network port on which X Plugin listens for connections. This is the X Plugin equivalent of port. + PortX *int `mandatory:"true" json:"portX"` + + // User provided description of the read replica. + Description *string `mandatory:"false" json:"description"` + + // A message describing the state of the read replica. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The time the read replica was last updated, as described by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The name of the Availability Domain the read replica is located in. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // The name of the Fault Domain the read replica is located in. + FaultDomain *string `mandatory:"false" json:"faultDomain"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. + // Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If + // the DB System is delete protected, read replicas can still be deleted individually if they are not delete + // protected themselves. + IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` +} + +func (m ReplicaSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ReplicaSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingReplicaSummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetReplicaSummaryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReplicaSummaryLifecycleStateEnum Enum with underlying type: string +type ReplicaSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ReplicaSummaryLifecycleStateEnum +const ( + ReplicaSummaryLifecycleStateCreating ReplicaSummaryLifecycleStateEnum = "CREATING" + ReplicaSummaryLifecycleStateActive ReplicaSummaryLifecycleStateEnum = "ACTIVE" + ReplicaSummaryLifecycleStateInactive ReplicaSummaryLifecycleStateEnum = "INACTIVE" + ReplicaSummaryLifecycleStateUpdating ReplicaSummaryLifecycleStateEnum = "UPDATING" + ReplicaSummaryLifecycleStateDeleting ReplicaSummaryLifecycleStateEnum = "DELETING" + ReplicaSummaryLifecycleStateDeleted ReplicaSummaryLifecycleStateEnum = "DELETED" + ReplicaSummaryLifecycleStateNeedsAttention ReplicaSummaryLifecycleStateEnum = "NEEDS_ATTENTION" + ReplicaSummaryLifecycleStateFailed ReplicaSummaryLifecycleStateEnum = "FAILED" +) + +var mappingReplicaSummaryLifecycleStateEnum = map[string]ReplicaSummaryLifecycleStateEnum{ + "CREATING": ReplicaSummaryLifecycleStateCreating, + "ACTIVE": ReplicaSummaryLifecycleStateActive, + "INACTIVE": ReplicaSummaryLifecycleStateInactive, + "UPDATING": ReplicaSummaryLifecycleStateUpdating, + "DELETING": ReplicaSummaryLifecycleStateDeleting, + "DELETED": ReplicaSummaryLifecycleStateDeleted, + "NEEDS_ATTENTION": ReplicaSummaryLifecycleStateNeedsAttention, + "FAILED": ReplicaSummaryLifecycleStateFailed, +} + +var mappingReplicaSummaryLifecycleStateEnumLowerCase = map[string]ReplicaSummaryLifecycleStateEnum{ + "creating": ReplicaSummaryLifecycleStateCreating, + "active": ReplicaSummaryLifecycleStateActive, + "inactive": ReplicaSummaryLifecycleStateInactive, + "updating": ReplicaSummaryLifecycleStateUpdating, + "deleting": ReplicaSummaryLifecycleStateDeleting, + "deleted": ReplicaSummaryLifecycleStateDeleted, + "needs_attention": ReplicaSummaryLifecycleStateNeedsAttention, + "failed": ReplicaSummaryLifecycleStateFailed, +} + +// GetReplicaSummaryLifecycleStateEnumValues Enumerates the set of values for ReplicaSummaryLifecycleStateEnum +func GetReplicaSummaryLifecycleStateEnumValues() []ReplicaSummaryLifecycleStateEnum { + values := make([]ReplicaSummaryLifecycleStateEnum, 0) + for _, v := range mappingReplicaSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetReplicaSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ReplicaSummaryLifecycleStateEnum +func GetReplicaSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "INACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "NEEDS_ATTENTION", + "FAILED", + } +} + +// GetMappingReplicaSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingReplicaSummaryLifecycleStateEnum(val string) (ReplicaSummaryLifecycleStateEnum, bool) { + enum, ok := mappingReplicaSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/update_channel_source_from_mysql_details.go b/mysql/update_channel_source_from_mysql_details.go index 028ee89a90..7aeba81829 100644 --- a/mysql/update_channel_source_from_mysql_details.go +++ b/mysql/update_channel_source_from_mysql_details.go @@ -39,6 +39,8 @@ type UpdateChannelSourceFromMysqlDetails struct { SslCaCertificate CaCertificate `mandatory:"false" json:"sslCaCertificate"` + AnonymousTransactionsHandling AnonymousTransactionsHandling `mandatory:"false" json:"anonymousTransactionsHandling"` + // The SSL mode of the Channel. SslMode ChannelSourceMysqlSslModeEnum `mandatory:"false" json:"sslMode,omitempty"` } @@ -79,12 +81,13 @@ func (m UpdateChannelSourceFromMysqlDetails) MarshalJSON() (buff []byte, e error // UnmarshalJSON unmarshals from json func (m *UpdateChannelSourceFromMysqlDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Hostname *string `json:"hostname"` - Port *int `json:"port"` - Username *string `json:"username"` - Password *string `json:"password"` - SslMode ChannelSourceMysqlSslModeEnum `json:"sslMode"` - SslCaCertificate cacertificate `json:"sslCaCertificate"` + Hostname *string `json:"hostname"` + Port *int `json:"port"` + Username *string `json:"username"` + Password *string `json:"password"` + SslMode ChannelSourceMysqlSslModeEnum `json:"sslMode"` + SslCaCertificate cacertificate `json:"sslCaCertificate"` + AnonymousTransactionsHandling anonymoustransactionshandling `json:"anonymousTransactionsHandling"` }{} e = json.Unmarshal(data, &model) @@ -112,5 +115,15 @@ func (m *UpdateChannelSourceFromMysqlDetails) UnmarshalJSON(data []byte) (e erro m.SslCaCertificate = nil } + nn, e = model.AnonymousTransactionsHandling.UnmarshalPolymorphicJSON(model.AnonymousTransactionsHandling.JsonData) + if e != nil { + return + } + if nn != nil { + m.AnonymousTransactionsHandling = nn.(AnonymousTransactionsHandling) + } else { + m.AnonymousTransactionsHandling = nil + } + return } diff --git a/mysql/update_channel_target_from_db_system_details.go b/mysql/update_channel_target_from_db_system_details.go index 47fea3a843..79606899ee 100644 --- a/mysql/update_channel_target_from_db_system_details.go +++ b/mysql/update_channel_target_from_db_system_details.go @@ -26,6 +26,9 @@ type UpdateChannelTargetFromDbSystemDetails struct { // The username for the replication applier of the target MySQL DB System. ApplierUsername *string `mandatory:"false" json:"applierUsername"` + + // Replication filter rules to be applied at the DB System Channel target. + Filters []ChannelFilter `mandatory:"false" json:"filters"` } func (m UpdateChannelTargetFromDbSystemDetails) String() string { diff --git a/mysql/update_maintenance_details.go b/mysql/update_maintenance_details.go index 3499161882..4cee7346d9 100644 --- a/mysql/update_maintenance_details.go +++ b/mysql/update_maintenance_details.go @@ -15,13 +15,15 @@ import ( "strings" ) -// UpdateMaintenanceDetails The Maintenance Policy for the DB System. +// UpdateMaintenanceDetails The Maintenance Policy for the DB System or Read Replica that this model is included in. type UpdateMaintenanceDetails struct { // The start of the 2 hour maintenance window. // This string is of the format: "{day-of-week} {time-of-day}". // "{day-of-week}" is a case-insensitive string like "mon", "tue", &c. // "{time-of-day}" is the "Time" portion of an RFC3339-formatted timestamp. Any second or sub-second time data will be truncated to zero. + // If you set the read replica maintenance window to "", the read replica is set same as the DB system maintenance window. If not specific by the user, + // there will be no changes to the maintenace window. WindowStartTime *string `mandatory:"false" json:"windowStartTime"` } diff --git a/mysql/update_replica_details.go b/mysql/update_replica_details.go new file mode 100644 index 0000000000..b427497c2d --- /dev/null +++ b/mysql/update_replica_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateReplicaDetails Details required to update a read replica. +type UpdateReplicaDetails struct { + + // The user-friendly name for the read replica. It does not have to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // User provided description of the read replica. + Description *string `mandatory:"false" json:"description"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. + // Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If + // the DB System is delete protected, read replicas can still be deleted individually if they are not delete + // protected themselves. + IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` +} + +func (m UpdateReplicaDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateReplicaDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/mysql/update_replica_request_response.go b/mysql/update_replica_request_response.go new file mode 100644 index 0000000000..7aedb4a24d --- /dev/null +++ b/mysql/update_replica_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateReplicaRequest wrapper for the UpdateReplica operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mysql/UpdateReplica.go.html to see an example of how to use UpdateReplicaRequest. +type UpdateReplicaRequest struct { + + // The Replica OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ReplicaId *string `mandatory:"true" contributesTo:"path" name:"replicaId"` + + // The parameters of the request to update the read replica. + UpdateReplicaDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a + // resource, set the `If-Match` header to the value of the etag from a + // previous GET or POST response for that resource. The resource will be + // updated or deleted only if the etag you provide matches the resource's + // current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Customer-defined unique identifier for the request. If you need to + // contact Oracle about a specific request, please provide the request + // ID that you supplied in this header with the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateReplicaRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateReplicaRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateReplicaRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateReplicaRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateReplicaRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateReplicaResponse wrapper for the UpdateReplica operation +type UpdateReplicaResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response UpdateReplicaResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateReplicaResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mysql/work_request_operation_type.go b/mysql/work_request_operation_type.go index 5811afb880..94ef9ba163 100644 --- a/mysql/work_request_operation_type.go +++ b/mysql/work_request_operation_type.go @@ -38,6 +38,14 @@ const ( WorkRequestOperationTypeStopHeatwaveCluster WorkRequestOperationTypeEnum = "STOP_HEATWAVE_CLUSTER" WorkRequestOperationTypeRestartHeatwaveCluster WorkRequestOperationTypeEnum = "RESTART_HEATWAVE_CLUSTER" WorkRequestOperationTypeGenerateHeatwaveClusterMemoryEstimate WorkRequestOperationTypeEnum = "GENERATE_HEATWAVE_CLUSTER_MEMORY_ESTIMATE" + WorkRequestOperationTypeCreateReplica WorkRequestOperationTypeEnum = "CREATE_REPLICA" + WorkRequestOperationTypeUpdateReplica WorkRequestOperationTypeEnum = "UPDATE_REPLICA" + WorkRequestOperationTypeDeleteReplica WorkRequestOperationTypeEnum = "DELETE_REPLICA" + WorkRequestOperationTypeCreateChannel WorkRequestOperationTypeEnum = "CREATE_CHANNEL" + WorkRequestOperationTypeUpdateChannel WorkRequestOperationTypeEnum = "UPDATE_CHANNEL" + WorkRequestOperationTypeResumeChannel WorkRequestOperationTypeEnum = "RESUME_CHANNEL" + WorkRequestOperationTypeResetChannel WorkRequestOperationTypeEnum = "RESET_CHANNEL" + WorkRequestOperationTypeDeleteChannel WorkRequestOperationTypeEnum = "DELETE_CHANNEL" ) var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnum{ @@ -61,6 +69,14 @@ var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnu "STOP_HEATWAVE_CLUSTER": WorkRequestOperationTypeStopHeatwaveCluster, "RESTART_HEATWAVE_CLUSTER": WorkRequestOperationTypeRestartHeatwaveCluster, "GENERATE_HEATWAVE_CLUSTER_MEMORY_ESTIMATE": WorkRequestOperationTypeGenerateHeatwaveClusterMemoryEstimate, + "CREATE_REPLICA": WorkRequestOperationTypeCreateReplica, + "UPDATE_REPLICA": WorkRequestOperationTypeUpdateReplica, + "DELETE_REPLICA": WorkRequestOperationTypeDeleteReplica, + "CREATE_CHANNEL": WorkRequestOperationTypeCreateChannel, + "UPDATE_CHANNEL": WorkRequestOperationTypeUpdateChannel, + "RESUME_CHANNEL": WorkRequestOperationTypeResumeChannel, + "RESET_CHANNEL": WorkRequestOperationTypeResetChannel, + "DELETE_CHANNEL": WorkRequestOperationTypeDeleteChannel, } var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperationTypeEnum{ @@ -84,6 +100,14 @@ var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperati "stop_heatwave_cluster": WorkRequestOperationTypeStopHeatwaveCluster, "restart_heatwave_cluster": WorkRequestOperationTypeRestartHeatwaveCluster, "generate_heatwave_cluster_memory_estimate": WorkRequestOperationTypeGenerateHeatwaveClusterMemoryEstimate, + "create_replica": WorkRequestOperationTypeCreateReplica, + "update_replica": WorkRequestOperationTypeUpdateReplica, + "delete_replica": WorkRequestOperationTypeDeleteReplica, + "create_channel": WorkRequestOperationTypeCreateChannel, + "update_channel": WorkRequestOperationTypeUpdateChannel, + "resume_channel": WorkRequestOperationTypeResumeChannel, + "reset_channel": WorkRequestOperationTypeResetChannel, + "delete_channel": WorkRequestOperationTypeDeleteChannel, } // GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum @@ -118,6 +142,14 @@ func GetWorkRequestOperationTypeEnumStringValues() []string { "STOP_HEATWAVE_CLUSTER", "RESTART_HEATWAVE_CLUSTER", "GENERATE_HEATWAVE_CLUSTER_MEMORY_ESTIMATE", + "CREATE_REPLICA", + "UPDATE_REPLICA", + "DELETE_REPLICA", + "CREATE_CHANNEL", + "UPDATE_CHANNEL", + "RESUME_CHANNEL", + "RESET_CHANNEL", + "DELETE_CHANNEL", } } diff --git a/opsi/add_exadata_insight_members_details.go b/opsi/add_exadata_insight_members_details.go index 92f25e9450..b01fdac0a6 100644 --- a/opsi/add_exadata_insight_members_details.go +++ b/opsi/add_exadata_insight_members_details.go @@ -52,6 +52,10 @@ func (m *addexadatainsightmembersdetails) UnmarshalPolymorphicJSON(data []byte) var err error switch m.EntitySource { + case "PE_COMANAGED_EXADATA": + mm := AddPeComanagedExadataInsightMembersDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "EM_MANAGED_EXTERNAL_EXADATA": mm := AddEmManagedExternalExadataInsightMembersDetails{} err = json.Unmarshal(data, &mm) diff --git a/opsi/add_pe_comanaged_exadata_insight_members_details.go b/opsi/add_pe_comanaged_exadata_insight_members_details.go new file mode 100644 index 0000000000..6765a4eaaf --- /dev/null +++ b/opsi/add_pe_comanaged_exadata_insight_members_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddPeComanagedExadataInsightMembersDetails The information about the members of Exadata system to be added. +type AddPeComanagedExadataInsightMembersDetails struct { + MemberEntityDetails []CreatePeComanagedExadataVmclusterDetails `mandatory:"false" json:"memberEntityDetails"` +} + +func (m AddPeComanagedExadataInsightMembersDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AddPeComanagedExadataInsightMembersDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m AddPeComanagedExadataInsightMembersDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAddPeComanagedExadataInsightMembersDetails AddPeComanagedExadataInsightMembersDetails + s := struct { + DiscriminatorParam string `json:"entitySource"` + MarshalTypeAddPeComanagedExadataInsightMembersDetails + }{ + "PE_COMANAGED_EXADATA", + (MarshalTypeAddPeComanagedExadataInsightMembersDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/create_exadata_insight_details.go b/opsi/create_exadata_insight_details.go index 8d90ab2e0c..e4bd07db32 100644 --- a/opsi/create_exadata_insight_details.go +++ b/opsi/create_exadata_insight_details.go @@ -73,6 +73,10 @@ func (m *createexadatainsightdetails) UnmarshalPolymorphicJSON(data []byte) (int mm := CreateEmManagedExternalExadataInsightDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "PE_COMANAGED_EXADATA": + mm := CreatePeComanagedExadataInsightDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } diff --git a/opsi/create_pe_comanaged_exadata_insight_details.go b/opsi/create_pe_comanaged_exadata_insight_details.go new file mode 100644 index 0000000000..f214a97d79 --- /dev/null +++ b/opsi/create_pe_comanaged_exadata_insight_details.go @@ -0,0 +1,84 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreatePeComanagedExadataInsightDetails The information about the Exadata system to be analyzed. +type CreatePeComanagedExadataInsightDetails struct { + + // Compartment Identifier of Exadata insight + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Infrastructure. + ExadataInfraId *string `mandatory:"true" json:"exadataInfraId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + MemberVmClusterDetails []CreatePeComanagedExadataVmclusterDetails `mandatory:"false" json:"memberVmClusterDetails"` +} + +//GetCompartmentId returns CompartmentId +func (m CreatePeComanagedExadataInsightDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetFreeformTags returns FreeformTags +func (m CreatePeComanagedExadataInsightDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreatePeComanagedExadataInsightDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreatePeComanagedExadataInsightDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreatePeComanagedExadataInsightDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreatePeComanagedExadataInsightDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreatePeComanagedExadataInsightDetails CreatePeComanagedExadataInsightDetails + s := struct { + DiscriminatorParam string `json:"entitySource"` + MarshalTypeCreatePeComanagedExadataInsightDetails + }{ + "PE_COMANAGED_EXADATA", + (MarshalTypeCreatePeComanagedExadataInsightDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/create_pe_comanaged_exadata_vmcluster_details.go b/opsi/create_pe_comanaged_exadata_vmcluster_details.go new file mode 100644 index 0000000000..9e948f8bc4 --- /dev/null +++ b/opsi/create_pe_comanaged_exadata_vmcluster_details.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreatePeComanagedExadataVmclusterDetails The information of the VM Cluster which contains databases. +type CreatePeComanagedExadataVmclusterDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM Cluster. + VmclusterId *string `mandatory:"true" json:"vmclusterId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint + OpsiPrivateEndpointId *string `mandatory:"true" json:"opsiPrivateEndpointId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The databases that belong to the VM Cluster + MemberDatabaseDetails []CreatePeComanagedDatabaseInsightDetails `mandatory:"false" json:"memberDatabaseDetails"` +} + +func (m CreatePeComanagedExadataVmclusterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreatePeComanagedExadataVmclusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/opsi/enable_exadata_insight_details.go b/opsi/enable_exadata_insight_details.go index 16ebeab4c4..910911ad71 100644 --- a/opsi/enable_exadata_insight_details.go +++ b/opsi/enable_exadata_insight_details.go @@ -52,6 +52,10 @@ func (m *enableexadatainsightdetails) UnmarshalPolymorphicJSON(data []byte) (int var err error switch m.EntitySource { + case "PE_COMANAGED_EXADATA": + mm := EnablePeComanagedExadataInsightDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "EM_MANAGED_EXTERNAL_EXADATA": mm := EnableEmManagedExternalExadataInsightDetails{} err = json.Unmarshal(data, &mm) diff --git a/opsi/enable_pe_comanaged_exadata_insight_details.go b/opsi/enable_pe_comanaged_exadata_insight_details.go new file mode 100644 index 0000000000..1bf0fd0c34 --- /dev/null +++ b/opsi/enable_pe_comanaged_exadata_insight_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnablePeComanagedExadataInsightDetails The information about the Exadata system to be analyzed. (ExaCS) +type EnablePeComanagedExadataInsightDetails struct { +} + +func (m EnablePeComanagedExadataInsightDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EnablePeComanagedExadataInsightDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m EnablePeComanagedExadataInsightDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeEnablePeComanagedExadataInsightDetails EnablePeComanagedExadataInsightDetails + s := struct { + DiscriminatorParam string `json:"entitySource"` + MarshalTypeEnablePeComanagedExadataInsightDetails + }{ + "PE_COMANAGED_EXADATA", + (MarshalTypeEnablePeComanagedExadataInsightDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/exadata_configuration_summary.go b/opsi/exadata_configuration_summary.go index 98c842ed64..e16403b3d2 100644 --- a/opsi/exadata_configuration_summary.go +++ b/opsi/exadata_configuration_summary.go @@ -46,6 +46,9 @@ type ExadataConfigurationSummary interface { // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` GetFreeformTags() map[string]string + + // Array of objects containing VM cluster information. + GetVmclusterDetails() []VmClusterSummary } type exadataconfigurationsummary struct { @@ -58,6 +61,7 @@ type exadataconfigurationsummary struct { ExadataRackType ExadataRackTypeEnum `mandatory:"true" json:"exadataRackType"` DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + VmclusterDetails []VmClusterSummary `mandatory:"false" json:"vmclusterDetails"` EntitySource string `json:"entitySource"` } @@ -80,6 +84,7 @@ func (m *exadataconfigurationsummary) UnmarshalJSON(data []byte) error { m.ExadataRackType = s.Model.ExadataRackType m.DefinedTags = s.Model.DefinedTags m.FreeformTags = s.Model.FreeformTags + m.VmclusterDetails = s.Model.VmclusterDetails m.EntitySource = s.Model.EntitySource return err @@ -98,6 +103,10 @@ func (m *exadataconfigurationsummary) UnmarshalPolymorphicJSON(data []byte) (int mm := ExadataDatabaseMachineConfigurationSummary{} err = json.Unmarshal(data, &mm) return mm, err + case "PE_COMANAGED_EXADATA": + mm := ExadataExacsConfigurationSummary{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } @@ -143,6 +152,11 @@ func (m exadataconfigurationsummary) GetFreeformTags() map[string]string { return m.FreeformTags } +//GetVmclusterDetails returns VmclusterDetails +func (m exadataconfigurationsummary) GetVmclusterDetails() []VmClusterSummary { + return m.VmclusterDetails +} + func (m exadataconfigurationsummary) String() string { return common.PointerString(m) } diff --git a/opsi/exadata_database_machine_configuration_summary.go b/opsi/exadata_database_machine_configuration_summary.go index 8ab04ff7d1..4d91b1fb5e 100644 --- a/opsi/exadata_database_machine_configuration_summary.go +++ b/opsi/exadata_database_machine_configuration_summary.go @@ -47,6 +47,9 @@ type ExadataDatabaseMachineConfigurationSummary struct { // OPSI Enterprise Manager Bridge OCID EnterpriseManagerBridgeId *string `mandatory:"true" json:"enterpriseManagerBridgeId"` + // Array of objects containing VM cluster information. + VmclusterDetails []VmClusterSummary `mandatory:"false" json:"vmclusterDetails"` + // Operations Insights internal representation of the the Exadata system type. ExadataType ExadataTypeEnum `mandatory:"true" json:"exadataType"` @@ -94,6 +97,11 @@ func (m ExadataDatabaseMachineConfigurationSummary) GetFreeformTags() map[string return m.FreeformTags } +//GetVmclusterDetails returns VmclusterDetails +func (m ExadataDatabaseMachineConfigurationSummary) GetVmclusterDetails() []VmClusterSummary { + return m.VmclusterDetails +} + func (m ExadataDatabaseMachineConfigurationSummary) String() string { return common.PointerString(m) } diff --git a/opsi/exadata_details.go b/opsi/exadata_details.go index 4bfa12971f..3f0eac7c02 100644 --- a/opsi/exadata_details.go +++ b/opsi/exadata_details.go @@ -17,7 +17,7 @@ import ( "strings" ) -// ExadataDetails Partial information about the exadata which includes id and name. +// ExadataDetails Partial information about the exadata which includes id, name and vmclusterNames. type ExadataDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of exadata insight resource. @@ -25,6 +25,9 @@ type ExadataDetails struct { // Name of exadata insight resource. Name *string `mandatory:"true" json:"name"` + + // Array of vm cluster names. Applicable for ExaCC and ExaCS. + VmclusterNames []string `mandatory:"false" json:"vmclusterNames"` } func (m ExadataDetails) String() string { diff --git a/opsi/exadata_entity_source.go b/opsi/exadata_entity_source.go index a21394b5bb..561625c7b2 100644 --- a/opsi/exadata_entity_source.go +++ b/opsi/exadata_entity_source.go @@ -21,14 +21,17 @@ type ExadataEntitySourceEnum string // Set of constants representing the allowable values for ExadataEntitySourceEnum const ( ExadataEntitySourceEmManagedExternalExadata ExadataEntitySourceEnum = "EM_MANAGED_EXTERNAL_EXADATA" + ExadataEntitySourcePeComanagedExadata ExadataEntitySourceEnum = "PE_COMANAGED_EXADATA" ) var mappingExadataEntitySourceEnum = map[string]ExadataEntitySourceEnum{ "EM_MANAGED_EXTERNAL_EXADATA": ExadataEntitySourceEmManagedExternalExadata, + "PE_COMANAGED_EXADATA": ExadataEntitySourcePeComanagedExadata, } var mappingExadataEntitySourceEnumLowerCase = map[string]ExadataEntitySourceEnum{ "em_managed_external_exadata": ExadataEntitySourceEmManagedExternalExadata, + "pe_comanaged_exadata": ExadataEntitySourcePeComanagedExadata, } // GetExadataEntitySourceEnumValues Enumerates the set of values for ExadataEntitySourceEnum @@ -44,6 +47,7 @@ func GetExadataEntitySourceEnumValues() []ExadataEntitySourceEnum { func GetExadataEntitySourceEnumStringValues() []string { return []string{ "EM_MANAGED_EXTERNAL_EXADATA", + "PE_COMANAGED_EXADATA", } } diff --git a/opsi/exadata_exacs_configuration_summary.go b/opsi/exadata_exacs_configuration_summary.go new file mode 100644 index 0000000000..dc605a4c03 --- /dev/null +++ b/opsi/exadata_exacs_configuration_summary.go @@ -0,0 +1,139 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExadataExacsConfigurationSummary Configuration summary of a Exacs exadata machine. +type ExadataExacsConfigurationSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata insight. + ExadataInsightId *string `mandatory:"true" json:"exadataInsightId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The Exadata system name. If the Exadata systems managed by Enterprise Manager, the name is unique amongst the Exadata systems managed by the same Enterprise Manager. + ExadataName *string `mandatory:"true" json:"exadataName"` + + // The user-friendly name for the Exadata system. The name does not have to be unique. + ExadataDisplayName *string `mandatory:"true" json:"exadataDisplayName"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint + OpsiPrivateEndpointId *string `mandatory:"true" json:"opsiPrivateEndpointId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database. + ParentId *string `mandatory:"true" json:"parentId"` + + // Array of objects containing VM cluster information. + VmclusterDetails []VmClusterSummary `mandatory:"false" json:"vmclusterDetails"` + + // Operations Insights internal representation of the the Exadata system type. + ExadataType ExadataTypeEnum `mandatory:"true" json:"exadataType"` + + // Exadata rack type. + ExadataRackType ExadataRackTypeEnum `mandatory:"true" json:"exadataRackType"` +} + +//GetExadataInsightId returns ExadataInsightId +func (m ExadataExacsConfigurationSummary) GetExadataInsightId() *string { + return m.ExadataInsightId +} + +//GetCompartmentId returns CompartmentId +func (m ExadataExacsConfigurationSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetExadataName returns ExadataName +func (m ExadataExacsConfigurationSummary) GetExadataName() *string { + return m.ExadataName +} + +//GetExadataDisplayName returns ExadataDisplayName +func (m ExadataExacsConfigurationSummary) GetExadataDisplayName() *string { + return m.ExadataDisplayName +} + +//GetExadataType returns ExadataType +func (m ExadataExacsConfigurationSummary) GetExadataType() ExadataTypeEnum { + return m.ExadataType +} + +//GetExadataRackType returns ExadataRackType +func (m ExadataExacsConfigurationSummary) GetExadataRackType() ExadataRackTypeEnum { + return m.ExadataRackType +} + +//GetDefinedTags returns DefinedTags +func (m ExadataExacsConfigurationSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetFreeformTags returns FreeformTags +func (m ExadataExacsConfigurationSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetVmclusterDetails returns VmclusterDetails +func (m ExadataExacsConfigurationSummary) GetVmclusterDetails() []VmClusterSummary { + return m.VmclusterDetails +} + +func (m ExadataExacsConfigurationSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExadataExacsConfigurationSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingExadataTypeEnum(string(m.ExadataType)); !ok && m.ExadataType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataType: %s. Supported values are: %s.", m.ExadataType, strings.Join(GetExadataTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingExadataRackTypeEnum(string(m.ExadataRackType)); !ok && m.ExadataRackType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataRackType: %s. Supported values are: %s.", m.ExadataRackType, strings.Join(GetExadataRackTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ExadataExacsConfigurationSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeExadataExacsConfigurationSummary ExadataExacsConfigurationSummary + s := struct { + DiscriminatorParam string `json:"entitySource"` + MarshalTypeExadataExacsConfigurationSummary + }{ + "PE_COMANAGED_EXADATA", + (MarshalTypeExadataExacsConfigurationSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/exadata_insight.go b/opsi/exadata_insight.go index c4b63ad433..c78c1d6934 100644 --- a/opsi/exadata_insight.go +++ b/opsi/exadata_insight.go @@ -134,6 +134,10 @@ func (m *exadatainsight) UnmarshalPolymorphicJSON(data []byte) (interface{}, err mm := EmManagedExternalExadataInsight{} err = json.Unmarshal(data, &mm) return mm, err + case "PE_COMANAGED_EXADATA": + mm := PeComanagedExadataInsight{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } diff --git a/opsi/exadata_insight_summary.go b/opsi/exadata_insight_summary.go index 0df55ae959..6c3e5a1cf9 100644 --- a/opsi/exadata_insight_summary.go +++ b/opsi/exadata_insight_summary.go @@ -129,6 +129,10 @@ func (m *exadatainsightsummary) UnmarshalPolymorphicJSON(data []byte) (interface mm := EmManagedExternalExadataInsightSummary{} err = json.Unmarshal(data, &mm) return mm, err + case "PE_COMANAGED_EXADATA": + mm := PeComanagedExadataInsightSummary{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } diff --git a/opsi/exadata_member_summary.go b/opsi/exadata_member_summary.go index ad9e83ef2f..c4a7a73081 100644 --- a/opsi/exadata_member_summary.go +++ b/opsi/exadata_member_summary.go @@ -62,6 +62,7 @@ const ( ExadataMemberSummaryEntityTypeInfinibandSwitch ExadataMemberSummaryEntityTypeEnum = "INFINIBAND_SWITCH" ExadataMemberSummaryEntityTypeEthernetSwitch ExadataMemberSummaryEntityTypeEnum = "ETHERNET_SWITCH" ExadataMemberSummaryEntityTypeHost ExadataMemberSummaryEntityTypeEnum = "HOST" + ExadataMemberSummaryEntityTypeVmCluster ExadataMemberSummaryEntityTypeEnum = "VM_CLUSTER" ) var mappingExadataMemberSummaryEntityTypeEnum = map[string]ExadataMemberSummaryEntityTypeEnum{ @@ -73,6 +74,7 @@ var mappingExadataMemberSummaryEntityTypeEnum = map[string]ExadataMemberSummaryE "INFINIBAND_SWITCH": ExadataMemberSummaryEntityTypeInfinibandSwitch, "ETHERNET_SWITCH": ExadataMemberSummaryEntityTypeEthernetSwitch, "HOST": ExadataMemberSummaryEntityTypeHost, + "VM_CLUSTER": ExadataMemberSummaryEntityTypeVmCluster, } var mappingExadataMemberSummaryEntityTypeEnumLowerCase = map[string]ExadataMemberSummaryEntityTypeEnum{ @@ -84,6 +86,7 @@ var mappingExadataMemberSummaryEntityTypeEnumLowerCase = map[string]ExadataMembe "infiniband_switch": ExadataMemberSummaryEntityTypeInfinibandSwitch, "ethernet_switch": ExadataMemberSummaryEntityTypeEthernetSwitch, "host": ExadataMemberSummaryEntityTypeHost, + "vm_cluster": ExadataMemberSummaryEntityTypeVmCluster, } // GetExadataMemberSummaryEntityTypeEnumValues Enumerates the set of values for ExadataMemberSummaryEntityTypeEnum @@ -106,6 +109,7 @@ func GetExadataMemberSummaryEntityTypeEnumStringValues() []string { "INFINIBAND_SWITCH", "ETHERNET_SWITCH", "HOST", + "VM_CLUSTER", } } diff --git a/opsi/exadata_rack_type.go b/opsi/exadata_rack_type.go index 7a0f64ea49..9445b24456 100644 --- a/opsi/exadata_rack_type.go +++ b/opsi/exadata_rack_type.go @@ -24,6 +24,7 @@ const ( ExadataRackTypeHalf ExadataRackTypeEnum = "HALF" ExadataRackTypeQuarter ExadataRackTypeEnum = "QUARTER" ExadataRackTypeEighth ExadataRackTypeEnum = "EIGHTH" + ExadataRackTypeFlex ExadataRackTypeEnum = "FLEX" ) var mappingExadataRackTypeEnum = map[string]ExadataRackTypeEnum{ @@ -31,6 +32,7 @@ var mappingExadataRackTypeEnum = map[string]ExadataRackTypeEnum{ "HALF": ExadataRackTypeHalf, "QUARTER": ExadataRackTypeQuarter, "EIGHTH": ExadataRackTypeEighth, + "FLEX": ExadataRackTypeFlex, } var mappingExadataRackTypeEnumLowerCase = map[string]ExadataRackTypeEnum{ @@ -38,6 +40,7 @@ var mappingExadataRackTypeEnumLowerCase = map[string]ExadataRackTypeEnum{ "half": ExadataRackTypeHalf, "quarter": ExadataRackTypeQuarter, "eighth": ExadataRackTypeEighth, + "flex": ExadataRackTypeFlex, } // GetExadataRackTypeEnumValues Enumerates the set of values for ExadataRackTypeEnum @@ -56,6 +59,7 @@ func GetExadataRackTypeEnumStringValues() []string { "HALF", "QUARTER", "EIGHTH", + "FLEX", } } diff --git a/opsi/exadata_resource_type.go b/opsi/exadata_resource_type.go new file mode 100644 index 0000000000..149eb877f7 --- /dev/null +++ b/opsi/exadata_resource_type.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// ExadataResourceTypeEnum Enum with underlying type: string +type ExadataResourceTypeEnum string + +// Set of constants representing the allowable values for ExadataResourceTypeEnum +const ( + ExadataResourceTypeCloudExadataInfrastructure ExadataResourceTypeEnum = "cloudExadataInfrastructure" +) + +var mappingExadataResourceTypeEnum = map[string]ExadataResourceTypeEnum{ + "cloudExadataInfrastructure": ExadataResourceTypeCloudExadataInfrastructure, +} + +var mappingExadataResourceTypeEnumLowerCase = map[string]ExadataResourceTypeEnum{ + "cloudexadatainfrastructure": ExadataResourceTypeCloudExadataInfrastructure, +} + +// GetExadataResourceTypeEnumValues Enumerates the set of values for ExadataResourceTypeEnum +func GetExadataResourceTypeEnumValues() []ExadataResourceTypeEnum { + values := make([]ExadataResourceTypeEnum, 0) + for _, v := range mappingExadataResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetExadataResourceTypeEnumStringValues Enumerates the set of values in String for ExadataResourceTypeEnum +func GetExadataResourceTypeEnumStringValues() []string { + return []string{ + "cloudExadataInfrastructure", + } +} + +// GetMappingExadataResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExadataResourceTypeEnum(val string) (ExadataResourceTypeEnum, bool) { + enum, ok := mappingExadataResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/opsi/list_database_configurations_request_response.go b/opsi/list_database_configurations_request_response.go index 3af2f8a99c..3b4c523063 100644 --- a/opsi/list_database_configurations_request_response.go +++ b/opsi/list_database_configurations_request_response.go @@ -93,6 +93,9 @@ type ListDatabaseConfigurationsRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/list_host_configurations_request_response.go b/opsi/list_host_configurations_request_response.go index e939e97c09..2245f8b7e0 100644 --- a/opsi/list_host_configurations_request_response.go +++ b/opsi/list_host_configurations_request_response.go @@ -93,6 +93,9 @@ type ListHostConfigurationsRequest struct { // Optional OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the host (Compute Id) HostId *string `mandatory:"false" contributesTo:"query" name:"hostId"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/pe_comanaged_database_insight.go b/opsi/pe_comanaged_database_insight.go index 817c0a3bb8..fdc64ac6d8 100644 --- a/opsi/pe_comanaged_database_insight.go +++ b/opsi/pe_comanaged_database_insight.go @@ -79,6 +79,12 @@ type PeComanagedDatabaseInsight struct { // Display name of database DatabaseDisplayName *string `mandatory:"false" json:"databaseDisplayName"` + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM Cluster or DB System ID, depending on which configuration the resource belongs to. + ParentId *string `mandatory:"false" json:"parentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Infrastructure. + RootId *string `mandatory:"false" json:"rootId"` + // Indicates the status of a database insight in Operations Insights Status ResourceStatusEnum `mandatory:"true" json:"status"` @@ -206,6 +212,8 @@ func (m *PeComanagedDatabaseInsight) UnmarshalJSON(data []byte) (e error) { ConnectionDetails *PeComanagedDatabaseConnectionDetails `json:"connectionDetails"` CredentialDetails credentialdetails `json:"credentialDetails"` DatabaseDisplayName *string `json:"databaseDisplayName"` + ParentId *string `json:"parentId"` + RootId *string `json:"rootId"` Id *string `json:"id"` CompartmentId *string `json:"compartmentId"` Status ResourceStatusEnum `json:"status"` @@ -253,6 +261,10 @@ func (m *PeComanagedDatabaseInsight) UnmarshalJSON(data []byte) (e error) { m.DatabaseDisplayName = model.DatabaseDisplayName + m.ParentId = model.ParentId + + m.RootId = model.RootId + m.Id = model.Id m.CompartmentId = model.CompartmentId diff --git a/opsi/pe_comanaged_database_insight_summary.go b/opsi/pe_comanaged_database_insight_summary.go index 20820dc3c4..e882083fcd 100644 --- a/opsi/pe_comanaged_database_insight_summary.go +++ b/opsi/pe_comanaged_database_insight_summary.go @@ -78,6 +78,12 @@ type PeComanagedDatabaseInsightSummary struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint OpsiPrivateEndpointId *string `mandatory:"false" json:"opsiPrivateEndpointId"` + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM Cluster or DB System ID, depending on which configuration the resource belongs to. + ParentId *string `mandatory:"false" json:"parentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the root resource for a composite target. e.g. for ExaCS members the rootId will be the OCID of the Exadata Infrastructure resource. + RootId *string `mandatory:"false" json:"rootId"` + // Indicates the status of a database insight in Operations Insights Status ResourceStatusEnum `mandatory:"false" json:"status,omitempty"` diff --git a/opsi/pe_comanaged_exadata_insight.go b/opsi/pe_comanaged_exadata_insight.go new file mode 100644 index 0000000000..c27275d3a9 --- /dev/null +++ b/opsi/pe_comanaged_exadata_insight.go @@ -0,0 +1,200 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PeComanagedExadataInsight Private endpoint managed Exadata insight resource (ExaCS). +type PeComanagedExadataInsight struct { + + // Exadata insight identifier + Id *string `mandatory:"true" json:"id"` + + // Compartment identifier of the Exadata insight resource + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The Exadata system name. If the Exadata systems managed by Enterprise Manager, the name is unique amongst the Exadata systems managed by the same Enterprise Manager. + ExadataName *string `mandatory:"true" json:"exadataName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The time the the Exadata insight was first enabled. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Infrastructure. + ExadataInfraId *string `mandatory:"true" json:"exadataInfraId"` + + // The shape of the Exadata Infrastructure. + ExadataShape *string `mandatory:"true" json:"exadataShape"` + + // The user-friendly name for the Exadata system. The name does not have to be unique. + ExadataDisplayName *string `mandatory:"false" json:"exadataDisplayName"` + + // true if virtualization is used in the Exadata system + IsVirtualizedExadata *bool `mandatory:"false" json:"isVirtualizedExadata"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The time the Exadata insight was updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // Operations Insights internal representation of the the Exadata system type. + ExadataType ExadataTypeEnum `mandatory:"false" json:"exadataType,omitempty"` + + // Exadata rack type. + ExadataRackType ExadataRackTypeEnum `mandatory:"false" json:"exadataRackType,omitempty"` + + // Indicates the status of an Exadata insight in Operations Insights + Status ResourceStatusEnum `mandatory:"true" json:"status"` + + // The current state of the Exadata insight. + LifecycleState ExadataInsightLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // OCI exadata infrastructure resource type + ExadataInfraResourceType ExadataResourceTypeEnum `mandatory:"true" json:"exadataInfraResourceType"` +} + +//GetId returns Id +func (m PeComanagedExadataInsight) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m PeComanagedExadataInsight) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetExadataName returns ExadataName +func (m PeComanagedExadataInsight) GetExadataName() *string { + return m.ExadataName +} + +//GetExadataDisplayName returns ExadataDisplayName +func (m PeComanagedExadataInsight) GetExadataDisplayName() *string { + return m.ExadataDisplayName +} + +//GetExadataType returns ExadataType +func (m PeComanagedExadataInsight) GetExadataType() ExadataTypeEnum { + return m.ExadataType +} + +//GetExadataRackType returns ExadataRackType +func (m PeComanagedExadataInsight) GetExadataRackType() ExadataRackTypeEnum { + return m.ExadataRackType +} + +//GetIsVirtualizedExadata returns IsVirtualizedExadata +func (m PeComanagedExadataInsight) GetIsVirtualizedExadata() *bool { + return m.IsVirtualizedExadata +} + +//GetStatus returns Status +func (m PeComanagedExadataInsight) GetStatus() ResourceStatusEnum { + return m.Status +} + +//GetFreeformTags returns FreeformTags +func (m PeComanagedExadataInsight) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m PeComanagedExadataInsight) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m PeComanagedExadataInsight) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +//GetTimeCreated returns TimeCreated +func (m PeComanagedExadataInsight) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m PeComanagedExadataInsight) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +//GetLifecycleState returns LifecycleState +func (m PeComanagedExadataInsight) GetLifecycleState() ExadataInsightLifecycleStateEnum { + return m.LifecycleState +} + +//GetLifecycleDetails returns LifecycleDetails +func (m PeComanagedExadataInsight) GetLifecycleDetails() *string { + return m.LifecycleDetails +} + +func (m PeComanagedExadataInsight) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PeComanagedExadataInsight) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingExadataTypeEnum(string(m.ExadataType)); !ok && m.ExadataType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataType: %s. Supported values are: %s.", m.ExadataType, strings.Join(GetExadataTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingExadataRackTypeEnum(string(m.ExadataRackType)); !ok && m.ExadataRackType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataRackType: %s. Supported values are: %s.", m.ExadataRackType, strings.Join(GetExadataRackTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetResourceStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingExadataInsightLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetExadataInsightLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingExadataResourceTypeEnum(string(m.ExadataInfraResourceType)); !ok && m.ExadataInfraResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataInfraResourceType: %s. Supported values are: %s.", m.ExadataInfraResourceType, strings.Join(GetExadataResourceTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PeComanagedExadataInsight) MarshalJSON() (buff []byte, e error) { + type MarshalTypePeComanagedExadataInsight PeComanagedExadataInsight + s := struct { + DiscriminatorParam string `json:"entitySource"` + MarshalTypePeComanagedExadataInsight + }{ + "PE_COMANAGED_EXADATA", + (MarshalTypePeComanagedExadataInsight)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/pe_comanaged_exadata_insight_summary.go b/opsi/pe_comanaged_exadata_insight_summary.go new file mode 100644 index 0000000000..992b98ba2f --- /dev/null +++ b/opsi/pe_comanaged_exadata_insight_summary.go @@ -0,0 +1,192 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PeComanagedExadataInsightSummary Summary of a Private endpoint managed Exadata insight resource (ExaCS). +type PeComanagedExadataInsightSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata insight resource. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The Exadata system name. If the Exadata systems managed by Enterprise Manager, the name is unique amongst the Exadata systems managed by the same Enterprise Manager. + ExadataName *string `mandatory:"true" json:"exadataName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The time the the Exadata insight was first enabled. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Infrastructure. + ExadataInfraId *string `mandatory:"true" json:"exadataInfraId"` + + // The shape of the Exadata Infrastructure. + ExadataShape *string `mandatory:"true" json:"exadataShape"` + + // The user-friendly name for the Exadata system. The name does not have to be unique. + ExadataDisplayName *string `mandatory:"false" json:"exadataDisplayName"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The time the Exadata insight was updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // Operations Insights internal representation of the the Exadata system type. + ExadataType ExadataTypeEnum `mandatory:"false" json:"exadataType,omitempty"` + + // Operations Insights internal representation of the the Exadata system rack type. + ExadataRackType ExadataRackTypeEnum `mandatory:"false" json:"exadataRackType,omitempty"` + + // Indicates the status of an Exadata insight in Operations Insights + Status ResourceStatusEnum `mandatory:"true" json:"status"` + + // The current state of the Exadata insight. + LifecycleState ExadataInsightLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // OCI exadata infrastructure resource type + ExadataInfraResourceType ExadataResourceTypeEnum `mandatory:"true" json:"exadataInfraResourceType"` +} + +//GetId returns Id +func (m PeComanagedExadataInsightSummary) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m PeComanagedExadataInsightSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetExadataName returns ExadataName +func (m PeComanagedExadataInsightSummary) GetExadataName() *string { + return m.ExadataName +} + +//GetExadataDisplayName returns ExadataDisplayName +func (m PeComanagedExadataInsightSummary) GetExadataDisplayName() *string { + return m.ExadataDisplayName +} + +//GetExadataType returns ExadataType +func (m PeComanagedExadataInsightSummary) GetExadataType() ExadataTypeEnum { + return m.ExadataType +} + +//GetExadataRackType returns ExadataRackType +func (m PeComanagedExadataInsightSummary) GetExadataRackType() ExadataRackTypeEnum { + return m.ExadataRackType +} + +//GetFreeformTags returns FreeformTags +func (m PeComanagedExadataInsightSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m PeComanagedExadataInsightSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +//GetSystemTags returns SystemTags +func (m PeComanagedExadataInsightSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +//GetStatus returns Status +func (m PeComanagedExadataInsightSummary) GetStatus() ResourceStatusEnum { + return m.Status +} + +//GetTimeCreated returns TimeCreated +func (m PeComanagedExadataInsightSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetTimeUpdated returns TimeUpdated +func (m PeComanagedExadataInsightSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +//GetLifecycleState returns LifecycleState +func (m PeComanagedExadataInsightSummary) GetLifecycleState() ExadataInsightLifecycleStateEnum { + return m.LifecycleState +} + +//GetLifecycleDetails returns LifecycleDetails +func (m PeComanagedExadataInsightSummary) GetLifecycleDetails() *string { + return m.LifecycleDetails +} + +func (m PeComanagedExadataInsightSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PeComanagedExadataInsightSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingExadataTypeEnum(string(m.ExadataType)); !ok && m.ExadataType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataType: %s. Supported values are: %s.", m.ExadataType, strings.Join(GetExadataTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingExadataRackTypeEnum(string(m.ExadataRackType)); !ok && m.ExadataRackType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataRackType: %s. Supported values are: %s.", m.ExadataRackType, strings.Join(GetExadataRackTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetResourceStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingExadataInsightLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetExadataInsightLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingExadataResourceTypeEnum(string(m.ExadataInfraResourceType)); !ok && m.ExadataInfraResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataInfraResourceType: %s. Supported values are: %s.", m.ExadataInfraResourceType, strings.Join(GetExadataResourceTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PeComanagedExadataInsightSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypePeComanagedExadataInsightSummary PeComanagedExadataInsightSummary + s := struct { + DiscriminatorParam string `json:"entitySource"` + MarshalTypePeComanagedExadataInsightSummary + }{ + "PE_COMANAGED_EXADATA", + (MarshalTypePeComanagedExadataInsightSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/pe_comanaged_host_configuration_summary.go b/opsi/pe_comanaged_host_configuration_summary.go index c21f5ce8dd..d76f4165b7 100644 --- a/opsi/pe_comanaged_host_configuration_summary.go +++ b/opsi/pe_comanaged_host_configuration_summary.go @@ -83,6 +83,8 @@ type PeComanagedHostConfigurationSummary struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database. ParentId *string `mandatory:"true" json:"parentId"` + ExadataDetails *ExadataDetails `mandatory:"true" json:"exadataDetails"` + // Platform type. // Supported platformType(s) for MACS-managed external host insight: [LINUX]. // Supported platformType(s) for MACS-managed cloud host insight: [LINUX]. diff --git a/opsi/pe_comanaged_managed_external_database_configuration_summary.go b/opsi/pe_comanaged_managed_external_database_configuration_summary.go index 9e19e6dbde..52b4d5203b 100644 --- a/opsi/pe_comanaged_managed_external_database_configuration_summary.go +++ b/opsi/pe_comanaged_managed_external_database_configuration_summary.go @@ -62,6 +62,8 @@ type PeComanagedManagedExternalDatabaseConfigurationSummary struct { // Array of hostname and instance name. Instances []HostInstanceMap `mandatory:"true" json:"instances"` + ExadataDetails *ExadataDetails `mandatory:"true" json:"exadataDetails"` + // Processor count. This is the OCPU count for Autonomous Database and CPU core count for other database types. ProcessorCount *int `mandatory:"false" json:"processorCount"` } diff --git a/opsi/summarize_database_insight_resource_capacity_trend_request_response.go b/opsi/summarize_database_insight_resource_capacity_trend_request_response.go index ab8ef3ba4b..e3e4bcf630 100644 --- a/opsi/summarize_database_insight_resource_capacity_trend_request_response.go +++ b/opsi/summarize_database_insight_resource_capacity_trend_request_response.go @@ -121,6 +121,9 @@ type SummarizeDatabaseInsightResourceCapacityTrendRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_database_insight_resource_forecast_trend_request_response.go b/opsi/summarize_database_insight_resource_forecast_trend_request_response.go index 275b92eb61..24805e5014 100644 --- a/opsi/summarize_database_insight_resource_forecast_trend_request_response.go +++ b/opsi/summarize_database_insight_resource_forecast_trend_request_response.go @@ -135,6 +135,9 @@ type SummarizeDatabaseInsightResourceForecastTrendRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_database_insight_resource_statistics_request_response.go b/opsi/summarize_database_insight_resource_statistics_request_response.go index 4362ee0235..629dbd6289 100644 --- a/opsi/summarize_database_insight_resource_statistics_request_response.go +++ b/opsi/summarize_database_insight_resource_statistics_request_response.go @@ -129,6 +129,9 @@ type SummarizeDatabaseInsightResourceStatisticsRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_database_insight_resource_usage_request_response.go b/opsi/summarize_database_insight_resource_usage_request_response.go index 48c6046547..c8de5e3194 100644 --- a/opsi/summarize_database_insight_resource_usage_request_response.go +++ b/opsi/summarize_database_insight_resource_usage_request_response.go @@ -105,6 +105,9 @@ type SummarizeDatabaseInsightResourceUsageRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_database_insight_resource_usage_trend_request_response.go b/opsi/summarize_database_insight_resource_usage_trend_request_response.go index a8836bc80c..6f69cb08e6 100644 --- a/opsi/summarize_database_insight_resource_usage_trend_request_response.go +++ b/opsi/summarize_database_insight_resource_usage_trend_request_response.go @@ -108,6 +108,9 @@ type SummarizeDatabaseInsightResourceUsageTrendRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_database_insight_resource_utilization_insight_request_response.go b/opsi/summarize_database_insight_resource_utilization_insight_request_response.go index 864f36044f..95bc982289 100644 --- a/opsi/summarize_database_insight_resource_utilization_insight_request_response.go +++ b/opsi/summarize_database_insight_resource_utilization_insight_request_response.go @@ -105,6 +105,9 @@ type SummarizeDatabaseInsightResourceUtilizationInsightRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_host_insight_resource_capacity_trend_request_response.go b/opsi/summarize_host_insight_resource_capacity_trend_request_response.go index 13661a99fe..38d73afb38 100644 --- a/opsi/summarize_host_insight_resource_capacity_trend_request_response.go +++ b/opsi/summarize_host_insight_resource_capacity_trend_request_response.go @@ -113,6 +113,9 @@ type SummarizeHostInsightResourceCapacityTrendRequest struct { // Optional OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the host (Compute Id) HostId *string `mandatory:"false" contributesTo:"query" name:"hostId"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_host_insight_resource_forecast_trend_request_response.go b/opsi/summarize_host_insight_resource_forecast_trend_request_response.go index 1c5ecd9018..d6db5209ff 100644 --- a/opsi/summarize_host_insight_resource_forecast_trend_request_response.go +++ b/opsi/summarize_host_insight_resource_forecast_trend_request_response.go @@ -127,6 +127,9 @@ type SummarizeHostInsightResourceForecastTrendRequest struct { // Optional OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the host (Compute Id) HostId *string `mandatory:"false" contributesTo:"query" name:"hostId"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_host_insight_resource_statistics_request_response.go b/opsi/summarize_host_insight_resource_statistics_request_response.go index 9a1cbb77f7..1dbf308d12 100644 --- a/opsi/summarize_host_insight_resource_statistics_request_response.go +++ b/opsi/summarize_host_insight_resource_statistics_request_response.go @@ -124,6 +124,9 @@ type SummarizeHostInsightResourceStatisticsRequest struct { // Optional OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the host (Compute Id) HostId *string `mandatory:"false" contributesTo:"query" name:"hostId"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_host_insight_resource_usage_request_response.go b/opsi/summarize_host_insight_resource_usage_request_response.go index 0e35b73617..37da8b0b69 100644 --- a/opsi/summarize_host_insight_resource_usage_request_response.go +++ b/opsi/summarize_host_insight_resource_usage_request_response.go @@ -103,6 +103,9 @@ type SummarizeHostInsightResourceUsageRequest struct { // Optional OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the host (Compute Id) HostId *string `mandatory:"false" contributesTo:"query" name:"hostId"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_host_insight_resource_usage_trend_request_response.go b/opsi/summarize_host_insight_resource_usage_trend_request_response.go index 35e1b9899e..9bfb96ff3b 100644 --- a/opsi/summarize_host_insight_resource_usage_trend_request_response.go +++ b/opsi/summarize_host_insight_resource_usage_trend_request_response.go @@ -106,6 +106,9 @@ type SummarizeHostInsightResourceUsageTrendRequest struct { // Optional OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the host (Compute Id) HostId *string `mandatory:"false" contributesTo:"query" name:"hostId"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_host_insight_resource_utilization_insight_request_response.go b/opsi/summarize_host_insight_resource_utilization_insight_request_response.go index b6e476aed9..084a0b5b92 100644 --- a/opsi/summarize_host_insight_resource_utilization_insight_request_response.go +++ b/opsi/summarize_host_insight_resource_utilization_insight_request_response.go @@ -103,6 +103,9 @@ type SummarizeHostInsightResourceUtilizationInsightRequest struct { // Optional OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the host (Compute Id) HostId *string `mandatory:"false" contributesTo:"query" name:"hostId"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_sql_statistics_request_response.go b/opsi/summarize_sql_statistics_request_response.go index 27edc36adc..6070d75a35 100644 --- a/opsi/summarize_sql_statistics_request_response.go +++ b/opsi/summarize_sql_statistics_request_response.go @@ -120,6 +120,9 @@ type SummarizeSqlStatisticsRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/summarize_sql_statistics_time_series_request_response.go b/opsi/summarize_sql_statistics_time_series_request_response.go index 01a27e6302..d54975d7d4 100644 --- a/opsi/summarize_sql_statistics_time_series_request_response.go +++ b/opsi/summarize_sql_statistics_time_series_request_response.go @@ -96,6 +96,9 @@ type SummarizeSqlStatisticsTimeSeriesRequest struct { // A flag to search all resources within a given compartment and all sub-compartments. CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + // Optional list of Exadata Insight VM cluster name. + VmclusterName []string `contributesTo:"query" name:"vmclusterName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/opsi/update_exadata_insight_details.go b/opsi/update_exadata_insight_details.go index f77062a63e..4fc93c4adc 100644 --- a/opsi/update_exadata_insight_details.go +++ b/opsi/update_exadata_insight_details.go @@ -64,6 +64,10 @@ func (m *updateexadatainsightdetails) UnmarshalPolymorphicJSON(data []byte) (int var err error switch m.EntitySource { + case "PE_COMANAGED_EXADATA": + mm := UpdatePeComanagedExadataInsightDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "EM_MANAGED_EXTERNAL_EXADATA": mm := UpdateEmManagedExternalExadataInsightDetails{} err = json.Unmarshal(data, &mm) diff --git a/opsi/update_pe_comanaged_exadata_insight_details.go b/opsi/update_pe_comanaged_exadata_insight_details.go new file mode 100644 index 0000000000..ca86121514 --- /dev/null +++ b/opsi/update_pe_comanaged_exadata_insight_details.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdatePeComanagedExadataInsightDetails The information to be updated. +type UpdatePeComanagedExadataInsightDetails struct { + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +//GetFreeformTags returns FreeformTags +func (m UpdatePeComanagedExadataInsightDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m UpdatePeComanagedExadataInsightDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdatePeComanagedExadataInsightDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdatePeComanagedExadataInsightDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdatePeComanagedExadataInsightDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdatePeComanagedExadataInsightDetails UpdatePeComanagedExadataInsightDetails + s := struct { + DiscriminatorParam string `json:"entitySource"` + MarshalTypeUpdatePeComanagedExadataInsightDetails + }{ + "PE_COMANAGED_EXADATA", + (MarshalTypeUpdatePeComanagedExadataInsightDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/opsi/vm_cluster_summary.go b/opsi/vm_cluster_summary.go new file mode 100644 index 0000000000..eff2c270ef --- /dev/null +++ b/opsi/vm_cluster_summary.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VmClusterSummary Partial information about the VM Cluster which includes name, memory allocated etc. +type VmClusterSummary struct { + + // The name of the vm cluster. + VmclusterName *string `mandatory:"true" json:"vmclusterName"` + + // The memory allocated on a vm cluster. + MemoryAllocatedInGBs *int `mandatory:"false" json:"memoryAllocatedInGBs"` + + // The cpu allocated on a vm cluster. + CpuAllocated *int `mandatory:"false" json:"cpuAllocated"` + + // The number of DB nodes on a vm cluster. + DbNodesCount *int `mandatory:"false" json:"dbNodesCount"` +} + +func (m VmClusterSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m VmClusterSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/resourcemanager/bitbucket_cloud_config_source.go b/resourcemanager/bitbucket_cloud_config_source.go new file mode 100644 index 0000000000..09f3bc3424 --- /dev/null +++ b/resourcemanager/bitbucket_cloud_config_source.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketCloudConfigSource Metadata about the Bitbucket Cloud configuration source. +type BitbucketCloudConfigSource struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Bitbucket Cloud configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // The URL of the Bitbucket Cloud repository for the configuration source. + RepositoryUrl *string `mandatory:"true" json:"repositoryUrl"` + + // The id of the workspace in Bitbucket Cloud for the configuration source + WorkspaceId *string `mandatory:"true" json:"workspaceId"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The name of the branch in the Bitbucket Cloud repository for the configuration source. + BranchName *string `mandatory:"false" json:"branchName"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m BitbucketCloudConfigSource) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m BitbucketCloudConfigSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketCloudConfigSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketCloudConfigSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketCloudConfigSource BitbucketCloudConfigSource + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeBitbucketCloudConfigSource + }{ + "BITBUCKET_CLOUD_CONFIG_SOURCE", + (MarshalTypeBitbucketCloudConfigSource)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/bitbucket_cloud_config_source_record.go b/resourcemanager/bitbucket_cloud_config_source_record.go new file mode 100644 index 0000000000..408f98f1eb --- /dev/null +++ b/resourcemanager/bitbucket_cloud_config_source_record.go @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketCloudConfigSourceRecord Metadata about the Bitbucket Cloud configuration source. +type BitbucketCloudConfigSourceRecord struct { + + // Unique identifier (OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)) + // for the Bitbucket Cloud configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // The URL of the Bitbucket Cloud repository. + RepositoryUrl *string `mandatory:"true" json:"repositoryUrl"` + + // The id of the workspace in Bitbucket Cloud for the configuration source. + WorkspaceId *string `mandatory:"true" json:"workspaceId"` + + // The name of the branch within the Bitbucket Cloud repository. + BranchName *string `mandatory:"false" json:"branchName"` + + // The unique identifier (SHA-1 hash) of the individual change to the Bitbucket Cloud repository. + CommitId *string `mandatory:"false" json:"commitId"` +} + +func (m BitbucketCloudConfigSourceRecord) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketCloudConfigSourceRecord) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketCloudConfigSourceRecord) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketCloudConfigSourceRecord BitbucketCloudConfigSourceRecord + s := struct { + DiscriminatorParam string `json:"configSourceRecordType"` + MarshalTypeBitbucketCloudConfigSourceRecord + }{ + "BITBUCKET_CLOUD_CONFIG_SOURCE", + (MarshalTypeBitbucketCloudConfigSourceRecord)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider.go b/resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider.go new file mode 100644 index 0000000000..4f4a4ccd60 --- /dev/null +++ b/resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider.go @@ -0,0 +1,157 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketCloudUsernameAppPasswordConfigurationSourceProvider The properties that define a configuration source provider of the type `BITBUCKET_CLOUD_USERNAME_APPPASSWORD`. +// This type corresponds to a configuration source provider in Bitbucket cloud that is authenticated with a username and app password. +type BitbucketCloudUsernameAppPasswordConfigurationSourceProvider struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration source provider. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the configuration source provider is located. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable display name for the configuration source provider. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the configuration source provider. + Description *string `mandatory:"false" json:"description"` + + // The date and time when the configuration source provider was created. + // Format is defined by RFC3339. + // Example: `2020-01-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Username which is used to authorize the user. + Username *string `mandatory:"false" json:"username"` + + // Secret ocid which is used to authorize the user. + SecretId *string `mandatory:"false" json:"secretId"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Bitbucket cloud service endpoint. + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"false" json:"apiEndpoint"` + + // The current lifecycle state of the configuration source provider. + // For more information about configuration source provider lifecycle states in Resource Manager, see + // Key Concepts (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm#concepts__CSPStates). + LifecycleState ConfigurationSourceProviderLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetDescription() *string { + return m.Description +} + +//GetTimeCreated returns TimeCreated +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetLifecycleState() ConfigurationSourceProviderLifecycleStateEnum { + return m.LifecycleState +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetUsername returns Username +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetUsername() *string { + return m.Username +} + +//GetSecretId returns SecretId +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetSecretId() *string { + return m.SecretId +} + +//GetFreeformTags returns FreeformTags +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingConfigurationSourceProviderLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetConfigurationSourceProviderLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProvider) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketCloudUsernameAppPasswordConfigurationSourceProvider BitbucketCloudUsernameAppPasswordConfigurationSourceProvider + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeBitbucketCloudUsernameAppPasswordConfigurationSourceProvider + }{ + "BITBUCKET_CLOUD_USERNAME_APPPASSWORD", + (MarshalTypeBitbucketCloudUsernameAppPasswordConfigurationSourceProvider)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider_summary.go b/resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider_summary.go new file mode 100644 index 0000000000..7b13bc85d7 --- /dev/null +++ b/resourcemanager/bitbucket_cloud_username_app_password_configuration_source_provider_summary.go @@ -0,0 +1,143 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary Summary information for a configuration source provider of the type `BITBUCKET_CLOUD_USERNAME_APPPASSWORD`. +// This type corresponds to a configuration source provider in Bitbucket cloud that is authenticated with a username and app password. +type BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration source provider. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the configuration source provider is located. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable display name for the configuration source provider. + DisplayName *string `mandatory:"false" json:"displayName"` + + // General description of the configuration source provider. + Description *string `mandatory:"false" json:"description"` + + // The date and time when the configuration source provider was created. + // Format is defined by RFC3339. + // Example: `2020-01-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Bitbucket cloud service endpoint. + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"false" json:"apiEndpoint"` + + // Current state of the specified configuration source provider. + // For more information about configuration source provider lifecycle states in Resource Manager, see + // Key Concepts (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm#concepts__CSPStates). + // Allowable values: + // - ACTIVE + LifecycleState ConfigurationSourceProviderLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetDescription() *string { + return m.Description +} + +//GetTimeCreated returns TimeCreated +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetLifecycleState() ConfigurationSourceProviderLifecycleStateEnum { + return m.LifecycleState +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetFreeformTags returns FreeformTags +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingConfigurationSourceProviderLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetConfigurationSourceProviderLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeBitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary + }{ + "BITBUCKET_CLOUD_USERNAME_APPPASSWORD", + (MarshalTypeBitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/bitbucket_server_access_token_configuration_source_provider.go b/resourcemanager/bitbucket_server_access_token_configuration_source_provider.go new file mode 100644 index 0000000000..753241125f --- /dev/null +++ b/resourcemanager/bitbucket_server_access_token_configuration_source_provider.go @@ -0,0 +1,157 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketServerAccessTokenConfigurationSourceProvider The properties that define a configuration source provider of the type `BITBUCKET_SERVER_ACCESS_TOKEN`. +// This type corresponds to a configuration source provider in Bitbucket server that is authenticated with a personal access token. +type BitbucketServerAccessTokenConfigurationSourceProvider struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration source provider. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the configuration source provider is located. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable display name for the configuration source provider. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the configuration source provider. + Description *string `mandatory:"false" json:"description"` + + // The date and time when the configuration source provider was created. + // Format is defined by RFC3339. + // Example: `2020-01-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Username which is used to authorize the user. + Username *string `mandatory:"false" json:"username"` + + // Secret ocid which is used to authorize the user. + SecretId *string `mandatory:"false" json:"secretId"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Bitbucket server service endpoint. + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"false" json:"apiEndpoint"` + + // The current lifecycle state of the configuration source provider. + // For more information about configuration source provider lifecycle states in Resource Manager, see + // Key Concepts (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm#concepts__CSPStates). + LifecycleState ConfigurationSourceProviderLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetDescription() *string { + return m.Description +} + +//GetTimeCreated returns TimeCreated +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetLifecycleState() ConfigurationSourceProviderLifecycleStateEnum { + return m.LifecycleState +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetUsername returns Username +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetUsername() *string { + return m.Username +} + +//GetSecretId returns SecretId +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetSecretId() *string { + return m.SecretId +} + +//GetFreeformTags returns FreeformTags +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m BitbucketServerAccessTokenConfigurationSourceProvider) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m BitbucketServerAccessTokenConfigurationSourceProvider) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketServerAccessTokenConfigurationSourceProvider) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingConfigurationSourceProviderLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetConfigurationSourceProviderLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketServerAccessTokenConfigurationSourceProvider) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketServerAccessTokenConfigurationSourceProvider BitbucketServerAccessTokenConfigurationSourceProvider + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeBitbucketServerAccessTokenConfigurationSourceProvider + }{ + "BITBUCKET_SERVER_ACCESS_TOKEN", + (MarshalTypeBitbucketServerAccessTokenConfigurationSourceProvider)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/bitbucket_server_access_token_configuration_source_provider_summary.go b/resourcemanager/bitbucket_server_access_token_configuration_source_provider_summary.go new file mode 100644 index 0000000000..ea80fb5ec9 --- /dev/null +++ b/resourcemanager/bitbucket_server_access_token_configuration_source_provider_summary.go @@ -0,0 +1,143 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketServerAccessTokenConfigurationSourceProviderSummary Summary information for a configuration source provider of the type `BITBUCKET_SERVER_ACCESS_TOKEN`. +// This type corresponds to a configuration source provider in Bitbucket server that is authenticated with a personal access token. +type BitbucketServerAccessTokenConfigurationSourceProviderSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration source provider. + Id *string `mandatory:"false" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the configuration source provider is located. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable display name for the configuration source provider. + DisplayName *string `mandatory:"false" json:"displayName"` + + // General description of the configuration source provider. + Description *string `mandatory:"false" json:"description"` + + // The date and time when the configuration source provider was created. + // Format is defined by RFC3339. + // Example: `2020-01-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Bitbucket server service endpoint. + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"false" json:"apiEndpoint"` + + // Current state of the specified configuration source provider. + // For more information about configuration source provider lifecycle states in Resource Manager, see + // Key Concepts (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm#concepts__CSPStates). + // Allowable values: + // - ACTIVE + LifecycleState ConfigurationSourceProviderLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +//GetId returns Id +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetId() *string { + return m.Id +} + +//GetCompartmentId returns CompartmentId +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetDescription() *string { + return m.Description +} + +//GetTimeCreated returns TimeCreated +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetLifecycleState returns LifecycleState +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetLifecycleState() ConfigurationSourceProviderLifecycleStateEnum { + return m.LifecycleState +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetFreeformTags returns FreeformTags +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingConfigurationSourceProviderLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetConfigurationSourceProviderLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketServerAccessTokenConfigurationSourceProviderSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketServerAccessTokenConfigurationSourceProviderSummary BitbucketServerAccessTokenConfigurationSourceProviderSummary + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeBitbucketServerAccessTokenConfigurationSourceProviderSummary + }{ + "BITBUCKET_SERVER_ACCESS_TOKEN", + (MarshalTypeBitbucketServerAccessTokenConfigurationSourceProviderSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/bitbucket_server_config_source.go b/resourcemanager/bitbucket_server_config_source.go new file mode 100644 index 0000000000..8b4cf10bdb --- /dev/null +++ b/resourcemanager/bitbucket_server_config_source.go @@ -0,0 +1,85 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketServerConfigSource Metadata about the Bitbucket Server configuration source. +type BitbucketServerConfigSource struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Bitbucket Server configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // The URL of the Bitbucket Server repository for the configuration source. + RepositoryUrl *string `mandatory:"true" json:"repositoryUrl"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The name of the branch in the Bitbucket Server repository for the configuration source. + BranchName *string `mandatory:"false" json:"branchName"` + + // Unique identifier for a Bitbucket Server project. + ProjectId *string `mandatory:"false" json:"projectId"` + + // Bitbucket Server repository identifier, usually identified as .git. + RepositoryId *string `mandatory:"false" json:"repositoryId"` + + // The clone URL of Bitbucket Server configuration source. + CloneUrl *string `mandatory:"false" json:"cloneUrl"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m BitbucketServerConfigSource) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m BitbucketServerConfigSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketServerConfigSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketServerConfigSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketServerConfigSource BitbucketServerConfigSource + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeBitbucketServerConfigSource + }{ + "BITBUCKET_SERVER_CONFIG_SOURCE", + (MarshalTypeBitbucketServerConfigSource)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/bitbucket_server_config_source_record.go b/resourcemanager/bitbucket_server_config_source_record.go new file mode 100644 index 0000000000..a4688e77c3 --- /dev/null +++ b/resourcemanager/bitbucket_server_config_source_record.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BitbucketServerConfigSourceRecord Metadata about the Bitbucket Server configuration source. +type BitbucketServerConfigSourceRecord struct { + + // Unique identifier (OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)) + // for the Bitbucket Server configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // The URL of the Bitbucket Server repository. + RepositoryUrl *string `mandatory:"true" json:"repositoryUrl"` + + // The name of the branch within the Bitbucket Server repository. + BranchName *string `mandatory:"false" json:"branchName"` + + // The unique identifier (SHA-1 hash) of the individual change to the Bitbucket Server repository. + CommitId *string `mandatory:"false" json:"commitId"` +} + +func (m BitbucketServerConfigSourceRecord) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m BitbucketServerConfigSourceRecord) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m BitbucketServerConfigSourceRecord) MarshalJSON() (buff []byte, e error) { + type MarshalTypeBitbucketServerConfigSourceRecord BitbucketServerConfigSourceRecord + s := struct { + DiscriminatorParam string `json:"configSourceRecordType"` + MarshalTypeBitbucketServerConfigSourceRecord + }{ + "BITBUCKET_SERVER_CONFIG_SOURCE", + (MarshalTypeBitbucketServerConfigSourceRecord)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/config_source.go b/resourcemanager/config_source.go index 82915ebcf4..92d5cfcf1b 100644 --- a/resourcemanager/config_source.go +++ b/resourcemanager/config_source.go @@ -67,10 +67,22 @@ func (m *configsource) UnmarshalPolymorphicJSON(data []byte) (interface{}, error mm := GitConfigSource{} err = json.Unmarshal(data, &mm) return mm, err + case "DEVOPS_CONFIG_SOURCE": + mm := DevOpsConfigSource{} + err = json.Unmarshal(data, &mm) + return mm, err case "OBJECT_STORAGE_CONFIG_SOURCE": mm := ObjectStorageConfigSource{} err = json.Unmarshal(data, &mm) return mm, err + case "BITBUCKET_SERVER_CONFIG_SOURCE": + mm := BitbucketServerConfigSource{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BITBUCKET_CLOUD_CONFIG_SOURCE": + mm := BitbucketCloudConfigSource{} + err = json.Unmarshal(data, &mm) + return mm, err case "COMPARTMENT_CONFIG_SOURCE": mm := CompartmentConfigSource{} err = json.Unmarshal(data, &mm) @@ -110,24 +122,33 @@ type ConfigSourceConfigSourceTypeEnum string // Set of constants representing the allowable values for ConfigSourceConfigSourceTypeEnum const ( - ConfigSourceConfigSourceTypeCompartmentConfigSource ConfigSourceConfigSourceTypeEnum = "COMPARTMENT_CONFIG_SOURCE" - ConfigSourceConfigSourceTypeGitConfigSource ConfigSourceConfigSourceTypeEnum = "GIT_CONFIG_SOURCE" - ConfigSourceConfigSourceTypeObjectStorageConfigSource ConfigSourceConfigSourceTypeEnum = "OBJECT_STORAGE_CONFIG_SOURCE" - ConfigSourceConfigSourceTypeZipUpload ConfigSourceConfigSourceTypeEnum = "ZIP_UPLOAD" + ConfigSourceConfigSourceTypeBitbucketCloudConfigSource ConfigSourceConfigSourceTypeEnum = "BITBUCKET_CLOUD_CONFIG_SOURCE" + ConfigSourceConfigSourceTypeBitbucketServerConfigSource ConfigSourceConfigSourceTypeEnum = "BITBUCKET_SERVER_CONFIG_SOURCE" + ConfigSourceConfigSourceTypeCompartmentConfigSource ConfigSourceConfigSourceTypeEnum = "COMPARTMENT_CONFIG_SOURCE" + ConfigSourceConfigSourceTypeDevopsConfigSource ConfigSourceConfigSourceTypeEnum = "DEVOPS_CONFIG_SOURCE" + ConfigSourceConfigSourceTypeGitConfigSource ConfigSourceConfigSourceTypeEnum = "GIT_CONFIG_SOURCE" + ConfigSourceConfigSourceTypeObjectStorageConfigSource ConfigSourceConfigSourceTypeEnum = "OBJECT_STORAGE_CONFIG_SOURCE" + ConfigSourceConfigSourceTypeZipUpload ConfigSourceConfigSourceTypeEnum = "ZIP_UPLOAD" ) var mappingConfigSourceConfigSourceTypeEnum = map[string]ConfigSourceConfigSourceTypeEnum{ - "COMPARTMENT_CONFIG_SOURCE": ConfigSourceConfigSourceTypeCompartmentConfigSource, - "GIT_CONFIG_SOURCE": ConfigSourceConfigSourceTypeGitConfigSource, - "OBJECT_STORAGE_CONFIG_SOURCE": ConfigSourceConfigSourceTypeObjectStorageConfigSource, - "ZIP_UPLOAD": ConfigSourceConfigSourceTypeZipUpload, + "BITBUCKET_CLOUD_CONFIG_SOURCE": ConfigSourceConfigSourceTypeBitbucketCloudConfigSource, + "BITBUCKET_SERVER_CONFIG_SOURCE": ConfigSourceConfigSourceTypeBitbucketServerConfigSource, + "COMPARTMENT_CONFIG_SOURCE": ConfigSourceConfigSourceTypeCompartmentConfigSource, + "DEVOPS_CONFIG_SOURCE": ConfigSourceConfigSourceTypeDevopsConfigSource, + "GIT_CONFIG_SOURCE": ConfigSourceConfigSourceTypeGitConfigSource, + "OBJECT_STORAGE_CONFIG_SOURCE": ConfigSourceConfigSourceTypeObjectStorageConfigSource, + "ZIP_UPLOAD": ConfigSourceConfigSourceTypeZipUpload, } var mappingConfigSourceConfigSourceTypeEnumLowerCase = map[string]ConfigSourceConfigSourceTypeEnum{ - "compartment_config_source": ConfigSourceConfigSourceTypeCompartmentConfigSource, - "git_config_source": ConfigSourceConfigSourceTypeGitConfigSource, - "object_storage_config_source": ConfigSourceConfigSourceTypeObjectStorageConfigSource, - "zip_upload": ConfigSourceConfigSourceTypeZipUpload, + "bitbucket_cloud_config_source": ConfigSourceConfigSourceTypeBitbucketCloudConfigSource, + "bitbucket_server_config_source": ConfigSourceConfigSourceTypeBitbucketServerConfigSource, + "compartment_config_source": ConfigSourceConfigSourceTypeCompartmentConfigSource, + "devops_config_source": ConfigSourceConfigSourceTypeDevopsConfigSource, + "git_config_source": ConfigSourceConfigSourceTypeGitConfigSource, + "object_storage_config_source": ConfigSourceConfigSourceTypeObjectStorageConfigSource, + "zip_upload": ConfigSourceConfigSourceTypeZipUpload, } // GetConfigSourceConfigSourceTypeEnumValues Enumerates the set of values for ConfigSourceConfigSourceTypeEnum @@ -142,7 +163,10 @@ func GetConfigSourceConfigSourceTypeEnumValues() []ConfigSourceConfigSourceTypeE // GetConfigSourceConfigSourceTypeEnumStringValues Enumerates the set of values in String for ConfigSourceConfigSourceTypeEnum func GetConfigSourceConfigSourceTypeEnumStringValues() []string { return []string{ + "BITBUCKET_CLOUD_CONFIG_SOURCE", + "BITBUCKET_SERVER_CONFIG_SOURCE", "COMPARTMENT_CONFIG_SOURCE", + "DEVOPS_CONFIG_SOURCE", "GIT_CONFIG_SOURCE", "OBJECT_STORAGE_CONFIG_SOURCE", "ZIP_UPLOAD", diff --git a/resourcemanager/config_source_record.go b/resourcemanager/config_source_record.go index e20f8d7ccc..8d1e2cd3c1 100644 --- a/resourcemanager/config_source_record.go +++ b/resourcemanager/config_source_record.go @@ -53,6 +53,10 @@ func (m *configsourcerecord) UnmarshalPolymorphicJSON(data []byte) (interface{}, var err error switch m.ConfigSourceRecordType { + case "DEVOPS_CONFIG_SOURCE": + mm := DevOpsConfigSourceRecord{} + err = json.Unmarshal(data, &mm) + return mm, err case "GIT_CONFIG_SOURCE": mm := GitConfigSourceRecord{} err = json.Unmarshal(data, &mm) @@ -61,6 +65,14 @@ func (m *configsourcerecord) UnmarshalPolymorphicJSON(data []byte) (interface{}, mm := ZipUploadConfigSourceRecord{} err = json.Unmarshal(data, &mm) return mm, err + case "BITBUCKET_CLOUD_CONFIG_SOURCE": + mm := BitbucketCloudConfigSourceRecord{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BITBUCKET_SERVER_CONFIG_SOURCE": + mm := BitbucketServerConfigSourceRecord{} + err = json.Unmarshal(data, &mm) + return mm, err case "OBJECT_STORAGE_CONFIG_SOURCE": mm := ObjectStorageConfigSourceRecord{} err = json.Unmarshal(data, &mm) @@ -91,24 +103,33 @@ type ConfigSourceRecordConfigSourceRecordTypeEnum string // Set of constants representing the allowable values for ConfigSourceRecordConfigSourceRecordTypeEnum const ( - ConfigSourceRecordConfigSourceRecordTypeCompartmentConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "COMPARTMENT_CONFIG_SOURCE" - ConfigSourceRecordConfigSourceRecordTypeGitConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "GIT_CONFIG_SOURCE" - ConfigSourceRecordConfigSourceRecordTypeObjectStorageConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "OBJECT_STORAGE_CONFIG_SOURCE" - ConfigSourceRecordConfigSourceRecordTypeZipUpload ConfigSourceRecordConfigSourceRecordTypeEnum = "ZIP_UPLOAD" + ConfigSourceRecordConfigSourceRecordTypeBitbucketCloudConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "BITBUCKET_CLOUD_CONFIG_SOURCE" + ConfigSourceRecordConfigSourceRecordTypeBitbucketServerConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "BITBUCKET_SERVER_CONFIG_SOURCE" + ConfigSourceRecordConfigSourceRecordTypeCompartmentConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "COMPARTMENT_CONFIG_SOURCE" + ConfigSourceRecordConfigSourceRecordTypeDevopsConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "DEVOPS_CONFIG_SOURCE" + ConfigSourceRecordConfigSourceRecordTypeGitConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "GIT_CONFIG_SOURCE" + ConfigSourceRecordConfigSourceRecordTypeObjectStorageConfigSource ConfigSourceRecordConfigSourceRecordTypeEnum = "OBJECT_STORAGE_CONFIG_SOURCE" + ConfigSourceRecordConfigSourceRecordTypeZipUpload ConfigSourceRecordConfigSourceRecordTypeEnum = "ZIP_UPLOAD" ) var mappingConfigSourceRecordConfigSourceRecordTypeEnum = map[string]ConfigSourceRecordConfigSourceRecordTypeEnum{ - "COMPARTMENT_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeCompartmentConfigSource, - "GIT_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeGitConfigSource, - "OBJECT_STORAGE_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeObjectStorageConfigSource, - "ZIP_UPLOAD": ConfigSourceRecordConfigSourceRecordTypeZipUpload, + "BITBUCKET_CLOUD_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeBitbucketCloudConfigSource, + "BITBUCKET_SERVER_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeBitbucketServerConfigSource, + "COMPARTMENT_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeCompartmentConfigSource, + "DEVOPS_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeDevopsConfigSource, + "GIT_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeGitConfigSource, + "OBJECT_STORAGE_CONFIG_SOURCE": ConfigSourceRecordConfigSourceRecordTypeObjectStorageConfigSource, + "ZIP_UPLOAD": ConfigSourceRecordConfigSourceRecordTypeZipUpload, } var mappingConfigSourceRecordConfigSourceRecordTypeEnumLowerCase = map[string]ConfigSourceRecordConfigSourceRecordTypeEnum{ - "compartment_config_source": ConfigSourceRecordConfigSourceRecordTypeCompartmentConfigSource, - "git_config_source": ConfigSourceRecordConfigSourceRecordTypeGitConfigSource, - "object_storage_config_source": ConfigSourceRecordConfigSourceRecordTypeObjectStorageConfigSource, - "zip_upload": ConfigSourceRecordConfigSourceRecordTypeZipUpload, + "bitbucket_cloud_config_source": ConfigSourceRecordConfigSourceRecordTypeBitbucketCloudConfigSource, + "bitbucket_server_config_source": ConfigSourceRecordConfigSourceRecordTypeBitbucketServerConfigSource, + "compartment_config_source": ConfigSourceRecordConfigSourceRecordTypeCompartmentConfigSource, + "devops_config_source": ConfigSourceRecordConfigSourceRecordTypeDevopsConfigSource, + "git_config_source": ConfigSourceRecordConfigSourceRecordTypeGitConfigSource, + "object_storage_config_source": ConfigSourceRecordConfigSourceRecordTypeObjectStorageConfigSource, + "zip_upload": ConfigSourceRecordConfigSourceRecordTypeZipUpload, } // GetConfigSourceRecordConfigSourceRecordTypeEnumValues Enumerates the set of values for ConfigSourceRecordConfigSourceRecordTypeEnum @@ -123,7 +144,10 @@ func GetConfigSourceRecordConfigSourceRecordTypeEnumValues() []ConfigSourceRecor // GetConfigSourceRecordConfigSourceRecordTypeEnumStringValues Enumerates the set of values in String for ConfigSourceRecordConfigSourceRecordTypeEnum func GetConfigSourceRecordConfigSourceRecordTypeEnumStringValues() []string { return []string{ + "BITBUCKET_CLOUD_CONFIG_SOURCE", + "BITBUCKET_SERVER_CONFIG_SOURCE", "COMPARTMENT_CONFIG_SOURCE", + "DEVOPS_CONFIG_SOURCE", "GIT_CONFIG_SOURCE", "OBJECT_STORAGE_CONFIG_SOURCE", "ZIP_UPLOAD", diff --git a/resourcemanager/configuration_source_provider.go b/resourcemanager/configuration_source_provider.go index 5fa8d86204..29b3490951 100644 --- a/resourcemanager/configuration_source_provider.go +++ b/resourcemanager/configuration_source_provider.go @@ -48,6 +48,12 @@ type ConfigurationSourceProvider interface { GetPrivateServerConfigDetails() *PrivateServerConfigDetails + // Username which is used to authorize the user. + GetUsername() *string + + // Secret ocid which is used to authorize the user. + GetSecretId() *string + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` @@ -68,6 +74,8 @@ type configurationsourceprovider struct { TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` LifecycleState ConfigurationSourceProviderLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + Username *string `mandatory:"false" json:"username"` + SecretId *string `mandatory:"false" json:"secretId"` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` ConfigSourceProviderType string `json:"configSourceProviderType"` @@ -91,6 +99,8 @@ func (m *configurationsourceprovider) UnmarshalJSON(data []byte) error { m.TimeCreated = s.Model.TimeCreated m.LifecycleState = s.Model.LifecycleState m.PrivateServerConfigDetails = s.Model.PrivateServerConfigDetails + m.Username = s.Model.Username + m.SecretId = s.Model.SecretId m.FreeformTags = s.Model.FreeformTags m.DefinedTags = s.Model.DefinedTags m.ConfigSourceProviderType = s.Model.ConfigSourceProviderType @@ -115,6 +125,14 @@ func (m *configurationsourceprovider) UnmarshalPolymorphicJSON(data []byte) (int mm := GitlabAccessTokenConfigurationSourceProvider{} err = json.Unmarshal(data, &mm) return mm, err + case "BITBUCKET_SERVER_ACCESS_TOKEN": + mm := BitbucketServerAccessTokenConfigurationSourceProvider{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BITBUCKET_CLOUD_USERNAME_APPPASSWORD": + mm := BitbucketCloudUsernameAppPasswordConfigurationSourceProvider{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } @@ -155,6 +173,16 @@ func (m configurationsourceprovider) GetPrivateServerConfigDetails() *PrivateSer return m.PrivateServerConfigDetails } +//GetUsername returns Username +func (m configurationsourceprovider) GetUsername() *string { + return m.Username +} + +//GetSecretId returns SecretId +func (m configurationsourceprovider) GetSecretId() *string { + return m.SecretId +} + //GetFreeformTags returns FreeformTags func (m configurationsourceprovider) GetFreeformTags() map[string]string { return m.FreeformTags @@ -227,18 +255,24 @@ type ConfigurationSourceProviderConfigSourceProviderTypeEnum string // Set of constants representing the allowable values for ConfigurationSourceProviderConfigSourceProviderTypeEnum const ( - ConfigurationSourceProviderConfigSourceProviderTypeGitlabAccessToken ConfigurationSourceProviderConfigSourceProviderTypeEnum = "GITLAB_ACCESS_TOKEN" - ConfigurationSourceProviderConfigSourceProviderTypeGithubAccessToken ConfigurationSourceProviderConfigSourceProviderTypeEnum = "GITHUB_ACCESS_TOKEN" + ConfigurationSourceProviderConfigSourceProviderTypeBitbucketCloudUsernameApppassword ConfigurationSourceProviderConfigSourceProviderTypeEnum = "BITBUCKET_CLOUD_USERNAME_APPPASSWORD" + ConfigurationSourceProviderConfigSourceProviderTypeBitbucketServerAccessToken ConfigurationSourceProviderConfigSourceProviderTypeEnum = "BITBUCKET_SERVER_ACCESS_TOKEN" + ConfigurationSourceProviderConfigSourceProviderTypeGitlabAccessToken ConfigurationSourceProviderConfigSourceProviderTypeEnum = "GITLAB_ACCESS_TOKEN" + ConfigurationSourceProviderConfigSourceProviderTypeGithubAccessToken ConfigurationSourceProviderConfigSourceProviderTypeEnum = "GITHUB_ACCESS_TOKEN" ) var mappingConfigurationSourceProviderConfigSourceProviderTypeEnum = map[string]ConfigurationSourceProviderConfigSourceProviderTypeEnum{ - "GITLAB_ACCESS_TOKEN": ConfigurationSourceProviderConfigSourceProviderTypeGitlabAccessToken, - "GITHUB_ACCESS_TOKEN": ConfigurationSourceProviderConfigSourceProviderTypeGithubAccessToken, + "BITBUCKET_CLOUD_USERNAME_APPPASSWORD": ConfigurationSourceProviderConfigSourceProviderTypeBitbucketCloudUsernameApppassword, + "BITBUCKET_SERVER_ACCESS_TOKEN": ConfigurationSourceProviderConfigSourceProviderTypeBitbucketServerAccessToken, + "GITLAB_ACCESS_TOKEN": ConfigurationSourceProviderConfigSourceProviderTypeGitlabAccessToken, + "GITHUB_ACCESS_TOKEN": ConfigurationSourceProviderConfigSourceProviderTypeGithubAccessToken, } var mappingConfigurationSourceProviderConfigSourceProviderTypeEnumLowerCase = map[string]ConfigurationSourceProviderConfigSourceProviderTypeEnum{ - "gitlab_access_token": ConfigurationSourceProviderConfigSourceProviderTypeGitlabAccessToken, - "github_access_token": ConfigurationSourceProviderConfigSourceProviderTypeGithubAccessToken, + "bitbucket_cloud_username_apppassword": ConfigurationSourceProviderConfigSourceProviderTypeBitbucketCloudUsernameApppassword, + "bitbucket_server_access_token": ConfigurationSourceProviderConfigSourceProviderTypeBitbucketServerAccessToken, + "gitlab_access_token": ConfigurationSourceProviderConfigSourceProviderTypeGitlabAccessToken, + "github_access_token": ConfigurationSourceProviderConfigSourceProviderTypeGithubAccessToken, } // GetConfigurationSourceProviderConfigSourceProviderTypeEnumValues Enumerates the set of values for ConfigurationSourceProviderConfigSourceProviderTypeEnum @@ -253,6 +287,8 @@ func GetConfigurationSourceProviderConfigSourceProviderTypeEnumValues() []Config // GetConfigurationSourceProviderConfigSourceProviderTypeEnumStringValues Enumerates the set of values in String for ConfigurationSourceProviderConfigSourceProviderTypeEnum func GetConfigurationSourceProviderConfigSourceProviderTypeEnumStringValues() []string { return []string{ + "BITBUCKET_CLOUD_USERNAME_APPPASSWORD", + "BITBUCKET_SERVER_ACCESS_TOKEN", "GITLAB_ACCESS_TOKEN", "GITHUB_ACCESS_TOKEN", } diff --git a/resourcemanager/configuration_source_provider_summary.go b/resourcemanager/configuration_source_provider_summary.go index 493a8b1dc8..2bd8584af0 100644 --- a/resourcemanager/configuration_source_provider_summary.go +++ b/resourcemanager/configuration_source_provider_summary.go @@ -111,6 +111,14 @@ func (m *configurationsourceprovidersummary) UnmarshalPolymorphicJSON(data []byt mm := GitlabAccessTokenConfigurationSourceProviderSummary{} err = json.Unmarshal(data, &mm) return mm, err + case "BITBUCKET_CLOUD_USERNAME_APPPASSWORD": + mm := BitbucketCloudUsernameAppPasswordConfigurationSourceProviderSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BITBUCKET_SERVER_ACCESS_TOKEN": + mm := BitbucketServerAccessTokenConfigurationSourceProviderSummary{} + err = json.Unmarshal(data, &mm) + return mm, err case "GITHUB_ACCESS_TOKEN": mm := GithubAccessTokenConfigurationSourceProviderSummary{} err = json.Unmarshal(data, &mm) diff --git a/resourcemanager/create_bitbucket_cloud_config_source_details.go b/resourcemanager/create_bitbucket_cloud_config_source_details.go new file mode 100644 index 0000000000..744a9488a0 --- /dev/null +++ b/resourcemanager/create_bitbucket_cloud_config_source_details.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateBitbucketCloudConfigSourceDetails Creation details for a Bitbucket Cloud configuration source. +type CreateBitbucketCloudConfigSourceDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Bitbucket Cloud configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // The URL of the Bitbucket Cloud repository for the configuration source. + RepositoryUrl *string `mandatory:"true" json:"repositoryUrl"` + + // The id of the workspace in Bitbucket Cloud for the configuration source + WorkspaceId *string `mandatory:"true" json:"workspaceId"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The name of the branch in the Bitbucket Cloud repository for the configuration source. + BranchName *string `mandatory:"false" json:"branchName"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m CreateBitbucketCloudConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m CreateBitbucketCloudConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateBitbucketCloudConfigSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateBitbucketCloudConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateBitbucketCloudConfigSourceDetails CreateBitbucketCloudConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeCreateBitbucketCloudConfigSourceDetails + }{ + "BITBUCKET_CLOUD_CONFIG_SOURCE", + (MarshalTypeCreateBitbucketCloudConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/create_bitbucket_cloud_username_app_password_configuration_source_provider_details.go b/resourcemanager/create_bitbucket_cloud_username_app_password_configuration_source_provider_details.go new file mode 100644 index 0000000000..24eb0ddb9a --- /dev/null +++ b/resourcemanager/create_bitbucket_cloud_username_app_password_configuration_source_provider_details.go @@ -0,0 +1,117 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails Creation details for a configuration source provider of the type `BITBUCKET_CLOUD_USERNAME_appPASSWORD`. +// This type corresponds to a configuration source provider in Bitbucket that is authenticated with a username and app password. +type CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails struct { + + // The Bitbucket cloud service endpoint. + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"true" json:"apiEndpoint"` + + // The username for the user of the Bitbucket cloud repository. + Username *string `mandatory:"true" json:"username"` + + // The secret ocid which is used to authorize the user. + SecretId *string `mandatory:"true" json:"secretId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where + // you want to create the configuration source provider. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable name of the configuration source provider. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the configuration source provider. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +//GetCompartmentId returns CompartmentId +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetDescription() *string { + return m.Description +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetFreeformTags returns FreeformTags +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeCreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails + }{ + "BITBUCKET_CLOUD_USERNAME_APPPASSWORD", + (MarshalTypeCreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/create_bitbucket_server_access_token_configuration_source_provider_details.go b/resourcemanager/create_bitbucket_server_access_token_configuration_source_provider_details.go new file mode 100644 index 0000000000..b83cbd6e58 --- /dev/null +++ b/resourcemanager/create_bitbucket_server_access_token_configuration_source_provider_details.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails The details for creating a configuration source provider of the type `BITBUCKET_SERVER_ACCESS_TOKEN`. +// This type corresponds to a configuration source provider in Bitbucket server that is authenticated with a personal access token. +type CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails struct { + + // The secret ocid which is used to authorize the user. + SecretId *string `mandatory:"true" json:"secretId"` + + // The Bitbucket Server service endpoint + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"true" json:"apiEndpoint"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where + // you want to create the configuration source provider. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Human-readable name of the configuration source provider. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the configuration source provider. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +//GetCompartmentId returns CompartmentId +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +//GetDisplayName returns DisplayName +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetDescription() *string { + return m.Description +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetFreeformTags returns FreeformTags +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateBitbucketServerAccessTokenConfigurationSourceProviderDetails CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeCreateBitbucketServerAccessTokenConfigurationSourceProviderDetails + }{ + "BITBUCKET_SERVER_ACCESS_TOKEN", + (MarshalTypeCreateBitbucketServerAccessTokenConfigurationSourceProviderDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/create_bitbucket_server_config_source_details.go b/resourcemanager/create_bitbucket_server_config_source_details.go new file mode 100644 index 0000000000..145686cc07 --- /dev/null +++ b/resourcemanager/create_bitbucket_server_config_source_details.go @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateBitbucketServerConfigSourceDetails Creation details for a Bitbucket Server configuration source. +type CreateBitbucketServerConfigSourceDetails struct { + + // Unique identifier (OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)) + // for the Bitbucket Server configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // The URL of the Bitbucket Server repository. + RepositoryUrl *string `mandatory:"true" json:"repositoryUrl"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The name of the branch within the Bitbucket Server repository. + BranchName *string `mandatory:"false" json:"branchName"` + + // Unique identifier for a Bitbucket Server project. + ProjectId *string `mandatory:"false" json:"projectId"` + + // Bitbucket Server repository identifier, usually identified as .git. + RepositoryId *string `mandatory:"false" json:"repositoryId"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m CreateBitbucketServerConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m CreateBitbucketServerConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateBitbucketServerConfigSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateBitbucketServerConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateBitbucketServerConfigSourceDetails CreateBitbucketServerConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeCreateBitbucketServerConfigSourceDetails + }{ + "BITBUCKET_SERVER_CONFIG_SOURCE", + (MarshalTypeCreateBitbucketServerConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/create_config_source_details.go b/resourcemanager/create_config_source_details.go index 720578d1bb..587b05d38b 100644 --- a/resourcemanager/create_config_source_details.go +++ b/resourcemanager/create_config_source_details.go @@ -63,10 +63,22 @@ func (m *createconfigsourcedetails) UnmarshalPolymorphicJSON(data []byte) (inter var err error switch m.ConfigSourceType { + case "DEVOPS_CONFIG_SOURCE": + mm := CreateDevOpsConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BITBUCKET_CLOUD_CONFIG_SOURCE": + mm := CreateBitbucketCloudConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "ZIP_UPLOAD": mm := CreateZipUploadConfigSourceDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "BITBUCKET_SERVER_CONFIG_SOURCE": + mm := CreateBitbucketServerConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "GIT_CONFIG_SOURCE": mm := CreateGitConfigSourceDetails{} err = json.Unmarshal(data, &mm) diff --git a/resourcemanager/create_configuration_source_provider_details.go b/resourcemanager/create_configuration_source_provider_details.go index a39d287036..bc3bfbce7c 100644 --- a/resourcemanager/create_configuration_source_provider_details.go +++ b/resourcemanager/create_configuration_source_provider_details.go @@ -91,10 +91,18 @@ func (m *createconfigurationsourceproviderdetails) UnmarshalPolymorphicJSON(data mm := CreateGitlabAccessTokenConfigurationSourceProviderDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "BITBUCKET_CLOUD_USERNAME_APPPASSWORD": + mm := CreateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "GITHUB_ACCESS_TOKEN": mm := CreateGithubAccessTokenConfigurationSourceProviderDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "BITBUCKET_SERVER_ACCESS_TOKEN": + mm := CreateBitbucketServerAccessTokenConfigurationSourceProviderDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } diff --git a/resourcemanager/create_dev_ops_config_source_details.go b/resourcemanager/create_dev_ops_config_source_details.go new file mode 100644 index 0000000000..8e140a3019 --- /dev/null +++ b/resourcemanager/create_dev_ops_config_source_details.go @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDevOpsConfigSourceDetails Creation details for a DevOps (https://docs.cloud.oracle.com/iaas/Content/devops/using/home.htm) configuration source. +type CreateDevOpsConfigSourceDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Project. + ProjectId *string `mandatory:"true" json:"projectId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Repository. + RepositoryId *string `mandatory:"true" json:"repositoryId"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The name of the branch that contains the Terraform configuration. + BranchName *string `mandatory:"false" json:"branchName"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m CreateDevOpsConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m CreateDevOpsConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateDevOpsConfigSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateDevOpsConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateDevOpsConfigSourceDetails CreateDevOpsConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeCreateDevOpsConfigSourceDetails + }{ + "DEVOPS_CONFIG_SOURCE", + (MarshalTypeCreateDevOpsConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/dev_ops_config_source.go b/resourcemanager/dev_ops_config_source.go new file mode 100644 index 0000000000..4d8877e9e6 --- /dev/null +++ b/resourcemanager/dev_ops_config_source.go @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DevOpsConfigSource Metadata about the DevOps (https://docs.cloud.oracle.com/iaas/Content/devops/using/home.htm) configuration source. +type DevOpsConfigSource struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Project. + ProjectId *string `mandatory:"true" json:"projectId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Repository. + RepositoryId *string `mandatory:"true" json:"repositoryId"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The name of the branch that contains the Terraform configuration. + BranchName *string `mandatory:"false" json:"branchName"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m DevOpsConfigSource) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m DevOpsConfigSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DevOpsConfigSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DevOpsConfigSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDevOpsConfigSource DevOpsConfigSource + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeDevOpsConfigSource + }{ + "DEVOPS_CONFIG_SOURCE", + (MarshalTypeDevOpsConfigSource)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/dev_ops_config_source_record.go b/resourcemanager/dev_ops_config_source_record.go new file mode 100644 index 0000000000..4f3f280cdd --- /dev/null +++ b/resourcemanager/dev_ops_config_source_record.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DevOpsConfigSourceRecord Metadata about the DevOps (https://docs.cloud.oracle.com/iaas/Content/devops/using/home.htm) configuration source. +type DevOpsConfigSourceRecord struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Project. + ProjectId *string `mandatory:"true" json:"projectId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Repository. + RepositoryId *string `mandatory:"true" json:"repositoryId"` + + // The name of the branch that contains the Terraform configuration. + BranchName *string `mandatory:"true" json:"branchName"` + + // The unique identifier (SHA-1 hash) of the individual change to the DevOps repository. + CommitId *string `mandatory:"false" json:"commitId"` +} + +func (m DevOpsConfigSourceRecord) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DevOpsConfigSourceRecord) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DevOpsConfigSourceRecord) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDevOpsConfigSourceRecord DevOpsConfigSourceRecord + s := struct { + DiscriminatorParam string `json:"configSourceRecordType"` + MarshalTypeDevOpsConfigSourceRecord + }{ + "DEVOPS_CONFIG_SOURCE", + (MarshalTypeDevOpsConfigSourceRecord)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/github_access_token_configuration_source_provider.go b/resourcemanager/github_access_token_configuration_source_provider.go index 3b09f12dbc..d726849eed 100644 --- a/resourcemanager/github_access_token_configuration_source_provider.go +++ b/resourcemanager/github_access_token_configuration_source_provider.go @@ -42,6 +42,12 @@ type GithubAccessTokenConfigurationSourceProvider struct { PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + // Username which is used to authorize the user. + Username *string `mandatory:"false" json:"username"` + + // Secret ocid which is used to authorize the user. + SecretId *string `mandatory:"false" json:"secretId"` + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` @@ -97,6 +103,16 @@ func (m GithubAccessTokenConfigurationSourceProvider) GetPrivateServerConfigDeta return m.PrivateServerConfigDetails } +//GetUsername returns Username +func (m GithubAccessTokenConfigurationSourceProvider) GetUsername() *string { + return m.Username +} + +//GetSecretId returns SecretId +func (m GithubAccessTokenConfigurationSourceProvider) GetSecretId() *string { + return m.SecretId +} + //GetFreeformTags returns FreeformTags func (m GithubAccessTokenConfigurationSourceProvider) GetFreeformTags() map[string]string { return m.FreeformTags diff --git a/resourcemanager/gitlab_access_token_configuration_source_provider.go b/resourcemanager/gitlab_access_token_configuration_source_provider.go index 21e16777a8..532dae5ac3 100644 --- a/resourcemanager/gitlab_access_token_configuration_source_provider.go +++ b/resourcemanager/gitlab_access_token_configuration_source_provider.go @@ -42,6 +42,12 @@ type GitlabAccessTokenConfigurationSourceProvider struct { PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + // Username which is used to authorize the user. + Username *string `mandatory:"false" json:"username"` + + // Secret ocid which is used to authorize the user. + SecretId *string `mandatory:"false" json:"secretId"` + // Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` @@ -97,6 +103,16 @@ func (m GitlabAccessTokenConfigurationSourceProvider) GetPrivateServerConfigDeta return m.PrivateServerConfigDetails } +//GetUsername returns Username +func (m GitlabAccessTokenConfigurationSourceProvider) GetUsername() *string { + return m.Username +} + +//GetSecretId returns SecretId +func (m GitlabAccessTokenConfigurationSourceProvider) GetSecretId() *string { + return m.SecretId +} + //GetFreeformTags returns FreeformTags func (m GitlabAccessTokenConfigurationSourceProvider) GetFreeformTags() map[string]string { return m.FreeformTags diff --git a/resourcemanager/update_bitbucket_cloud_config_source_details.go b/resourcemanager/update_bitbucket_cloud_config_source_details.go new file mode 100644 index 0000000000..99da70892a --- /dev/null +++ b/resourcemanager/update_bitbucket_cloud_config_source_details.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateBitbucketCloudConfigSourceDetails Update details for a Bitbucket Cloud configuration source. +type UpdateBitbucketCloudConfigSourceDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Bitbucket Cloud configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The URL of the Bitbucket Cloud repository for the configuration source. + RepositoryUrl *string `mandatory:"false" json:"repositoryUrl"` + + // The name of the branch in the Bitbucket Cloud repository for the configuration source. + BranchName *string `mandatory:"false" json:"branchName"` + + // The id of the workspace in Bitbucket Cloud for the configuration source + WorkspaceId *string `mandatory:"false" json:"workspaceId"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m UpdateBitbucketCloudConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m UpdateBitbucketCloudConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateBitbucketCloudConfigSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateBitbucketCloudConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateBitbucketCloudConfigSourceDetails UpdateBitbucketCloudConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeUpdateBitbucketCloudConfigSourceDetails + }{ + "BITBUCKET_CLOUD_CONFIG_SOURCE", + (MarshalTypeUpdateBitbucketCloudConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/update_bitbucket_cloud_username_app_password_configuration_source_provider_details.go b/resourcemanager/update_bitbucket_cloud_username_app_password_configuration_source_provider_details.go new file mode 100644 index 0000000000..5f21cfe407 --- /dev/null +++ b/resourcemanager/update_bitbucket_cloud_username_app_password_configuration_source_provider_details.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails Update details for a configuration source provider of the type `BITBUCKET_CLOUD_USERNAME_APPPASSWORD`. +// This type corresponds to a configuration source provider in Bitbucket that is authenticated with a username and app password. +type UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails struct { + + // Human-readable name of the configuration source provider. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the configuration source provider. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The Bitbucket service endpoint. + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"false" json:"apiEndpoint"` + + // The username for the user of the Bitbucket cloud repository. + Username *string `mandatory:"false" json:"username"` + + // The secret ocid which is used to authorize the user. + SecretId *string `mandatory:"false" json:"secretId"` +} + +//GetDisplayName returns DisplayName +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetDescription() *string { + return m.Description +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetFreeformTags returns FreeformTags +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeUpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails + }{ + "BITBUCKET_CLOUD_USERNAME_APPPASSWORD", + (MarshalTypeUpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/update_bitbucket_server_access_token_configuration_source_provider_details.go b/resourcemanager/update_bitbucket_server_access_token_configuration_source_provider_details.go new file mode 100644 index 0000000000..c8d60e0ed1 --- /dev/null +++ b/resourcemanager/update_bitbucket_server_access_token_configuration_source_provider_details.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails The details for creating a configuration source provider of the type `BITBUCKET_SERVER_ACCESS_TOKEN`. +// This type corresponds to a configuration source provider in Bitbucket server that is authenticated with a personal access token. +type UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails struct { + + // Human-readable name of the configuration source provider. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the configuration source provider. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + PrivateServerConfigDetails *PrivateServerConfigDetails `mandatory:"false" json:"privateServerConfigDetails"` + + // Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The secret ocid which is used to authorize the user. + SecretId *string `mandatory:"false" json:"secretId"` + + // The Bitbucket server service endpoint + // Example: `https://bitbucket.org/` + ApiEndpoint *string `mandatory:"false" json:"apiEndpoint"` +} + +//GetDisplayName returns DisplayName +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetDisplayName() *string { + return m.DisplayName +} + +//GetDescription returns Description +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetDescription() *string { + return m.Description +} + +//GetPrivateServerConfigDetails returns PrivateServerConfigDetails +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetPrivateServerConfigDetails() *PrivateServerConfigDetails { + return m.PrivateServerConfigDetails +} + +//GetFreeformTags returns FreeformTags +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +//GetDefinedTags returns DefinedTags +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails + s := struct { + DiscriminatorParam string `json:"configSourceProviderType"` + MarshalTypeUpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails + }{ + "BITBUCKET_SERVER_ACCESS_TOKEN", + (MarshalTypeUpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/update_bitbucket_server_config_source_details.go b/resourcemanager/update_bitbucket_server_config_source_details.go new file mode 100644 index 0000000000..3608ec9be4 --- /dev/null +++ b/resourcemanager/update_bitbucket_server_config_source_details.go @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateBitbucketServerConfigSourceDetails Update details for a Bitbucket Server configuration source. +type UpdateBitbucketServerConfigSourceDetails struct { + + // Unique identifier (OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)) + // for the Bitbucket Server configuration source. + ConfigurationSourceProviderId *string `mandatory:"true" json:"configurationSourceProviderId"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The URL of the Bitbucket Server repository. + RepositoryUrl *string `mandatory:"false" json:"repositoryUrl"` + + // The name of the branch within the Bitbucket Server repository. + BranchName *string `mandatory:"false" json:"branchName"` + + // Unique identifier for a Bitbucket Server project. + ProjectId *string `mandatory:"false" json:"projectId"` + + // Bitbucket Server repository identifier, usually identified as .git. + RepositoryId *string `mandatory:"false" json:"repositoryId"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m UpdateBitbucketServerConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m UpdateBitbucketServerConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateBitbucketServerConfigSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateBitbucketServerConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateBitbucketServerConfigSourceDetails UpdateBitbucketServerConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeUpdateBitbucketServerConfigSourceDetails + }{ + "BITBUCKET_SERVER_CONFIG_SOURCE", + (MarshalTypeUpdateBitbucketServerConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/resourcemanager/update_config_source_details.go b/resourcemanager/update_config_source_details.go index 03650b0f27..44d827c409 100644 --- a/resourcemanager/update_config_source_details.go +++ b/resourcemanager/update_config_source_details.go @@ -63,6 +63,14 @@ func (m *updateconfigsourcedetails) UnmarshalPolymorphicJSON(data []byte) (inter var err error switch m.ConfigSourceType { + case "BITBUCKET_CLOUD_CONFIG_SOURCE": + mm := UpdateBitbucketCloudConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BITBUCKET_SERVER_CONFIG_SOURCE": + mm := UpdateBitbucketServerConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "GIT_CONFIG_SOURCE": mm := UpdateGitConfigSourceDetails{} err = json.Unmarshal(data, &mm) @@ -75,6 +83,10 @@ func (m *updateconfigsourcedetails) UnmarshalPolymorphicJSON(data []byte) (inter mm := UpdateZipUploadConfigSourceDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "DEVOPS_CONFIG_SOURCE": + mm := UpdateDevOpsConfigSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: return *m, nil } diff --git a/resourcemanager/update_configuration_source_provider_details.go b/resourcemanager/update_configuration_source_provider_details.go index 8cb5aaf297..9b00520e41 100644 --- a/resourcemanager/update_configuration_source_provider_details.go +++ b/resourcemanager/update_configuration_source_provider_details.go @@ -81,6 +81,14 @@ func (m *updateconfigurationsourceproviderdetails) UnmarshalPolymorphicJSON(data var err error switch m.ConfigSourceProviderType { + case "BITBUCKET_CLOUD_USERNAME_APPPASSWORD": + mm := UpdateBitbucketCloudUsernameAppPasswordConfigurationSourceProviderDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "BITBUCKET_SERVER_ACCESS_TOKEN": + mm := UpdateBitbucketServerAccessTokenConfigurationSourceProviderDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "GITLAB_ACCESS_TOKEN": mm := UpdateGitlabAccessTokenConfigurationSourceProviderDetails{} err = json.Unmarshal(data, &mm) diff --git a/resourcemanager/update_dev_ops_config_source_details.go b/resourcemanager/update_dev_ops_config_source_details.go new file mode 100644 index 0000000000..298e59a980 --- /dev/null +++ b/resourcemanager/update_dev_ops_config_source_details.go @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Resource Manager API +// +// Use the Resource Manager API to automate deployment and operations for all Oracle Cloud Infrastructure resources. +// Using the infrastructure-as-code (IaC) model, the service is based on Terraform, an open source industry standard that lets DevOps engineers develop and deploy their infrastructure anywhere. +// For more information, see +// the Resource Manager documentation (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/home.htm). +// + +package resourcemanager + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDevOpsConfigSourceDetails Update details for a DevOps (https://docs.cloud.oracle.com/iaas/Content/devops/using/home.htm) configuration source. +type UpdateDevOpsConfigSourceDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Project. + ProjectId *string `mandatory:"true" json:"projectId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Repository. + RepositoryId *string `mandatory:"true" json:"repositoryId"` + + // File path to the directory to use for running Terraform. + // If not specified, the root directory is used. + // Required when using a zip Terraform configuration (`configSourceType` value of `ZIP_UPLOAD`) that contains folders. + // Ignored for the `configSourceType` value of `COMPARTMENT_CONFIG_SOURCE`. + // For more information about required and recommended file structure, see + // File Structure (Terraform Configurations for Resource Manager) (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/terraformconfigresourcemanager.htm#filestructure). + WorkingDirectory *string `mandatory:"false" json:"workingDirectory"` + + // The name of the branch that contains the Terraform configuration. + BranchName *string `mandatory:"false" json:"branchName"` +} + +//GetWorkingDirectory returns WorkingDirectory +func (m UpdateDevOpsConfigSourceDetails) GetWorkingDirectory() *string { + return m.WorkingDirectory +} + +func (m UpdateDevOpsConfigSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateDevOpsConfigSourceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateDevOpsConfigSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateDevOpsConfigSourceDetails UpdateDevOpsConfigSourceDetails + s := struct { + DiscriminatorParam string `json:"configSourceType"` + MarshalTypeUpdateDevOpsConfigSourceDetails + }{ + "DEVOPS_CONFIG_SOURCE", + (MarshalTypeUpdateDevOpsConfigSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/stackmonitoring/discovery_details.go b/stackmonitoring/discovery_details.go index ee3787e700..858b107147 100644 --- a/stackmonitoring/discovery_details.go +++ b/stackmonitoring/discovery_details.go @@ -60,31 +60,40 @@ type DiscoveryDetailsResourceTypeEnum string const ( DiscoveryDetailsResourceTypeWeblogicDomain DiscoveryDetailsResourceTypeEnum = "WEBLOGIC_DOMAIN" DiscoveryDetailsResourceTypeEbsInstance DiscoveryDetailsResourceTypeEnum = "EBS_INSTANCE" + DiscoveryDetailsResourceTypeSqlServer DiscoveryDetailsResourceTypeEnum = "SQL_SERVER" + DiscoveryDetailsResourceTypeApacheTomcat DiscoveryDetailsResourceTypeEnum = "APACHE_TOMCAT" DiscoveryDetailsResourceTypeOracleDatabase DiscoveryDetailsResourceTypeEnum = "ORACLE_DATABASE" DiscoveryDetailsResourceTypeOciOracleDb DiscoveryDetailsResourceTypeEnum = "OCI_ORACLE_DB" DiscoveryDetailsResourceTypeOciOracleCdb DiscoveryDetailsResourceTypeEnum = "OCI_ORACLE_CDB" DiscoveryDetailsResourceTypeOciOraclePdb DiscoveryDetailsResourceTypeEnum = "OCI_ORACLE_PDB" DiscoveryDetailsResourceTypeHost DiscoveryDetailsResourceTypeEnum = "HOST" + DiscoveryDetailsResourceTypeOraclePsft DiscoveryDetailsResourceTypeEnum = "ORACLE_PSFT" ) var mappingDiscoveryDetailsResourceTypeEnum = map[string]DiscoveryDetailsResourceTypeEnum{ "WEBLOGIC_DOMAIN": DiscoveryDetailsResourceTypeWeblogicDomain, "EBS_INSTANCE": DiscoveryDetailsResourceTypeEbsInstance, + "SQL_SERVER": DiscoveryDetailsResourceTypeSqlServer, + "APACHE_TOMCAT": DiscoveryDetailsResourceTypeApacheTomcat, "ORACLE_DATABASE": DiscoveryDetailsResourceTypeOracleDatabase, "OCI_ORACLE_DB": DiscoveryDetailsResourceTypeOciOracleDb, "OCI_ORACLE_CDB": DiscoveryDetailsResourceTypeOciOracleCdb, "OCI_ORACLE_PDB": DiscoveryDetailsResourceTypeOciOraclePdb, "HOST": DiscoveryDetailsResourceTypeHost, + "ORACLE_PSFT": DiscoveryDetailsResourceTypeOraclePsft, } var mappingDiscoveryDetailsResourceTypeEnumLowerCase = map[string]DiscoveryDetailsResourceTypeEnum{ "weblogic_domain": DiscoveryDetailsResourceTypeWeblogicDomain, "ebs_instance": DiscoveryDetailsResourceTypeEbsInstance, + "sql_server": DiscoveryDetailsResourceTypeSqlServer, + "apache_tomcat": DiscoveryDetailsResourceTypeApacheTomcat, "oracle_database": DiscoveryDetailsResourceTypeOracleDatabase, "oci_oracle_db": DiscoveryDetailsResourceTypeOciOracleDb, "oci_oracle_cdb": DiscoveryDetailsResourceTypeOciOracleCdb, "oci_oracle_pdb": DiscoveryDetailsResourceTypeOciOraclePdb, "host": DiscoveryDetailsResourceTypeHost, + "oracle_psft": DiscoveryDetailsResourceTypeOraclePsft, } // GetDiscoveryDetailsResourceTypeEnumValues Enumerates the set of values for DiscoveryDetailsResourceTypeEnum @@ -101,11 +110,14 @@ func GetDiscoveryDetailsResourceTypeEnumStringValues() []string { return []string{ "WEBLOGIC_DOMAIN", "EBS_INSTANCE", + "SQL_SERVER", + "APACHE_TOMCAT", "ORACLE_DATABASE", "OCI_ORACLE_DB", "OCI_ORACLE_CDB", "OCI_ORACLE_PDB", "HOST", + "ORACLE_PSFT", } } diff --git a/stackmonitoring/discovery_job_summary.go b/stackmonitoring/discovery_job_summary.go index b6c1c7ab05..9124367799 100644 --- a/stackmonitoring/discovery_job_summary.go +++ b/stackmonitoring/discovery_job_summary.go @@ -99,31 +99,40 @@ type DiscoveryJobSummaryResourceTypeEnum string const ( DiscoveryJobSummaryResourceTypeWeblogicDomain DiscoveryJobSummaryResourceTypeEnum = "WEBLOGIC_DOMAIN" DiscoveryJobSummaryResourceTypeEbsInstance DiscoveryJobSummaryResourceTypeEnum = "EBS_INSTANCE" + DiscoveryJobSummaryResourceTypeSqlServer DiscoveryJobSummaryResourceTypeEnum = "SQL_SERVER" + DiscoveryJobSummaryResourceTypeApacheTomcat DiscoveryJobSummaryResourceTypeEnum = "APACHE_TOMCAT" DiscoveryJobSummaryResourceTypeOracleDatabase DiscoveryJobSummaryResourceTypeEnum = "ORACLE_DATABASE" DiscoveryJobSummaryResourceTypeOciOracleDb DiscoveryJobSummaryResourceTypeEnum = "OCI_ORACLE_DB" DiscoveryJobSummaryResourceTypeOciOracleCdb DiscoveryJobSummaryResourceTypeEnum = "OCI_ORACLE_CDB" DiscoveryJobSummaryResourceTypeOciOraclePdb DiscoveryJobSummaryResourceTypeEnum = "OCI_ORACLE_PDB" DiscoveryJobSummaryResourceTypeHost DiscoveryJobSummaryResourceTypeEnum = "HOST" + DiscoveryJobSummaryResourceTypeOraclePsft DiscoveryJobSummaryResourceTypeEnum = "ORACLE_PSFT" ) var mappingDiscoveryJobSummaryResourceTypeEnum = map[string]DiscoveryJobSummaryResourceTypeEnum{ "WEBLOGIC_DOMAIN": DiscoveryJobSummaryResourceTypeWeblogicDomain, "EBS_INSTANCE": DiscoveryJobSummaryResourceTypeEbsInstance, + "SQL_SERVER": DiscoveryJobSummaryResourceTypeSqlServer, + "APACHE_TOMCAT": DiscoveryJobSummaryResourceTypeApacheTomcat, "ORACLE_DATABASE": DiscoveryJobSummaryResourceTypeOracleDatabase, "OCI_ORACLE_DB": DiscoveryJobSummaryResourceTypeOciOracleDb, "OCI_ORACLE_CDB": DiscoveryJobSummaryResourceTypeOciOracleCdb, "OCI_ORACLE_PDB": DiscoveryJobSummaryResourceTypeOciOraclePdb, "HOST": DiscoveryJobSummaryResourceTypeHost, + "ORACLE_PSFT": DiscoveryJobSummaryResourceTypeOraclePsft, } var mappingDiscoveryJobSummaryResourceTypeEnumLowerCase = map[string]DiscoveryJobSummaryResourceTypeEnum{ "weblogic_domain": DiscoveryJobSummaryResourceTypeWeblogicDomain, "ebs_instance": DiscoveryJobSummaryResourceTypeEbsInstance, + "sql_server": DiscoveryJobSummaryResourceTypeSqlServer, + "apache_tomcat": DiscoveryJobSummaryResourceTypeApacheTomcat, "oracle_database": DiscoveryJobSummaryResourceTypeOracleDatabase, "oci_oracle_db": DiscoveryJobSummaryResourceTypeOciOracleDb, "oci_oracle_cdb": DiscoveryJobSummaryResourceTypeOciOracleCdb, "oci_oracle_pdb": DiscoveryJobSummaryResourceTypeOciOraclePdb, "host": DiscoveryJobSummaryResourceTypeHost, + "oracle_psft": DiscoveryJobSummaryResourceTypeOraclePsft, } // GetDiscoveryJobSummaryResourceTypeEnumValues Enumerates the set of values for DiscoveryJobSummaryResourceTypeEnum @@ -140,11 +149,14 @@ func GetDiscoveryJobSummaryResourceTypeEnumStringValues() []string { return []string{ "WEBLOGIC_DOMAIN", "EBS_INSTANCE", + "SQL_SERVER", + "APACHE_TOMCAT", "ORACLE_DATABASE", "OCI_ORACLE_DB", "OCI_ORACLE_CDB", "OCI_ORACLE_PDB", "HOST", + "ORACLE_PSFT", } }