From 5bfe43686ea5ddd523a9b670e46d545c26c07053 Mon Sep 17 00:00:00 2001 From: oci-dex-release-bot Date: Tue, 16 Apr 2024 11:45:42 +0000 Subject: [PATCH] Releasing version 2.125.3 --- CHANGELOG.rst | 21 + docs/api/ai_language.rst | 12 + ...ci.ai_language.models.AssertionDetails.rst | 11 + ....models.BatchDetectHealthEntityDetails.rst | 11 + ...e.models.BatchDetectHealthEntityResult.rst | 11 + .../oci.ai_language.models.HealthEntity.rst | 11 + ...uage.models.HealthEntityDocumentResult.rst | 11 + .../oci.ai_language.models.MelConcept.rst | 11 + ...i.ai_language.models.MelConceptDetails.rst | 11 + ...oci.ai_language.models.PiiModelDetails.rst | 11 + .../models/oci.ai_language.models.Profile.rst | 11 + .../oci.ai_language.models.RelationEntity.rst | 11 + ...ci.ai_language.models.ResolvedEntities.rst | 11 + .../oci.ai_language.models.ResolvedEntity.rst | 11 + docs/api/database.rst | 6 + ...models.AutonomousDatabaseSoftwareImage.rst | 11 + ...onomousDatabaseSoftwareImageCollection.rst | 11 + ...AutonomousDatabaseSoftwareImageSummary.rst | 11 + ...atabaseSoftwareImageCompartmentDetails.rst | 11 + ...AutonomousDatabaseSoftwareImageDetails.rst | 11 + ...AutonomousDatabaseSoftwareImageDetails.rst | 11 + docs/api/generative_ai_inference.rst | 15 + ...ve_ai_inference.models.BaseChatRequest.rst | 11 + ...e_ai_inference.models.BaseChatResponse.rst | 11 + ...erative_ai_inference.models.ChatChoice.rst | 11 + ...rative_ai_inference.models.ChatContent.rst | 11 + ...rative_ai_inference.models.ChatDetails.rst | 11 + ...erative_ai_inference.models.ChatResult.rst | 11 + ...enerative_ai_inference.models.Citation.rst | 11 + ..._ai_inference.models.CohereChatRequest.rst | 11 + ...ai_inference.models.CohereChatResponse.rst | 11 + ...tive_ai_inference.models.CohereMessage.rst | 11 + ...ai_inference.models.GenericChatRequest.rst | 11 + ...i_inference.models.GenericChatResponse.rst | 11 + ...generative_ai_inference.models.Message.rst | 11 + ...rative_ai_inference.models.SearchQuery.rst | 11 + ...rative_ai_inference.models.TextContent.rst | 11 + docs/api/usage_api.rst | 6 + ...dels.CreateEmailRecipientsGroupDetails.rst | 11 + .../oci.usage_api.models.EmailRecipient.rst | 11 + ....usage_api.models.EmailRecipientsGroup.rst | 11 + ....models.EmailRecipientsGroupCollection.rst | 11 + ...api.models.EmailRecipientsGroupSummary.rst | 11 + ...dels.UpdateEmailRecipientsGroupDetails.rst | 11 + examples/showoci/CHANGELOG.rst | 5 + examples/showoci/showoci.py | 2 +- examples/showoci/showoci_data.py | 76 +- examples/showoci/showoci_output.py | 50 +- examples/showoci/showoci_service.py | 82 +- .../ai_language/ai_service_language_client.py | 91 +++ src/oci/ai_language/models/__init__.py | 24 + .../ai_language/models/assertion_details.py | 165 ++++ .../batch_detect_health_entity_details.py | 223 +++++ .../batch_detect_health_entity_result.py | 103 +++ ...ch_detect_language_pii_entities_details.py | 31 +- src/oci/ai_language/models/health_entity.py | 351 ++++++++ .../models/health_entity_document_result.py | 200 +++++ src/oci/ai_language/models/input_location.py | 3 +- src/oci/ai_language/models/mel_concept.py | 103 +++ .../ai_language/models/mel_concept_details.py | 165 ++++ src/oci/ai_language/models/model_details.py | 14 +- .../named_entity_recognition_model_details.py | 2 +- src/oci/ai_language/models/pii_entity.py | 125 ++- .../ai_language/models/pii_model_details.py | 91 +++ .../pre_trained_health_nlu_model_details.py | 2 +- ...ned_key_phrase_extraction_model_details.py | 2 +- ...rained_language_detection_model_details.py | 2 +- ..._named_entity_recognition_model_details.py | 2 +- .../models/pre_trained_pii_model_details.py | 2 +- ...rained_sentiment_analysis_model_details.py | 2 +- .../models/pre_trained_summarization.py | 2 +- ...ained_text_classification_model_details.py | 2 +- .../models/pre_trained_universal_model.py | 2 +- src/oci/ai_language/models/profile.py | 134 +++ src/oci/ai_language/models/relation_entity.py | 196 +++++ .../ai_language/models/resolved_entities.py | 72 ++ src/oci/ai_language/models/resolved_entity.py | 227 ++++++ .../text_classification_model_details.py | 2 +- .../models/instance_configuration.py | 39 +- src/oci/database/database_client.py | 771 +++++++++++++++++- .../database_client_composite_operations.py | 204 +++++ src/oci/database/models/__init__.py | 12 + .../models/autonomous_container_database.py | 31 + .../autonomous_container_database_summary.py | 31 + .../autonomous_database_software_image.py | 489 +++++++++++ ...mous_database_software_image_collection.py | 72 ++ ...onomous_database_software_image_summary.py | 437 ++++++++++ ...base_software_image_compartment_details.py | 76 ++ ...e_autonomous_container_database_details.py | 35 + ...onomous_database_software_image_details.py | 267 ++++++ src/oci/database/models/maintenance_window.py | 35 +- ...onomous_database_software_image_details.py | 119 +++ .../aws_s3_data_transfer_medium_details.py | 31 +- .../models/data_transfer_medium_details_v2.py | 2 +- .../nfs_data_transfer_medium_details.py | 31 +- src/oci/generative_ai/generative_ai_client.py | 4 +- src/oci/generative_ai/models/dataset.py | 2 +- .../models/dedicated_ai_cluster.py | 37 +- src/oci/generative_ai/models/endpoint.py | 27 + src/oci/generative_ai/models/model.py | 37 +- src/oci/generative_ai/models/model_summary.py | 10 +- .../generative_ai_inference_client.py | 98 +++ .../models/__init__.py | 30 + .../models/base_chat_request.py | 109 +++ .../models/base_chat_response.py | 109 +++ .../models/chat_choice.py | 161 ++++ .../models/chat_content.py | 101 +++ .../models/chat_details.py | 126 +++ .../models/chat_result.py | 130 +++ .../models/citation.py | 165 ++++ .../models/cohere_chat_request.py | 443 ++++++++++ .../models/cohere_chat_response.py | 272 ++++++ .../models/cohere_llm_inference_response.py | 2 +- .../models/cohere_message.py | 119 +++ .../models/embed_text_details.py | 4 +- .../models/generic_chat_request.py | 474 +++++++++++ .../models/generic_chat_response.py | 113 +++ .../models/llama_llm_inference_request.py | 4 +- .../models/llama_llm_inference_response.py | 2 +- .../models/llm_inference_response.py | 14 +- .../generative_ai_inference/models/message.py | 103 +++ .../models/search_query.py | 72 ++ .../models/text_content.py | 82 ++ src/oci/opa/models/opa_instance.py | 10 +- src/oci/opa/models/work_request.py | 14 +- src/oci/opa/models/work_request_summary.py | 14 +- src/oci/opa/opa_instance_client.py | 214 ++++- ...pa_instance_client_composite_operations.py | 78 ++ .../models/create_redis_cluster_details.py | 31 + src/oci/redis/models/redis_cluster.py | 31 + src/oci/redis/models/redis_cluster_summary.py | 31 + .../models/update_redis_cluster_details.py | 31 + src/oci/usage_api/models/__init__.py | 12 + .../create_email_recipients_group_details.py | 103 +++ src/oci/usage_api/models/email_recipient.py | 181 ++++ .../models/email_recipients_group.py | 181 ++++ .../email_recipients_group_collection.py | 72 ++ .../models/email_recipients_group_summary.py | 272 ++++++ .../update_email_recipients_group_details.py | 72 ++ src/oci/usage_api/usageapi_client.py | 634 +++++++++++++- .../usageapi_client_composite_operations.py | 96 +++ src/oci/version.py | 2 +- 142 files changed, 10457 insertions(+), 198 deletions(-) create mode 100644 docs/api/ai_language/models/oci.ai_language.models.AssertionDetails.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityDetails.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityResult.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.HealthEntity.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.HealthEntityDocumentResult.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.MelConcept.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.MelConceptDetails.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.PiiModelDetails.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.Profile.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.RelationEntity.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.ResolvedEntities.rst create mode 100644 docs/api/ai_language/models/oci.ai_language.models.ResolvedEntity.rst create mode 100644 docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImage.rst create mode 100644 docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageCollection.rst create mode 100644 docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageSummary.rst create mode 100644 docs/api/database/models/oci.database.models.ChangeAutonomousDatabaseSoftwareImageCompartmentDetails.rst create mode 100644 docs/api/database/models/oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails.rst create mode 100644 docs/api/database/models/oci.database.models.UpdateAutonomousDatabaseSoftwareImageDetails.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatRequest.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatResponse.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatChoice.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatContent.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatDetails.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatResult.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Citation.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatRequest.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatResponse.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereMessage.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatRequest.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatResponse.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Message.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.SearchQuery.rst create mode 100644 docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.TextContent.rst create mode 100644 docs/api/usage_api/models/oci.usage_api.models.CreateEmailRecipientsGroupDetails.rst create mode 100644 docs/api/usage_api/models/oci.usage_api.models.EmailRecipient.rst create mode 100644 docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroup.rst create mode 100644 docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupCollection.rst create mode 100644 docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupSummary.rst create mode 100644 docs/api/usage_api/models/oci.usage_api.models.UpdateEmailRecipientsGroupDetails.rst create mode 100644 src/oci/ai_language/models/assertion_details.py create mode 100644 src/oci/ai_language/models/batch_detect_health_entity_details.py create mode 100644 src/oci/ai_language/models/batch_detect_health_entity_result.py create mode 100644 src/oci/ai_language/models/health_entity.py create mode 100644 src/oci/ai_language/models/health_entity_document_result.py create mode 100644 src/oci/ai_language/models/mel_concept.py create mode 100644 src/oci/ai_language/models/mel_concept_details.py create mode 100644 src/oci/ai_language/models/pii_model_details.py create mode 100644 src/oci/ai_language/models/profile.py create mode 100644 src/oci/ai_language/models/relation_entity.py create mode 100644 src/oci/ai_language/models/resolved_entities.py create mode 100644 src/oci/ai_language/models/resolved_entity.py create mode 100644 src/oci/database/models/autonomous_database_software_image.py create mode 100644 src/oci/database/models/autonomous_database_software_image_collection.py create mode 100644 src/oci/database/models/autonomous_database_software_image_summary.py create mode 100644 src/oci/database/models/change_autonomous_database_software_image_compartment_details.py create mode 100644 src/oci/database/models/create_autonomous_database_software_image_details.py create mode 100644 src/oci/database/models/update_autonomous_database_software_image_details.py create mode 100644 src/oci/generative_ai_inference/models/base_chat_request.py create mode 100644 src/oci/generative_ai_inference/models/base_chat_response.py create mode 100644 src/oci/generative_ai_inference/models/chat_choice.py create mode 100644 src/oci/generative_ai_inference/models/chat_content.py create mode 100644 src/oci/generative_ai_inference/models/chat_details.py create mode 100644 src/oci/generative_ai_inference/models/chat_result.py create mode 100644 src/oci/generative_ai_inference/models/citation.py create mode 100644 src/oci/generative_ai_inference/models/cohere_chat_request.py create mode 100644 src/oci/generative_ai_inference/models/cohere_chat_response.py create mode 100644 src/oci/generative_ai_inference/models/cohere_message.py create mode 100644 src/oci/generative_ai_inference/models/generic_chat_request.py create mode 100644 src/oci/generative_ai_inference/models/generic_chat_response.py create mode 100644 src/oci/generative_ai_inference/models/message.py create mode 100644 src/oci/generative_ai_inference/models/search_query.py create mode 100644 src/oci/generative_ai_inference/models/text_content.py create mode 100644 src/oci/usage_api/models/create_email_recipients_group_details.py create mode 100644 src/oci/usage_api/models/email_recipient.py create mode 100644 src/oci/usage_api/models/email_recipients_group.py create mode 100644 src/oci/usage_api/models/email_recipients_group_collection.py create mode 100644 src/oci/usage_api/models/email_recipients_group_summary.py create mode 100644 src/oci/usage_api/models/update_email_recipients_group_details.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9e89f56c9..25152493b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,27 @@ Change Log All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== +2.125.3 - 2024-04-16 +==================== + + +Added +----- +* Support for calling Oracle Cloud Infrastructure services in the me-abudhabi-3 region +* Support for new Image resource for an Autonomous Database in the Database service +* Support for creating Autonomous Container Database using Autonomous Database Software Image in the Database service +* Support for new dedicated AI cluster unit shape in the Generative AI service +* Support for Chat API for LLM models in the Generative AI service +* Support for network security groups (NSGs) in the Redis service +* Support for custom public egress on model deployments in the Data Science service +* Support for a new data transfer parameter for AWS S3 bucket in the Database Migration service +* Support for Oracle Process Automation instance start and stop operations in the Process Automation service +* Support for healthcare Natural Language Processing (NLP) in the AI Language service +* Support for identification and de-identification of Private Health Information (PHI) service in the AI Language service +* Support for multilingual content for using machine learning models in the AI Language service +* Support for usage statements in cost management in the Usage service + ==================== 2.125.2 - 2024-04-09 ==================== diff --git a/docs/api/ai_language.rst b/docs/api/ai_language.rst index ca5c00666..5751106da 100644 --- a/docs/api/ai_language.rst +++ b/docs/api/ai_language.rst @@ -18,8 +18,11 @@ Ai Language :nosignatures: :template: autosummary/model_class.rst + oci.ai_language.models.AssertionDetails oci.ai_language.models.BatchDetectDominantLanguageDetails oci.ai_language.models.BatchDetectDominantLanguageResult + oci.ai_language.models.BatchDetectHealthEntityDetails + oci.ai_language.models.BatchDetectHealthEntityResult oci.ai_language.models.BatchDetectLanguageEntitiesDetails oci.ai_language.models.BatchDetectLanguageEntitiesResult oci.ai_language.models.BatchDetectLanguageKeyPhrasesDetails @@ -76,6 +79,8 @@ Ai Language oci.ai_language.models.EvaluationResultCollection oci.ai_language.models.EvaluationResultSummary oci.ai_language.models.EvaluationResults + oci.ai_language.models.HealthEntity + oci.ai_language.models.HealthEntityDocumentResult oci.ai_language.models.HierarchicalEntity oci.ai_language.models.InputConfiguration oci.ai_language.models.InputLocation @@ -85,6 +90,8 @@ Ai Language oci.ai_language.models.KeyPhrase oci.ai_language.models.KeyPhraseDocumentResult oci.ai_language.models.LocationDetails + oci.ai_language.models.MelConcept + oci.ai_language.models.MelConceptDetails oci.ai_language.models.Model oci.ai_language.models.ModelCollection oci.ai_language.models.ModelDetails @@ -106,6 +113,7 @@ Ai Language oci.ai_language.models.PiiEntityMasking oci.ai_language.models.PiiEntityRemove oci.ai_language.models.PiiEntityReplace + oci.ai_language.models.PiiModelDetails oci.ai_language.models.PreDeployedLanguageModels oci.ai_language.models.PreTrainedHealthNluModelDetails oci.ai_language.models.PreTrainedKeyPhraseExtractionModelDetails @@ -116,9 +124,13 @@ Ai Language oci.ai_language.models.PreTrainedSummarization oci.ai_language.models.PreTrainedTextClassificationModelDetails oci.ai_language.models.PreTrainedUniversalModel + oci.ai_language.models.Profile oci.ai_language.models.Project oci.ai_language.models.ProjectCollection oci.ai_language.models.ProjectSummary + oci.ai_language.models.RelationEntity + oci.ai_language.models.ResolvedEntities + oci.ai_language.models.ResolvedEntity oci.ai_language.models.SentimentAspect oci.ai_language.models.SentimentDocumentResult oci.ai_language.models.SentimentSentence diff --git a/docs/api/ai_language/models/oci.ai_language.models.AssertionDetails.rst b/docs/api/ai_language/models/oci.ai_language.models.AssertionDetails.rst new file mode 100644 index 000000000..87288ed57 --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.AssertionDetails.rst @@ -0,0 +1,11 @@ +AssertionDetails +================ + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: AssertionDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityDetails.rst b/docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityDetails.rst new file mode 100644 index 000000000..eca3fa950 --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityDetails.rst @@ -0,0 +1,11 @@ +BatchDetectHealthEntityDetails +============================== + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: BatchDetectHealthEntityDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityResult.rst b/docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityResult.rst new file mode 100644 index 000000000..e12e20c01 --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.BatchDetectHealthEntityResult.rst @@ -0,0 +1,11 @@ +BatchDetectHealthEntityResult +============================= + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: BatchDetectHealthEntityResult + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.HealthEntity.rst b/docs/api/ai_language/models/oci.ai_language.models.HealthEntity.rst new file mode 100644 index 000000000..dab522bab --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.HealthEntity.rst @@ -0,0 +1,11 @@ +HealthEntity +============ + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: HealthEntity + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.HealthEntityDocumentResult.rst b/docs/api/ai_language/models/oci.ai_language.models.HealthEntityDocumentResult.rst new file mode 100644 index 000000000..2c7bdeaf5 --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.HealthEntityDocumentResult.rst @@ -0,0 +1,11 @@ +HealthEntityDocumentResult +========================== + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: HealthEntityDocumentResult + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.MelConcept.rst b/docs/api/ai_language/models/oci.ai_language.models.MelConcept.rst new file mode 100644 index 000000000..3bc3b73fd --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.MelConcept.rst @@ -0,0 +1,11 @@ +MelConcept +========== + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: MelConcept + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.MelConceptDetails.rst b/docs/api/ai_language/models/oci.ai_language.models.MelConceptDetails.rst new file mode 100644 index 000000000..082a40c31 --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.MelConceptDetails.rst @@ -0,0 +1,11 @@ +MelConceptDetails +================= + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: MelConceptDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.PiiModelDetails.rst b/docs/api/ai_language/models/oci.ai_language.models.PiiModelDetails.rst new file mode 100644 index 000000000..f4094f032 --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.PiiModelDetails.rst @@ -0,0 +1,11 @@ +PiiModelDetails +=============== + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: PiiModelDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.Profile.rst b/docs/api/ai_language/models/oci.ai_language.models.Profile.rst new file mode 100644 index 000000000..ab70b335e --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.Profile.rst @@ -0,0 +1,11 @@ +Profile +======= + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: Profile + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.RelationEntity.rst b/docs/api/ai_language/models/oci.ai_language.models.RelationEntity.rst new file mode 100644 index 000000000..5cd218d8c --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.RelationEntity.rst @@ -0,0 +1,11 @@ +RelationEntity +============== + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: RelationEntity + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.ResolvedEntities.rst b/docs/api/ai_language/models/oci.ai_language.models.ResolvedEntities.rst new file mode 100644 index 000000000..1e5fe3fa4 --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.ResolvedEntities.rst @@ -0,0 +1,11 @@ +ResolvedEntities +================ + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: ResolvedEntities + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/ai_language/models/oci.ai_language.models.ResolvedEntity.rst b/docs/api/ai_language/models/oci.ai_language.models.ResolvedEntity.rst new file mode 100644 index 000000000..7a31108fa --- /dev/null +++ b/docs/api/ai_language/models/oci.ai_language.models.ResolvedEntity.rst @@ -0,0 +1,11 @@ +ResolvedEntity +============== + +.. currentmodule:: oci.ai_language.models + +.. autoclass:: ResolvedEntity + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/database.rst b/docs/api/database.rst index 226654424..43de78539 100644 --- a/docs/api/database.rst +++ b/docs/api/database.rst @@ -48,6 +48,9 @@ Database oci.database.models.AutonomousDatabaseDataguardAssociation oci.database.models.AutonomousDatabaseKeyHistoryEntry oci.database.models.AutonomousDatabaseManualRefreshDetails + oci.database.models.AutonomousDatabaseSoftwareImage + oci.database.models.AutonomousDatabaseSoftwareImageCollection + oci.database.models.AutonomousDatabaseSoftwareImageSummary oci.database.models.AutonomousDatabaseStandbySummary oci.database.models.AutonomousDatabaseSummary oci.database.models.AutonomousDatabaseWallet @@ -71,6 +74,7 @@ Database oci.database.models.BackupDestinationDetails oci.database.models.BackupDestinationSummary oci.database.models.BackupSummary + oci.database.models.ChangeAutonomousDatabaseSoftwareImageCompartmentDetails oci.database.models.ChangeAutonomousVmClusterCompartmentDetails oci.database.models.ChangeCloudAutonomousVmClusterCompartmentDetails oci.database.models.ChangeCloudExadataInfrastructureCompartmentDetails @@ -114,6 +118,7 @@ Database oci.database.models.CreateAutonomousDatabaseDetails oci.database.models.CreateAutonomousDatabaseFromBackupDetails oci.database.models.CreateAutonomousDatabaseFromBackupTimestampDetails + oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails oci.database.models.CreateAutonomousVmClusterDetails oci.database.models.CreateBackupDestinationDetails oci.database.models.CreateBackupDetails @@ -338,6 +343,7 @@ Database oci.database.models.UpdateAutonomousContainerDatabaseDetails oci.database.models.UpdateAutonomousDatabaseBackupDetails oci.database.models.UpdateAutonomousDatabaseDetails + oci.database.models.UpdateAutonomousDatabaseSoftwareImageDetails oci.database.models.UpdateAutonomousDatabaseWalletDetails oci.database.models.UpdateAutonomousExadataInfrastructureDetails oci.database.models.UpdateAutonomousVmClusterDetails diff --git a/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImage.rst b/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImage.rst new file mode 100644 index 000000000..1cd2e7585 --- /dev/null +++ b/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImage.rst @@ -0,0 +1,11 @@ +AutonomousDatabaseSoftwareImage +=============================== + +.. currentmodule:: oci.database.models + +.. autoclass:: AutonomousDatabaseSoftwareImage + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageCollection.rst b/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageCollection.rst new file mode 100644 index 000000000..9e739df88 --- /dev/null +++ b/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageCollection.rst @@ -0,0 +1,11 @@ +AutonomousDatabaseSoftwareImageCollection +========================================= + +.. currentmodule:: oci.database.models + +.. autoclass:: AutonomousDatabaseSoftwareImageCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageSummary.rst b/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageSummary.rst new file mode 100644 index 000000000..5b9f09e7b --- /dev/null +++ b/docs/api/database/models/oci.database.models.AutonomousDatabaseSoftwareImageSummary.rst @@ -0,0 +1,11 @@ +AutonomousDatabaseSoftwareImageSummary +====================================== + +.. currentmodule:: oci.database.models + +.. autoclass:: AutonomousDatabaseSoftwareImageSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/database/models/oci.database.models.ChangeAutonomousDatabaseSoftwareImageCompartmentDetails.rst b/docs/api/database/models/oci.database.models.ChangeAutonomousDatabaseSoftwareImageCompartmentDetails.rst new file mode 100644 index 000000000..7eb619e24 --- /dev/null +++ b/docs/api/database/models/oci.database.models.ChangeAutonomousDatabaseSoftwareImageCompartmentDetails.rst @@ -0,0 +1,11 @@ +ChangeAutonomousDatabaseSoftwareImageCompartmentDetails +======================================================= + +.. currentmodule:: oci.database.models + +.. autoclass:: ChangeAutonomousDatabaseSoftwareImageCompartmentDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails.rst b/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails.rst new file mode 100644 index 000000000..4fe47191f --- /dev/null +++ b/docs/api/database/models/oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails.rst @@ -0,0 +1,11 @@ +CreateAutonomousDatabaseSoftwareImageDetails +============================================ + +.. currentmodule:: oci.database.models + +.. autoclass:: CreateAutonomousDatabaseSoftwareImageDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/database/models/oci.database.models.UpdateAutonomousDatabaseSoftwareImageDetails.rst b/docs/api/database/models/oci.database.models.UpdateAutonomousDatabaseSoftwareImageDetails.rst new file mode 100644 index 000000000..428411de8 --- /dev/null +++ b/docs/api/database/models/oci.database.models.UpdateAutonomousDatabaseSoftwareImageDetails.rst @@ -0,0 +1,11 @@ +UpdateAutonomousDatabaseSoftwareImageDetails +============================================ + +.. currentmodule:: oci.database.models + +.. autoclass:: UpdateAutonomousDatabaseSoftwareImageDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference.rst b/docs/api/generative_ai_inference.rst index 0a6cbdc19..4111f1762 100644 --- a/docs/api/generative_ai_inference.rst +++ b/docs/api/generative_ai_inference.rst @@ -18,22 +18,37 @@ Generative Ai Inference :nosignatures: :template: autosummary/model_class.rst + oci.generative_ai_inference.models.BaseChatRequest + oci.generative_ai_inference.models.BaseChatResponse + oci.generative_ai_inference.models.ChatChoice + oci.generative_ai_inference.models.ChatContent + oci.generative_ai_inference.models.ChatDetails + oci.generative_ai_inference.models.ChatResult oci.generative_ai_inference.models.Choice + oci.generative_ai_inference.models.Citation + oci.generative_ai_inference.models.CohereChatRequest + oci.generative_ai_inference.models.CohereChatResponse oci.generative_ai_inference.models.CohereLlmInferenceRequest oci.generative_ai_inference.models.CohereLlmInferenceResponse + oci.generative_ai_inference.models.CohereMessage oci.generative_ai_inference.models.DedicatedServingMode oci.generative_ai_inference.models.EmbedTextDetails oci.generative_ai_inference.models.EmbedTextResult oci.generative_ai_inference.models.GenerateTextDetails oci.generative_ai_inference.models.GenerateTextResult oci.generative_ai_inference.models.GeneratedText + oci.generative_ai_inference.models.GenericChatRequest + oci.generative_ai_inference.models.GenericChatResponse oci.generative_ai_inference.models.LlamaLlmInferenceRequest oci.generative_ai_inference.models.LlamaLlmInferenceResponse oci.generative_ai_inference.models.LlmInferenceRequest oci.generative_ai_inference.models.LlmInferenceResponse oci.generative_ai_inference.models.Logprobs + oci.generative_ai_inference.models.Message oci.generative_ai_inference.models.OnDemandServingMode + oci.generative_ai_inference.models.SearchQuery oci.generative_ai_inference.models.ServingMode oci.generative_ai_inference.models.SummarizeTextDetails oci.generative_ai_inference.models.SummarizeTextResult + oci.generative_ai_inference.models.TextContent oci.generative_ai_inference.models.TokenLikelihood diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatRequest.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatRequest.rst new file mode 100644 index 000000000..d77e74655 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatRequest.rst @@ -0,0 +1,11 @@ +BaseChatRequest +=============== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: BaseChatRequest + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatResponse.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatResponse.rst new file mode 100644 index 000000000..26a3e561a --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.BaseChatResponse.rst @@ -0,0 +1,11 @@ +BaseChatResponse +================ + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: BaseChatResponse + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatChoice.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatChoice.rst new file mode 100644 index 000000000..4100b906d --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatChoice.rst @@ -0,0 +1,11 @@ +ChatChoice +========== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: ChatChoice + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatContent.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatContent.rst new file mode 100644 index 000000000..690b6ec69 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatContent.rst @@ -0,0 +1,11 @@ +ChatContent +=========== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: ChatContent + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatDetails.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatDetails.rst new file mode 100644 index 000000000..dfda9878d --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatDetails.rst @@ -0,0 +1,11 @@ +ChatDetails +=========== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: ChatDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatResult.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatResult.rst new file mode 100644 index 000000000..dc26de7ef --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.ChatResult.rst @@ -0,0 +1,11 @@ +ChatResult +========== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: ChatResult + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Citation.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Citation.rst new file mode 100644 index 000000000..ed4fa01f7 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Citation.rst @@ -0,0 +1,11 @@ +Citation +======== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: Citation + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatRequest.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatRequest.rst new file mode 100644 index 000000000..bda526525 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatRequest.rst @@ -0,0 +1,11 @@ +CohereChatRequest +================= + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: CohereChatRequest + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatResponse.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatResponse.rst new file mode 100644 index 000000000..4d2047298 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereChatResponse.rst @@ -0,0 +1,11 @@ +CohereChatResponse +================== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: CohereChatResponse + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereMessage.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereMessage.rst new file mode 100644 index 000000000..7dceb841d --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.CohereMessage.rst @@ -0,0 +1,11 @@ +CohereMessage +============= + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: CohereMessage + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatRequest.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatRequest.rst new file mode 100644 index 000000000..bf214fa95 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatRequest.rst @@ -0,0 +1,11 @@ +GenericChatRequest +================== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: GenericChatRequest + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatResponse.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatResponse.rst new file mode 100644 index 000000000..f2abfba1e --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.GenericChatResponse.rst @@ -0,0 +1,11 @@ +GenericChatResponse +=================== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: GenericChatResponse + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Message.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Message.rst new file mode 100644 index 000000000..3b69b6473 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.Message.rst @@ -0,0 +1,11 @@ +Message +======= + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: Message + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.SearchQuery.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.SearchQuery.rst new file mode 100644 index 000000000..e5dab5155 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.SearchQuery.rst @@ -0,0 +1,11 @@ +SearchQuery +=========== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: SearchQuery + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.TextContent.rst b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.TextContent.rst new file mode 100644 index 000000000..e378bf4c5 --- /dev/null +++ b/docs/api/generative_ai_inference/models/oci.generative_ai_inference.models.TextContent.rst @@ -0,0 +1,11 @@ +TextContent +=========== + +.. currentmodule:: oci.generative_ai_inference.models + +.. autoclass:: TextContent + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/usage_api.rst b/docs/api/usage_api.rst index 7867c6cf8..db524724e 100644 --- a/docs/api/usage_api.rst +++ b/docs/api/usage_api.rst @@ -24,6 +24,7 @@ Usage Api oci.usage_api.models.ConfigurationAggregation oci.usage_api.models.CostAnalysisUI oci.usage_api.models.CreateCustomTableDetails + oci.usage_api.models.CreateEmailRecipientsGroupDetails oci.usage_api.models.CreateQueryDetails oci.usage_api.models.CreateScheduleDetails oci.usage_api.models.CreateUsageCarbonEmissionsQueryDetails @@ -33,6 +34,10 @@ Usage Api oci.usage_api.models.DateRange oci.usage_api.models.Dimension oci.usage_api.models.DynamicDateRange + oci.usage_api.models.EmailRecipient + oci.usage_api.models.EmailRecipientsGroup + oci.usage_api.models.EmailRecipientsGroupCollection + oci.usage_api.models.EmailRecipientsGroupSummary oci.usage_api.models.Filter oci.usage_api.models.Forecast oci.usage_api.models.ObjectStorageLocation @@ -55,6 +60,7 @@ Usage Api oci.usage_api.models.StaticDateRange oci.usage_api.models.Tag oci.usage_api.models.UpdateCustomTableDetails + oci.usage_api.models.UpdateEmailRecipientsGroupDetails oci.usage_api.models.UpdateQueryDetails oci.usage_api.models.UpdateScheduleDetails oci.usage_api.models.UpdateUsageCarbonEmissionsQueryDetails diff --git a/docs/api/usage_api/models/oci.usage_api.models.CreateEmailRecipientsGroupDetails.rst b/docs/api/usage_api/models/oci.usage_api.models.CreateEmailRecipientsGroupDetails.rst new file mode 100644 index 000000000..179963729 --- /dev/null +++ b/docs/api/usage_api/models/oci.usage_api.models.CreateEmailRecipientsGroupDetails.rst @@ -0,0 +1,11 @@ +CreateEmailRecipientsGroupDetails +================================= + +.. currentmodule:: oci.usage_api.models + +.. autoclass:: CreateEmailRecipientsGroupDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/usage_api/models/oci.usage_api.models.EmailRecipient.rst b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipient.rst new file mode 100644 index 000000000..a74690398 --- /dev/null +++ b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipient.rst @@ -0,0 +1,11 @@ +EmailRecipient +============== + +.. currentmodule:: oci.usage_api.models + +.. autoclass:: EmailRecipient + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroup.rst b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroup.rst new file mode 100644 index 000000000..dba001def --- /dev/null +++ b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroup.rst @@ -0,0 +1,11 @@ +EmailRecipientsGroup +==================== + +.. currentmodule:: oci.usage_api.models + +.. autoclass:: EmailRecipientsGroup + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupCollection.rst b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupCollection.rst new file mode 100644 index 000000000..62d8b5e2e --- /dev/null +++ b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupCollection.rst @@ -0,0 +1,11 @@ +EmailRecipientsGroupCollection +============================== + +.. currentmodule:: oci.usage_api.models + +.. autoclass:: EmailRecipientsGroupCollection + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupSummary.rst b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupSummary.rst new file mode 100644 index 000000000..4c1e72ac2 --- /dev/null +++ b/docs/api/usage_api/models/oci.usage_api.models.EmailRecipientsGroupSummary.rst @@ -0,0 +1,11 @@ +EmailRecipientsGroupSummary +=========================== + +.. currentmodule:: oci.usage_api.models + +.. autoclass:: EmailRecipientsGroupSummary + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/docs/api/usage_api/models/oci.usage_api.models.UpdateEmailRecipientsGroupDetails.rst b/docs/api/usage_api/models/oci.usage_api.models.UpdateEmailRecipientsGroupDetails.rst new file mode 100644 index 000000000..984759fe0 --- /dev/null +++ b/docs/api/usage_api/models/oci.usage_api.models.UpdateEmailRecipientsGroupDetails.rst @@ -0,0 +1,11 @@ +UpdateEmailRecipientsGroupDetails +================================= + +.. currentmodule:: oci.usage_api.models + +.. autoclass:: UpdateEmailRecipientsGroupDetails + :show-inheritance: + :special-members: __init__ + :members: + :undoc-members: + :inherited-members: \ No newline at end of file diff --git a/examples/showoci/CHANGELOG.rst b/examples/showoci/CHANGELOG.rst index b82e33830..03b6fc721 100644 --- a/examples/showoci/CHANGELOG.rst +++ b/examples/showoci/CHANGELOG.rst @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +===================== +24.04.16 - 24.04.16 +===================== +* Added more details to DBNode of database areas + ===================== 24.04.09 - 24.04.09 ===================== diff --git a/examples/showoci/showoci.py b/examples/showoci/showoci.py index 681ea2269..2d4ac62c3 100644 --- a/examples/showoci/showoci.py +++ b/examples/showoci/showoci.py @@ -128,7 +128,7 @@ import os import time -version = "24.04.09" +version = "24.04.16" ########################################################################## # check OCI version diff --git a/examples/showoci/showoci_data.py b/examples/showoci/showoci_data.py index 1bae499a0..17c9a3faf 100644 --- a/examples/showoci/showoci_data.py +++ b/examples/showoci/showoci_data.py @@ -20,7 +20,7 @@ class ShowOCIData(object): - version = "24.04.09" + version = "24.04.16" ############################################ # ShowOCIService - Service object to query @@ -2192,12 +2192,17 @@ def __get_database_db_nodes(self, db_nodes): try: for db_node in db_nodes: - vnic_desc = "" + ip_desc = "" nsg_names = "" nsg_ids = "" + if 'host_ip' in db_node: + if db_node['host_ip']: + ip_desc = " - " + db_node['host_ip'] + if 'vnic_details' in db_node: - if 'dbdesc' in db_node['vnic_details']: - vnic_desc = " - " + db_node['vnic_details']['dbdesc'] + + if 'dbdesc' in db_node['vnic_details'] and not ip_desc: + ip_desc = " - " + db_node['vnic_details']['dbdesc'] if 'nsg_names' in db_node['vnic_details']: nsg_names = db_node['vnic_details']['nsg_names'] @@ -2205,26 +2210,39 @@ def __get_database_db_nodes(self, db_nodes): if 'nsg_ids' in db_node['vnic_details']: nsg_ids = db_node['vnic_details']['nsg_ids'] - value = {'desc': "", - 'software_storage_size_in_gb': db_node['software_storage_size_in_gb'], - 'lifecycle_state': db_node['lifecycle_state'], - 'hostname': db_node['hostname'], - 'nsg_names': nsg_names, - 'nsg_ids': nsg_ids, - 'vnic_id': db_node['vnic_id'], - 'backup_vnic_id': ("" if db_node['backup_vnic_id'] == "None" else db_node['backup_vnic_id']), - 'vnic_details': db_node['vnic_details'], - 'backup_vnic_details': db_node['backup_vnic_details'], - 'maintenance_type': db_node['maintenance_type'], - 'time_maintenance_window_start': db_node['time_maintenance_window_start'], - 'time_maintenance_window_end': db_node['time_maintenance_window_end'], - 'fault_domain': ("" if db_node['fault_domain'] == "None" else db_node['fault_domain']), - 'cpu_core_count': db_node['cpu_core_count'], - 'memory_size_in_gbs': db_node['memory_size_in_gbs'], - 'db_node_storage_size_in_gbs': db_node['db_node_storage_size_in_gbs'], - 'db_server_id': str(db_node['db_server_id']), - 'db_server_name': "" - } + value = { + 'desc': "", + 'software_storage_size_in_gb': db_node['software_storage_size_in_gb'], + 'lifecycle_state': db_node['lifecycle_state'], + 'hostname': db_node['hostname'], + 'nsg_names': nsg_names, + 'nsg_ids': nsg_ids, + 'vnic_id': db_node['vnic_id'], + 'backup_vnic_id': db_node['backup_vnic_id'], + 'vnic_details': db_node['vnic_details'], + 'backup_vnic_details': db_node['backup_vnic_details'], + 'maintenance_type': db_node['maintenance_type'], + 'time_maintenance_window_start': db_node['time_maintenance_window_start'], + 'time_maintenance_window_end': db_node['time_maintenance_window_end'], + 'fault_domain': db_node['fault_domain'], + 'cpu_core_count': db_node['cpu_core_count'], + 'memory_size_in_gbs': db_node['memory_size_in_gbs'], + 'db_node_storage_size_in_gbs': db_node['db_node_storage_size_in_gbs'], + 'db_server_id': str(db_node['db_server_id']), + 'db_server_name': "", + # Added 4/5/2024 + 'host_ip_id': db_node['host_ip_id'], + 'host_ip': db_node['host_ip'], + 'backup_ip_id': db_node['backup_ip_id'], + 'backup_ip': db_node['backup_ip'], + 'vnic2_id': db_node['vnic2_id'], + 'vnic2_details': db_node['vnic2_details'], + 'backup_vnic2_id': db_node['backup_vnic2_id'], + 'backup_vnic2_details': db_node['backup_vnic2_details'], + 'time_created': db_node['time_created'], + 'defined_tags': db_node['defined_tags'], + 'freeform_tags': db_node['freeform_tags'] + } # get db server name dbserver_info = "" @@ -2236,18 +2254,18 @@ def __get_database_db_nodes(self, db_nodes): # cpu + mem cpu_info = "" - if db_node['cpu_core_count'] != 'None': + if db_node['cpu_core_count']: cpu_info = " - Cores: " + db_node['cpu_core_count'] - if db_node['memory_size_in_gbs'] != 'None': + if db_node['memory_size_in_gbs']: cpu_info += " - Mem: " + db_node['memory_size_in_gbs'] - if db_node['db_node_storage_size_in_gbs'] != 'None': + if db_node['db_node_storage_size_in_gbs']: cpu_info += " - Disk: " + db_node['db_node_storage_size_in_gbs'] lifecycle = (" - " + str(db_node['lifecycle_state'])) if db_node['lifecycle_state'] else "" - fault_domain = ("" if db_node['fault_domain'] == "None" else " - " + str(db_node['fault_domain'])) + fault_domain = ("" if db_node['fault_domain'] == "" else " - " + str(db_node['fault_domain'])) # desc - value['desc'] = str(db_node['hostname']) + dbserver_info + lifecycle + cpu_info + vnic_desc + fault_domain + value['desc'] = str(db_node['hostname']) + dbserver_info + lifecycle + cpu_info + ip_desc + fault_domain + " - " + db_node['time_created'] data.append(value) diff --git a/examples/showoci/showoci_output.py b/examples/showoci/showoci_output.py index 171fd83f7..195ad4a98 100644 --- a/examples/showoci/showoci_output.py +++ b/examples/showoci/showoci_output.py @@ -22,7 +22,7 @@ class ShowOCIOutput(object): - version = "24.04.09" + version = "24.04.16" ########################################################################## # spaces for align @@ -269,26 +269,32 @@ def __print_identity_domains_users(self, domain_name, users): header = domain_name + ":Users" self.print_header(header, 2) + # Calculate ljust for printout aligned + ljust_value = 0 for user in users: - last_login = ", Last Login = " + user['ext_user_state']['last_successful_login_date'] if user['ext_user_state']['last_successful_login_date'] else "" - mfa_enabled = "" if user['ext_mfa']['mfa_enabled_on'] == "False" else ", MFA Enabled" - print(self.taba + str(user['user_name']) + " (" + str(user['family_name']) + " " + str(user['given_name']) + ")" + mfa_enabled + last_login) + val = len(user['user_name'] + user['family_name'] + user['given_name']) + 2 + ljust_value = val if val > ljust_value else ljust_value + ljust_value = 50 if ljust_value > 50 else ljust_value - if user['groups']: - print(self.tabs + "Groups : " + ', '.join(x['display'] for x in user['groups'])) + for user in users: + username = user['user_name'] + family_name = user['family_name'] if user['family_name'] != username else "" + given_name = user['given_name'] if user['given_name'] != username else "" + family_given_name = (" (" + family_name + " " + given_name + ")") if family_name or given_name else "" - api_keys = "API Keys: " + str(len(user['api_keys'])) if user['api_keys'] else "" - roles = " Roles: " + str(len(user['roles'])) if user['roles'] else "" - customer_secret_keys = " Secrets: " + str(len(user['customer_secret_keys'])) if user['customer_secret_keys'] else "" - auth_tokens = " Auth Tokens: " + str(len(user['auth_tokens'])) if user['auth_tokens'] else "" - smtp_credentials = " SMTP Cred: " + str(len(user['smtp_credentials'])) if user['smtp_credentials'] else "" - o_auth2_client_credentials = " OAuth: " + str(len(user['o_auth2_client_credentials'])) if user['o_auth2_client_credentials'] else "" - db_credentials = " DB Cred: " + str(len(user['db_credentials'])) if user['db_credentials'] else "" + last_login = ", Last Login = " + user['ext_user_state']['last_successful_login_date'] if user['ext_user_state']['last_successful_login_date'] else ", Last Login = None " + mfa_enabled = "" if user['ext_mfa']['mfa_enabled_on'] == "False" else ", MFA Enabled" - if user['api_keys'] and user['roles'] and user['customer_secret_keys'] and user['auth_tokens'] and user['smtp_credentials'] and user['o_auth2_client_credentials'] and user['db_credentials']: - print(self.tabs + "Keys : " + api_keys + roles + customer_secret_keys + auth_tokens + smtp_credentials + o_auth2_client_credentials + db_credentials) + groups = (", Groups: " + ', '.join(x['display'] for x in user['groups'])) if user['groups'] else "" + api_keys = ", API: " + str(len(user['api_keys'])) if user['api_keys'] else "" + roles = ", Roles: " + str(len(user['roles'])) if user['roles'] else "" + customer_secret_keys = ", Secrets: " + str(len(user['customer_secret_keys'])) if user['customer_secret_keys'] else "" + auth_tokens = ", AuthToken: " + str(len(user['auth_tokens'])) if user['auth_tokens'] else "" + smtp_credentials = ", SMTP: " + str(len(user['smtp_credentials'])) if user['smtp_credentials'] else "" + o_auth2_client_credentials = ", OAuth: " + str(len(user['o_auth2_client_credentials'])) if user['o_auth2_client_credentials'] else "" + db_credentials = ", DBCred: " + str(len(user['db_credentials'])) if user['db_credentials'] else "" - print("") + print(self.taba + (username + family_given_name).ljust(ljust_value) + last_login + mfa_enabled + api_keys + roles + customer_secret_keys + auth_tokens + smtp_credentials + o_auth2_client_credentials + db_credentials + groups) except Exception as e: self.__print_error("__print_identity_domains_users", e) @@ -305,7 +311,6 @@ def __print_identity_domains_groups(self, domain_name, groups): print(self.taba + val['display_name'] + " (" + val['ext_group']['description'] + ")") if val['members']: print(self.tabs + "Users : " + ', '.join(x['name'] for x in val['members'])) - print("") except Exception as e: self.__print_error("__print_identity_domains_groups", e) @@ -1295,7 +1300,7 @@ def __print_database_db_exadata_infra(self, list_exadata): if 'time_maintenance_window_start' in db_node: if db_node['maintenance_type'] != "None": - print(self.tabs + self.tabs + " Maintenance: " + db_node['maintenance_type'] + " " + db_node['time_maintenance_window_start'][0:16] + " - " + db_node['time_maintenance_window_end'][0:16]) + print(self.tabs + self.tabs + " Maintenance: " + db_node['maintenance_type'] + " " + db_node['time_maintenance_window_start'][0:16] + " - " + db_node['time_maintenance_window_end'][0:16]) # db homes for db_home in vm['db_homes']: @@ -1316,7 +1321,7 @@ def __print_database_db_exadata_infra(self, list_exadata): # print backups for backup in db['backups']: - print(self.tabs + self.tabs + " " + backup['name'] + " - " + backup['time'] + " - " + backup['size']) + print(self.tabs + self.tabs + " " + backup['name'] + " - " + backup['time'] + " - " + backup['size']) print(self.tabs + " : " + '-' * 90) @@ -1453,7 +1458,7 @@ def __print_database_db_exacc_infra(self, list_exadata): if 'time_maintenance_window_start' in db_node: if db_node['maintenance_type'] != "None": - print(self.tabs + self.tabs + " Maintenance: " + db_node['maintenance_type'] + " " + db_node['time_maintenance_window_start'][0:16] + " - " + db_node['time_maintenance_window_end'][0:16]) + print(self.tabs + self.tabs + " Maintenance: " + db_node['maintenance_type'] + " " + db_node['time_maintenance_window_start'][0:16] + " - " + db_node['time_maintenance_window_end'][0:16]) # db homes for db_home in vm['db_homes']: @@ -1570,7 +1575,8 @@ def __print_database_db_system_details(self, dbs): print(self.tabs + "Port : " + dbs['listener_port']) if 'cluster_name' in dbs: - print(self.tabs + "Cluster : " + dbs['cluster_name']) + if dbs['cluster_name']: + print(self.tabs + "Cluster : " + dbs['cluster_name']) if 'patches' in dbs: for p in dbs['patches']: @@ -1618,7 +1624,7 @@ def __print_database_db_system(self, list_db_systems): if 'time_maintenance_window_start' in db_node: if db_node['maintenance_type'] != "None": - print(self.tabs + self.tabs + " Maintenance: " + db_node['maintenance_type'] + " " + db_node['time_maintenance_window_start'][0:16] + " - " + db_node['time_maintenance_window_end'][0:16]) + print(self.tabs + self.tabs + " Maintenance: " + db_node['maintenance_type'] + " " + db_node['time_maintenance_window_start'][0:16] + " - " + db_node['time_maintenance_window_end'][0:16]) # db homes for db_home in dbs['db_homes']: diff --git a/examples/showoci/showoci_service.py b/examples/showoci/showoci_service.py index a806e4e5e..b57df5f72 100644 --- a/examples/showoci/showoci_service.py +++ b/examples/showoci/showoci_service.py @@ -39,9 +39,10 @@ # class ShowOCIService ########################################################################## class ShowOCIService(object): - version = "24.04.09" + version = "24.04.16" oci_compatible_version = "2.125.0" thread_lock = threading.Lock() + collection_ljust = 40 ########################################################################## # Global Constants @@ -1192,7 +1193,7 @@ def __initialize_data_key(self, module, section): ########################################################################## def __load_print_status_with_threads(self, msg): if self.flags.skip_threads: - print("--> " + msg.ljust(32) + "<-- ", end="") + print("--> " + msg.ljust(self.collection_ljust) + "<-- ", end="") ########################################################################## # Print Section Time @@ -1375,7 +1376,7 @@ def __load_print_thread_exclude(self, header, msg="excluded"): else: # lock for printing with self.thread_lock: - print("--> " + header.ljust(32) + "<-- " + msg) + print("--> " + header.ljust(self.collection_ljust) + "<-- " + msg) ########################################################################## # print count result for Thread @@ -1391,7 +1392,7 @@ def __load_print_thread_cnt(self, header, cnt, start_time, errstr): else: # lock for printing with self.thread_lock: - str1 = "--> " + header.ljust(32) + "<-- " + str1 = "--> " + header.ljust(self.collection_ljust) + "<-- " str2 = str_cnt + " - " + str_time + ((" - " + errstr) if errstr else '') print(str1 + str2) @@ -9907,23 +9908,39 @@ def __load_database_dbsystems_dbnodes(self, database_client, virtual_network, co # db_node = oci.database.models.DbNodeSummary for db_node in db_nodes: - data.append( - {'id': str(db_node.id), - 'hostname': str(db_node.hostname), - 'fault_domain': str(db_node.fault_domain), - 'lifecycle_state': str(db_node.lifecycle_state), - 'vnic_id': str(db_node.vnic_id), - 'backup_vnic_id': str(db_node.backup_vnic_id), - 'cpu_core_count': str(db_node.cpu_core_count), - 'memory_size_in_gbs': str(db_node.memory_size_in_gbs), - 'db_node_storage_size_in_gbs': str(db_node.db_node_storage_size_in_gbs), - 'db_server_id': str(db_node.db_server_id), - 'maintenance_type': str(db_node.maintenance_type), - 'time_maintenance_window_start': str(db_node.time_maintenance_window_start), - 'time_maintenance_window_end': str(db_node.time_maintenance_window_end), - 'vnic_details': self.__load_core_compute_vnic(virtual_network, db_node.vnic_id, compartment), - 'backup_vnic_details': self.__load_core_compute_vnic(virtual_network, db_node.backup_vnic_id, compartment), - 'software_storage_size_in_gb': str(db_node.software_storage_size_in_gb)}) + var = { + 'id': self.get_value(db_node.id), + 'hostname': self.get_value(db_node.hostname), + 'fault_domain': self.get_value(db_node.fault_domain), + 'lifecycle_state': self.get_value(db_node.lifecycle_state), + 'vnic_id': self.get_value(db_node.vnic_id), + 'backup_vnic_id': self.get_value(db_node.backup_vnic_id), + 'cpu_core_count': self.get_value(db_node.cpu_core_count), + 'memory_size_in_gbs': self.get_value(db_node.memory_size_in_gbs), + 'db_node_storage_size_in_gbs': self.get_value(db_node.db_node_storage_size_in_gbs), + 'db_server_id': self.get_value(db_node.db_server_id), + 'maintenance_type': self.get_value(db_node.maintenance_type), + 'time_maintenance_window_start': self.get_value(db_node.time_maintenance_window_start), + 'time_maintenance_window_end': self.get_value(db_node.time_maintenance_window_end), + 'vnic_details': self.__load_core_compute_vnic(virtual_network, db_node.vnic_id, compartment), + 'backup_vnic_details': self.__load_core_compute_vnic(virtual_network, db_node.backup_vnic_id, compartment), + 'software_storage_size_in_gb': str(db_node.software_storage_size_in_gb), + # Added 4/5/2024 + 'host_ip_id': self.get_value(db_node.host_ip_id), + 'host_ip': self.__load_core_network_single_privateip(virtual_network, db_node.host_ip_id), + 'backup_ip_id': self.get_value(db_node.backup_ip_id), + 'backup_ip': self.__load_core_network_single_privateip(virtual_network, db_node.backup_ip_id), + 'vnic2_id': self.get_value(db_node.vnic2_id), + 'vnic2_details': self.__load_core_compute_vnic(virtual_network, db_node.vnic2_id, compartment), + 'backup_vnic2_id': self.get_value(db_node.backup_vnic2_id), + 'backup_vnic2_details': self.__load_core_compute_vnic(virtual_network, db_node.backup_vnic2_id, compartment), + 'time_created': self.get_value(db_node.time_created, trim_date=True), + 'additional_details': self.get_value(db_node.additional_details), + 'defined_tags': [] if db_node.defined_tags is None else db_node.defined_tags, + 'freeform_tags': [] if db_node.freeform_tags is None else db_node.freeform_tags + } + + data.append(var) # mark reboot migration flag if db_node.maintenance_type is not None: @@ -18912,6 +18929,7 @@ class ShowOCIDomains(object): skip_identity_user_credential = False skip_threads = False thread_lock = threading.Lock() + collection_ljust = 40 ########################################################################## # init class @@ -19108,7 +19126,7 @@ def __load_print_thread_cnt(self, header, cnt, start_time, errstr): else: # lock for printing with self.thread_lock: - str1 = "--> " + header.ljust(32) + "<-- " + errstr + str1 = "--> " + header.ljust(self.collection_ljust) + "<-- " + errstr str2 = str_cnt + " - " + str_time print(str1 + str2) @@ -19117,7 +19135,7 @@ def __load_print_thread_cnt(self, header, cnt, start_time, errstr): ########################################################################## def __load_print_status_with_threads(self, msg): if self.skip_threads: - print("--> " + msg.ljust(32) + "<-- ", end="") + print("--> " + msg.ljust(self.collection_ljust) + "<-- ", end="") # else: # print("=== Running " + msg + "...") @@ -19357,7 +19375,7 @@ def __load_identity_domain_users(self, identity_domain_client, domain_name): data = [] errstr = "" - header = domain_name[0:10] + ".Users" + header = domain_name[0:21] + ".Users" self.__load_print_status_with_threads(header) start_time = time.time() @@ -19399,8 +19417,8 @@ def __load_identity_domain_users(self, identity_domain_client, domain_name): 'idcs_prevented_operations': str(','.join(x for x in var.idcs_prevented_operations)) if var.idcs_prevented_operations else "", 'idcs_created_by': var.idcs_created_by.value if var.idcs_created_by else "", 'idcs_last_modified_by': var.idcs_last_modified_by.value if var.idcs_last_modified_by else "", - 'family_name': var.name.family_name if var.name else "", - 'given_name': var.name.given_name if var.name else "", + 'family_name': self.get_value(var.name.family_name) if var.name else "", + 'given_name': self.get_value(var.name.given_name) if var.name else "", 'tags': [{'key': x.key, 'value': x.value} for x in var.tags] if var.tags else [], 'freeform_tags': self.__get_tags(var.urn_ietf_params_scim_schemas_oracle_idcs_extension_oci_tags, False), 'defined_tags': self.__get_tags(var.urn_ietf_params_scim_schemas_oracle_idcs_extension_oci_tags, True), @@ -19794,7 +19812,7 @@ def __load_identity_domain_groups(self, identity_domain_client, domain_name): data = [] errstr = "" - header = domain_name[0:10] + ".Groups" + header = domain_name[0:21] + ".Groups" self.__load_print_status_with_threads(header) start_time = time.time() @@ -19889,7 +19907,7 @@ def __load_identity_domain_dynamic_resource_groups(self, identity_domain_client, data = [] errstr = "" - header = domain_name[0:10] + ".Dynamic Groups" + header = domain_name[0:21] + ".Dynamic Groups" self.__load_print_status_with_threads(header) start_time = time.time() @@ -19967,7 +19985,7 @@ def __load_identity_domain_identity_providers(self, identity_domain_client, doma data = [] errstr = "" - header = domain_name[0:10] + ".IDPs" + header = domain_name[0:21] + ".IDPs" self.__load_print_status_with_threads(header) start_time = time.time() @@ -20109,7 +20127,7 @@ def __load_identity_domain_kmsi_setting(self, identity_domain_client, domain_nam data = [] errstr = "" - header = domain_name[0:10] + ".Kmsi Setting" + header = domain_name[0:21] + ".Kmsi Setting" self.__load_print_status_with_threads(header) start_time = time.time() @@ -20174,7 +20192,7 @@ def __load_identity_domain_authentication_factor_settings(self, identity_domain_ data = [] errstr = "" - header = domain_name[0:10] + ".AuthN Factors" + header = domain_name[0:21] + ".AuthN Factors" self.__load_print_status_with_threads(header) start_time = time.time() @@ -20313,7 +20331,7 @@ def __load_identity_domain_password_policies(self, identity_domain_client, domai data = [] errstr = "" - header = domain_name[0:10] + ".Password Policies" + header = domain_name[0:21] + ".Password Policies" self.__load_print_status_with_threads(header) start_time = time.time() diff --git a/src/oci/ai_language/ai_service_language_client.py b/src/oci/ai_language/ai_service_language_client.py index 8711ba77c..ccc0a2f06 100644 --- a/src/oci/ai_language/ai_service_language_client.py +++ b/src/oci/ai_language/ai_service_language_client.py @@ -213,6 +213,97 @@ def batch_detect_dominant_language(self, batch_detect_dominant_language_details, api_reference_link=api_reference_link, required_arguments=required_arguments) + def batch_detect_health_entity(self, batch_detect_health_entity_details, **kwargs): + """ + The API extracts health entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned. It supports passing a batch of records. + + Limitations: + - A batch may have up to 100 records. + - A record may be up to 5000 characters long. + - The total of characters to process in a request can be up to 20,000 characters. + + + :param oci.ai_language.models.BatchDetectHealthEntityDetails batch_detect_health_entity_details: (required) + The details to make a health entity detect call. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.ai_language.models.BatchDetectHealthEntityResult` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use batch_detect_health_entity API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = [] + resource_path = "/actions/batchDetectHealthEntities" + method = "POST" + operation_name = "batch_detect_health_entity" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/language/20221001/BatchDetectHealthEntityDetails/BatchDetectHealthEntity" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"batch_detect_health_entity got unknown kwargs: {extra_kwargs!r}") + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=batch_detect_health_entity_details, + response_type="BatchDetectHealthEntityResult", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=batch_detect_health_entity_details, + response_type="BatchDetectHealthEntityResult", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def batch_detect_language_entities(self, batch_detect_language_entities_details, **kwargs): """ The API extracts entities in text records. For each entity, its type/subtype and confidence score (between 0 and 1) is returned. It supports passing a batch of records. diff --git a/src/oci/ai_language/models/__init__.py b/src/oci/ai_language/models/__init__.py index cb818024d..67f8a361e 100644 --- a/src/oci/ai_language/models/__init__.py +++ b/src/oci/ai_language/models/__init__.py @@ -6,8 +6,11 @@ from __future__ import absolute_import +from .assertion_details import AssertionDetails from .batch_detect_dominant_language_details import BatchDetectDominantLanguageDetails from .batch_detect_dominant_language_result import BatchDetectDominantLanguageResult +from .batch_detect_health_entity_details import BatchDetectHealthEntityDetails +from .batch_detect_health_entity_result import BatchDetectHealthEntityResult from .batch_detect_language_entities_details import BatchDetectLanguageEntitiesDetails from .batch_detect_language_entities_result import BatchDetectLanguageEntitiesResult from .batch_detect_language_key_phrases_details import BatchDetectLanguageKeyPhrasesDetails @@ -64,6 +67,8 @@ from .evaluation_result_collection import EvaluationResultCollection from .evaluation_result_summary import EvaluationResultSummary from .evaluation_results import EvaluationResults +from .health_entity import HealthEntity +from .health_entity_document_result import HealthEntityDocumentResult from .hierarchical_entity import HierarchicalEntity from .input_configuration import InputConfiguration from .input_location import InputLocation @@ -73,6 +78,8 @@ from .key_phrase import KeyPhrase from .key_phrase_document_result import KeyPhraseDocumentResult from .location_details import LocationDetails +from .mel_concept import MelConcept +from .mel_concept_details import MelConceptDetails from .model import Model from .model_collection import ModelCollection from .model_details import ModelDetails @@ -94,6 +101,7 @@ from .pii_entity_masking import PiiEntityMasking from .pii_entity_remove import PiiEntityRemove from .pii_entity_replace import PiiEntityReplace +from .pii_model_details import PiiModelDetails from .pre_deployed_language_models import PreDeployedLanguageModels from .pre_trained_health_nlu_model_details import PreTrainedHealthNluModelDetails from .pre_trained_key_phrase_extraction_model_details import PreTrainedKeyPhraseExtractionModelDetails @@ -104,9 +112,13 @@ from .pre_trained_summarization import PreTrainedSummarization from .pre_trained_text_classification_model_details import PreTrainedTextClassificationModelDetails from .pre_trained_universal_model import PreTrainedUniversalModel +from .profile import Profile from .project import Project from .project_collection import ProjectCollection from .project_summary import ProjectSummary +from .relation_entity import RelationEntity +from .resolved_entities import ResolvedEntities +from .resolved_entity import ResolvedEntity from .sentiment_aspect import SentimentAspect from .sentiment_document_result import SentimentDocumentResult from .sentiment_sentence import SentimentSentence @@ -135,8 +147,11 @@ # Maps type names to classes for ai_language services. ai_language_type_mapping = { + "AssertionDetails": AssertionDetails, "BatchDetectDominantLanguageDetails": BatchDetectDominantLanguageDetails, "BatchDetectDominantLanguageResult": BatchDetectDominantLanguageResult, + "BatchDetectHealthEntityDetails": BatchDetectHealthEntityDetails, + "BatchDetectHealthEntityResult": BatchDetectHealthEntityResult, "BatchDetectLanguageEntitiesDetails": BatchDetectLanguageEntitiesDetails, "BatchDetectLanguageEntitiesResult": BatchDetectLanguageEntitiesResult, "BatchDetectLanguageKeyPhrasesDetails": BatchDetectLanguageKeyPhrasesDetails, @@ -193,6 +208,8 @@ "EvaluationResultCollection": EvaluationResultCollection, "EvaluationResultSummary": EvaluationResultSummary, "EvaluationResults": EvaluationResults, + "HealthEntity": HealthEntity, + "HealthEntityDocumentResult": HealthEntityDocumentResult, "HierarchicalEntity": HierarchicalEntity, "InputConfiguration": InputConfiguration, "InputLocation": InputLocation, @@ -202,6 +219,8 @@ "KeyPhrase": KeyPhrase, "KeyPhraseDocumentResult": KeyPhraseDocumentResult, "LocationDetails": LocationDetails, + "MelConcept": MelConcept, + "MelConceptDetails": MelConceptDetails, "Model": Model, "ModelCollection": ModelCollection, "ModelDetails": ModelDetails, @@ -223,6 +242,7 @@ "PiiEntityMasking": PiiEntityMasking, "PiiEntityRemove": PiiEntityRemove, "PiiEntityReplace": PiiEntityReplace, + "PiiModelDetails": PiiModelDetails, "PreDeployedLanguageModels": PreDeployedLanguageModels, "PreTrainedHealthNluModelDetails": PreTrainedHealthNluModelDetails, "PreTrainedKeyPhraseExtractionModelDetails": PreTrainedKeyPhraseExtractionModelDetails, @@ -233,9 +253,13 @@ "PreTrainedSummarization": PreTrainedSummarization, "PreTrainedTextClassificationModelDetails": PreTrainedTextClassificationModelDetails, "PreTrainedUniversalModel": PreTrainedUniversalModel, + "Profile": Profile, "Project": Project, "ProjectCollection": ProjectCollection, "ProjectSummary": ProjectSummary, + "RelationEntity": RelationEntity, + "ResolvedEntities": ResolvedEntities, + "ResolvedEntity": ResolvedEntity, "SentimentAspect": SentimentAspect, "SentimentDocumentResult": SentimentDocumentResult, "SentimentSentence": SentimentSentence, diff --git a/src/oci/ai_language/models/assertion_details.py b/src/oci/ai_language/models/assertion_details.py new file mode 100644 index 000000000..dd6107923 --- /dev/null +++ b/src/oci/ai_language/models/assertion_details.py @@ -0,0 +1,165 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class AssertionDetails(object): + """ + The assertion details for health ner. + """ + + def __init__(self, **kwargs): + """ + Initializes a new AssertionDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this AssertionDetails. + :type id: str + + :param type: + The value to assign to the type property of this AssertionDetails. + :type type: str + + :param value: + The value to assign to the value property of this AssertionDetails. + :type value: str + + :param score: + The value to assign to the score property of this AssertionDetails. + :type score: float + + """ + self.swagger_types = { + 'id': 'str', + 'type': 'str', + 'value': 'str', + 'score': 'float' + } + + self.attribute_map = { + 'id': 'id', + 'type': 'type', + 'value': 'value', + 'score': 'score' + } + + self._id = None + self._type = None + self._value = None + self._score = None + + @property + def id(self): + """ + **[Required]** Gets the id of this AssertionDetails. + id of the relation + + + :return: The id of this AssertionDetails. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this AssertionDetails. + id of the relation + + + :param id: The id of this AssertionDetails. + :type: str + """ + self._id = id + + @property + def type(self): + """ + **[Required]** Gets the type of this AssertionDetails. + type of assertion ex, Status, Certainty, Temporality, Actor, etc. + + + :return: The type of this AssertionDetails. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this AssertionDetails. + type of assertion ex, Status, Certainty, Temporality, Actor, etc. + + + :param type: The type of this AssertionDetails. + :type: str + """ + self._type = type + + @property + def value(self): + """ + **[Required]** Gets the value of this AssertionDetails. + Possible value for assertion type + + + :return: The value of this AssertionDetails. + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """ + Sets the value of this AssertionDetails. + Possible value for assertion type + + + :param value: The value of this AssertionDetails. + :type: str + """ + self._value = value + + @property + def score(self): + """ + **[Required]** Gets the score of this AssertionDetails. + Score or confidence for health detected entity. + + + :return: The score of this AssertionDetails. + :rtype: float + """ + return self._score + + @score.setter + def score(self, score): + """ + Sets the score of this AssertionDetails. + Score or confidence for health detected entity. + + + :param score: The score of this AssertionDetails. + :type: float + """ + self._score = score + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/batch_detect_health_entity_details.py b/src/oci/ai_language/models/batch_detect_health_entity_details.py new file mode 100644 index 000000000..b96a25212 --- /dev/null +++ b/src/oci/ai_language/models/batch_detect_health_entity_details.py @@ -0,0 +1,223 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class BatchDetectHealthEntityDetails(object): + """ + The documents details for health entities detect call. + """ + + def __init__(self, **kwargs): + """ + Initializes a new BatchDetectHealthEntityDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param endpoint_id: + The value to assign to the endpoint_id property of this BatchDetectHealthEntityDetails. + :type endpoint_id: str + + :param documents: + The value to assign to the documents property of this BatchDetectHealthEntityDetails. + :type documents: list[oci.ai_language.models.TextDocument] + + :param link_ontologies: + The value to assign to the link_ontologies property of this BatchDetectHealthEntityDetails. + :type link_ontologies: list[str] + + :param is_detect_assertions: + The value to assign to the is_detect_assertions property of this BatchDetectHealthEntityDetails. + :type is_detect_assertions: bool + + :param is_detect_relationships: + The value to assign to the is_detect_relationships property of this BatchDetectHealthEntityDetails. + :type is_detect_relationships: bool + + :param profile: + The value to assign to the profile property of this BatchDetectHealthEntityDetails. + :type profile: oci.ai_language.models.Profile + + """ + self.swagger_types = { + 'endpoint_id': 'str', + 'documents': 'list[TextDocument]', + 'link_ontologies': 'list[str]', + 'is_detect_assertions': 'bool', + 'is_detect_relationships': 'bool', + 'profile': 'Profile' + } + + self.attribute_map = { + 'endpoint_id': 'endpointId', + 'documents': 'documents', + 'link_ontologies': 'linkOntologies', + 'is_detect_assertions': 'isDetectAssertions', + 'is_detect_relationships': 'isDetectRelationships', + 'profile': 'profile' + } + + self._endpoint_id = None + self._documents = None + self._link_ontologies = None + self._is_detect_assertions = None + self._is_detect_relationships = None + self._profile = None + + @property + def endpoint_id(self): + """ + **[Required]** Gets the endpoint_id of this BatchDetectHealthEntityDetails. + The endpoint which have to be used for inferencing. + + + :return: The endpoint_id of this BatchDetectHealthEntityDetails. + :rtype: str + """ + return self._endpoint_id + + @endpoint_id.setter + def endpoint_id(self, endpoint_id): + """ + Sets the endpoint_id of this BatchDetectHealthEntityDetails. + The endpoint which have to be used for inferencing. + + + :param endpoint_id: The endpoint_id of this BatchDetectHealthEntityDetails. + :type: str + """ + self._endpoint_id = endpoint_id + + @property + def documents(self): + """ + **[Required]** Gets the documents of this BatchDetectHealthEntityDetails. + List of Documents for detect health entities. + + + :return: The documents of this BatchDetectHealthEntityDetails. + :rtype: list[oci.ai_language.models.TextDocument] + """ + return self._documents + + @documents.setter + def documents(self, documents): + """ + Sets the documents of this BatchDetectHealthEntityDetails. + List of Documents for detect health entities. + + + :param documents: The documents of this BatchDetectHealthEntityDetails. + :type: list[oci.ai_language.models.TextDocument] + """ + self._documents = documents + + @property + def link_ontologies(self): + """ + Gets the link_ontologies of this BatchDetectHealthEntityDetails. + List of NLP health ontologies to be linked + + + :return: The link_ontologies of this BatchDetectHealthEntityDetails. + :rtype: list[str] + """ + return self._link_ontologies + + @link_ontologies.setter + def link_ontologies(self, link_ontologies): + """ + Sets the link_ontologies of this BatchDetectHealthEntityDetails. + List of NLP health ontologies to be linked + + + :param link_ontologies: The link_ontologies of this BatchDetectHealthEntityDetails. + :type: list[str] + """ + self._link_ontologies = link_ontologies + + @property + def is_detect_assertions(self): + """ + Gets the is_detect_assertions of this BatchDetectHealthEntityDetails. + is assertion on input text required. default value true. + + + :return: The is_detect_assertions of this BatchDetectHealthEntityDetails. + :rtype: bool + """ + return self._is_detect_assertions + + @is_detect_assertions.setter + def is_detect_assertions(self, is_detect_assertions): + """ + Sets the is_detect_assertions of this BatchDetectHealthEntityDetails. + is assertion on input text required. default value true. + + + :param is_detect_assertions: The is_detect_assertions of this BatchDetectHealthEntityDetails. + :type: bool + """ + self._is_detect_assertions = is_detect_assertions + + @property + def is_detect_relationships(self): + """ + Gets the is_detect_relationships of this BatchDetectHealthEntityDetails. + is relationship on input text required. default value true. + + + :return: The is_detect_relationships of this BatchDetectHealthEntityDetails. + :rtype: bool + """ + return self._is_detect_relationships + + @is_detect_relationships.setter + def is_detect_relationships(self, is_detect_relationships): + """ + Sets the is_detect_relationships of this BatchDetectHealthEntityDetails. + is relationship on input text required. default value true. + + + :param is_detect_relationships: The is_detect_relationships of this BatchDetectHealthEntityDetails. + :type: bool + """ + self._is_detect_relationships = is_detect_relationships + + @property + def profile(self): + """ + Gets the profile of this BatchDetectHealthEntityDetails. + + :return: The profile of this BatchDetectHealthEntityDetails. + :rtype: oci.ai_language.models.Profile + """ + return self._profile + + @profile.setter + def profile(self, profile): + """ + Sets the profile of this BatchDetectHealthEntityDetails. + + :param profile: The profile of this BatchDetectHealthEntityDetails. + :type: oci.ai_language.models.Profile + """ + self._profile = profile + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/batch_detect_health_entity_result.py b/src/oci/ai_language/models/batch_detect_health_entity_result.py new file mode 100644 index 000000000..84337ea6a --- /dev/null +++ b/src/oci/ai_language/models/batch_detect_health_entity_result.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class BatchDetectHealthEntityResult(object): + """ + Result of health entity detect call. + """ + + def __init__(self, **kwargs): + """ + Initializes a new BatchDetectHealthEntityResult object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param documents: + The value to assign to the documents property of this BatchDetectHealthEntityResult. + :type documents: list[oci.ai_language.models.HealthEntityDocumentResult] + + :param errors: + The value to assign to the errors property of this BatchDetectHealthEntityResult. + :type errors: list[oci.ai_language.models.DocumentError] + + """ + self.swagger_types = { + 'documents': 'list[HealthEntityDocumentResult]', + 'errors': 'list[DocumentError]' + } + + self.attribute_map = { + 'documents': 'documents', + 'errors': 'errors' + } + + self._documents = None + self._errors = None + + @property + def documents(self): + """ + **[Required]** Gets the documents of this BatchDetectHealthEntityResult. + List of succeeded document response. + + + :return: The documents of this BatchDetectHealthEntityResult. + :rtype: list[oci.ai_language.models.HealthEntityDocumentResult] + """ + return self._documents + + @documents.setter + def documents(self, documents): + """ + Sets the documents of this BatchDetectHealthEntityResult. + List of succeeded document response. + + + :param documents: The documents of this BatchDetectHealthEntityResult. + :type: list[oci.ai_language.models.HealthEntityDocumentResult] + """ + self._documents = documents + + @property + def errors(self): + """ + Gets the errors of this BatchDetectHealthEntityResult. + List of failed document response. + + + :return: The errors of this BatchDetectHealthEntityResult. + :rtype: list[oci.ai_language.models.DocumentError] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """ + Sets the errors of this BatchDetectHealthEntityResult. + List of failed document response. + + + :param errors: The errors of this BatchDetectHealthEntityResult. + :type: list[oci.ai_language.models.DocumentError] + """ + self._errors = errors + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py b/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py index 13b4a6d27..915d5bd45 100644 --- a/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py +++ b/src/oci/ai_language/models/batch_detect_language_pii_entities_details.py @@ -36,25 +36,32 @@ def __init__(self, **kwargs): The value to assign to the masking property of this BatchDetectLanguagePiiEntitiesDetails. :type masking: dict(str, PiiEntityMasking) + :param profile: + The value to assign to the profile property of this BatchDetectLanguagePiiEntitiesDetails. + :type profile: oci.ai_language.models.Profile + """ self.swagger_types = { 'endpoint_id': 'str', 'compartment_id': 'str', 'documents': 'list[TextDocument]', - 'masking': 'dict(str, PiiEntityMasking)' + 'masking': 'dict(str, PiiEntityMasking)', + 'profile': 'Profile' } self.attribute_map = { 'endpoint_id': 'endpointId', 'compartment_id': 'compartmentId', 'documents': 'documents', - 'masking': 'masking' + 'masking': 'masking', + 'profile': 'profile' } self._endpoint_id = None self._compartment_id = None self._documents = None self._masking = None + self._profile = None @property def endpoint_id(self): @@ -156,6 +163,26 @@ def masking(self, masking): """ self._masking = masking + @property + def profile(self): + """ + Gets the profile of this BatchDetectLanguagePiiEntitiesDetails. + + :return: The profile of this BatchDetectLanguagePiiEntitiesDetails. + :rtype: oci.ai_language.models.Profile + """ + return self._profile + + @profile.setter + def profile(self, profile): + """ + Sets the profile of this BatchDetectLanguagePiiEntitiesDetails. + + :param profile: The profile of this BatchDetectLanguagePiiEntitiesDetails. + :type: oci.ai_language.models.Profile + """ + self._profile = profile + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/ai_language/models/health_entity.py b/src/oci/ai_language/models/health_entity.py new file mode 100644 index 000000000..eb90b6694 --- /dev/null +++ b/src/oci/ai_language/models/health_entity.py @@ -0,0 +1,351 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class HealthEntity(object): + """ + Health entity object + """ + + def __init__(self, **kwargs): + """ + Initializes a new HealthEntity object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param offset: + The value to assign to the offset property of this HealthEntity. + :type offset: int + + :param length: + The value to assign to the length property of this HealthEntity. + :type length: int + + :param text: + The value to assign to the text property of this HealthEntity. + :type text: str + + :param type: + The value to assign to the type property of this HealthEntity. + :type type: str + + :param sub_type: + The value to assign to the sub_type property of this HealthEntity. + :type sub_type: str + + :param score: + The value to assign to the score property of this HealthEntity. + :type score: float + + :param category: + The value to assign to the category property of this HealthEntity. + :type category: str + + :param id: + The value to assign to the id property of this HealthEntity. + :type id: str + + :param assertions: + The value to assign to the assertions property of this HealthEntity. + :type assertions: list[oci.ai_language.models.AssertionDetails] + + :param matched_concepts: + The value to assign to the matched_concepts property of this HealthEntity. + :type matched_concepts: list[oci.ai_language.models.MelConcept] + + """ + self.swagger_types = { + 'offset': 'int', + 'length': 'int', + 'text': 'str', + 'type': 'str', + 'sub_type': 'str', + 'score': 'float', + 'category': 'str', + 'id': 'str', + 'assertions': 'list[AssertionDetails]', + 'matched_concepts': 'list[MelConcept]' + } + + self.attribute_map = { + 'offset': 'offset', + 'length': 'length', + 'text': 'text', + 'type': 'type', + 'sub_type': 'subType', + 'score': 'score', + 'category': 'category', + 'id': 'id', + 'assertions': 'assertions', + 'matched_concepts': 'matchedConcepts' + } + + self._offset = None + self._length = None + self._text = None + self._type = None + self._sub_type = None + self._score = None + self._category = None + self._id = None + self._assertions = None + self._matched_concepts = None + + @property + def offset(self): + """ + **[Required]** Gets the offset of this HealthEntity. + The number of Unicode code points preceding this entity in the submitted text. + + + :return: The offset of this HealthEntity. + :rtype: int + """ + return self._offset + + @offset.setter + def offset(self, offset): + """ + Sets the offset of this HealthEntity. + The number of Unicode code points preceding this entity in the submitted text. + + + :param offset: The offset of this HealthEntity. + :type: int + """ + self._offset = offset + + @property + def length(self): + """ + **[Required]** Gets the length of this HealthEntity. + Length of entity text + + + :return: The length of this HealthEntity. + :rtype: int + """ + return self._length + + @length.setter + def length(self, length): + """ + Sets the length of this HealthEntity. + Length of entity text + + + :param length: The length of this HealthEntity. + :type: int + """ + self._length = length + + @property + def text(self): + """ + **[Required]** Gets the text of this HealthEntity. + Entity text like name of person, location, and so on. + + + :return: The text of this HealthEntity. + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """ + Sets the text of this HealthEntity. + Entity text like name of person, location, and so on. + + + :param text: The text of this HealthEntity. + :type: str + """ + self._text = text + + @property + def type(self): + """ + **[Required]** Gets the type of this HealthEntity. + Type of entity text like PER, LOC. + + + :return: The type of this HealthEntity. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this HealthEntity. + Type of entity text like PER, LOC. + + + :param type: The type of this HealthEntity. + :type: str + """ + self._type = type + + @property + def sub_type(self): + """ + Gets the sub_type of this HealthEntity. + Sub-type of entity text like GPE for LOCATION type + + + :return: The sub_type of this HealthEntity. + :rtype: str + """ + return self._sub_type + + @sub_type.setter + def sub_type(self, sub_type): + """ + Sets the sub_type of this HealthEntity. + Sub-type of entity text like GPE for LOCATION type + + + :param sub_type: The sub_type of this HealthEntity. + :type: str + """ + self._sub_type = sub_type + + @property + def score(self): + """ + **[Required]** Gets the score of this HealthEntity. + Score or confidence for detected entity. + + + :return: The score of this HealthEntity. + :rtype: float + """ + return self._score + + @score.setter + def score(self, score): + """ + Sets the score of this HealthEntity. + Score or confidence for detected entity. + + + :param score: The score of this HealthEntity. + :type: float + """ + self._score = score + + @property + def category(self): + """ + Gets the category of this HealthEntity. + Entity category e.g, MEDICAL_CONDITION, MEDICATION, GENERAL, ANATOMY + + + :return: The category of this HealthEntity. + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """ + Sets the category of this HealthEntity. + Entity category e.g, MEDICAL_CONDITION, MEDICATION, GENERAL, ANATOMY + + + :param category: The category of this HealthEntity. + :type: str + """ + self._category = category + + @property + def id(self): + """ + **[Required]** Gets the id of this HealthEntity. + Unique id of the entity + + + :return: The id of this HealthEntity. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this HealthEntity. + Unique id of the entity + + + :param id: The id of this HealthEntity. + :type: str + """ + self._id = id + + @property + def assertions(self): + """ + Gets the assertions of this HealthEntity. + list of all assertions associated with this entity. + + + :return: The assertions of this HealthEntity. + :rtype: list[oci.ai_language.models.AssertionDetails] + """ + return self._assertions + + @assertions.setter + def assertions(self, assertions): + """ + Sets the assertions of this HealthEntity. + list of all assertions associated with this entity. + + + :param assertions: The assertions of this HealthEntity. + :type: list[oci.ai_language.models.AssertionDetails] + """ + self._assertions = assertions + + @property + def matched_concepts(self): + """ + Gets the matched_concepts of this HealthEntity. + This contains the list of matched concepts which are ranked by the relevant score with the input text + + + :return: The matched_concepts of this HealthEntity. + :rtype: list[oci.ai_language.models.MelConcept] + """ + return self._matched_concepts + + @matched_concepts.setter + def matched_concepts(self, matched_concepts): + """ + Sets the matched_concepts of this HealthEntity. + This contains the list of matched concepts which are ranked by the relevant score with the input text + + + :param matched_concepts: The matched_concepts of this HealthEntity. + :type: list[oci.ai_language.models.MelConcept] + """ + self._matched_concepts = matched_concepts + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/health_entity_document_result.py b/src/oci/ai_language/models/health_entity_document_result.py new file mode 100644 index 000000000..4a6bec10b --- /dev/null +++ b/src/oci/ai_language/models/health_entity_document_result.py @@ -0,0 +1,200 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class HealthEntityDocumentResult(object): + """ + The document response for health entity detect call. + """ + + def __init__(self, **kwargs): + """ + Initializes a new HealthEntityDocumentResult object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param key: + The value to assign to the key property of this HealthEntityDocumentResult. + :type key: str + + :param entities: + The value to assign to the entities property of this HealthEntityDocumentResult. + :type entities: list[oci.ai_language.models.HealthEntity] + + :param relations: + The value to assign to the relations property of this HealthEntityDocumentResult. + :type relations: list[oci.ai_language.models.RelationEntity] + + :param resolved_entities: + The value to assign to the resolved_entities property of this HealthEntityDocumentResult. + :type resolved_entities: dict(str, ResolvedEntities) + + :param language_code: + The value to assign to the language_code property of this HealthEntityDocumentResult. + :type language_code: str + + """ + self.swagger_types = { + 'key': 'str', + 'entities': 'list[HealthEntity]', + 'relations': 'list[RelationEntity]', + 'resolved_entities': 'dict(str, ResolvedEntities)', + 'language_code': 'str' + } + + self.attribute_map = { + 'key': 'key', + 'entities': 'entities', + 'relations': 'relations', + 'resolved_entities': 'resolvedEntities', + 'language_code': 'languageCode' + } + + self._key = None + self._entities = None + self._relations = None + self._resolved_entities = None + self._language_code = None + + @property + def key(self): + """ + **[Required]** Gets the key of this HealthEntityDocumentResult. + Document unique identifier defined by the user. + + + :return: The key of this HealthEntityDocumentResult. + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """ + Sets the key of this HealthEntityDocumentResult. + Document unique identifier defined by the user. + + + :param key: The key of this HealthEntityDocumentResult. + :type: str + """ + self._key = key + + @property + def entities(self): + """ + **[Required]** Gets the entities of this HealthEntityDocumentResult. + List of detected entities. + + + :return: The entities of this HealthEntityDocumentResult. + :rtype: list[oci.ai_language.models.HealthEntity] + """ + return self._entities + + @entities.setter + def entities(self, entities): + """ + Sets the entities of this HealthEntityDocumentResult. + List of detected entities. + + + :param entities: The entities of this HealthEntityDocumentResult. + :type: list[oci.ai_language.models.HealthEntity] + """ + self._entities = entities + + @property + def relations(self): + """ + Gets the relations of this HealthEntityDocumentResult. + List of succeeded document response. + + + :return: The relations of this HealthEntityDocumentResult. + :rtype: list[oci.ai_language.models.RelationEntity] + """ + return self._relations + + @relations.setter + def relations(self, relations): + """ + Sets the relations of this HealthEntityDocumentResult. + List of succeeded document response. + + + :param relations: The relations of this HealthEntityDocumentResult. + :type: list[oci.ai_language.models.RelationEntity] + """ + self._relations = relations + + @property + def resolved_entities(self): + """ + **[Required]** Gets the resolved_entities of this HealthEntityDocumentResult. + Map of resolved entities by entity type + + + :return: The resolved_entities of this HealthEntityDocumentResult. + :rtype: dict(str, ResolvedEntities) + """ + return self._resolved_entities + + @resolved_entities.setter + def resolved_entities(self, resolved_entities): + """ + Sets the resolved_entities of this HealthEntityDocumentResult. + Map of resolved entities by entity type + + + :param resolved_entities: The resolved_entities of this HealthEntityDocumentResult. + :type: dict(str, ResolvedEntities) + """ + self._resolved_entities = resolved_entities + + @property + def language_code(self): + """ + **[Required]** Gets the language_code of this HealthEntityDocumentResult. + Language code of the document. Please refer to respective model `API documentation`__ for supported languages. + + __ https://docs.cloud.oracle.com/iaas/language/using/overview.htm + + + :return: The language_code of this HealthEntityDocumentResult. + :rtype: str + """ + return self._language_code + + @language_code.setter + def language_code(self, language_code): + """ + Sets the language_code of this HealthEntityDocumentResult. + Language code of the document. Please refer to respective model `API documentation`__ for supported languages. + + __ https://docs.cloud.oracle.com/iaas/language/using/overview.htm + + + :param language_code: The language_code of this HealthEntityDocumentResult. + :type: str + """ + self._language_code = language_code + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/input_location.py b/src/oci/ai_language/models/input_location.py index 369c4966a..ae47fcc71 100644 --- a/src/oci/ai_language/models/input_location.py +++ b/src/oci/ai_language/models/input_location.py @@ -13,8 +13,9 @@ class InputLocation(object): """ document location and other meta data about documents - For TXT both ObjectStoragePrefixLocation and ObjectStorageFileNameLocation supported + For TXT only ObjectStoragePrefixLocation supported For CSV only ObjectStorageFileNameLocation is supported + For this release only one file is supported for ObjectStorageFileNameLocation i.e CSV file type """ #: A constant which can be used with the location_type property of a InputLocation. diff --git a/src/oci/ai_language/models/mel_concept.py b/src/oci/ai_language/models/mel_concept.py new file mode 100644 index 000000000..f2f52dc09 --- /dev/null +++ b/src/oci/ai_language/models/mel_concept.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class MelConcept(object): + """ + The MEL concepts details for health ner. + """ + + def __init__(self, **kwargs): + """ + Initializes a new MelConcept object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param ontology_name: + The value to assign to the ontology_name property of this MelConcept. + :type ontology_name: str + + :param concepts: + The value to assign to the concepts property of this MelConcept. + :type concepts: list[oci.ai_language.models.MelConceptDetails] + + """ + self.swagger_types = { + 'ontology_name': 'str', + 'concepts': 'list[MelConceptDetails]' + } + + self.attribute_map = { + 'ontology_name': 'ontologyName', + 'concepts': 'concepts' + } + + self._ontology_name = None + self._concepts = None + + @property + def ontology_name(self): + """ + **[Required]** Gets the ontology_name of this MelConcept. + Name of the ontology to which the Entity is mapped + + + :return: The ontology_name of this MelConcept. + :rtype: str + """ + return self._ontology_name + + @ontology_name.setter + def ontology_name(self, ontology_name): + """ + Sets the ontology_name of this MelConcept. + Name of the ontology to which the Entity is mapped + + + :param ontology_name: The ontology_name of this MelConcept. + :type: str + """ + self._ontology_name = ontology_name + + @property + def concepts(self): + """ + **[Required]** Gets the concepts of this MelConcept. + This contains the list of matched concepts which are ranked by the relevant score with the input text + + + :return: The concepts of this MelConcept. + :rtype: list[oci.ai_language.models.MelConceptDetails] + """ + return self._concepts + + @concepts.setter + def concepts(self, concepts): + """ + Sets the concepts of this MelConcept. + This contains the list of matched concepts which are ranked by the relevant score with the input text + + + :param concepts: The concepts of this MelConcept. + :type: list[oci.ai_language.models.MelConceptDetails] + """ + self._concepts = concepts + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/mel_concept_details.py b/src/oci/ai_language/models/mel_concept_details.py new file mode 100644 index 000000000..cd01a13eb --- /dev/null +++ b/src/oci/ai_language/models/mel_concept_details.py @@ -0,0 +1,165 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class MelConceptDetails(object): + """ + The MEL concepts details for health ner. + """ + + def __init__(self, **kwargs): + """ + Initializes a new MelConceptDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this MelConceptDetails. + :type id: str + + :param name: + The value to assign to the name property of this MelConceptDetails. + :type name: str + + :param score: + The value to assign to the score property of this MelConceptDetails. + :type score: float + + :param attributes: + The value to assign to the attributes property of this MelConceptDetails. + :type attributes: dict(str, str) + + """ + self.swagger_types = { + 'id': 'str', + 'name': 'str', + 'score': 'float', + 'attributes': 'dict(str, str)' + } + + self.attribute_map = { + 'id': 'id', + 'name': 'name', + 'score': 'score', + 'attributes': 'attributes' + } + + self._id = None + self._name = None + self._score = None + self._attributes = None + + @property + def id(self): + """ + **[Required]** Gets the id of this MelConceptDetails. + id of the relation + + + :return: The id of this MelConceptDetails. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this MelConceptDetails. + id of the relation + + + :param id: The id of this MelConceptDetails. + :type: str + """ + self._id = id + + @property + def name(self): + """ + **[Required]** Gets the name of this MelConceptDetails. + The matched concept name/description on the ontology + + + :return: The name of this MelConceptDetails. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this MelConceptDetails. + The matched concept name/description on the ontology + + + :param name: The name of this MelConceptDetails. + :type: str + """ + self._name = name + + @property + def score(self): + """ + **[Required]** Gets the score of this MelConceptDetails. + The relevant score between the concept and the input text + + + :return: The score of this MelConceptDetails. + :rtype: float + """ + return self._score + + @score.setter + def score(self, score): + """ + Sets the score of this MelConceptDetails. + The relevant score between the concept and the input text + + + :param score: The score of this MelConceptDetails. + :type: float + """ + self._score = score + + @property + def attributes(self): + """ + Gets the attributes of this MelConceptDetails. + additional attribute values specific to ontology for ex. for SNOMED semantic_type and for for ICD-10 default_charge_code etc. + + + :return: The attributes of this MelConceptDetails. + :rtype: dict(str, str) + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """ + Sets the attributes of this MelConceptDetails. + additional attribute values specific to ontology for ex. for SNOMED semantic_type and for for ICD-10 default_charge_code etc. + + + :param attributes: The attributes of this MelConceptDetails. + :type: dict(str, str) + """ + self._attributes = attributes + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/model_details.py b/src/oci/ai_language/models/model_details.py index 8da9fe666..a0a6dda95 100644 --- a/src/oci/ai_language/models/model_details.py +++ b/src/oci/ai_language/models/model_details.py @@ -63,6 +63,10 @@ class ModelDetails(object): #: This constant has a value of "PRE_TRAINED_UNIVERSAL" MODEL_TYPE_PRE_TRAINED_UNIVERSAL = "PRE_TRAINED_UNIVERSAL" + #: A constant which can be used with the model_type property of a ModelDetails. + #: This constant has a value of "PII" + MODEL_TYPE_PII = "PII" + def __init__(self, **kwargs): """ Initializes a new ModelDetails object with values from keyword arguments. This class has the following subclasses and if you are using this class as input @@ -72,6 +76,7 @@ def __init__(self, **kwargs): * :class:`~oci.ai_language.models.PreTrainedHealthNluModelDetails` * :class:`~oci.ai_language.models.PreTrainedUniversalModel` * :class:`~oci.ai_language.models.NamedEntityRecognitionModelDetails` + * :class:`~oci.ai_language.models.PiiModelDetails` * :class:`~oci.ai_language.models.PreTrainedLanguageDetectionModelDetails` * :class:`~oci.ai_language.models.PreTrainedNamedEntityRecognitionModelDetails` * :class:`~oci.ai_language.models.PreTrainedSentimentAnalysisModelDetails` @@ -88,7 +93,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this ModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type model_type: str @@ -126,6 +131,9 @@ def get_subtype(object_dictionary): if type == 'NAMED_ENTITY_RECOGNITION': return 'NamedEntityRecognitionModelDetails' + if type == 'PII': + return 'PiiModelDetails' + if type == 'PRE_TRAINED_LANGUAGE_DETECTION': return 'PreTrainedLanguageDetectionModelDetails' @@ -179,7 +187,7 @@ def model_type(self): **[Required]** Gets the model_type of this ModelDetails. Model type - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -198,7 +206,7 @@ def model_type(self, model_type): :param model_type: The model_type of this ModelDetails. :type: str """ - allowed_values = ["NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL"] + allowed_values = ["NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII"] if not value_allowed_none_or_none_sentinel(model_type, allowed_values): model_type = 'UNKNOWN_ENUM_VALUE' self._model_type = model_type diff --git a/src/oci/ai_language/models/named_entity_recognition_model_details.py b/src/oci/ai_language/models/named_entity_recognition_model_details.py index 6ea53b550..4df5199da 100644 --- a/src/oci/ai_language/models/named_entity_recognition_model_details.py +++ b/src/oci/ai_language/models/named_entity_recognition_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this NamedEntityRecognitionModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pii_entity.py b/src/oci/ai_language/models/pii_entity.py index e40340fa6..fb88f180a 100644 --- a/src/oci/ai_language/models/pii_entity.py +++ b/src/oci/ai_language/models/pii_entity.py @@ -20,6 +20,10 @@ def __init__(self, **kwargs): Initializes a new PiiEntity object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): + :param id: + The value to assign to the id property of this PiiEntity. + :type id: str + :param offset: The value to assign to the offset property of this PiiEntity. :type offset: int @@ -42,6 +46,7 @@ def __init__(self, **kwargs): """ self.swagger_types = { + 'id': 'str', 'offset': 'int', 'length': 'int', 'text': 'str', @@ -50,6 +55,7 @@ def __init__(self, **kwargs): } self.attribute_map = { + 'id': 'id', 'offset': 'offset', 'length': 'length', 'text': 'text', @@ -57,16 +63,41 @@ def __init__(self, **kwargs): 'score': 'score' } + self._id = None self._offset = None self._length = None self._text = None self._type = None self._score = None + @property + def id(self): + """ + Gets the id of this PiiEntity. + Unique id of the entity. + + + :return: The id of this PiiEntity. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this PiiEntity. + Unique id of the entity. + + + :param id: The id of this PiiEntity. + :type: str + """ + self._id = id + @property def offset(self): """ - Gets the offset of this PiiEntity. + **[Required]** Gets the offset of this PiiEntity. The number of Unicode code points preceding this entity in the submitted text. @@ -90,7 +121,7 @@ def offset(self, offset): @property def length(self): """ - Gets the length of this PiiEntity. + **[Required]** Gets the length of this PiiEntity. Length of PII entity text. @@ -114,7 +145,7 @@ def length(self, length): @property def text(self): """ - Gets the text of this PiiEntity. + **[Required]** Gets the text of this PiiEntity. Entity text like name of person, Organization and so on. @@ -138,8 +169,48 @@ def text(self, text): @property def type(self): """ - Gets the type of this PiiEntity. - Type of PII entity text like PER, LOC. + **[Required]** Gets the type of this PiiEntity. + Entity type supported + PERSON + ADDRESS + AGE + DATE_TIME + SSN_OR_TAXPAYER + EMAIL + PASSPORT_NUMBER_US + TELEPHONE_NUMBER + DRIVER_ID_US + BANK_ACCOUNT_NUMBER + BANK_SWIFT + BANK_ROUTING + CREDIT_DEBIT_NUMBER + IP_ADDRESS + MAC_ADDRESS + COOKIE + XSRF_TOKEN + AUTH_BASIC + AUTH_BEARER + JSON_WEB_TOKEN + PRIVATE_KEY + PUBLIC_KEY + OCI_OCID_USER + OCI_OCID_TENANCY + OCI_SMTP_USERNAME + OCI_OCID_REFERENCE + OCI_FINGERPRINT + OCI_CREDENTIAL + OCI_PRE_AUTH_REQUEST + OCI_STORAGE_SIGNED_URL + OCI_CUSTOMER_SECRET_KEY + OCI_ACCESS_KEy + MEDICAL_RECORD_NUMBER + HEALTH_PLAN_ID + URL + CERTIFICATE_NUMBER + FIN + GUIDs + VEHICLE_LICENSE_PLATE_US + VEHICLE_IDENTIFIER_US :return: The type of this PiiEntity. @@ -151,7 +222,47 @@ def type(self): def type(self, type): """ Sets the type of this PiiEntity. - Type of PII entity text like PER, LOC. + Entity type supported + PERSON + ADDRESS + AGE + DATE_TIME + SSN_OR_TAXPAYER + EMAIL + PASSPORT_NUMBER_US + TELEPHONE_NUMBER + DRIVER_ID_US + BANK_ACCOUNT_NUMBER + BANK_SWIFT + BANK_ROUTING + CREDIT_DEBIT_NUMBER + IP_ADDRESS + MAC_ADDRESS + COOKIE + XSRF_TOKEN + AUTH_BASIC + AUTH_BEARER + JSON_WEB_TOKEN + PRIVATE_KEY + PUBLIC_KEY + OCI_OCID_USER + OCI_OCID_TENANCY + OCI_SMTP_USERNAME + OCI_OCID_REFERENCE + OCI_FINGERPRINT + OCI_CREDENTIAL + OCI_PRE_AUTH_REQUEST + OCI_STORAGE_SIGNED_URL + OCI_CUSTOMER_SECRET_KEY + OCI_ACCESS_KEy + MEDICAL_RECORD_NUMBER + HEALTH_PLAN_ID + URL + CERTIFICATE_NUMBER + FIN + GUIDs + VEHICLE_LICENSE_PLATE_US + VEHICLE_IDENTIFIER_US :param type: The type of this PiiEntity. @@ -162,7 +273,7 @@ def type(self, type): @property def score(self): """ - Gets the score of this PiiEntity. + **[Required]** Gets the score of this PiiEntity. Score or confidence for detected PII entity. diff --git a/src/oci/ai_language/models/pii_model_details.py b/src/oci/ai_language/models/pii_model_details.py new file mode 100644 index 000000000..25aa6e78c --- /dev/null +++ b/src/oci/ai_language/models/pii_model_details.py @@ -0,0 +1,91 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + +from .model_details import ModelDetails +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class PiiModelDetails(ModelDetails): + """ + Possible Custom PII model information + """ + + def __init__(self, **kwargs): + """ + Initializes a new PiiModelDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.ai_language.models.PiiModelDetails.model_type` attribute + of this class is ``PII`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param language_code: + The value to assign to the language_code property of this PiiModelDetails. + :type language_code: str + + :param model_type: + The value to assign to the model_type property of this PiiModelDetails. + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" + :type model_type: str + + :param version: + The value to assign to the version property of this PiiModelDetails. + :type version: str + + """ + self.swagger_types = { + 'language_code': 'str', + 'model_type': 'str', + 'version': 'str' + } + + self.attribute_map = { + 'language_code': 'languageCode', + 'model_type': 'modelType', + 'version': 'version' + } + + self._language_code = None + self._model_type = None + self._version = None + self._model_type = 'PII' + + @property + def version(self): + """ + Gets the version of this PiiModelDetails. + Optional pre trained model version. if nothing specified latest pre trained model will be used. + Supported versions can be found at /modelTypes/{modelType} + + + :return: The version of this PiiModelDetails. + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """ + Sets the version of this PiiModelDetails. + Optional pre trained model version. if nothing specified latest pre trained model will be used. + Supported versions can be found at /modelTypes/{modelType} + + + :param version: The version of this PiiModelDetails. + :type: str + """ + self._version = version + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/pre_trained_health_nlu_model_details.py b/src/oci/ai_language/models/pre_trained_health_nlu_model_details.py index 061e1522b..73a98ab3a 100644 --- a/src/oci/ai_language/models/pre_trained_health_nlu_model_details.py +++ b/src/oci/ai_language/models/pre_trained_health_nlu_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedHealthNluModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_key_phrase_extraction_model_details.py b/src/oci/ai_language/models/pre_trained_key_phrase_extraction_model_details.py index 8b29c0771..bfb75186c 100644 --- a/src/oci/ai_language/models/pre_trained_key_phrase_extraction_model_details.py +++ b/src/oci/ai_language/models/pre_trained_key_phrase_extraction_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedKeyPhraseExtractionModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_language_detection_model_details.py b/src/oci/ai_language/models/pre_trained_language_detection_model_details.py index 490e764c7..856f7d901 100644 --- a/src/oci/ai_language/models/pre_trained_language_detection_model_details.py +++ b/src/oci/ai_language/models/pre_trained_language_detection_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedLanguageDetectionModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_named_entity_recognition_model_details.py b/src/oci/ai_language/models/pre_trained_named_entity_recognition_model_details.py index af4b15d23..943ce645f 100644 --- a/src/oci/ai_language/models/pre_trained_named_entity_recognition_model_details.py +++ b/src/oci/ai_language/models/pre_trained_named_entity_recognition_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedNamedEntityRecognitionModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_pii_model_details.py b/src/oci/ai_language/models/pre_trained_pii_model_details.py index 36853994d..ff38f8589 100644 --- a/src/oci/ai_language/models/pre_trained_pii_model_details.py +++ b/src/oci/ai_language/models/pre_trained_pii_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedPiiModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_sentiment_analysis_model_details.py b/src/oci/ai_language/models/pre_trained_sentiment_analysis_model_details.py index 55349ce1f..03a95ed01 100644 --- a/src/oci/ai_language/models/pre_trained_sentiment_analysis_model_details.py +++ b/src/oci/ai_language/models/pre_trained_sentiment_analysis_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedSentimentAnalysisModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_summarization.py b/src/oci/ai_language/models/pre_trained_summarization.py index e21cb0bc3..ee31f289a 100644 --- a/src/oci/ai_language/models/pre_trained_summarization.py +++ b/src/oci/ai_language/models/pre_trained_summarization.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedSummarization. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_text_classification_model_details.py b/src/oci/ai_language/models/pre_trained_text_classification_model_details.py index 1ddf88fb9..eed40020f 100644 --- a/src/oci/ai_language/models/pre_trained_text_classification_model_details.py +++ b/src/oci/ai_language/models/pre_trained_text_classification_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedTextClassificationModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/pre_trained_universal_model.py b/src/oci/ai_language/models/pre_trained_universal_model.py index da091717a..d419ab5c5 100644 --- a/src/oci/ai_language/models/pre_trained_universal_model.py +++ b/src/oci/ai_language/models/pre_trained_universal_model.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this PreTrainedUniversalModel. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param version: diff --git a/src/oci/ai_language/models/profile.py b/src/oci/ai_language/models/profile.py new file mode 100644 index 000000000..f6d772482 --- /dev/null +++ b/src/oci/ai_language/models/profile.py @@ -0,0 +1,134 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Profile(object): + """ + Documents profile + """ + + def __init__(self, **kwargs): + """ + Initializes a new Profile object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param domain: + The value to assign to the domain property of this Profile. + :type domain: str + + :param document_type: + The value to assign to the document_type property of this Profile. + :type document_type: str + + :param speciality: + The value to assign to the speciality property of this Profile. + :type speciality: str + + """ + self.swagger_types = { + 'domain': 'str', + 'document_type': 'str', + 'speciality': 'str' + } + + self.attribute_map = { + 'domain': 'domain', + 'document_type': 'documentType', + 'speciality': 'speciality' + } + + self._domain = None + self._document_type = None + self._speciality = None + + @property + def domain(self): + """ + Gets the domain of this Profile. + For PHI API this field can be PII/PHI/ALL and by default PII will be used. For other APIs Healthcare or Financial etc. + + + :return: The domain of this Profile. + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """ + Sets the domain of this Profile. + For PHI API this field can be PII/PHI/ALL and by default PII will be used. For other APIs Healthcare or Financial etc. + + + :param domain: The domain of this Profile. + :type: str + """ + self._domain = domain + + @property + def document_type(self): + """ + Gets the document_type of this Profile. + Document type EHR Or Utterance + + + :return: The document_type of this Profile. + :rtype: str + """ + return self._document_type + + @document_type.setter + def document_type(self, document_type): + """ + Sets the document_type of this Profile. + Document type EHR Or Utterance + + + :param document_type: The document_type of this Profile. + :type: str + """ + self._document_type = document_type + + @property + def speciality(self): + """ + Gets the speciality of this Profile. + Document speciality like paediatrics, internal medicine etc. + + + :return: The speciality of this Profile. + :rtype: str + """ + return self._speciality + + @speciality.setter + def speciality(self, speciality): + """ + Sets the speciality of this Profile. + Document speciality like paediatrics, internal medicine etc. + + + :param speciality: The speciality of this Profile. + :type: str + """ + self._speciality = speciality + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/relation_entity.py b/src/oci/ai_language/models/relation_entity.py new file mode 100644 index 000000000..e7499e784 --- /dev/null +++ b/src/oci/ai_language/models/relation_entity.py @@ -0,0 +1,196 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class RelationEntity(object): + """ + The relation entities details for health ner. + """ + + def __init__(self, **kwargs): + """ + Initializes a new RelationEntity object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this RelationEntity. + :type id: str + + :param subject_id: + The value to assign to the subject_id property of this RelationEntity. + :type subject_id: str + + :param object_id: + The value to assign to the object_id property of this RelationEntity. + :type object_id: str + + :param type: + The value to assign to the type property of this RelationEntity. + :type type: str + + :param score: + The value to assign to the score property of this RelationEntity. + :type score: float + + """ + self.swagger_types = { + 'id': 'str', + 'subject_id': 'str', + 'object_id': 'str', + 'type': 'str', + 'score': 'float' + } + + self.attribute_map = { + 'id': 'id', + 'subject_id': 'subjectId', + 'object_id': 'objectId', + 'type': 'type', + 'score': 'score' + } + + self._id = None + self._subject_id = None + self._object_id = None + self._type = None + self._score = None + + @property + def id(self): + """ + **[Required]** Gets the id of this RelationEntity. + id of the relation + + + :return: The id of this RelationEntity. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this RelationEntity. + id of the relation + + + :param id: The id of this RelationEntity. + :type: str + """ + self._id = id + + @property + def subject_id(self): + """ + **[Required]** Gets the subject_id of this RelationEntity. + Subject entity of the relation. eg,MEDICINE_NAME, EXAMINATION + + + :return: The subject_id of this RelationEntity. + :rtype: str + """ + return self._subject_id + + @subject_id.setter + def subject_id(self, subject_id): + """ + Sets the subject_id of this RelationEntity. + Subject entity of the relation. eg,MEDICINE_NAME, EXAMINATION + + + :param subject_id: The subject_id of this RelationEntity. + :type: str + """ + self._subject_id = subject_id + + @property + def object_id(self): + """ + **[Required]** Gets the object_id of this RelationEntity. + Object entity of the relation. eg, MEDICINE_DOSAGE, MEDICINE_DURATION, MEASUREMENT + + + :return: The object_id of this RelationEntity. + :rtype: str + """ + return self._object_id + + @object_id.setter + def object_id(self, object_id): + """ + Sets the object_id of this RelationEntity. + Object entity of the relation. eg, MEDICINE_DOSAGE, MEDICINE_DURATION, MEASUREMENT + + + :param object_id: The object_id of this RelationEntity. + :type: str + """ + self._object_id = object_id + + @property + def type(self): + """ + **[Required]** Gets the type of this RelationEntity. + Type of relation between subject entity and object entity. eg,EXAMINATION_MEASUREMENT, FREQUENCY, DOSAGE + + + :return: The type of this RelationEntity. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this RelationEntity. + Type of relation between subject entity and object entity. eg,EXAMINATION_MEASUREMENT, FREQUENCY, DOSAGE + + + :param type: The type of this RelationEntity. + :type: str + """ + self._type = type + + @property + def score(self): + """ + **[Required]** Gets the score of this RelationEntity. + Score or confidence for detected entity. + + + :return: The score of this RelationEntity. + :rtype: float + """ + return self._score + + @score.setter + def score(self, score): + """ + Sets the score of this RelationEntity. + Score or confidence for detected entity. + + + :param score: The score of this RelationEntity. + :type: float + """ + self._score = score + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/resolved_entities.py b/src/oci/ai_language/models/resolved_entities.py new file mode 100644 index 000000000..2dd601b4b --- /dev/null +++ b/src/oci/ai_language/models/resolved_entities.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ResolvedEntities(object): + """ + Resolved entities. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ResolvedEntities object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param details: + The value to assign to the details property of this ResolvedEntities. + :type details: list[oci.ai_language.models.ResolvedEntity] + + """ + self.swagger_types = { + 'details': 'list[ResolvedEntity]' + } + + self.attribute_map = { + 'details': 'details' + } + + self._details = None + + @property + def details(self): + """ + **[Required]** Gets the details of this ResolvedEntities. + List of resolved entities + + + :return: The details of this ResolvedEntities. + :rtype: list[oci.ai_language.models.ResolvedEntity] + """ + return self._details + + @details.setter + def details(self, details): + """ + Sets the details of this ResolvedEntities. + List of resolved entities + + + :param details: The details of this ResolvedEntities. + :type: list[oci.ai_language.models.ResolvedEntity] + """ + self._details = details + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/resolved_entity.py b/src/oci/ai_language/models/resolved_entity.py new file mode 100644 index 000000000..c31ea8d9f --- /dev/null +++ b/src/oci/ai_language/models/resolved_entity.py @@ -0,0 +1,227 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20221001 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ResolvedEntity(object): + """ + Resolved entity. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ResolvedEntity object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this ResolvedEntity. + :type id: str + + :param offset: + The value to assign to the offset property of this ResolvedEntity. + :type offset: int + + :param length: + The value to assign to the length property of this ResolvedEntity. + :type length: int + + :param text: + The value to assign to the text property of this ResolvedEntity. + :type text: str + + :param type: + The value to assign to the type property of this ResolvedEntity. + :type type: str + + :param value: + The value to assign to the value property of this ResolvedEntity. + :type value: dict(str, str) + + """ + self.swagger_types = { + 'id': 'str', + 'offset': 'int', + 'length': 'int', + 'text': 'str', + 'type': 'str', + 'value': 'dict(str, str)' + } + + self.attribute_map = { + 'id': 'id', + 'offset': 'offset', + 'length': 'length', + 'text': 'text', + 'type': 'type', + 'value': 'value' + } + + self._id = None + self._offset = None + self._length = None + self._text = None + self._type = None + self._value = None + + @property + def id(self): + """ + **[Required]** Gets the id of this ResolvedEntity. + id of the resolved entity in input + + + :return: The id of this ResolvedEntity. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this ResolvedEntity. + id of the resolved entity in input + + + :param id: The id of this ResolvedEntity. + :type: str + """ + self._id = id + + @property + def offset(self): + """ + **[Required]** Gets the offset of this ResolvedEntity. + offset of resolved entity in input + + + :return: The offset of this ResolvedEntity. + :rtype: int + """ + return self._offset + + @offset.setter + def offset(self, offset): + """ + Sets the offset of this ResolvedEntity. + offset of resolved entity in input + + + :param offset: The offset of this ResolvedEntity. + :type: int + """ + self._offset = offset + + @property + def length(self): + """ + **[Required]** Gets the length of this ResolvedEntity. + length of resolved entity in input + + + :return: The length of this ResolvedEntity. + :rtype: int + """ + return self._length + + @length.setter + def length(self, length): + """ + Sets the length of this ResolvedEntity. + length of resolved entity in input + + + :param length: The length of this ResolvedEntity. + :type: int + """ + self._length = length + + @property + def text(self): + """ + **[Required]** Gets the text of this ResolvedEntity. + Entity text like name of person, location, and so on. + + + :return: The text of this ResolvedEntity. + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """ + Sets the text of this ResolvedEntity. + Entity text like name of person, location, and so on. + + + :param text: The text of this ResolvedEntity. + :type: str + """ + self._text = text + + @property + def type(self): + """ + **[Required]** Gets the type of this ResolvedEntity. + Type of entity text like PER, LOC. + + + :return: The type of this ResolvedEntity. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this ResolvedEntity. + Type of entity text like PER, LOC. + + + :param type: The type of this ResolvedEntity. + :type: str + """ + self._type = type + + @property + def value(self): + """ + **[Required]** Gets the value of this ResolvedEntity. + key and value pair for resolved entities. keys can be specific for each type of resolved entity. Values can be instances of resolvedEntity, arrays of resolvedEntities, primitives, or custom JSON. + + + :return: The value of this ResolvedEntity. + :rtype: dict(str, str) + """ + return self._value + + @value.setter + def value(self, value): + """ + Sets the value of this ResolvedEntity. + key and value pair for resolved entities. keys can be specific for each type of resolved entity. Values can be instances of resolvedEntity, arrays of resolvedEntities, primitives, or custom JSON. + + + :param value: The value of this ResolvedEntity. + :type: dict(str, str) + """ + self._value = value + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/ai_language/models/text_classification_model_details.py b/src/oci/ai_language/models/text_classification_model_details.py index 0775f2345..0363fb1d4 100644 --- a/src/oci/ai_language/models/text_classification_model_details.py +++ b/src/oci/ai_language/models/text_classification_model_details.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): :param model_type: The value to assign to the model_type property of this TextClassificationModelDetails. - Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL" + Allowed values for this property are: "NAMED_ENTITY_RECOGNITION", "TEXT_CLASSIFICATION", "PRE_TRAINED_NAMED_ENTITY_RECOGNITION", "PRE_TRAINED_TEXT_CLASSIFICATION", "PRE_TRAINED_SENTIMENT_ANALYSIS", "PRE_TRAINED_KEYPHRASE_EXTRACTION", "PRE_TRAINED_LANGUAGE_DETECTION", "PRE_TRAINED_PII", "PRE_TRAINED_TRANSLATION", "PRE_TRAINED_HEALTH_NLU", "PRE_TRAINED_SUMMARIZATION", "PRE_TRAINED_UNIVERSAL", "PII" :type model_type: str :param classification_mode: diff --git a/src/oci/data_science/models/instance_configuration.py b/src/oci/data_science/models/instance_configuration.py index fdd0e3ea1..4c79144c7 100644 --- a/src/oci/data_science/models/instance_configuration.py +++ b/src/oci/data_science/models/instance_configuration.py @@ -28,19 +28,26 @@ def __init__(self, **kwargs): The value to assign to the model_deployment_instance_shape_config_details property of this InstanceConfiguration. :type model_deployment_instance_shape_config_details: oci.data_science.models.ModelDeploymentInstanceShapeConfigDetails + :param subnet_id: + The value to assign to the subnet_id property of this InstanceConfiguration. + :type subnet_id: str + """ self.swagger_types = { 'instance_shape_name': 'str', - 'model_deployment_instance_shape_config_details': 'ModelDeploymentInstanceShapeConfigDetails' + 'model_deployment_instance_shape_config_details': 'ModelDeploymentInstanceShapeConfigDetails', + 'subnet_id': 'str' } self.attribute_map = { 'instance_shape_name': 'instanceShapeName', - 'model_deployment_instance_shape_config_details': 'modelDeploymentInstanceShapeConfigDetails' + 'model_deployment_instance_shape_config_details': 'modelDeploymentInstanceShapeConfigDetails', + 'subnet_id': 'subnetId' } self._instance_shape_name = None self._model_deployment_instance_shape_config_details = None + self._subnet_id = None @property def instance_shape_name(self): @@ -86,6 +93,34 @@ def model_deployment_instance_shape_config_details(self, model_deployment_instan """ self._model_deployment_instance_shape_config_details = model_deployment_instance_shape_config_details + @property + def subnet_id(self): + """ + Gets the subnet_id of this InstanceConfiguration. + A model deployment instance is provided with a VNIC for network access. This specifies the `OCID`__ of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT/SGW gateway for egress. + + __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm + + + :return: The subnet_id of this InstanceConfiguration. + :rtype: str + """ + return self._subnet_id + + @subnet_id.setter + def subnet_id(self, subnet_id): + """ + Sets the subnet_id of this InstanceConfiguration. + A model deployment instance is provided with a VNIC for network access. This specifies the `OCID`__ of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT/SGW gateway for egress. + + __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm + + + :param subnet_id: The subnet_id of this InstanceConfiguration. + :type: str + """ + self._subnet_id = subnet_id + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/database/database_client.py b/src/oci/database/database_client.py index 266be81ce..0661124ed 100644 --- a/src/oci/database/database_client.py +++ b/src/oci/database/database_client.py @@ -1178,6 +1178,124 @@ def change_autonomous_database_compartment(self, change_compartment_details, aut api_reference_link=api_reference_link, required_arguments=required_arguments) + def change_autonomous_database_software_image_compartment(self, change_autonomous_database_software_image_compartment_details, autonomous_database_software_image_id, **kwargs): + """ + Move the Autonomous Database Software Image and its dependent resources to the specified compartment. + + + :param oci.database.models.ChangeAutonomousDatabaseSoftwareImageCompartmentDetails change_autonomous_database_software_image_compartment_details: (required) + Request to move Autonomous Database Software Image to a different compartment + + :param str autonomous_database_software_image_id: (required) + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param str opc_retry_token: (optional) + 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). + + :param str opc_request_id: (optional) + Unique identifier for the request. + + :param str if_match: (optional) + 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. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use change_autonomous_database_software_image_compartment API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['autonomousDatabaseSoftwareImageId'] + resource_path = "/autonomousDatabaseSoftwareImages/{autonomousDatabaseSoftwareImageId}/actions/changeCompartment" + method = "POST" + operation_name = "change_autonomous_database_software_image_compartment" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabaseSoftwareImage/ChangeAutonomousDatabaseSoftwareImageCompartment" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_retry_token", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"change_autonomous_database_software_image_compartment got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "autonomousDatabaseSoftwareImageId": autonomous_database_software_image_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=change_autonomous_database_software_image_compartment_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=change_autonomous_database_software_image_compartment_details, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def change_autonomous_exadata_infrastructure_compartment(self, change_compartment_details, autonomous_exadata_infrastructure_id, **kwargs): """ **Deprecated.** Use the :func:`change_cloud_exadata_infrastructure_compartment` operation to move an Exadata infrastructure resource to a different compartment and :func:`change_cloud_autonomous_vm_cluster_compartment` operation to move an Autonomous Exadata VM cluster to a different compartment. @@ -4542,6 +4660,102 @@ def create_autonomous_database_backup(self, create_autonomous_database_backup_de api_reference_link=api_reference_link, required_arguments=required_arguments) + def create_autonomous_database_software_image(self, create_autonomous_database_software_image_details, **kwargs): + """ + create Autonomous Database Software Image in the specified compartment. + + + :param oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails create_autonomous_database_software_image_details: (required) + Request to create Autonomous Database Software Image. + + :param str opc_retry_token: (optional) + 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). + + :param str opc_request_id: (optional) + Unique identifier for the request. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.database.models.AutonomousDatabaseSoftwareImage` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use create_autonomous_database_software_image API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = [] + resource_path = "/autonomousDatabaseSoftwareImages" + method = "POST" + operation_name = "create_autonomous_database_software_image" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabaseSoftwareImage/CreateAutonomousDatabaseSoftwareImage" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"create_autonomous_database_software_image got unknown kwargs: {extra_kwargs!r}") + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_autonomous_database_software_image_details, + response_type="AutonomousDatabaseSoftwareImage", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=create_autonomous_database_software_image_details, + response_type="AutonomousDatabaseSoftwareImage", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def create_autonomous_vm_cluster(self, create_autonomous_vm_cluster_details, **kwargs): """ Creates an Autonomous VM cluster for Exadata Cloud@Customer. To create an Autonomous VM Cluster in the Oracle cloud, see :func:`create_cloud_autonomous_vm_cluster`. @@ -7358,13 +7572,13 @@ def delete_autonomous_database_backup(self, autonomous_database_backup_id, **kwa api_reference_link=api_reference_link, required_arguments=required_arguments) - def delete_autonomous_vm_cluster(self, autonomous_vm_cluster_id, **kwargs): + def delete_autonomous_database_software_image(self, autonomous_database_software_image_id, **kwargs): """ - Deletes the specified Autonomous VM cluster in an Exadata Cloud@Customer system. To delete an Autonomous VM Cluster in the Oracle cloud, see :func:`delete_cloud_autonomous_vm_cluster`. + Delete an Autonomous Database Software Image - :param str autonomous_vm_cluster_id: (required) - The autonomous VM cluster `OCID`__. + :param str autonomous_database_software_image_id: (required) + The Autonomous Database Software Image `OCID`__. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm @@ -7392,14 +7606,14 @@ def delete_autonomous_vm_cluster(self, autonomous_vm_cluster_id, **kwargs): :rtype: :class:`~oci.response.Response` :example: - Click `here `__ to see an example of how to use delete_autonomous_vm_cluster API. + Click `here `__ to see an example of how to use delete_autonomous_database_software_image API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. - required_arguments = ['autonomousVmClusterId'] - resource_path = "/autonomousVmClusters/{autonomousVmClusterId}" + required_arguments = ['autonomousDatabaseSoftwareImageId'] + resource_path = "/autonomousDatabaseSoftwareImages/{autonomousDatabaseSoftwareImageId}" method = "DELETE" - operation_name = "delete_autonomous_vm_cluster" - api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousVmCluster/DeleteAutonomousVmCluster" + operation_name = "delete_autonomous_database_software_image" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabaseSoftwareImage/DeleteAutonomousDatabaseSoftwareImage" # Don't accept unknown kwargs expected_kwargs = [ @@ -7411,10 +7625,10 @@ def delete_autonomous_vm_cluster(self, autonomous_vm_cluster_id, **kwargs): extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( - f"delete_autonomous_vm_cluster got unknown kwargs: {extra_kwargs!r}") + f"delete_autonomous_database_software_image got unknown kwargs: {extra_kwargs!r}") path_params = { - "autonomousVmClusterId": autonomous_vm_cluster_id + "autonomousDatabaseSoftwareImageId": autonomous_database_software_image_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} @@ -7461,13 +7675,13 @@ def delete_autonomous_vm_cluster(self, autonomous_vm_cluster_id, **kwargs): api_reference_link=api_reference_link, required_arguments=required_arguments) - def delete_backup(self, backup_id, **kwargs): + def delete_autonomous_vm_cluster(self, autonomous_vm_cluster_id, **kwargs): """ - Deletes a full backup. You cannot delete automatic backups using this API. + Deletes the specified Autonomous VM cluster in an Exadata Cloud@Customer system. To delete an Autonomous VM Cluster in the Oracle cloud, see :func:`delete_cloud_autonomous_vm_cluster`. - :param str backup_id: (required) - The backup `OCID`__. + :param str autonomous_vm_cluster_id: (required) + The autonomous VM cluster `OCID`__. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm @@ -7476,6 +7690,9 @@ def delete_backup(self, backup_id, **kwargs): 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. + :param str opc_request_id: (optional) + Unique identifier for the request. + :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. @@ -7492,28 +7709,29 @@ def delete_backup(self, backup_id, **kwargs): :rtype: :class:`~oci.response.Response` :example: - Click `here `__ to see an example of how to use delete_backup API. + Click `here `__ to see an example of how to use delete_autonomous_vm_cluster API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. - required_arguments = ['backupId'] - resource_path = "/backups/{backupId}" + required_arguments = ['autonomousVmClusterId'] + resource_path = "/autonomousVmClusters/{autonomousVmClusterId}" method = "DELETE" - operation_name = "delete_backup" - api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/Backup/DeleteBackup" + operation_name = "delete_autonomous_vm_cluster" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousVmCluster/DeleteAutonomousVmCluster" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", - "if_match" + "if_match", + "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( - f"delete_backup got unknown kwargs: {extra_kwargs!r}") + f"delete_autonomous_vm_cluster got unknown kwargs: {extra_kwargs!r}") path_params = { - "backupId": backup_id + "autonomousVmClusterId": autonomous_vm_cluster_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} @@ -7525,7 +7743,8 @@ def delete_backup(self, backup_id, **kwargs): header_params = { "accept": "application/json", "content-type": "application/json", - "if-match": kwargs.get("if_match", missing) + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} @@ -7559,13 +7778,13 @@ def delete_backup(self, backup_id, **kwargs): api_reference_link=api_reference_link, required_arguments=required_arguments) - def delete_backup_destination(self, backup_destination_id, **kwargs): + def delete_backup(self, backup_id, **kwargs): """ - Deletes a backup destination in an Exadata Cloud@Customer system. + Deletes a full backup. You cannot delete automatic backups using this API. - :param str backup_destination_id: (required) - The `OCID`__ of the backup destination. + :param str backup_id: (required) + The backup `OCID`__. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm @@ -7574,9 +7793,6 @@ def delete_backup_destination(self, backup_destination_id, **kwargs): 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. - :param str opc_request_id: (optional) - Unique identifier for the request. - :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. @@ -7593,29 +7809,28 @@ def delete_backup_destination(self, backup_destination_id, **kwargs): :rtype: :class:`~oci.response.Response` :example: - Click `here `__ to see an example of how to use delete_backup_destination API. + Click `here `__ to see an example of how to use delete_backup API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. - required_arguments = ['backupDestinationId'] - resource_path = "/backupDestinations/{backupDestinationId}" + required_arguments = ['backupId'] + resource_path = "/backups/{backupId}" method = "DELETE" - operation_name = "delete_backup_destination" - api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/BackupDestination/DeleteBackupDestination" + operation_name = "delete_backup" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/Backup/DeleteBackup" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", - "if_match", - "opc_request_id" + "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( - f"delete_backup_destination got unknown kwargs: {extra_kwargs!r}") + f"delete_backup got unknown kwargs: {extra_kwargs!r}") path_params = { - "backupDestinationId": backup_destination_id + "backupId": backup_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} @@ -7627,8 +7842,110 @@ def delete_backup_destination(self, backup_destination_id, **kwargs): header_params = { "accept": "application/json", "content-type": "application/json", - "if-match": kwargs.get("if_match", missing), - "opc-request-id": kwargs.get("opc_request_id", missing) + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def delete_backup_destination(self, backup_destination_id, **kwargs): + """ + Deletes a backup destination in an Exadata Cloud@Customer system. + + + :param str backup_destination_id: (required) + The `OCID`__ of the backup destination. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + Unique identifier for the request. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use delete_backup_destination API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['backupDestinationId'] + resource_path = "/backupDestinations/{backupDestinationId}" + method = "DELETE" + operation_name = "delete_backup_destination" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/BackupDestination/DeleteBackupDestination" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"delete_backup_destination got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "backupDestinationId": backup_destination_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} @@ -14181,6 +14498,104 @@ def get_autonomous_database_regional_wallet(self, **kwargs): api_reference_link=api_reference_link, required_arguments=required_arguments) + def get_autonomous_database_software_image(self, autonomous_database_software_image_id, **kwargs): + """ + Gets information about the specified Autonomous Database Software Image. + + + :param str autonomous_database_software_image_id: (required) + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param str opc_request_id: (optional) + Unique identifier for the request. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.database.models.AutonomousDatabaseSoftwareImage` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_autonomous_database_software_image API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['autonomousDatabaseSoftwareImageId'] + resource_path = "/autonomousDatabaseSoftwareImages/{autonomousDatabaseSoftwareImageId}" + method = "GET" + operation_name = "get_autonomous_database_software_image" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabaseSoftwareImage/GetAutonomousDatabaseSoftwareImage" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"get_autonomous_database_software_image got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "autonomousDatabaseSoftwareImageId": autonomous_database_software_image_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="AutonomousDatabaseSoftwareImage", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="AutonomousDatabaseSoftwareImage", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def get_autonomous_database_wallet(self, autonomous_database_id, **kwargs): """ Gets the wallet details for the specified Autonomous Database. @@ -20938,6 +21353,168 @@ def list_autonomous_database_refreshable_clones(self, autonomous_database_id, ** api_reference_link=api_reference_link, required_arguments=required_arguments) + def list_autonomous_database_software_images(self, compartment_id, image_shape_family, **kwargs): + """ + Gets a list of the Autonomous Database Software Images in the specified compartment. + + + :param str compartment_id: (required) + The compartment `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param str image_shape_family: (required) + A filter to return only resources that match the given image shape family exactly. + + Allowed values are: "EXACC_SHAPE", "EXADATA_SHAPE" + + :param int limit: (optional) + The maximum number of items to return per page. + + :param str page: (optional) + The pagination token to continue listing from. + + :param str sort_order: (optional) + The sort order to use, either ascending (`ASC`) or descending (`DESC`). + + Allowed values are: "ASC", "DESC" + + :param str sort_by: (optional) + parameter according to which Autonomous Database Software Images will be sorted. + + Allowed values are: "TIMECREATED", "DISPLAYNAME" + + :param str lifecycle_state: (optional) + A filter to return only resources that match the given lifecycle state exactly. + + Allowed values are: "AVAILABLE", "FAILED", "PROVISIONING", "EXPIRED", "TERMINATED", "TERMINATING", "UPDATING" + + :param str opc_request_id: (optional) + Unique identifier for the request. + + :param str display_name: (optional) + A filter to return only resources that match the entire display name given. The match is not case sensitive. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.database.models.AutonomousDatabaseSoftwareImageCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_autonomous_database_software_images API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['compartmentId', 'imageShapeFamily'] + resource_path = "/autonomousDatabaseSoftwareImages" + method = "GET" + operation_name = "list_autonomous_database_software_images" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabaseSoftwareImage/ListAutonomousDatabaseSoftwareImages" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "limit", + "page", + "sort_order", + "sort_by", + "lifecycle_state", + "opc_request_id", + "display_name" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"list_autonomous_database_software_images got unknown kwargs: {extra_kwargs!r}") + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["TIMECREATED", "DISPLAYNAME"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["AVAILABLE", "FAILED", "PROVISIONING", "EXPIRED", "TERMINATED", "TERMINATING", "UPDATING"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + f"Invalid value for `lifecycle_state`, must be one of { lifecycle_state_allowed_values }" + ) + + image_shape_family_allowed_values = ["EXACC_SHAPE", "EXADATA_SHAPE"] + if image_shape_family not in image_shape_family_allowed_values: + raise ValueError( + f"Invalid value for `image_shape_family`, must be one of { image_shape_family_allowed_values }" + ) + + query_params = { + "compartmentId": compartment_id, + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "sortOrder": kwargs.get("sort_order", missing), + "sortBy": kwargs.get("sort_by", missing), + "lifecycleState": kwargs.get("lifecycle_state", missing), + "displayName": kwargs.get("display_name", missing), + "imageShapeFamily": image_shape_family + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="AutonomousDatabaseSoftwareImageCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + query_params=query_params, + header_params=header_params, + response_type="AutonomousDatabaseSoftwareImageCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def list_autonomous_databases(self, compartment_id, **kwargs): """ Gets a list of Autonomous Databases based on the query parameters specified. @@ -33916,6 +34493,116 @@ def update_autonomous_database_regional_wallet(self, update_autonomous_database_ api_reference_link=api_reference_link, required_arguments=required_arguments) + def update_autonomous_database_software_image(self, autonomous_database_software_image_id, update_autonomous_database_software_image_details, **kwargs): + """ + Updates the properties of an Autonomous Database Software Image, like add tags + + + :param str autonomous_database_software_image_id: (required) + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param oci.database.models.UpdateAutonomousDatabaseSoftwareImageDetails update_autonomous_database_software_image_details: (required) + Request to update the properties of an Autonomous Database Software Image. + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + Unique identifier for the request. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.database.models.AutonomousDatabaseSoftwareImage` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use update_autonomous_database_software_image API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['autonomousDatabaseSoftwareImageId'] + resource_path = "/autonomousDatabaseSoftwareImages/{autonomousDatabaseSoftwareImageId}" + method = "PUT" + operation_name = "update_autonomous_database_software_image" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabaseSoftwareImage/UpdateAutonomousDatabaseSoftwareImage" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"update_autonomous_database_software_image got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "autonomousDatabaseSoftwareImageId": autonomous_database_software_image_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_autonomous_database_software_image_details, + response_type="AutonomousDatabaseSoftwareImage", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=update_autonomous_database_software_image_details, + response_type="AutonomousDatabaseSoftwareImage", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def update_autonomous_database_wallet(self, autonomous_database_id, update_autonomous_database_wallet_details, **kwargs): """ Updates the wallet for the specified Autonomous Database. diff --git a/src/oci/database/database_client_composite_operations.py b/src/oci/database/database_client_composite_operations.py index 0f2210c61..4e39ff62a 100644 --- a/src/oci/database/database_client_composite_operations.py +++ b/src/oci/database/database_client_composite_operations.py @@ -665,6 +665,47 @@ def change_autonomous_database_compartment_and_wait_for_work_request(self, chang except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def change_autonomous_database_software_image_compartment_and_wait_for_work_request(self, change_autonomous_database_software_image_compartment_details, autonomous_database_software_image_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.database.DatabaseClient.change_autonomous_database_software_image_compartment` and waits for the oci.work_requests.models.WorkRequest + to enter the given state(s). + + :param oci.database.models.ChangeAutonomousDatabaseSoftwareImageCompartmentDetails change_autonomous_database_software_image_compartment_details: (required) + Request to move Autonomous Database Software Image to a different compartment + + :param str autonomous_database_software_image_id: (required) + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param list[str] work_request_states: (optional) + An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status` + Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED] + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.database.DatabaseClient.change_autonomous_database_software_image_compartment` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.change_autonomous_database_software_image_compartment(change_autonomous_database_software_image_compartment_details, autonomous_database_software_image_id, **operation_kwargs) + work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES + lowered_work_request_states = [w.lower() for w in work_request_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + work_request_id = operation_result.headers['opc-work-request-id'] + try: + waiter_result = oci.wait_until( + self._work_request_client, + self._work_request_client.get_work_request(work_request_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states, + **waiter_kwargs + ) + return waiter_result + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def change_autonomous_exadata_infrastructure_compartment_and_wait_for_work_request(self, change_compartment_details, autonomous_exadata_infrastructure_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.database.DatabaseClient.change_autonomous_exadata_infrastructure_compartment` and waits for the oci.work_requests.models.WorkRequest @@ -2293,6 +2334,84 @@ def create_autonomous_database_backup_and_wait_for_state(self, create_autonomous except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def create_autonomous_database_software_image_and_wait_for_work_request(self, create_autonomous_database_software_image_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.database.DatabaseClient.create_autonomous_database_software_image` and waits for the oci.work_requests.models.WorkRequest + to enter the given state(s). + + :param oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails create_autonomous_database_software_image_details: (required) + Request to create Autonomous Database Software Image. + + :param list[str] work_request_states: (optional) + An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status` + Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED] + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.database.DatabaseClient.create_autonomous_database_software_image` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.create_autonomous_database_software_image(create_autonomous_database_software_image_details, **operation_kwargs) + work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES + lowered_work_request_states = [w.lower() for w in work_request_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + work_request_id = operation_result.headers['opc-work-request-id'] + try: + waiter_result = oci.wait_until( + self._work_request_client, + self._work_request_client.get_work_request(work_request_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states, + **waiter_kwargs + ) + return waiter_result + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def create_autonomous_database_software_image_and_wait_for_state(self, create_autonomous_database_software_image_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.database.DatabaseClient.create_autonomous_database_software_image` and waits for the :py:class:`~oci.database.models.AutonomousDatabaseSoftwareImage` acted upon + to enter the given state(s). + + :param oci.database.models.CreateAutonomousDatabaseSoftwareImageDetails create_autonomous_database_software_image_details: (required) + Request to create Autonomous Database Software Image. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.database.models.AutonomousDatabaseSoftwareImage.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.database.DatabaseClient.create_autonomous_database_software_image` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.create_autonomous_database_software_image(create_autonomous_database_software_image_details, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + autonomous_database_software_image_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_autonomous_database_software_image(autonomous_database_software_image_id), # noqa: F821 + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except (NameError, TypeError) as e: + if not e.args: + e.args = ('',) + e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', ) + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def create_autonomous_vm_cluster_and_wait_for_work_request(self, create_autonomous_vm_cluster_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.database.DatabaseClient.create_autonomous_vm_cluster` and waits for the oci.work_requests.models.WorkRequest @@ -4271,6 +4390,44 @@ def delete_autonomous_database_backup_and_wait_for_work_request(self, autonomous except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def delete_autonomous_database_software_image_and_wait_for_work_request(self, autonomous_database_software_image_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.database.DatabaseClient.delete_autonomous_database_software_image` and waits for the oci.work_requests.models.WorkRequest + to enter the given state(s). + + :param str autonomous_database_software_image_id: (required) + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param list[str] work_request_states: (optional) + An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status` + Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED] + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.database.DatabaseClient.delete_autonomous_database_software_image` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.delete_autonomous_database_software_image(autonomous_database_software_image_id, **operation_kwargs) + work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES + lowered_work_request_states = [w.lower() for w in work_request_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + work_request_id = operation_result.headers['opc-work-request-id'] + try: + waiter_result = oci.wait_until( + self._work_request_client, + self._work_request_client.get_work_request(work_request_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states, + **waiter_kwargs + ) + return waiter_result + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def delete_autonomous_vm_cluster_and_wait_for_work_request(self, autonomous_vm_cluster_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.database.DatabaseClient.delete_autonomous_vm_cluster` and waits for the oci.work_requests.models.WorkRequest @@ -9889,6 +10046,53 @@ def update_autonomous_database_regional_wallet_and_wait_for_work_request(self, u except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def update_autonomous_database_software_image_and_wait_for_state(self, autonomous_database_software_image_id, update_autonomous_database_software_image_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.database.DatabaseClient.update_autonomous_database_software_image` and waits for the :py:class:`~oci.database.models.AutonomousDatabaseSoftwareImage` acted upon + to enter the given state(s). + + :param str autonomous_database_software_image_id: (required) + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + :param oci.database.models.UpdateAutonomousDatabaseSoftwareImageDetails update_autonomous_database_software_image_details: (required) + Request to update the properties of an Autonomous Database Software Image. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.database.models.AutonomousDatabaseSoftwareImage.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.database.DatabaseClient.update_autonomous_database_software_image` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_autonomous_database_software_image(autonomous_database_software_image_id, update_autonomous_database_software_image_details, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + autonomous_database_software_image_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_autonomous_database_software_image(autonomous_database_software_image_id), # noqa: F821 + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except (NameError, TypeError) as e: + if not e.args: + e.args = ('',) + e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', ) + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def update_autonomous_database_wallet_and_wait_for_work_request(self, autonomous_database_id, update_autonomous_database_wallet_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.database.DatabaseClient.update_autonomous_database_wallet` and waits for the oci.work_requests.models.WorkRequest diff --git a/src/oci/database/models/__init__.py b/src/oci/database/models/__init__.py index 4c4762d1a..4b84aece8 100644 --- a/src/oci/database/models/__init__.py +++ b/src/oci/database/models/__init__.py @@ -36,6 +36,9 @@ from .autonomous_database_dataguard_association import AutonomousDatabaseDataguardAssociation from .autonomous_database_key_history_entry import AutonomousDatabaseKeyHistoryEntry from .autonomous_database_manual_refresh_details import AutonomousDatabaseManualRefreshDetails +from .autonomous_database_software_image import AutonomousDatabaseSoftwareImage +from .autonomous_database_software_image_collection import AutonomousDatabaseSoftwareImageCollection +from .autonomous_database_software_image_summary import AutonomousDatabaseSoftwareImageSummary from .autonomous_database_standby_summary import AutonomousDatabaseStandbySummary from .autonomous_database_summary import AutonomousDatabaseSummary from .autonomous_database_wallet import AutonomousDatabaseWallet @@ -59,6 +62,7 @@ from .backup_destination_details import BackupDestinationDetails from .backup_destination_summary import BackupDestinationSummary from .backup_summary import BackupSummary +from .change_autonomous_database_software_image_compartment_details import ChangeAutonomousDatabaseSoftwareImageCompartmentDetails from .change_autonomous_vm_cluster_compartment_details import ChangeAutonomousVmClusterCompartmentDetails from .change_cloud_autonomous_vm_cluster_compartment_details import ChangeCloudAutonomousVmClusterCompartmentDetails from .change_cloud_exadata_infrastructure_compartment_details import ChangeCloudExadataInfrastructureCompartmentDetails @@ -102,6 +106,7 @@ from .create_autonomous_database_details import CreateAutonomousDatabaseDetails from .create_autonomous_database_from_backup_details import CreateAutonomousDatabaseFromBackupDetails from .create_autonomous_database_from_backup_timestamp_details import CreateAutonomousDatabaseFromBackupTimestampDetails +from .create_autonomous_database_software_image_details import CreateAutonomousDatabaseSoftwareImageDetails from .create_autonomous_vm_cluster_details import CreateAutonomousVmClusterDetails from .create_backup_destination_details import CreateBackupDestinationDetails from .create_backup_details import CreateBackupDetails @@ -326,6 +331,7 @@ from .update_autonomous_container_database_details import UpdateAutonomousContainerDatabaseDetails from .update_autonomous_database_backup_details import UpdateAutonomousDatabaseBackupDetails from .update_autonomous_database_details import UpdateAutonomousDatabaseDetails +from .update_autonomous_database_software_image_details import UpdateAutonomousDatabaseSoftwareImageDetails from .update_autonomous_database_wallet_details import UpdateAutonomousDatabaseWalletDetails from .update_autonomous_exadata_infrastructure_details import UpdateAutonomousExadataInfrastructureDetails from .update_autonomous_vm_cluster_details import UpdateAutonomousVmClusterDetails @@ -405,6 +411,9 @@ "AutonomousDatabaseDataguardAssociation": AutonomousDatabaseDataguardAssociation, "AutonomousDatabaseKeyHistoryEntry": AutonomousDatabaseKeyHistoryEntry, "AutonomousDatabaseManualRefreshDetails": AutonomousDatabaseManualRefreshDetails, + "AutonomousDatabaseSoftwareImage": AutonomousDatabaseSoftwareImage, + "AutonomousDatabaseSoftwareImageCollection": AutonomousDatabaseSoftwareImageCollection, + "AutonomousDatabaseSoftwareImageSummary": AutonomousDatabaseSoftwareImageSummary, "AutonomousDatabaseStandbySummary": AutonomousDatabaseStandbySummary, "AutonomousDatabaseSummary": AutonomousDatabaseSummary, "AutonomousDatabaseWallet": AutonomousDatabaseWallet, @@ -428,6 +437,7 @@ "BackupDestinationDetails": BackupDestinationDetails, "BackupDestinationSummary": BackupDestinationSummary, "BackupSummary": BackupSummary, + "ChangeAutonomousDatabaseSoftwareImageCompartmentDetails": ChangeAutonomousDatabaseSoftwareImageCompartmentDetails, "ChangeAutonomousVmClusterCompartmentDetails": ChangeAutonomousVmClusterCompartmentDetails, "ChangeCloudAutonomousVmClusterCompartmentDetails": ChangeCloudAutonomousVmClusterCompartmentDetails, "ChangeCloudExadataInfrastructureCompartmentDetails": ChangeCloudExadataInfrastructureCompartmentDetails, @@ -471,6 +481,7 @@ "CreateAutonomousDatabaseDetails": CreateAutonomousDatabaseDetails, "CreateAutonomousDatabaseFromBackupDetails": CreateAutonomousDatabaseFromBackupDetails, "CreateAutonomousDatabaseFromBackupTimestampDetails": CreateAutonomousDatabaseFromBackupTimestampDetails, + "CreateAutonomousDatabaseSoftwareImageDetails": CreateAutonomousDatabaseSoftwareImageDetails, "CreateAutonomousVmClusterDetails": CreateAutonomousVmClusterDetails, "CreateBackupDestinationDetails": CreateBackupDestinationDetails, "CreateBackupDetails": CreateBackupDetails, @@ -695,6 +706,7 @@ "UpdateAutonomousContainerDatabaseDetails": UpdateAutonomousContainerDatabaseDetails, "UpdateAutonomousDatabaseBackupDetails": UpdateAutonomousDatabaseBackupDetails, "UpdateAutonomousDatabaseDetails": UpdateAutonomousDatabaseDetails, + "UpdateAutonomousDatabaseSoftwareImageDetails": UpdateAutonomousDatabaseSoftwareImageDetails, "UpdateAutonomousDatabaseWalletDetails": UpdateAutonomousDatabaseWalletDetails, "UpdateAutonomousExadataInfrastructureDetails": UpdateAutonomousExadataInfrastructureDetails, "UpdateAutonomousVmClusterDetails": UpdateAutonomousVmClusterDetails, diff --git a/src/oci/database/models/autonomous_container_database.py b/src/oci/database/models/autonomous_container_database.py index 1e81669d1..a145a23b5 100644 --- a/src/oci/database/models/autonomous_container_database.py +++ b/src/oci/database/models/autonomous_container_database.py @@ -328,6 +328,10 @@ def __init__(self, **kwargs): The value to assign to the provisionable_cpus property of this AutonomousContainerDatabase. :type provisionable_cpus: list[float] + :param list_one_off_patches: + The value to assign to the list_one_off_patches property of this AutonomousContainerDatabase. + :type list_one_off_patches: list[str] + :param compute_model: The value to assign to the compute_model property of this AutonomousContainerDatabase. Allowed values for this property are: "ECPU", "OCPU", 'UNKNOWN_ENUM_VALUE'. @@ -412,6 +416,7 @@ def __init__(self, **kwargs): 'total_cpus': 'int', 'reclaimable_cpus': 'float', 'provisionable_cpus': 'list[float]', + 'list_one_off_patches': 'list[str]', 'compute_model': 'str', 'provisioned_cpus': 'float', 'reserved_cpus': 'float', @@ -464,6 +469,7 @@ def __init__(self, **kwargs): 'total_cpus': 'totalCpus', 'reclaimable_cpus': 'reclaimableCpus', 'provisionable_cpus': 'provisionableCpus', + 'list_one_off_patches': 'listOneOffPatches', 'compute_model': 'computeModel', 'provisioned_cpus': 'provisionedCpus', 'reserved_cpus': 'reservedCpus', @@ -515,6 +521,7 @@ def __init__(self, **kwargs): self._total_cpus = None self._reclaimable_cpus = None self._provisionable_cpus = None + self._list_one_off_patches = None self._compute_model = None self._provisioned_cpus = None self._reserved_cpus = None @@ -1557,6 +1564,30 @@ def provisionable_cpus(self, provisionable_cpus): """ self._provisionable_cpus = provisionable_cpus + @property + def list_one_off_patches(self): + """ + Gets the list_one_off_patches of this AutonomousContainerDatabase. + List of One-Off patches that has been successfully applied to Autonomous Container Database + + + :return: The list_one_off_patches of this AutonomousContainerDatabase. + :rtype: list[str] + """ + return self._list_one_off_patches + + @list_one_off_patches.setter + def list_one_off_patches(self, list_one_off_patches): + """ + Sets the list_one_off_patches of this AutonomousContainerDatabase. + List of One-Off patches that has been successfully applied to Autonomous Container Database + + + :param list_one_off_patches: The list_one_off_patches of this AutonomousContainerDatabase. + :type: list[str] + """ + self._list_one_off_patches = list_one_off_patches + @property def compute_model(self): """ diff --git a/src/oci/database/models/autonomous_container_database_summary.py b/src/oci/database/models/autonomous_container_database_summary.py index 4ba20c3a8..214c1c998 100644 --- a/src/oci/database/models/autonomous_container_database_summary.py +++ b/src/oci/database/models/autonomous_container_database_summary.py @@ -328,6 +328,10 @@ def __init__(self, **kwargs): The value to assign to the provisionable_cpus property of this AutonomousContainerDatabaseSummary. :type provisionable_cpus: list[float] + :param list_one_off_patches: + The value to assign to the list_one_off_patches property of this AutonomousContainerDatabaseSummary. + :type list_one_off_patches: list[str] + :param compute_model: The value to assign to the compute_model property of this AutonomousContainerDatabaseSummary. Allowed values for this property are: "ECPU", "OCPU", 'UNKNOWN_ENUM_VALUE'. @@ -412,6 +416,7 @@ def __init__(self, **kwargs): 'total_cpus': 'int', 'reclaimable_cpus': 'float', 'provisionable_cpus': 'list[float]', + 'list_one_off_patches': 'list[str]', 'compute_model': 'str', 'provisioned_cpus': 'float', 'reserved_cpus': 'float', @@ -464,6 +469,7 @@ def __init__(self, **kwargs): 'total_cpus': 'totalCpus', 'reclaimable_cpus': 'reclaimableCpus', 'provisionable_cpus': 'provisionableCpus', + 'list_one_off_patches': 'listOneOffPatches', 'compute_model': 'computeModel', 'provisioned_cpus': 'provisionedCpus', 'reserved_cpus': 'reservedCpus', @@ -515,6 +521,7 @@ def __init__(self, **kwargs): self._total_cpus = None self._reclaimable_cpus = None self._provisionable_cpus = None + self._list_one_off_patches = None self._compute_model = None self._provisioned_cpus = None self._reserved_cpus = None @@ -1557,6 +1564,30 @@ def provisionable_cpus(self, provisionable_cpus): """ self._provisionable_cpus = provisionable_cpus + @property + def list_one_off_patches(self): + """ + Gets the list_one_off_patches of this AutonomousContainerDatabaseSummary. + List of One-Off patches that has been successfully applied to Autonomous Container Database + + + :return: The list_one_off_patches of this AutonomousContainerDatabaseSummary. + :rtype: list[str] + """ + return self._list_one_off_patches + + @list_one_off_patches.setter + def list_one_off_patches(self, list_one_off_patches): + """ + Sets the list_one_off_patches of this AutonomousContainerDatabaseSummary. + List of One-Off patches that has been successfully applied to Autonomous Container Database + + + :param list_one_off_patches: The list_one_off_patches of this AutonomousContainerDatabaseSummary. + :type: list[str] + """ + self._list_one_off_patches = list_one_off_patches + @property def compute_model(self): """ diff --git a/src/oci/database/models/autonomous_database_software_image.py b/src/oci/database/models/autonomous_database_software_image.py new file mode 100644 index 000000000..11fc4168e --- /dev/null +++ b/src/oci/database/models/autonomous_database_software_image.py @@ -0,0 +1,489 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class AutonomousDatabaseSoftwareImage(object): + """ + Autonomous Database Software Images created from Autonomous Container Database + """ + + #: A constant which can be used with the lifecycle_state property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "AVAILABLE" + LIFECYCLE_STATE_AVAILABLE = "AVAILABLE" + + #: A constant which can be used with the lifecycle_state property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "FAILED" + LIFECYCLE_STATE_FAILED = "FAILED" + + #: A constant which can be used with the lifecycle_state property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "PROVISIONING" + LIFECYCLE_STATE_PROVISIONING = "PROVISIONING" + + #: A constant which can be used with the lifecycle_state property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "EXPIRED" + LIFECYCLE_STATE_EXPIRED = "EXPIRED" + + #: A constant which can be used with the lifecycle_state property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "TERMINATED" + LIFECYCLE_STATE_TERMINATED = "TERMINATED" + + #: A constant which can be used with the lifecycle_state property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "TERMINATING" + LIFECYCLE_STATE_TERMINATING = "TERMINATING" + + #: A constant which can be used with the lifecycle_state property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "UPDATING" + LIFECYCLE_STATE_UPDATING = "UPDATING" + + #: A constant which can be used with the image_shape_family property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "EXACC_SHAPE" + IMAGE_SHAPE_FAMILY_EXACC_SHAPE = "EXACC_SHAPE" + + #: A constant which can be used with the image_shape_family property of a AutonomousDatabaseSoftwareImage. + #: This constant has a value of "EXADATA_SHAPE" + IMAGE_SHAPE_FAMILY_EXADATA_SHAPE = "EXADATA_SHAPE" + + def __init__(self, **kwargs): + """ + Initializes a new AutonomousDatabaseSoftwareImage object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this AutonomousDatabaseSoftwareImage. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this AutonomousDatabaseSoftwareImage. + :type compartment_id: str + + :param database_version: + The value to assign to the database_version property of this AutonomousDatabaseSoftwareImage. + :type database_version: str + + :param display_name: + The value to assign to the display_name property of this AutonomousDatabaseSoftwareImage. + :type display_name: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this AutonomousDatabaseSoftwareImage. + Allowed values for this property are: "AVAILABLE", "FAILED", "PROVISIONING", "EXPIRED", "TERMINATED", "TERMINATING", "UPDATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + :param lifecycle_details: + The value to assign to the lifecycle_details property of this AutonomousDatabaseSoftwareImage. + :type lifecycle_details: str + + :param time_created: + The value to assign to the time_created property of this AutonomousDatabaseSoftwareImage. + :type time_created: datetime + + :param release_update: + The value to assign to the release_update property of this AutonomousDatabaseSoftwareImage. + :type release_update: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this AutonomousDatabaseSoftwareImage. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this AutonomousDatabaseSoftwareImage. + :type defined_tags: dict(str, dict(str, object)) + + :param autonomous_dsi_one_off_patches: + The value to assign to the autonomous_dsi_one_off_patches property of this AutonomousDatabaseSoftwareImage. + :type autonomous_dsi_one_off_patches: list[str] + + :param image_shape_family: + The value to assign to the image_shape_family property of this AutonomousDatabaseSoftwareImage. + Allowed values for this property are: "EXACC_SHAPE", "EXADATA_SHAPE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type image_shape_family: str + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'database_version': 'str', + 'display_name': 'str', + 'lifecycle_state': 'str', + 'lifecycle_details': 'str', + 'time_created': 'datetime', + 'release_update': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'autonomous_dsi_one_off_patches': 'list[str]', + 'image_shape_family': 'str' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'database_version': 'databaseVersion', + 'display_name': 'displayName', + 'lifecycle_state': 'lifecycleState', + 'lifecycle_details': 'lifecycleDetails', + 'time_created': 'timeCreated', + 'release_update': 'releaseUpdate', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'autonomous_dsi_one_off_patches': 'autonomousDsiOneOffPatches', + 'image_shape_family': 'imageShapeFamily' + } + + self._id = None + self._compartment_id = None + self._database_version = None + self._display_name = None + self._lifecycle_state = None + self._lifecycle_details = None + self._time_created = None + self._release_update = None + self._freeform_tags = None + self._defined_tags = None + self._autonomous_dsi_one_off_patches = None + self._image_shape_family = None + + @property + def id(self): + """ + **[Required]** Gets the id of this AutonomousDatabaseSoftwareImage. + The `OCID`__ of the Autonomous Database Software Image. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The id of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this AutonomousDatabaseSoftwareImage. + The `OCID`__ of the Autonomous Database Software Image. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param id: The id of this AutonomousDatabaseSoftwareImage. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this AutonomousDatabaseSoftwareImage. + The `OCID`__ of the compartment. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The compartment_id of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this AutonomousDatabaseSoftwareImage. + The `OCID`__ of the compartment. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param compartment_id: The compartment_id of this AutonomousDatabaseSoftwareImage. + :type: str + """ + self._compartment_id = compartment_id + + @property + def database_version(self): + """ + **[Required]** Gets the database_version of this AutonomousDatabaseSoftwareImage. + The database version with which the Autonomous Database Software Image is to be built. + + + :return: The database_version of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._database_version + + @database_version.setter + def database_version(self, database_version): + """ + Sets the database_version of this AutonomousDatabaseSoftwareImage. + The database version with which the Autonomous Database Software Image is to be built. + + + :param database_version: The database_version of this AutonomousDatabaseSoftwareImage. + :type: str + """ + self._database_version = database_version + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this AutonomousDatabaseSoftwareImage. + The user-friendly name for the Autonomous Database Software Image. The name does not have to be unique. + + + :return: The display_name of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this AutonomousDatabaseSoftwareImage. + The user-friendly name for the Autonomous Database Software Image. The name does not have to be unique. + + + :param display_name: The display_name of this AutonomousDatabaseSoftwareImage. + :type: str + """ + self._display_name = display_name + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this AutonomousDatabaseSoftwareImage. + The current state of the Autonomous Database Software Image. + + Allowed values for this property are: "AVAILABLE", "FAILED", "PROVISIONING", "EXPIRED", "TERMINATED", "TERMINATING", "UPDATING", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this AutonomousDatabaseSoftwareImage. + The current state of the Autonomous Database Software Image. + + + :param lifecycle_state: The lifecycle_state of this AutonomousDatabaseSoftwareImage. + :type: str + """ + allowed_values = ["AVAILABLE", "FAILED", "PROVISIONING", "EXPIRED", "TERMINATED", "TERMINATING", "UPDATING"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + @property + def lifecycle_details(self): + """ + Gets the lifecycle_details of this AutonomousDatabaseSoftwareImage. + Detailed message for the lifecycle state. + + + :return: The lifecycle_details of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._lifecycle_details + + @lifecycle_details.setter + def lifecycle_details(self, lifecycle_details): + """ + Sets the lifecycle_details of this AutonomousDatabaseSoftwareImage. + Detailed message for the lifecycle state. + + + :param lifecycle_details: The lifecycle_details of this AutonomousDatabaseSoftwareImage. + :type: str + """ + self._lifecycle_details = lifecycle_details + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this AutonomousDatabaseSoftwareImage. + The date and time the Autonomous Database Software Image was created. + + + :return: The time_created of this AutonomousDatabaseSoftwareImage. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this AutonomousDatabaseSoftwareImage. + The date and time the Autonomous Database Software Image was created. + + + :param time_created: The time_created of this AutonomousDatabaseSoftwareImage. + :type: datetime + """ + self._time_created = time_created + + @property + def release_update(self): + """ + **[Required]** Gets the release_update of this AutonomousDatabaseSoftwareImage. + The Release Updates. + + + :return: The release_update of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._release_update + + @release_update.setter + def release_update(self, release_update): + """ + Sets the release_update of this AutonomousDatabaseSoftwareImage. + The Release Updates. + + + :param release_update: The release_update of this AutonomousDatabaseSoftwareImage. + :type: str + """ + self._release_update = release_update + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this AutonomousDatabaseSoftwareImage. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this AutonomousDatabaseSoftwareImage. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this AutonomousDatabaseSoftwareImage. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this AutonomousDatabaseSoftwareImage. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this AutonomousDatabaseSoftwareImage. + 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/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this AutonomousDatabaseSoftwareImage. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this AutonomousDatabaseSoftwareImage. + 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/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this AutonomousDatabaseSoftwareImage. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def autonomous_dsi_one_off_patches(self): + """ + Gets the autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImage. + One-off patches included in the Autonomous Database Software Image + + + :return: The autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImage. + :rtype: list[str] + """ + return self._autonomous_dsi_one_off_patches + + @autonomous_dsi_one_off_patches.setter + def autonomous_dsi_one_off_patches(self, autonomous_dsi_one_off_patches): + """ + Sets the autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImage. + One-off patches included in the Autonomous Database Software Image + + + :param autonomous_dsi_one_off_patches: The autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImage. + :type: list[str] + """ + self._autonomous_dsi_one_off_patches = autonomous_dsi_one_off_patches + + @property + def image_shape_family(self): + """ + **[Required]** Gets the image_shape_family of this AutonomousDatabaseSoftwareImage. + To what shape the image is meant for. + + Allowed values for this property are: "EXACC_SHAPE", "EXADATA_SHAPE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The image_shape_family of this AutonomousDatabaseSoftwareImage. + :rtype: str + """ + return self._image_shape_family + + @image_shape_family.setter + def image_shape_family(self, image_shape_family): + """ + Sets the image_shape_family of this AutonomousDatabaseSoftwareImage. + To what shape the image is meant for. + + + :param image_shape_family: The image_shape_family of this AutonomousDatabaseSoftwareImage. + :type: str + """ + allowed_values = ["EXACC_SHAPE", "EXADATA_SHAPE"] + if not value_allowed_none_or_none_sentinel(image_shape_family, allowed_values): + image_shape_family = 'UNKNOWN_ENUM_VALUE' + self._image_shape_family = image_shape_family + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database/models/autonomous_database_software_image_collection.py b/src/oci/database/models/autonomous_database_software_image_collection.py new file mode 100644 index 000000000..287e04c34 --- /dev/null +++ b/src/oci/database/models/autonomous_database_software_image_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class AutonomousDatabaseSoftwareImageCollection(object): + """ + Result of List Autonomous Database Software Images. + """ + + def __init__(self, **kwargs): + """ + Initializes a new AutonomousDatabaseSoftwareImageCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this AutonomousDatabaseSoftwareImageCollection. + :type items: list[oci.database.models.AutonomousDatabaseSoftwareImageSummary] + + """ + self.swagger_types = { + 'items': 'list[AutonomousDatabaseSoftwareImageSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this AutonomousDatabaseSoftwareImageCollection. + List of Autonomous Database Software Images. + + + :return: The items of this AutonomousDatabaseSoftwareImageCollection. + :rtype: list[oci.database.models.AutonomousDatabaseSoftwareImageSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this AutonomousDatabaseSoftwareImageCollection. + List of Autonomous Database Software Images. + + + :param items: The items of this AutonomousDatabaseSoftwareImageCollection. + :type: list[oci.database.models.AutonomousDatabaseSoftwareImageSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database/models/autonomous_database_software_image_summary.py b/src/oci/database/models/autonomous_database_software_image_summary.py new file mode 100644 index 000000000..cc02033a7 --- /dev/null +++ b/src/oci/database/models/autonomous_database_software_image_summary.py @@ -0,0 +1,437 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class AutonomousDatabaseSoftwareImageSummary(object): + """ + The Database service supports the creation of Autonomous Database Software Images for use in creating Autonomous Container Database. + """ + + def __init__(self, **kwargs): + """ + Initializes a new AutonomousDatabaseSoftwareImageSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this AutonomousDatabaseSoftwareImageSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this AutonomousDatabaseSoftwareImageSummary. + :type compartment_id: str + + :param database_version: + The value to assign to the database_version property of this AutonomousDatabaseSoftwareImageSummary. + :type database_version: str + + :param display_name: + The value to assign to the display_name property of this AutonomousDatabaseSoftwareImageSummary. + :type display_name: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this AutonomousDatabaseSoftwareImageSummary. + :type lifecycle_state: str + + :param lifecycle_details: + The value to assign to the lifecycle_details property of this AutonomousDatabaseSoftwareImageSummary. + :type lifecycle_details: str + + :param time_created: + The value to assign to the time_created property of this AutonomousDatabaseSoftwareImageSummary. + :type time_created: datetime + + :param release_update: + The value to assign to the release_update property of this AutonomousDatabaseSoftwareImageSummary. + :type release_update: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this AutonomousDatabaseSoftwareImageSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this AutonomousDatabaseSoftwareImageSummary. + :type defined_tags: dict(str, dict(str, object)) + + :param autonomous_dsi_one_off_patches: + The value to assign to the autonomous_dsi_one_off_patches property of this AutonomousDatabaseSoftwareImageSummary. + :type autonomous_dsi_one_off_patches: list[str] + + :param image_shape_family: + The value to assign to the image_shape_family property of this AutonomousDatabaseSoftwareImageSummary. + :type image_shape_family: str + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'database_version': 'str', + 'display_name': 'str', + 'lifecycle_state': 'str', + 'lifecycle_details': 'str', + 'time_created': 'datetime', + 'release_update': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'autonomous_dsi_one_off_patches': 'list[str]', + 'image_shape_family': 'str' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'database_version': 'databaseVersion', + 'display_name': 'displayName', + 'lifecycle_state': 'lifecycleState', + 'lifecycle_details': 'lifecycleDetails', + 'time_created': 'timeCreated', + 'release_update': 'releaseUpdate', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'autonomous_dsi_one_off_patches': 'autonomousDsiOneOffPatches', + 'image_shape_family': 'imageShapeFamily' + } + + self._id = None + self._compartment_id = None + self._database_version = None + self._display_name = None + self._lifecycle_state = None + self._lifecycle_details = None + self._time_created = None + self._release_update = None + self._freeform_tags = None + self._defined_tags = None + self._autonomous_dsi_one_off_patches = None + self._image_shape_family = None + + @property + def id(self): + """ + **[Required]** Gets the id of this AutonomousDatabaseSoftwareImageSummary. + The `OCID`__ of the Autonomous Database Software Image. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The id of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this AutonomousDatabaseSoftwareImageSummary. + The `OCID`__ of the Autonomous Database Software Image. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param id: The id of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this AutonomousDatabaseSoftwareImageSummary. + The `OCID`__ of the compartment. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The compartment_id of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this AutonomousDatabaseSoftwareImageSummary. + The `OCID`__ of the compartment. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param compartment_id: The compartment_id of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def database_version(self): + """ + **[Required]** Gets the database_version of this AutonomousDatabaseSoftwareImageSummary. + The database version with which the Autonomous Database Software Image is to be built. + + + :return: The database_version of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._database_version + + @database_version.setter + def database_version(self, database_version): + """ + Sets the database_version of this AutonomousDatabaseSoftwareImageSummary. + The database version with which the Autonomous Database Software Image is to be built. + + + :param database_version: The database_version of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._database_version = database_version + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this AutonomousDatabaseSoftwareImageSummary. + The user-friendly name for the Autonomous Database Software Image. The name does not have to be unique. + + + :return: The display_name of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this AutonomousDatabaseSoftwareImageSummary. + The user-friendly name for the Autonomous Database Software Image. The name does not have to be unique. + + + :param display_name: The display_name of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._display_name = display_name + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this AutonomousDatabaseSoftwareImageSummary. + The current state of the Autonomous Database Software Image. + + + :return: The lifecycle_state of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this AutonomousDatabaseSoftwareImageSummary. + The current state of the Autonomous Database Software Image. + + + :param lifecycle_state: The lifecycle_state of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._lifecycle_state = lifecycle_state + + @property + def lifecycle_details(self): + """ + Gets the lifecycle_details of this AutonomousDatabaseSoftwareImageSummary. + Detailed message for the lifecycle state. + + + :return: The lifecycle_details of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._lifecycle_details + + @lifecycle_details.setter + def lifecycle_details(self, lifecycle_details): + """ + Sets the lifecycle_details of this AutonomousDatabaseSoftwareImageSummary. + Detailed message for the lifecycle state. + + + :param lifecycle_details: The lifecycle_details of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._lifecycle_details = lifecycle_details + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this AutonomousDatabaseSoftwareImageSummary. + The date and time the Autonomous Database Software Image was created. + + + :return: The time_created of this AutonomousDatabaseSoftwareImageSummary. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this AutonomousDatabaseSoftwareImageSummary. + The date and time the Autonomous Database Software Image was created. + + + :param time_created: The time_created of this AutonomousDatabaseSoftwareImageSummary. + :type: datetime + """ + self._time_created = time_created + + @property + def release_update(self): + """ + **[Required]** Gets the release_update of this AutonomousDatabaseSoftwareImageSummary. + The Release Updates. + + + :return: The release_update of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._release_update + + @release_update.setter + def release_update(self, release_update): + """ + Sets the release_update of this AutonomousDatabaseSoftwareImageSummary. + The Release Updates. + + + :param release_update: The release_update of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._release_update = release_update + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this AutonomousDatabaseSoftwareImageSummary. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this AutonomousDatabaseSoftwareImageSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this AutonomousDatabaseSoftwareImageSummary. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this AutonomousDatabaseSoftwareImageSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this AutonomousDatabaseSoftwareImageSummary. + 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/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this AutonomousDatabaseSoftwareImageSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this AutonomousDatabaseSoftwareImageSummary. + 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/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this AutonomousDatabaseSoftwareImageSummary. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def autonomous_dsi_one_off_patches(self): + """ + Gets the autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImageSummary. + One-off patches included in the Autonomous Database Software Image + + + :return: The autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImageSummary. + :rtype: list[str] + """ + return self._autonomous_dsi_one_off_patches + + @autonomous_dsi_one_off_patches.setter + def autonomous_dsi_one_off_patches(self, autonomous_dsi_one_off_patches): + """ + Sets the autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImageSummary. + One-off patches included in the Autonomous Database Software Image + + + :param autonomous_dsi_one_off_patches: The autonomous_dsi_one_off_patches of this AutonomousDatabaseSoftwareImageSummary. + :type: list[str] + """ + self._autonomous_dsi_one_off_patches = autonomous_dsi_one_off_patches + + @property + def image_shape_family(self): + """ + **[Required]** Gets the image_shape_family of this AutonomousDatabaseSoftwareImageSummary. + To what shape the image is meant for. + + + :return: The image_shape_family of this AutonomousDatabaseSoftwareImageSummary. + :rtype: str + """ + return self._image_shape_family + + @image_shape_family.setter + def image_shape_family(self, image_shape_family): + """ + Sets the image_shape_family of this AutonomousDatabaseSoftwareImageSummary. + To what shape the image is meant for. + + + :param image_shape_family: The image_shape_family of this AutonomousDatabaseSoftwareImageSummary. + :type: str + """ + self._image_shape_family = image_shape_family + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database/models/change_autonomous_database_software_image_compartment_details.py b/src/oci/database/models/change_autonomous_database_software_image_compartment_details.py new file mode 100644 index 000000000..2802a737d --- /dev/null +++ b/src/oci/database/models/change_autonomous_database_software_image_compartment_details.py @@ -0,0 +1,76 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ChangeAutonomousDatabaseSoftwareImageCompartmentDetails(object): + """ + The configuration details for moving the resource. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ChangeAutonomousDatabaseSoftwareImageCompartmentDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this ChangeAutonomousDatabaseSoftwareImageCompartmentDetails. + :type compartment_id: str + + """ + self.swagger_types = { + 'compartment_id': 'str' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId' + } + + self._compartment_id = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this ChangeAutonomousDatabaseSoftwareImageCompartmentDetails. + The `OCID`__ of the compartment to move the resource to. + + __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm + + + :return: The compartment_id of this ChangeAutonomousDatabaseSoftwareImageCompartmentDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this ChangeAutonomousDatabaseSoftwareImageCompartmentDetails. + The `OCID`__ of the compartment to move the resource to. + + __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm + + + :param compartment_id: The compartment_id of this ChangeAutonomousDatabaseSoftwareImageCompartmentDetails. + :type: str + """ + self._compartment_id = compartment_id + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database/models/create_autonomous_container_database_details.py b/src/oci/database/models/create_autonomous_container_database_details.py index 2ad3e470c..365ee139b 100644 --- a/src/oci/database/models/create_autonomous_container_database_details.py +++ b/src/oci/database/models/create_autonomous_container_database_details.py @@ -93,6 +93,10 @@ def __init__(self, **kwargs): The value to assign to the db_version property of this CreateAutonomousContainerDatabaseDetails. :type db_version: str + :param database_software_image_id: + The value to assign to the database_software_image_id property of this CreateAutonomousContainerDatabaseDetails. + :type database_software_image_id: str + :param peer_autonomous_exadata_infrastructure_id: The value to assign to the peer_autonomous_exadata_infrastructure_id property of this CreateAutonomousContainerDatabaseDetails. :type peer_autonomous_exadata_infrastructure_id: str @@ -222,6 +226,7 @@ def __init__(self, **kwargs): 'service_level_agreement_type': 'str', 'autonomous_exadata_infrastructure_id': 'str', 'db_version': 'str', + 'database_software_image_id': 'str', 'peer_autonomous_exadata_infrastructure_id': 'str', 'peer_autonomous_container_database_display_name': 'str', 'protection_mode': 'str', @@ -260,6 +265,7 @@ def __init__(self, **kwargs): 'service_level_agreement_type': 'serviceLevelAgreementType', 'autonomous_exadata_infrastructure_id': 'autonomousExadataInfrastructureId', 'db_version': 'dbVersion', + 'database_software_image_id': 'databaseSoftwareImageId', 'peer_autonomous_exadata_infrastructure_id': 'peerAutonomousExadataInfrastructureId', 'peer_autonomous_container_database_display_name': 'peerAutonomousContainerDatabaseDisplayName', 'protection_mode': 'protectionMode', @@ -297,6 +303,7 @@ def __init__(self, **kwargs): self._service_level_agreement_type = None self._autonomous_exadata_infrastructure_id = None self._db_version = None + self._database_software_image_id = None self._peer_autonomous_exadata_infrastructure_id = None self._peer_autonomous_container_database_display_name = None self._protection_mode = None @@ -478,6 +485,34 @@ def db_version(self, db_version): """ self._db_version = db_version + @property + def database_software_image_id(self): + """ + Gets the database_software_image_id of this CreateAutonomousContainerDatabaseDetails. + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The database_software_image_id of this CreateAutonomousContainerDatabaseDetails. + :rtype: str + """ + return self._database_software_image_id + + @database_software_image_id.setter + def database_software_image_id(self, database_software_image_id): + """ + Sets the database_software_image_id of this CreateAutonomousContainerDatabaseDetails. + The Autonomous Database Software Image `OCID`__. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param database_software_image_id: The database_software_image_id of this CreateAutonomousContainerDatabaseDetails. + :type: str + """ + self._database_software_image_id = database_software_image_id + @property def peer_autonomous_exadata_infrastructure_id(self): """ diff --git a/src/oci/database/models/create_autonomous_database_software_image_details.py b/src/oci/database/models/create_autonomous_database_software_image_details.py new file mode 100644 index 000000000..0ae5aa966 --- /dev/null +++ b/src/oci/database/models/create_autonomous_database_software_image_details.py @@ -0,0 +1,267 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CreateAutonomousDatabaseSoftwareImageDetails(object): + """ + Parameters for creating a Autonomous Database Software Image + """ + + #: A constant which can be used with the image_shape_family property of a CreateAutonomousDatabaseSoftwareImageDetails. + #: This constant has a value of "EXADATA_SHAPE" + IMAGE_SHAPE_FAMILY_EXADATA_SHAPE = "EXADATA_SHAPE" + + #: A constant which can be used with the image_shape_family property of a CreateAutonomousDatabaseSoftwareImageDetails. + #: This constant has a value of "EXACC_SHAPE" + IMAGE_SHAPE_FAMILY_EXACC_SHAPE = "EXACC_SHAPE" + + def __init__(self, **kwargs): + """ + Initializes a new CreateAutonomousDatabaseSoftwareImageDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this CreateAutonomousDatabaseSoftwareImageDetails. + :type compartment_id: str + + :param display_name: + The value to assign to the display_name property of this CreateAutonomousDatabaseSoftwareImageDetails. + :type display_name: str + + :param source_cdb_id: + The value to assign to the source_cdb_id property of this CreateAutonomousDatabaseSoftwareImageDetails. + :type source_cdb_id: str + + :param image_shape_family: + The value to assign to the image_shape_family property of this CreateAutonomousDatabaseSoftwareImageDetails. + Allowed values for this property are: "EXADATA_SHAPE", "EXACC_SHAPE" + :type image_shape_family: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this CreateAutonomousDatabaseSoftwareImageDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this CreateAutonomousDatabaseSoftwareImageDetails. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'display_name': 'str', + 'source_cdb_id': 'str', + 'image_shape_family': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'display_name': 'displayName', + 'source_cdb_id': 'sourceCdbId', + 'image_shape_family': 'imageShapeFamily', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._compartment_id = None + self._display_name = None + self._source_cdb_id = None + self._image_shape_family = None + self._freeform_tags = None + self._defined_tags = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateAutonomousDatabaseSoftwareImageDetails. + The `OCID`__ of the compartment. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The compartment_id of this CreateAutonomousDatabaseSoftwareImageDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateAutonomousDatabaseSoftwareImageDetails. + The `OCID`__ of the compartment. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param compartment_id: The compartment_id of this CreateAutonomousDatabaseSoftwareImageDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def display_name(self): + """ + **[Required]** Gets the display_name of this CreateAutonomousDatabaseSoftwareImageDetails. + The user-friendly name for the Autonomous Database Software Image. The name does not have to be unique. + + + :return: The display_name of this CreateAutonomousDatabaseSoftwareImageDetails. + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """ + Sets the display_name of this CreateAutonomousDatabaseSoftwareImageDetails. + The user-friendly name for the Autonomous Database Software Image. The name does not have to be unique. + + + :param display_name: The display_name of this CreateAutonomousDatabaseSoftwareImageDetails. + :type: str + """ + self._display_name = display_name + + @property + def source_cdb_id(self): + """ + **[Required]** Gets the source_cdb_id of this CreateAutonomousDatabaseSoftwareImageDetails. + The source Autonomous Container Database `OCID`__ from which to create Autonomous Database Software Image. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :return: The source_cdb_id of this CreateAutonomousDatabaseSoftwareImageDetails. + :rtype: str + """ + return self._source_cdb_id + + @source_cdb_id.setter + def source_cdb_id(self, source_cdb_id): + """ + Sets the source_cdb_id of this CreateAutonomousDatabaseSoftwareImageDetails. + The source Autonomous Container Database `OCID`__ from which to create Autonomous Database Software Image. + + __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm + + + :param source_cdb_id: The source_cdb_id of this CreateAutonomousDatabaseSoftwareImageDetails. + :type: str + """ + self._source_cdb_id = source_cdb_id + + @property + def image_shape_family(self): + """ + **[Required]** Gets the image_shape_family of this CreateAutonomousDatabaseSoftwareImageDetails. + To what shape the image is meant for. + + Allowed values for this property are: "EXADATA_SHAPE", "EXACC_SHAPE" + + + :return: The image_shape_family of this CreateAutonomousDatabaseSoftwareImageDetails. + :rtype: str + """ + return self._image_shape_family + + @image_shape_family.setter + def image_shape_family(self, image_shape_family): + """ + Sets the image_shape_family of this CreateAutonomousDatabaseSoftwareImageDetails. + To what shape the image is meant for. + + + :param image_shape_family: The image_shape_family of this CreateAutonomousDatabaseSoftwareImageDetails. + :type: str + """ + allowed_values = ["EXADATA_SHAPE", "EXACC_SHAPE"] + if not value_allowed_none_or_none_sentinel(image_shape_family, allowed_values): + raise ValueError( + f"Invalid value for `image_shape_family`, must be None or one of {allowed_values}" + ) + self._image_shape_family = image_shape_family + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + 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/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + 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/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this CreateAutonomousDatabaseSoftwareImageDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database/models/maintenance_window.py b/src/oci/database/models/maintenance_window.py index 0ad37d1d0..d4d829a48 100644 --- a/src/oci/database/models/maintenance_window.py +++ b/src/oci/database/models/maintenance_window.py @@ -80,6 +80,10 @@ def __init__(self, **kwargs): The value to assign to the lead_time_in_weeks property of this MaintenanceWindow. :type lead_time_in_weeks: int + :param skip_ru: + The value to assign to the skip_ru property of this MaintenanceWindow. + :type skip_ru: list[bool] + """ self.swagger_types = { 'preference': 'str', @@ -91,7 +95,8 @@ def __init__(self, **kwargs): 'weeks_of_month': 'list[int]', 'days_of_week': 'list[DayOfWeek]', 'hours_of_day': 'list[int]', - 'lead_time_in_weeks': 'int' + 'lead_time_in_weeks': 'int', + 'skip_ru': 'list[bool]' } self.attribute_map = { @@ -104,7 +109,8 @@ def __init__(self, **kwargs): 'weeks_of_month': 'weeksOfMonth', 'days_of_week': 'daysOfWeek', 'hours_of_day': 'hoursOfDay', - 'lead_time_in_weeks': 'leadTimeInWeeks' + 'lead_time_in_weeks': 'leadTimeInWeeks', + 'skip_ru': 'skipRu' } self._preference = None @@ -117,6 +123,7 @@ def __init__(self, **kwargs): self._days_of_week = None self._hours_of_day = None self._lead_time_in_weeks = None + self._skip_ru = None @property def preference(self): @@ -386,6 +393,30 @@ def lead_time_in_weeks(self, lead_time_in_weeks): """ self._lead_time_in_weeks = lead_time_in_weeks + @property + def skip_ru(self): + """ + Gets the skip_ru of this MaintenanceWindow. + If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. + + + :return: The skip_ru of this MaintenanceWindow. + :rtype: list[bool] + """ + return self._skip_ru + + @skip_ru.setter + def skip_ru(self, skip_ru): + """ + Sets the skip_ru of this MaintenanceWindow. + If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. + + + :param skip_ru: The skip_ru of this MaintenanceWindow. + :type: list[bool] + """ + self._skip_ru = skip_ru + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/database/models/update_autonomous_database_software_image_details.py b/src/oci/database/models/update_autonomous_database_software_image_details.py new file mode 100644 index 000000000..4acf00ac9 --- /dev/null +++ b/src/oci/database/models/update_autonomous_database_software_image_details.py @@ -0,0 +1,119 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateAutonomousDatabaseSoftwareImageDetails(object): + """ + Describes the parameters for updating the Autonomous Database Software Image + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateAutonomousDatabaseSoftwareImageDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param freeform_tags: + The value to assign to the freeform_tags property of this UpdateAutonomousDatabaseSoftwareImageDetails. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this UpdateAutonomousDatabaseSoftwareImageDetails. + :type defined_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags' + } + + self._freeform_tags = None + self._defined_tags = None + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + 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`__. + + Example: `{\"Department\": \"Finance\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + 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/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + 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/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this UpdateAutonomousDatabaseSoftwareImageDetails. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/database_migration/models/aws_s3_data_transfer_medium_details.py b/src/oci/database_migration/models/aws_s3_data_transfer_medium_details.py index 32a404ee6..a1bcf3664 100644 --- a/src/oci/database_migration/models/aws_s3_data_transfer_medium_details.py +++ b/src/oci/database_migration/models/aws_s3_data_transfer_medium_details.py @@ -43,13 +43,18 @@ def __init__(self, **kwargs): The value to assign to the secret_access_key property of this AwsS3DataTransferMediumDetails. :type secret_access_key: str + :param object_storage_bucket: + The value to assign to the object_storage_bucket property of this AwsS3DataTransferMediumDetails. + :type object_storage_bucket: oci.database_migration.models.ObjectStoreBucket + """ self.swagger_types = { 'type': 'str', 'name': 'str', 'region': 'str', 'access_key_id': 'str', - 'secret_access_key': 'str' + 'secret_access_key': 'str', + 'object_storage_bucket': 'ObjectStoreBucket' } self.attribute_map = { @@ -57,7 +62,8 @@ def __init__(self, **kwargs): 'name': 'name', 'region': 'region', 'access_key_id': 'accessKeyId', - 'secret_access_key': 'secretAccessKey' + 'secret_access_key': 'secretAccessKey', + 'object_storage_bucket': 'objectStorageBucket' } self._type = None @@ -65,6 +71,7 @@ def __init__(self, **kwargs): self._region = None self._access_key_id = None self._secret_access_key = None + self._object_storage_bucket = None self._type = 'AWS_S3' @property @@ -171,6 +178,26 @@ def secret_access_key(self, secret_access_key): """ self._secret_access_key = secret_access_key + @property + def object_storage_bucket(self): + """ + Gets the object_storage_bucket of this AwsS3DataTransferMediumDetails. + + :return: The object_storage_bucket of this AwsS3DataTransferMediumDetails. + :rtype: oci.database_migration.models.ObjectStoreBucket + """ + return self._object_storage_bucket + + @object_storage_bucket.setter + def object_storage_bucket(self, object_storage_bucket): + """ + Sets the object_storage_bucket of this AwsS3DataTransferMediumDetails. + + :param object_storage_bucket: The object_storage_bucket of this AwsS3DataTransferMediumDetails. + :type: oci.database_migration.models.ObjectStoreBucket + """ + self._object_storage_bucket = object_storage_bucket + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/database_migration/models/data_transfer_medium_details_v2.py b/src/oci/database_migration/models/data_transfer_medium_details_v2.py index aa83fe1f9..5f6e258d5 100644 --- a/src/oci/database_migration/models/data_transfer_medium_details_v2.py +++ b/src/oci/database_migration/models/data_transfer_medium_details_v2.py @@ -12,7 +12,7 @@ @init_model_state_from_kwargs class DataTransferMediumDetailsV2(object): """ - Optional additional properties for dump transfer in source or target host. Default kind is CURL + Optional additional properties for dump transfer in source or target host. """ #: A constant which can be used with the type property of a DataTransferMediumDetailsV2. diff --git a/src/oci/database_migration/models/nfs_data_transfer_medium_details.py b/src/oci/database_migration/models/nfs_data_transfer_medium_details.py index 9bc6a99ed..b3051274b 100644 --- a/src/oci/database_migration/models/nfs_data_transfer_medium_details.py +++ b/src/oci/database_migration/models/nfs_data_transfer_medium_details.py @@ -26,18 +26,45 @@ def __init__(self, **kwargs): Allowed values for this property are: "DBLINK", "OBJECT_STORAGE", "AWS_S3", "NFS" :type type: str + :param object_storage_bucket: + The value to assign to the object_storage_bucket property of this NfsDataTransferMediumDetails. + :type object_storage_bucket: oci.database_migration.models.ObjectStoreBucket + """ self.swagger_types = { - 'type': 'str' + 'type': 'str', + 'object_storage_bucket': 'ObjectStoreBucket' } self.attribute_map = { - 'type': 'type' + 'type': 'type', + 'object_storage_bucket': 'objectStorageBucket' } self._type = None + self._object_storage_bucket = None self._type = 'NFS' + @property + def object_storage_bucket(self): + """ + Gets the object_storage_bucket of this NfsDataTransferMediumDetails. + + :return: The object_storage_bucket of this NfsDataTransferMediumDetails. + :rtype: oci.database_migration.models.ObjectStoreBucket + """ + return self._object_storage_bucket + + @object_storage_bucket.setter + def object_storage_bucket(self, object_storage_bucket): + """ + Sets the object_storage_bucket of this NfsDataTransferMediumDetails. + + :param object_storage_bucket: The object_storage_bucket of this NfsDataTransferMediumDetails. + :type: oci.database_migration.models.ObjectStoreBucket + """ + self._object_storage_bucket = object_storage_bucket + def __repr__(self): return formatted_flat_dict(self) diff --git a/src/oci/generative_ai/generative_ai_client.py b/src/oci/generative_ai/generative_ai_client.py index 1fb29e914..3b53fa06b 100644 --- a/src/oci/generative_ai/generative_ai_client.py +++ b/src/oci/generative_ai/generative_ai_client.py @@ -1906,7 +1906,7 @@ def list_models(self, compartment_id, **kwargs): :param list[str] capability: (optional) A filter to return only resources their capability matches the given capability. - Allowed values are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE" + Allowed values are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT" :param str lifecycle_state: (optional) A filter to return only resources their lifecycleState matches the given lifecycleState. @@ -1989,7 +1989,7 @@ def list_models(self, compartment_id, **kwargs): f"list_models got unknown kwargs: {extra_kwargs!r}") if 'capability' in kwargs: - capability_allowed_values = ["TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE"] + capability_allowed_values = ["TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT"] for capability_item in kwargs['capability']: if capability_item not in capability_allowed_values: raise ValueError( diff --git a/src/oci/generative_ai/models/dataset.py b/src/oci/generative_ai/models/dataset.py index 8eac88435..5dcbdebf3 100644 --- a/src/oci/generative_ai/models/dataset.py +++ b/src/oci/generative_ai/models/dataset.py @@ -14,7 +14,7 @@ class Dataset(object): """ The dataset used to fine-tune the model. - Only one dataset is allowed per custom model, which is split 90-10 for training and validating. You must provide the dataset in a JSON Lines (JSONL) file. Each line in the JSONL file must have the format: + Only one dataset is allowed per custom model, which is split 80-20 for training and validating. You must provide the dataset in a JSON Lines (JSONL) file. Each line in the JSONL file must have the format: `{\"prompt\": \"\", \"completion\": \"\"}` """ diff --git a/src/oci/generative_ai/models/dedicated_ai_cluster.py b/src/oci/generative_ai/models/dedicated_ai_cluster.py index 3723e0bd2..0083dc033 100644 --- a/src/oci/generative_ai/models/dedicated_ai_cluster.py +++ b/src/oci/generative_ai/models/dedicated_ai_cluster.py @@ -73,6 +73,10 @@ class DedicatedAiCluster(object): #: This constant has a value of "LLAMA2_70" UNIT_SHAPE_LLAMA2_70 = "LLAMA2_70" + #: A constant which can be used with the unit_shape property of a DedicatedAiCluster. + #: This constant has a value of "LARGE_COHERE_V2" + UNIT_SHAPE_LARGE_COHERE_V2 = "LARGE_COHERE_V2" + def __init__(self, **kwargs): """ Initializes a new DedicatedAiCluster object with values from keyword arguments. @@ -124,7 +128,7 @@ def __init__(self, **kwargs): :param unit_shape: The value to assign to the unit_shape property of this DedicatedAiCluster. - Allowed values for this property are: "LARGE_COHERE", "SMALL_COHERE", "EMBED_COHERE", "LLAMA2_70", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "LARGE_COHERE", "SMALL_COHERE", "EMBED_COHERE", "LLAMA2_70", "LARGE_COHERE_V2", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type unit_shape: str @@ -132,6 +136,10 @@ def __init__(self, **kwargs): The value to assign to the capacity property of this DedicatedAiCluster. :type capacity: oci.generative_ai.models.DedicatedAiClusterCapacity + :param previous_state: + The value to assign to the previous_state property of this DedicatedAiCluster. + :type previous_state: oci.generative_ai.models.DedicatedAiCluster + :param freeform_tags: The value to assign to the freeform_tags property of this DedicatedAiCluster. :type freeform_tags: dict(str, str) @@ -158,6 +166,7 @@ def __init__(self, **kwargs): 'unit_count': 'int', 'unit_shape': 'str', 'capacity': 'DedicatedAiClusterCapacity', + 'previous_state': 'DedicatedAiCluster', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'system_tags': 'dict(str, dict(str, object))' @@ -176,6 +185,7 @@ def __init__(self, **kwargs): 'unit_count': 'unitCount', 'unit_shape': 'unitShape', 'capacity': 'capacity', + 'previous_state': 'previousState', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'system_tags': 'systemTags' @@ -193,6 +203,7 @@ def __init__(self, **kwargs): self._unit_count = None self._unit_shape = None self._capacity = None + self._previous_state = None self._freeform_tags = None self._defined_tags = None self._system_tags = None @@ -459,7 +470,7 @@ def unit_shape(self): **[Required]** Gets the unit_shape of this DedicatedAiCluster. The shape of dedicated unit in this AI cluster. The underlying hardware configuration is hidden from customers. - Allowed values for this property are: "LARGE_COHERE", "SMALL_COHERE", "EMBED_COHERE", "LLAMA2_70", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "LARGE_COHERE", "SMALL_COHERE", "EMBED_COHERE", "LLAMA2_70", "LARGE_COHERE_V2", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -478,7 +489,7 @@ def unit_shape(self, unit_shape): :param unit_shape: The unit_shape of this DedicatedAiCluster. :type: str """ - allowed_values = ["LARGE_COHERE", "SMALL_COHERE", "EMBED_COHERE", "LLAMA2_70"] + allowed_values = ["LARGE_COHERE", "SMALL_COHERE", "EMBED_COHERE", "LLAMA2_70", "LARGE_COHERE_V2"] if not value_allowed_none_or_none_sentinel(unit_shape, allowed_values): unit_shape = 'UNKNOWN_ENUM_VALUE' self._unit_shape = unit_shape @@ -503,6 +514,26 @@ def capacity(self, capacity): """ self._capacity = capacity + @property + def previous_state(self): + """ + Gets the previous_state of this DedicatedAiCluster. + + :return: The previous_state of this DedicatedAiCluster. + :rtype: oci.generative_ai.models.DedicatedAiCluster + """ + return self._previous_state + + @previous_state.setter + def previous_state(self, previous_state): + """ + Sets the previous_state of this DedicatedAiCluster. + + :param previous_state: The previous_state of this DedicatedAiCluster. + :type: oci.generative_ai.models.DedicatedAiCluster + """ + self._previous_state = previous_state + @property def freeform_tags(self): """ diff --git a/src/oci/generative_ai/models/endpoint.py b/src/oci/generative_ai/models/endpoint.py index f57156d0e..f7631afb0 100644 --- a/src/oci/generative_ai/models/endpoint.py +++ b/src/oci/generative_ai/models/endpoint.py @@ -96,6 +96,10 @@ def __init__(self, **kwargs): The value to assign to the content_moderation_config property of this Endpoint. :type content_moderation_config: oci.generative_ai.models.ContentModerationConfig + :param previous_state: + The value to assign to the previous_state property of this Endpoint. + :type previous_state: oci.generative_ai.models.Endpoint + :param freeform_tags: The value to assign to the freeform_tags property of this Endpoint. :type freeform_tags: dict(str, str) @@ -121,6 +125,7 @@ def __init__(self, **kwargs): 'lifecycle_state': 'str', 'lifecycle_details': 'str', 'content_moderation_config': 'ContentModerationConfig', + 'previous_state': 'Endpoint', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'system_tags': 'dict(str, dict(str, object))' @@ -138,6 +143,7 @@ def __init__(self, **kwargs): 'lifecycle_state': 'lifecycleState', 'lifecycle_details': 'lifecycleDetails', 'content_moderation_config': 'contentModerationConfig', + 'previous_state': 'previousState', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'system_tags': 'systemTags' @@ -154,6 +160,7 @@ def __init__(self, **kwargs): self._lifecycle_state = None self._lifecycle_details = None self._content_moderation_config = None + self._previous_state = None self._freeform_tags = None self._defined_tags = None self._system_tags = None @@ -424,6 +431,26 @@ def content_moderation_config(self, content_moderation_config): """ self._content_moderation_config = content_moderation_config + @property + def previous_state(self): + """ + Gets the previous_state of this Endpoint. + + :return: The previous_state of this Endpoint. + :rtype: oci.generative_ai.models.Endpoint + """ + return self._previous_state + + @previous_state.setter + def previous_state(self, previous_state): + """ + Sets the previous_state of this Endpoint. + + :param previous_state: The previous_state of this Endpoint. + :type: oci.generative_ai.models.Endpoint + """ + self._previous_state = previous_state + @property def freeform_tags(self): """ diff --git a/src/oci/generative_ai/models/model.py b/src/oci/generative_ai/models/model.py index 503ae9d78..b9de5f287 100644 --- a/src/oci/generative_ai/models/model.py +++ b/src/oci/generative_ai/models/model.py @@ -38,6 +38,10 @@ class Model(object): #: This constant has a value of "FINE_TUNE" CAPABILITIES_FINE_TUNE = "FINE_TUNE" + #: A constant which can be used with the capabilities property of a Model. + #: This constant has a value of "CHAT" + CAPABILITIES_CHAT = "CHAT" + #: A constant which can be used with the lifecycle_state property of a Model. #: This constant has a value of "ACTIVE" LIFECYCLE_STATE_ACTIVE = "ACTIVE" @@ -85,7 +89,7 @@ def __init__(self, **kwargs): :param capabilities: The value to assign to the capabilities property of this Model. - Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", 'UNKNOWN_ENUM_VALUE'. + Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type capabilities: list[str] @@ -145,6 +149,10 @@ def __init__(self, **kwargs): The value to assign to the time_deprecated property of this Model. :type time_deprecated: datetime + :param previous_state: + The value to assign to the previous_state property of this Model. + :type previous_state: oci.generative_ai.models.Model + :param freeform_tags: The value to assign to the freeform_tags property of this Model. :type freeform_tags: dict(str, str) @@ -176,6 +184,7 @@ def __init__(self, **kwargs): 'model_metrics': 'ModelMetrics', 'is_long_term_supported': 'bool', 'time_deprecated': 'datetime', + 'previous_state': 'Model', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'system_tags': 'dict(str, dict(str, object))' @@ -199,6 +208,7 @@ def __init__(self, **kwargs): 'model_metrics': 'modelMetrics', 'is_long_term_supported': 'isLongTermSupported', 'time_deprecated': 'timeDeprecated', + 'previous_state': 'previousState', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'system_tags': 'systemTags' @@ -221,6 +231,7 @@ def __init__(self, **kwargs): self._model_metrics = None self._is_long_term_supported = None self._time_deprecated = None + self._previous_state = None self._freeform_tags = None self._defined_tags = None self._system_tags = None @@ -303,7 +314,7 @@ def capabilities(self): **[Required]** Gets the capabilities of this Model. Describes what this model can be used for. - Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", 'UNKNOWN_ENUM_VALUE'. + Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -322,7 +333,7 @@ def capabilities(self, capabilities): :param capabilities: The capabilities of this Model. :type: list[str] """ - allowed_values = ["TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE"] + allowed_values = ["TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT"] if capabilities: capabilities[:] = ['UNKNOWN_ENUM_VALUE' if not value_allowed_none_or_none_sentinel(x, allowed_values) else x for x in capabilities] self._capabilities = capabilities @@ -643,6 +654,26 @@ def time_deprecated(self, time_deprecated): """ self._time_deprecated = time_deprecated + @property + def previous_state(self): + """ + Gets the previous_state of this Model. + + :return: The previous_state of this Model. + :rtype: oci.generative_ai.models.Model + """ + return self._previous_state + + @previous_state.setter + def previous_state(self, previous_state): + """ + Sets the previous_state of this Model. + + :param previous_state: The previous_state of this Model. + :type: oci.generative_ai.models.Model + """ + self._previous_state = previous_state + @property def freeform_tags(self): """ diff --git a/src/oci/generative_ai/models/model_summary.py b/src/oci/generative_ai/models/model_summary.py index dbb0e9e33..52b9d312a 100644 --- a/src/oci/generative_ai/models/model_summary.py +++ b/src/oci/generative_ai/models/model_summary.py @@ -31,6 +31,10 @@ class ModelSummary(object): #: This constant has a value of "FINE_TUNE" CAPABILITIES_FINE_TUNE = "FINE_TUNE" + #: A constant which can be used with the capabilities property of a ModelSummary. + #: This constant has a value of "CHAT" + CAPABILITIES_CHAT = "CHAT" + def __init__(self, **kwargs): """ Initializes a new ModelSummary object with values from keyword arguments. @@ -46,7 +50,7 @@ def __init__(self, **kwargs): :param capabilities: The value to assign to the capabilities property of this ModelSummary. - Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", 'UNKNOWN_ENUM_VALUE'. + Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type capabilities: list[str] @@ -226,7 +230,7 @@ def capabilities(self): **[Required]** Gets the capabilities of this ModelSummary. Describes what this model can be used for. - Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", 'UNKNOWN_ENUM_VALUE'. + Allowed values for items in this list are: "TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -245,7 +249,7 @@ def capabilities(self, capabilities): :param capabilities: The capabilities of this ModelSummary. :type: list[str] """ - allowed_values = ["TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE"] + allowed_values = ["TEXT_GENERATION", "TEXT_SUMMARIZATION", "TEXT_EMBEDDINGS", "FINE_TUNE", "CHAT"] if capabilities: capabilities[:] = ['UNKNOWN_ENUM_VALUE' if not value_allowed_none_or_none_sentinel(x, allowed_values) else x for x in capabilities] self._capabilities = capabilities diff --git a/src/oci/generative_ai_inference/generative_ai_inference_client.py b/src/oci/generative_ai_inference/generative_ai_inference_client.py index d16ed53ea..300b86c75 100644 --- a/src/oci/generative_ai_inference/generative_ai_inference_client.py +++ b/src/oci/generative_ai_inference/generative_ai_inference_client.py @@ -122,6 +122,104 @@ def __init__(self, config, **kwargs): self.retry_strategy = kwargs.get('retry_strategy') self.circuit_breaker_callback = kwargs.get('circuit_breaker_callback') + def chat(self, chat_details, **kwargs): + """ + Creates a response for the given conversation. + + + :param oci.generative_ai_inference.models.ChatDetails chat_details: (required) + Details of the conversation for the model to respond. + + :param str opc_retry_token: (optional) + 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. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.generative_ai_inference.models.ChatResult` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use chat API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = [] + resource_path = "/actions/chat" + method = "POST" + operation_name = "chat" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/20231130/ChatResult/Chat" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_retry_token", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"chat got unknown kwargs: {extra_kwargs!r}") + + header_params = { + "accept": "application/json, text/event-stream", + "content-type": "application/json", + "opc-retry-token": kwargs.get("opc_retry_token", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + header_params=header_params, + body=chat_details, + response_type="ChatResult", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + header_params=header_params, + body=chat_details, + response_type="ChatResult", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def embed_text(self, embed_text_details, **kwargs): """ Produces embeddings for the inputs. diff --git a/src/oci/generative_ai_inference/models/__init__.py b/src/oci/generative_ai_inference/models/__init__.py index 14b63f649..59ebaf55d 100644 --- a/src/oci/generative_ai_inference/models/__init__.py +++ b/src/oci/generative_ai_inference/models/__init__.py @@ -6,45 +6,75 @@ from __future__ import absolute_import +from .base_chat_request import BaseChatRequest +from .base_chat_response import BaseChatResponse +from .chat_choice import ChatChoice +from .chat_content import ChatContent +from .chat_details import ChatDetails +from .chat_result import ChatResult from .choice import Choice +from .citation import Citation +from .cohere_chat_request import CohereChatRequest +from .cohere_chat_response import CohereChatResponse from .cohere_llm_inference_request import CohereLlmInferenceRequest from .cohere_llm_inference_response import CohereLlmInferenceResponse +from .cohere_message import CohereMessage from .dedicated_serving_mode import DedicatedServingMode from .embed_text_details import EmbedTextDetails from .embed_text_result import EmbedTextResult from .generate_text_details import GenerateTextDetails from .generate_text_result import GenerateTextResult from .generated_text import GeneratedText +from .generic_chat_request import GenericChatRequest +from .generic_chat_response import GenericChatResponse from .llama_llm_inference_request import LlamaLlmInferenceRequest from .llama_llm_inference_response import LlamaLlmInferenceResponse from .llm_inference_request import LlmInferenceRequest from .llm_inference_response import LlmInferenceResponse from .logprobs import Logprobs +from .message import Message from .on_demand_serving_mode import OnDemandServingMode +from .search_query import SearchQuery from .serving_mode import ServingMode from .summarize_text_details import SummarizeTextDetails from .summarize_text_result import SummarizeTextResult +from .text_content import TextContent from .token_likelihood import TokenLikelihood # Maps type names to classes for generative_ai_inference services. generative_ai_inference_type_mapping = { + "BaseChatRequest": BaseChatRequest, + "BaseChatResponse": BaseChatResponse, + "ChatChoice": ChatChoice, + "ChatContent": ChatContent, + "ChatDetails": ChatDetails, + "ChatResult": ChatResult, "Choice": Choice, + "Citation": Citation, + "CohereChatRequest": CohereChatRequest, + "CohereChatResponse": CohereChatResponse, "CohereLlmInferenceRequest": CohereLlmInferenceRequest, "CohereLlmInferenceResponse": CohereLlmInferenceResponse, + "CohereMessage": CohereMessage, "DedicatedServingMode": DedicatedServingMode, "EmbedTextDetails": EmbedTextDetails, "EmbedTextResult": EmbedTextResult, "GenerateTextDetails": GenerateTextDetails, "GenerateTextResult": GenerateTextResult, "GeneratedText": GeneratedText, + "GenericChatRequest": GenericChatRequest, + "GenericChatResponse": GenericChatResponse, "LlamaLlmInferenceRequest": LlamaLlmInferenceRequest, "LlamaLlmInferenceResponse": LlamaLlmInferenceResponse, "LlmInferenceRequest": LlmInferenceRequest, "LlmInferenceResponse": LlmInferenceResponse, "Logprobs": Logprobs, + "Message": Message, "OnDemandServingMode": OnDemandServingMode, + "SearchQuery": SearchQuery, "ServingMode": ServingMode, "SummarizeTextDetails": SummarizeTextDetails, "SummarizeTextResult": SummarizeTextResult, + "TextContent": TextContent, "TokenLikelihood": TokenLikelihood } diff --git a/src/oci/generative_ai_inference/models/base_chat_request.py b/src/oci/generative_ai_inference/models/base_chat_request.py new file mode 100644 index 000000000..28cd36c64 --- /dev/null +++ b/src/oci/generative_ai_inference/models/base_chat_request.py @@ -0,0 +1,109 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class BaseChatRequest(object): + """ + Base class for chat inference requests + """ + + #: A constant which can be used with the api_format property of a BaseChatRequest. + #: This constant has a value of "COHERE" + API_FORMAT_COHERE = "COHERE" + + #: A constant which can be used with the api_format property of a BaseChatRequest. + #: This constant has a value of "GENERIC" + API_FORMAT_GENERIC = "GENERIC" + + def __init__(self, **kwargs): + """ + Initializes a new BaseChatRequest object with values from keyword arguments. This class has the following subclasses and if you are using this class as input + to a service operations then you should favor using a subclass over the base class: + + * :class:`~oci.generative_ai_inference.models.GenericChatRequest` + * :class:`~oci.generative_ai_inference.models.CohereChatRequest` + + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param api_format: + The value to assign to the api_format property of this BaseChatRequest. + Allowed values for this property are: "COHERE", "GENERIC" + :type api_format: str + + """ + self.swagger_types = { + 'api_format': 'str' + } + + self.attribute_map = { + 'api_format': 'apiFormat' + } + + self._api_format = None + + @staticmethod + def get_subtype(object_dictionary): + """ + Given the hash representation of a subtype of this class, + use the info in the hash to return the class of the subtype. + """ + type = object_dictionary['apiFormat'] + + if type == 'GENERIC': + return 'GenericChatRequest' + + if type == 'COHERE': + return 'CohereChatRequest' + else: + return 'BaseChatRequest' + + @property + def api_format(self): + """ + **[Required]** Gets the api_format of this BaseChatRequest. + The api format for the model's request + + Allowed values for this property are: "COHERE", "GENERIC" + + + :return: The api_format of this BaseChatRequest. + :rtype: str + """ + return self._api_format + + @api_format.setter + def api_format(self, api_format): + """ + Sets the api_format of this BaseChatRequest. + The api format for the model's request + + + :param api_format: The api_format of this BaseChatRequest. + :type: str + """ + allowed_values = ["COHERE", "GENERIC"] + if not value_allowed_none_or_none_sentinel(api_format, allowed_values): + raise ValueError( + f"Invalid value for `api_format`, must be None or one of {allowed_values}" + ) + self._api_format = api_format + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/base_chat_response.py b/src/oci/generative_ai_inference/models/base_chat_response.py new file mode 100644 index 000000000..25eca810b --- /dev/null +++ b/src/oci/generative_ai_inference/models/base_chat_response.py @@ -0,0 +1,109 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class BaseChatResponse(object): + """ + Base class for chat inference response + """ + + #: A constant which can be used with the api_format property of a BaseChatResponse. + #: This constant has a value of "COHERE" + API_FORMAT_COHERE = "COHERE" + + #: A constant which can be used with the api_format property of a BaseChatResponse. + #: This constant has a value of "GENERIC" + API_FORMAT_GENERIC = "GENERIC" + + def __init__(self, **kwargs): + """ + Initializes a new BaseChatResponse object with values from keyword arguments. This class has the following subclasses and if you are using this class as input + to a service operations then you should favor using a subclass over the base class: + + * :class:`~oci.generative_ai_inference.models.GenericChatResponse` + * :class:`~oci.generative_ai_inference.models.CohereChatResponse` + + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param api_format: + The value to assign to the api_format property of this BaseChatResponse. + Allowed values for this property are: "COHERE", "GENERIC", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type api_format: str + + """ + self.swagger_types = { + 'api_format': 'str' + } + + self.attribute_map = { + 'api_format': 'apiFormat' + } + + self._api_format = None + + @staticmethod + def get_subtype(object_dictionary): + """ + Given the hash representation of a subtype of this class, + use the info in the hash to return the class of the subtype. + """ + type = object_dictionary['apiFormat'] + + if type == 'GENERIC': + return 'GenericChatResponse' + + if type == 'COHERE': + return 'CohereChatResponse' + else: + return 'BaseChatResponse' + + @property + def api_format(self): + """ + **[Required]** Gets the api_format of this BaseChatResponse. + The api format for the model's response + + Allowed values for this property are: "COHERE", "GENERIC", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The api_format of this BaseChatResponse. + :rtype: str + """ + return self._api_format + + @api_format.setter + def api_format(self, api_format): + """ + Sets the api_format of this BaseChatResponse. + The api format for the model's response + + + :param api_format: The api_format of this BaseChatResponse. + :type: str + """ + allowed_values = ["COHERE", "GENERIC"] + if not value_allowed_none_or_none_sentinel(api_format, allowed_values): + api_format = 'UNKNOWN_ENUM_VALUE' + self._api_format = api_format + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/chat_choice.py b/src/oci/generative_ai_inference/models/chat_choice.py new file mode 100644 index 000000000..627022dba --- /dev/null +++ b/src/oci/generative_ai_inference/models/chat_choice.py @@ -0,0 +1,161 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ChatChoice(object): + """ + Represents a single instance of the chat response. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ChatChoice object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param index: + The value to assign to the index property of this ChatChoice. + :type index: int + + :param message: + The value to assign to the message property of this ChatChoice. + :type message: oci.generative_ai_inference.models.Message + + :param finish_reason: + The value to assign to the finish_reason property of this ChatChoice. + :type finish_reason: str + + :param logprobs: + The value to assign to the logprobs property of this ChatChoice. + :type logprobs: oci.generative_ai_inference.models.Logprobs + + """ + self.swagger_types = { + 'index': 'int', + 'message': 'Message', + 'finish_reason': 'str', + 'logprobs': 'Logprobs' + } + + self.attribute_map = { + 'index': 'index', + 'message': 'message', + 'finish_reason': 'finishReason', + 'logprobs': 'logprobs' + } + + self._index = None + self._message = None + self._finish_reason = None + self._logprobs = None + + @property + def index(self): + """ + **[Required]** Gets the index of this ChatChoice. + The index of the chat. + + + :return: The index of this ChatChoice. + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """ + Sets the index of this ChatChoice. + The index of the chat. + + + :param index: The index of this ChatChoice. + :type: int + """ + self._index = index + + @property + def message(self): + """ + **[Required]** Gets the message of this ChatChoice. + + :return: The message of this ChatChoice. + :rtype: oci.generative_ai_inference.models.Message + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this ChatChoice. + + :param message: The message of this ChatChoice. + :type: oci.generative_ai_inference.models.Message + """ + self._message = message + + @property + def finish_reason(self): + """ + **[Required]** Gets the finish_reason of this ChatChoice. + The reason why the model stopped generating tokens. + + Stops if the model hits a natural stop point or a provided stop sequence. Returns the length if the tokens reach the specified maximum number of tokens. + + + :return: The finish_reason of this ChatChoice. + :rtype: str + """ + return self._finish_reason + + @finish_reason.setter + def finish_reason(self, finish_reason): + """ + Sets the finish_reason of this ChatChoice. + The reason why the model stopped generating tokens. + + Stops if the model hits a natural stop point or a provided stop sequence. Returns the length if the tokens reach the specified maximum number of tokens. + + + :param finish_reason: The finish_reason of this ChatChoice. + :type: str + """ + self._finish_reason = finish_reason + + @property + def logprobs(self): + """ + Gets the logprobs of this ChatChoice. + + :return: The logprobs of this ChatChoice. + :rtype: oci.generative_ai_inference.models.Logprobs + """ + return self._logprobs + + @logprobs.setter + def logprobs(self, logprobs): + """ + Sets the logprobs of this ChatChoice. + + :param logprobs: The logprobs of this ChatChoice. + :type: oci.generative_ai_inference.models.Logprobs + """ + self._logprobs = logprobs + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/chat_content.py b/src/oci/generative_ai_inference/models/chat_content.py new file mode 100644 index 000000000..d074a8c03 --- /dev/null +++ b/src/oci/generative_ai_inference/models/chat_content.py @@ -0,0 +1,101 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ChatContent(object): + """ + The base class for the chat content. + """ + + #: A constant which can be used with the type property of a ChatContent. + #: This constant has a value of "TEXT" + TYPE_TEXT = "TEXT" + + def __init__(self, **kwargs): + """ + Initializes a new ChatContent object with values from keyword arguments. This class has the following subclasses and if you are using this class as input + to a service operations then you should favor using a subclass over the base class: + + * :class:`~oci.generative_ai_inference.models.TextContent` + + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param type: + The value to assign to the type property of this ChatContent. + Allowed values for this property are: "TEXT", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type type: str + + """ + self.swagger_types = { + 'type': 'str' + } + + self.attribute_map = { + 'type': 'type' + } + + self._type = None + + @staticmethod + def get_subtype(object_dictionary): + """ + Given the hash representation of a subtype of this class, + use the info in the hash to return the class of the subtype. + """ + type = object_dictionary['type'] + + if type == 'TEXT': + return 'TextContent' + else: + return 'ChatContent' + + @property + def type(self): + """ + **[Required]** Gets the type of this ChatContent. + The type of the content. + + Allowed values for this property are: "TEXT", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The type of this ChatContent. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this ChatContent. + The type of the content. + + + :param type: The type of this ChatContent. + :type: str + """ + allowed_values = ["TEXT"] + if not value_allowed_none_or_none_sentinel(type, allowed_values): + type = 'UNKNOWN_ENUM_VALUE' + self._type = type + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/chat_details.py b/src/oci/generative_ai_inference/models/chat_details.py new file mode 100644 index 000000000..d2b27c17b --- /dev/null +++ b/src/oci/generative_ai_inference/models/chat_details.py @@ -0,0 +1,126 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ChatDetails(object): + """ + Details of the conversation for the model to respond. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ChatDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this ChatDetails. + :type compartment_id: str + + :param serving_mode: + The value to assign to the serving_mode property of this ChatDetails. + :type serving_mode: oci.generative_ai_inference.models.ServingMode + + :param chat_request: + The value to assign to the chat_request property of this ChatDetails. + :type chat_request: oci.generative_ai_inference.models.BaseChatRequest + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'serving_mode': 'ServingMode', + 'chat_request': 'BaseChatRequest' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'serving_mode': 'servingMode', + 'chat_request': 'chatRequest' + } + + self._compartment_id = None + self._serving_mode = None + self._chat_request = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this ChatDetails. + The OCID of compartment that the user is authorized to use to call into the Generative AI service. + + + :return: The compartment_id of this ChatDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this ChatDetails. + The OCID of compartment that the user is authorized to use to call into the Generative AI service. + + + :param compartment_id: The compartment_id of this ChatDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def serving_mode(self): + """ + **[Required]** Gets the serving_mode of this ChatDetails. + + :return: The serving_mode of this ChatDetails. + :rtype: oci.generative_ai_inference.models.ServingMode + """ + return self._serving_mode + + @serving_mode.setter + def serving_mode(self, serving_mode): + """ + Sets the serving_mode of this ChatDetails. + + :param serving_mode: The serving_mode of this ChatDetails. + :type: oci.generative_ai_inference.models.ServingMode + """ + self._serving_mode = serving_mode + + @property + def chat_request(self): + """ + Gets the chat_request of this ChatDetails. + + :return: The chat_request of this ChatDetails. + :rtype: oci.generative_ai_inference.models.BaseChatRequest + """ + return self._chat_request + + @chat_request.setter + def chat_request(self, chat_request): + """ + Sets the chat_request of this ChatDetails. + + :param chat_request: The chat_request of this ChatDetails. + :type: oci.generative_ai_inference.models.BaseChatRequest + """ + self._chat_request = chat_request + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/chat_result.py b/src/oci/generative_ai_inference/models/chat_result.py new file mode 100644 index 000000000..3ce75a9ec --- /dev/null +++ b/src/oci/generative_ai_inference/models/chat_result.py @@ -0,0 +1,130 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class ChatResult(object): + """ + The response to the chat conversation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new ChatResult object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param model_id: + The value to assign to the model_id property of this ChatResult. + :type model_id: str + + :param model_version: + The value to assign to the model_version property of this ChatResult. + :type model_version: str + + :param chat_response: + The value to assign to the chat_response property of this ChatResult. + :type chat_response: oci.generative_ai_inference.models.BaseChatResponse + + """ + self.swagger_types = { + 'model_id': 'str', + 'model_version': 'str', + 'chat_response': 'BaseChatResponse' + } + + self.attribute_map = { + 'model_id': 'modelId', + 'model_version': 'modelVersion', + 'chat_response': 'chatResponse' + } + + self._model_id = None + self._model_version = None + self._chat_response = None + + @property + def model_id(self): + """ + **[Required]** Gets the model_id of this ChatResult. + The OCID of the model used in this inference request. + + + :return: The model_id of this ChatResult. + :rtype: str + """ + return self._model_id + + @model_id.setter + def model_id(self, model_id): + """ + Sets the model_id of this ChatResult. + The OCID of the model used in this inference request. + + + :param model_id: The model_id of this ChatResult. + :type: str + """ + self._model_id = model_id + + @property + def model_version(self): + """ + **[Required]** Gets the model_version of this ChatResult. + The version of the model. + + + :return: The model_version of this ChatResult. + :rtype: str + """ + return self._model_version + + @model_version.setter + def model_version(self, model_version): + """ + Sets the model_version of this ChatResult. + The version of the model. + + + :param model_version: The model_version of this ChatResult. + :type: str + """ + self._model_version = model_version + + @property + def chat_response(self): + """ + **[Required]** Gets the chat_response of this ChatResult. + + :return: The chat_response of this ChatResult. + :rtype: oci.generative_ai_inference.models.BaseChatResponse + """ + return self._chat_response + + @chat_response.setter + def chat_response(self, chat_response): + """ + Sets the chat_response of this ChatResult. + + :param chat_response: The chat_response of this ChatResult. + :type: oci.generative_ai_inference.models.BaseChatResponse + """ + self._chat_response = chat_response + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/citation.py b/src/oci/generative_ai_inference/models/citation.py new file mode 100644 index 000000000..7a20ddf60 --- /dev/null +++ b/src/oci/generative_ai_inference/models/citation.py @@ -0,0 +1,165 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Citation(object): + """ + A section of the generated reply which cites external knowledge. + """ + + def __init__(self, **kwargs): + """ + Initializes a new Citation object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param start: + The value to assign to the start property of this Citation. + :type start: int + + :param end: + The value to assign to the end property of this Citation. + :type end: int + + :param text: + The value to assign to the text property of this Citation. + :type text: str + + :param document_ids: + The value to assign to the document_ids property of this Citation. + :type document_ids: list[str] + + """ + self.swagger_types = { + 'start': 'int', + 'end': 'int', + 'text': 'str', + 'document_ids': 'list[str]' + } + + self.attribute_map = { + 'start': 'start', + 'end': 'end', + 'text': 'text', + 'document_ids': 'documentIds' + } + + self._start = None + self._end = None + self._text = None + self._document_ids = None + + @property + def start(self): + """ + **[Required]** Gets the start of this Citation. + The index of text that the citation starts at, counting from zero. + + + :return: The start of this Citation. + :rtype: int + """ + return self._start + + @start.setter + def start(self, start): + """ + Sets the start of this Citation. + The index of text that the citation starts at, counting from zero. + + + :param start: The start of this Citation. + :type: int + """ + self._start = start + + @property + def end(self): + """ + **[Required]** Gets the end of this Citation. + The index of text that the citation ends after, counting from zero. + + + :return: The end of this Citation. + :rtype: int + """ + return self._end + + @end.setter + def end(self, end): + """ + Sets the end of this Citation. + The index of text that the citation ends after, counting from zero. + + + :param end: The end of this Citation. + :type: int + """ + self._end = end + + @property + def text(self): + """ + **[Required]** Gets the text of this Citation. + The text of the citation + + + :return: The text of this Citation. + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """ + Sets the text of this Citation. + The text of the citation + + + :param text: The text of this Citation. + :type: str + """ + self._text = text + + @property + def document_ids(self): + """ + **[Required]** Gets the document_ids of this Citation. + Identifiers of documents cited by this section of the generated reply. + + + :return: The document_ids of this Citation. + :rtype: list[str] + """ + return self._document_ids + + @document_ids.setter + def document_ids(self, document_ids): + """ + Sets the document_ids of this Citation. + Identifiers of documents cited by this section of the generated reply. + + + :param document_ids: The document_ids of this Citation. + :type: list[str] + """ + self._document_ids = document_ids + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/cohere_chat_request.py b/src/oci/generative_ai_inference/models/cohere_chat_request.py new file mode 100644 index 000000000..0ab57b97f --- /dev/null +++ b/src/oci/generative_ai_inference/models/cohere_chat_request.py @@ -0,0 +1,443 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + +from .base_chat_request import BaseChatRequest +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CohereChatRequest(BaseChatRequest): + """ + Details for the chat request for Cohere models. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CohereChatRequest object with values from keyword arguments. The default value of the :py:attr:`~oci.generative_ai_inference.models.CohereChatRequest.api_format` attribute + of this class is ``COHERE`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param api_format: + The value to assign to the api_format property of this CohereChatRequest. + Allowed values for this property are: "COHERE", "GENERIC" + :type api_format: str + + :param message: + The value to assign to the message property of this CohereChatRequest. + :type message: str + + :param chat_history: + The value to assign to the chat_history property of this CohereChatRequest. + :type chat_history: list[oci.generative_ai_inference.models.CohereMessage] + + :param documents: + The value to assign to the documents property of this CohereChatRequest. + :type documents: list[object] + + :param is_search_queries_only: + The value to assign to the is_search_queries_only property of this CohereChatRequest. + :type is_search_queries_only: bool + + :param preamble_override: + The value to assign to the preamble_override property of this CohereChatRequest. + :type preamble_override: str + + :param is_stream: + The value to assign to the is_stream property of this CohereChatRequest. + :type is_stream: bool + + :param max_tokens: + The value to assign to the max_tokens property of this CohereChatRequest. + :type max_tokens: int + + :param temperature: + The value to assign to the temperature property of this CohereChatRequest. + :type temperature: float + + :param top_k: + The value to assign to the top_k property of this CohereChatRequest. + :type top_k: int + + :param top_p: + The value to assign to the top_p property of this CohereChatRequest. + :type top_p: float + + :param frequency_penalty: + The value to assign to the frequency_penalty property of this CohereChatRequest. + :type frequency_penalty: float + + :param presence_penalty: + The value to assign to the presence_penalty property of this CohereChatRequest. + :type presence_penalty: float + + """ + self.swagger_types = { + 'api_format': 'str', + 'message': 'str', + 'chat_history': 'list[CohereMessage]', + 'documents': 'list[object]', + 'is_search_queries_only': 'bool', + 'preamble_override': 'str', + 'is_stream': 'bool', + 'max_tokens': 'int', + 'temperature': 'float', + 'top_k': 'int', + 'top_p': 'float', + 'frequency_penalty': 'float', + 'presence_penalty': 'float' + } + + self.attribute_map = { + 'api_format': 'apiFormat', + 'message': 'message', + 'chat_history': 'chatHistory', + 'documents': 'documents', + 'is_search_queries_only': 'isSearchQueriesOnly', + 'preamble_override': 'preambleOverride', + 'is_stream': 'isStream', + 'max_tokens': 'maxTokens', + 'temperature': 'temperature', + 'top_k': 'topK', + 'top_p': 'topP', + 'frequency_penalty': 'frequencyPenalty', + 'presence_penalty': 'presencePenalty' + } + + self._api_format = None + self._message = None + self._chat_history = None + self._documents = None + self._is_search_queries_only = None + self._preamble_override = None + self._is_stream = None + self._max_tokens = None + self._temperature = None + self._top_k = None + self._top_p = None + self._frequency_penalty = None + self._presence_penalty = None + self._api_format = 'COHERE' + + @property + def message(self): + """ + **[Required]** Gets the message of this CohereChatRequest. + Text input for the model to respond to. + + + :return: The message of this CohereChatRequest. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this CohereChatRequest. + Text input for the model to respond to. + + + :param message: The message of this CohereChatRequest. + :type: str + """ + self._message = message + + @property + def chat_history(self): + """ + Gets the chat_history of this CohereChatRequest. + A list of previous messages between the user and the model, meant to give the model conversational context for responding to the user's message. + + + :return: The chat_history of this CohereChatRequest. + :rtype: list[oci.generative_ai_inference.models.CohereMessage] + """ + return self._chat_history + + @chat_history.setter + def chat_history(self, chat_history): + """ + Sets the chat_history of this CohereChatRequest. + A list of previous messages between the user and the model, meant to give the model conversational context for responding to the user's message. + + + :param chat_history: The chat_history of this CohereChatRequest. + :type: list[oci.generative_ai_inference.models.CohereMessage] + """ + self._chat_history = chat_history + + @property + def documents(self): + """ + Gets the documents of this CohereChatRequest. + list of relevant documents that the model can cite to generate a more accurate reply. + Some suggested keys are \"text\", \"author\", and \"date\". For better generation quality, it is + recommended to keep the total word count of the strings in the dictionary to under 300 + words. + + + :return: The documents of this CohereChatRequest. + :rtype: list[object] + """ + return self._documents + + @documents.setter + def documents(self, documents): + """ + Sets the documents of this CohereChatRequest. + list of relevant documents that the model can cite to generate a more accurate reply. + Some suggested keys are \"text\", \"author\", and \"date\". For better generation quality, it is + recommended to keep the total word count of the strings in the dictionary to under 300 + words. + + + :param documents: The documents of this CohereChatRequest. + :type: list[object] + """ + self._documents = documents + + @property + def is_search_queries_only(self): + """ + Gets the is_search_queries_only of this CohereChatRequest. + When true, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's message will be generated. + + + :return: The is_search_queries_only of this CohereChatRequest. + :rtype: bool + """ + return self._is_search_queries_only + + @is_search_queries_only.setter + def is_search_queries_only(self, is_search_queries_only): + """ + Sets the is_search_queries_only of this CohereChatRequest. + When true, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's message will be generated. + + + :param is_search_queries_only: The is_search_queries_only of this CohereChatRequest. + :type: bool + """ + self._is_search_queries_only = is_search_queries_only + + @property + def preamble_override(self): + """ + Gets the preamble_override of this CohereChatRequest. + When specified, the default Cohere preamble will be replaced with the provided one. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style. Default preambles vary for different models. + + + :return: The preamble_override of this CohereChatRequest. + :rtype: str + """ + return self._preamble_override + + @preamble_override.setter + def preamble_override(self, preamble_override): + """ + Sets the preamble_override of this CohereChatRequest. + When specified, the default Cohere preamble will be replaced with the provided one. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style. Default preambles vary for different models. + + + :param preamble_override: The preamble_override of this CohereChatRequest. + :type: str + """ + self._preamble_override = preamble_override + + @property + def is_stream(self): + """ + Gets the is_stream of this CohereChatRequest. + Whether to stream back partial progress. If set, tokens are sent as data-only server-sent events as they become available. + + + :return: The is_stream of this CohereChatRequest. + :rtype: bool + """ + return self._is_stream + + @is_stream.setter + def is_stream(self, is_stream): + """ + Sets the is_stream of this CohereChatRequest. + Whether to stream back partial progress. If set, tokens are sent as data-only server-sent events as they become available. + + + :param is_stream: The is_stream of this CohereChatRequest. + :type: bool + """ + self._is_stream = is_stream + + @property + def max_tokens(self): + """ + Gets the max_tokens of this CohereChatRequest. + The maximum number of tokens to predict for each response. Includes input plus output tokens. + + + :return: The max_tokens of this CohereChatRequest. + :rtype: int + """ + return self._max_tokens + + @max_tokens.setter + def max_tokens(self, max_tokens): + """ + Sets the max_tokens of this CohereChatRequest. + The maximum number of tokens to predict for each response. Includes input plus output tokens. + + + :param max_tokens: The max_tokens of this CohereChatRequest. + :type: int + """ + self._max_tokens = max_tokens + + @property + def temperature(self): + """ + Gets the temperature of this CohereChatRequest. + A number that sets the randomness of the generated output. A lower temperature means a less random generations. + Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs. + + + :return: The temperature of this CohereChatRequest. + :rtype: float + """ + return self._temperature + + @temperature.setter + def temperature(self, temperature): + """ + Sets the temperature of this CohereChatRequest. + A number that sets the randomness of the generated output. A lower temperature means a less random generations. + Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs. + + + :param temperature: The temperature of this CohereChatRequest. + :type: float + """ + self._temperature = temperature + + @property + def top_k(self): + """ + Gets the top_k of this CohereChatRequest. + An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is 0 which disables this method and considers all tokens. To set a number for the likely tokens, choose an integer between 1 and 500. + + If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen. + + + :return: The top_k of this CohereChatRequest. + :rtype: int + """ + return self._top_k + + @top_k.setter + def top_k(self, top_k): + """ + Sets the top_k of this CohereChatRequest. + An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is 0 which disables this method and considers all tokens. To set a number for the likely tokens, choose an integer between 1 and 500. + + If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen. + + + :param top_k: The top_k of this CohereChatRequest. + :type: int + """ + self._top_k = top_k + + @property + def top_p(self): + """ + Gets the top_p of this CohereChatRequest. + If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. + + To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1.0 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k. + + + :return: The top_p of this CohereChatRequest. + :rtype: float + """ + return self._top_p + + @top_p.setter + def top_p(self, top_p): + """ + Sets the top_p of this CohereChatRequest. + If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. + + To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1.0 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k. + + + :param top_p: The top_p of this CohereChatRequest. + :type: float + """ + self._top_p = top_p + + @property + def frequency_penalty(self): + """ + Gets the frequency_penalty of this CohereChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens. Set to 0 to disable. + + + :return: The frequency_penalty of this CohereChatRequest. + :rtype: float + """ + return self._frequency_penalty + + @frequency_penalty.setter + def frequency_penalty(self, frequency_penalty): + """ + Sets the frequency_penalty of this CohereChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens. Set to 0 to disable. + + + :param frequency_penalty: The frequency_penalty of this CohereChatRequest. + :type: float + """ + self._frequency_penalty = frequency_penalty + + @property + def presence_penalty(self): + """ + Gets the presence_penalty of this CohereChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens. + + Similar to frequency penalty, a penalty is applied to previously present tokens, except that this penalty is applied equally to all tokens that have already appeared, regardless of how many times they've appeared. Set to 0 to disable. + + + :return: The presence_penalty of this CohereChatRequest. + :rtype: float + """ + return self._presence_penalty + + @presence_penalty.setter + def presence_penalty(self, presence_penalty): + """ + Sets the presence_penalty of this CohereChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens. + + Similar to frequency penalty, a penalty is applied to previously present tokens, except that this penalty is applied equally to all tokens that have already appeared, regardless of how many times they've appeared. Set to 0 to disable. + + + :param presence_penalty: The presence_penalty of this CohereChatRequest. + :type: float + """ + self._presence_penalty = presence_penalty + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/cohere_chat_response.py b/src/oci/generative_ai_inference/models/cohere_chat_response.py new file mode 100644 index 000000000..f5b2c78d6 --- /dev/null +++ b/src/oci/generative_ai_inference/models/cohere_chat_response.py @@ -0,0 +1,272 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + +from .base_chat_response import BaseChatResponse +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CohereChatResponse(BaseChatResponse): + """ + The response to the chat conversation. + """ + + #: A constant which can be used with the finish_reason property of a CohereChatResponse. + #: This constant has a value of "COMPLETE" + FINISH_REASON_COMPLETE = "COMPLETE" + + #: A constant which can be used with the finish_reason property of a CohereChatResponse. + #: This constant has a value of "ERROR_TOXIC" + FINISH_REASON_ERROR_TOXIC = "ERROR_TOXIC" + + #: A constant which can be used with the finish_reason property of a CohereChatResponse. + #: This constant has a value of "ERROR_LIMIT" + FINISH_REASON_ERROR_LIMIT = "ERROR_LIMIT" + + #: A constant which can be used with the finish_reason property of a CohereChatResponse. + #: This constant has a value of "ERROR" + FINISH_REASON_ERROR = "ERROR" + + #: A constant which can be used with the finish_reason property of a CohereChatResponse. + #: This constant has a value of "USER_CANCEL" + FINISH_REASON_USER_CANCEL = "USER_CANCEL" + + #: A constant which can be used with the finish_reason property of a CohereChatResponse. + #: This constant has a value of "MAX_TOKENS" + FINISH_REASON_MAX_TOKENS = "MAX_TOKENS" + + def __init__(self, **kwargs): + """ + Initializes a new CohereChatResponse object with values from keyword arguments. The default value of the :py:attr:`~oci.generative_ai_inference.models.CohereChatResponse.api_format` attribute + of this class is ``COHERE`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param api_format: + The value to assign to the api_format property of this CohereChatResponse. + Allowed values for this property are: "COHERE", "GENERIC", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type api_format: str + + :param text: + The value to assign to the text property of this CohereChatResponse. + :type text: str + + :param citations: + The value to assign to the citations property of this CohereChatResponse. + :type citations: list[oci.generative_ai_inference.models.Citation] + + :param is_search_required: + The value to assign to the is_search_required property of this CohereChatResponse. + :type is_search_required: bool + + :param finish_reason: + The value to assign to the finish_reason property of this CohereChatResponse. + Allowed values for this property are: "COMPLETE", "ERROR_TOXIC", "ERROR_LIMIT", "ERROR", "USER_CANCEL", "MAX_TOKENS", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type finish_reason: str + + :param search_queries: + The value to assign to the search_queries property of this CohereChatResponse. + :type search_queries: list[oci.generative_ai_inference.models.SearchQuery] + + :param documents: + The value to assign to the documents property of this CohereChatResponse. + :type documents: list[object] + + """ + self.swagger_types = { + 'api_format': 'str', + 'text': 'str', + 'citations': 'list[Citation]', + 'is_search_required': 'bool', + 'finish_reason': 'str', + 'search_queries': 'list[SearchQuery]', + 'documents': 'list[object]' + } + + self.attribute_map = { + 'api_format': 'apiFormat', + 'text': 'text', + 'citations': 'citations', + 'is_search_required': 'isSearchRequired', + 'finish_reason': 'finishReason', + 'search_queries': 'searchQueries', + 'documents': 'documents' + } + + self._api_format = None + self._text = None + self._citations = None + self._is_search_required = None + self._finish_reason = None + self._search_queries = None + self._documents = None + self._api_format = 'COHERE' + + @property + def text(self): + """ + **[Required]** Gets the text of this CohereChatResponse. + Contents of the reply generated by the model. + + + :return: The text of this CohereChatResponse. + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """ + Sets the text of this CohereChatResponse. + Contents of the reply generated by the model. + + + :param text: The text of this CohereChatResponse. + :type: str + """ + self._text = text + + @property + def citations(self): + """ + Gets the citations of this CohereChatResponse. + Inline citations for the generated reply. + + + :return: The citations of this CohereChatResponse. + :rtype: list[oci.generative_ai_inference.models.Citation] + """ + return self._citations + + @citations.setter + def citations(self, citations): + """ + Sets the citations of this CohereChatResponse. + Inline citations for the generated reply. + + + :param citations: The citations of this CohereChatResponse. + :type: list[oci.generative_ai_inference.models.Citation] + """ + self._citations = citations + + @property + def is_search_required(self): + """ + Gets the is_search_required of this CohereChatResponse. + Denotes that a search for documents is required. + + + :return: The is_search_required of this CohereChatResponse. + :rtype: bool + """ + return self._is_search_required + + @is_search_required.setter + def is_search_required(self, is_search_required): + """ + Sets the is_search_required of this CohereChatResponse. + Denotes that a search for documents is required. + + + :param is_search_required: The is_search_required of this CohereChatResponse. + :type: bool + """ + self._is_search_required = is_search_required + + @property + def finish_reason(self): + """ + **[Required]** Gets the finish_reason of this CohereChatResponse. + Why the generation was completed. + + Allowed values for this property are: "COMPLETE", "ERROR_TOXIC", "ERROR_LIMIT", "ERROR", "USER_CANCEL", "MAX_TOKENS", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The finish_reason of this CohereChatResponse. + :rtype: str + """ + return self._finish_reason + + @finish_reason.setter + def finish_reason(self, finish_reason): + """ + Sets the finish_reason of this CohereChatResponse. + Why the generation was completed. + + + :param finish_reason: The finish_reason of this CohereChatResponse. + :type: str + """ + allowed_values = ["COMPLETE", "ERROR_TOXIC", "ERROR_LIMIT", "ERROR", "USER_CANCEL", "MAX_TOKENS"] + if not value_allowed_none_or_none_sentinel(finish_reason, allowed_values): + finish_reason = 'UNKNOWN_ENUM_VALUE' + self._finish_reason = finish_reason + + @property + def search_queries(self): + """ + Gets the search_queries of this CohereChatResponse. + Generated search queries. + + + :return: The search_queries of this CohereChatResponse. + :rtype: list[oci.generative_ai_inference.models.SearchQuery] + """ + return self._search_queries + + @search_queries.setter + def search_queries(self, search_queries): + """ + Sets the search_queries of this CohereChatResponse. + Generated search queries. + + + :param search_queries: The search_queries of this CohereChatResponse. + :type: list[oci.generative_ai_inference.models.SearchQuery] + """ + self._search_queries = search_queries + + @property + def documents(self): + """ + Gets the documents of this CohereChatResponse. + Documents seen by the model when generating the reply. Each document is a JSON String + representing the field and values of the document. + + + :return: The documents of this CohereChatResponse. + :rtype: list[object] + """ + return self._documents + + @documents.setter + def documents(self, documents): + """ + Sets the documents of this CohereChatResponse. + Documents seen by the model when generating the reply. Each document is a JSON String + representing the field and values of the document. + + + :param documents: The documents of this CohereChatResponse. + :type: list[object] + """ + self._documents = documents + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/cohere_llm_inference_response.py b/src/oci/generative_ai_inference/models/cohere_llm_inference_response.py index 7b27c22d8..17a9c12b3 100644 --- a/src/oci/generative_ai_inference/models/cohere_llm_inference_response.py +++ b/src/oci/generative_ai_inference/models/cohere_llm_inference_response.py @@ -23,7 +23,7 @@ def __init__(self, **kwargs): :param runtime_type: The value to assign to the runtime_type property of this CohereLlmInferenceResponse. - Allowed values for this property are: "COHERE", "LLAMA" + Allowed values for this property are: "COHERE", "LLAMA", "OPENAI", "DALLE3" :type runtime_type: str :param generated_texts: diff --git a/src/oci/generative_ai_inference/models/cohere_message.py b/src/oci/generative_ai_inference/models/cohere_message.py new file mode 100644 index 000000000..70c9ebc15 --- /dev/null +++ b/src/oci/generative_ai_inference/models/cohere_message.py @@ -0,0 +1,119 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CohereMessage(object): + """ + An message that represents a single dialogue of chat + """ + + #: A constant which can be used with the role property of a CohereMessage. + #: This constant has a value of "CHATBOT" + ROLE_CHATBOT = "CHATBOT" + + #: A constant which can be used with the role property of a CohereMessage. + #: This constant has a value of "USER" + ROLE_USER = "USER" + + def __init__(self, **kwargs): + """ + Initializes a new CohereMessage object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param role: + The value to assign to the role property of this CohereMessage. + Allowed values for this property are: "CHATBOT", "USER" + :type role: str + + :param message: + The value to assign to the message property of this CohereMessage. + :type message: str + + """ + self.swagger_types = { + 'role': 'str', + 'message': 'str' + } + + self.attribute_map = { + 'role': 'role', + 'message': 'message' + } + + self._role = None + self._message = None + + @property + def role(self): + """ + **[Required]** Gets the role of this CohereMessage. + One of CHATBOT|USER to identify who the message is coming from. + + Allowed values for this property are: "CHATBOT", "USER" + + + :return: The role of this CohereMessage. + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """ + Sets the role of this CohereMessage. + One of CHATBOT|USER to identify who the message is coming from. + + + :param role: The role of this CohereMessage. + :type: str + """ + allowed_values = ["CHATBOT", "USER"] + if not value_allowed_none_or_none_sentinel(role, allowed_values): + raise ValueError( + f"Invalid value for `role`, must be None or one of {allowed_values}" + ) + self._role = role + + @property + def message(self): + """ + **[Required]** Gets the message of this CohereMessage. + Contents of the chat message. + + + :return: The message of this CohereMessage. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this CohereMessage. + Contents of the chat message. + + + :param message: The message of this CohereMessage. + :type: str + """ + self._message = message + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/embed_text_details.py b/src/oci/generative_ai_inference/models/embed_text_details.py index 235e75fbd..f18a10381 100644 --- a/src/oci/generative_ai_inference/models/embed_text_details.py +++ b/src/oci/generative_ai_inference/models/embed_text_details.py @@ -104,7 +104,7 @@ def __init__(self, **kwargs): def inputs(self): """ **[Required]** Gets the inputs of this EmbedTextDetails. - The list of strings for embeddings. + Provide a list of strings with a maximum number of 96 entries. Each string can be words, a phrase, or a paragraph. The maximum length of each string entry in the list is 512 tokens. :return: The inputs of this EmbedTextDetails. @@ -116,7 +116,7 @@ def inputs(self): def inputs(self, inputs): """ Sets the inputs of this EmbedTextDetails. - The list of strings for embeddings. + Provide a list of strings with a maximum number of 96 entries. Each string can be words, a phrase, or a paragraph. The maximum length of each string entry in the list is 512 tokens. :param inputs: The inputs of this EmbedTextDetails. diff --git a/src/oci/generative_ai_inference/models/generic_chat_request.py b/src/oci/generative_ai_inference/models/generic_chat_request.py new file mode 100644 index 000000000..13532e4f3 --- /dev/null +++ b/src/oci/generative_ai_inference/models/generic_chat_request.py @@ -0,0 +1,474 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + +from .base_chat_request import BaseChatRequest +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class GenericChatRequest(BaseChatRequest): + """ + Details for the chat request. + """ + + def __init__(self, **kwargs): + """ + Initializes a new GenericChatRequest object with values from keyword arguments. The default value of the :py:attr:`~oci.generative_ai_inference.models.GenericChatRequest.api_format` attribute + of this class is ``GENERIC`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param api_format: + The value to assign to the api_format property of this GenericChatRequest. + Allowed values for this property are: "COHERE", "GENERIC" + :type api_format: str + + :param messages: + The value to assign to the messages property of this GenericChatRequest. + :type messages: list[oci.generative_ai_inference.models.Message] + + :param is_stream: + The value to assign to the is_stream property of this GenericChatRequest. + :type is_stream: bool + + :param num_generations: + The value to assign to the num_generations property of this GenericChatRequest. + :type num_generations: int + + :param is_echo: + The value to assign to the is_echo property of this GenericChatRequest. + :type is_echo: bool + + :param top_k: + The value to assign to the top_k property of this GenericChatRequest. + :type top_k: int + + :param top_p: + The value to assign to the top_p property of this GenericChatRequest. + :type top_p: float + + :param temperature: + The value to assign to the temperature property of this GenericChatRequest. + :type temperature: float + + :param frequency_penalty: + The value to assign to the frequency_penalty property of this GenericChatRequest. + :type frequency_penalty: float + + :param presence_penalty: + The value to assign to the presence_penalty property of this GenericChatRequest. + :type presence_penalty: float + + :param stop: + The value to assign to the stop property of this GenericChatRequest. + :type stop: list[str] + + :param log_probs: + The value to assign to the log_probs property of this GenericChatRequest. + :type log_probs: int + + :param max_tokens: + The value to assign to the max_tokens property of this GenericChatRequest. + :type max_tokens: int + + :param logit_bias: + The value to assign to the logit_bias property of this GenericChatRequest. + :type logit_bias: object + + """ + self.swagger_types = { + 'api_format': 'str', + 'messages': 'list[Message]', + 'is_stream': 'bool', + 'num_generations': 'int', + 'is_echo': 'bool', + 'top_k': 'int', + 'top_p': 'float', + 'temperature': 'float', + 'frequency_penalty': 'float', + 'presence_penalty': 'float', + 'stop': 'list[str]', + 'log_probs': 'int', + 'max_tokens': 'int', + 'logit_bias': 'object' + } + + self.attribute_map = { + 'api_format': 'apiFormat', + 'messages': 'messages', + 'is_stream': 'isStream', + 'num_generations': 'numGenerations', + 'is_echo': 'isEcho', + 'top_k': 'topK', + 'top_p': 'topP', + 'temperature': 'temperature', + 'frequency_penalty': 'frequencyPenalty', + 'presence_penalty': 'presencePenalty', + 'stop': 'stop', + 'log_probs': 'logProbs', + 'max_tokens': 'maxTokens', + 'logit_bias': 'logitBias' + } + + self._api_format = None + self._messages = None + self._is_stream = None + self._num_generations = None + self._is_echo = None + self._top_k = None + self._top_p = None + self._temperature = None + self._frequency_penalty = None + self._presence_penalty = None + self._stop = None + self._log_probs = None + self._max_tokens = None + self._logit_bias = None + self._api_format = 'GENERIC' + + @property + def messages(self): + """ + Gets the messages of this GenericChatRequest. + The series of messages associated with this chat completion request. It should include previous messages in the conversation. Each message has a role and content. + + + :return: The messages of this GenericChatRequest. + :rtype: list[oci.generative_ai_inference.models.Message] + """ + return self._messages + + @messages.setter + def messages(self, messages): + """ + Sets the messages of this GenericChatRequest. + The series of messages associated with this chat completion request. It should include previous messages in the conversation. Each message has a role and content. + + + :param messages: The messages of this GenericChatRequest. + :type: list[oci.generative_ai_inference.models.Message] + """ + self._messages = messages + + @property + def is_stream(self): + """ + Gets the is_stream of this GenericChatRequest. + Whether to stream back partial progress. If set, tokens are sent as data-only server-sent events as they become available. + + + :return: The is_stream of this GenericChatRequest. + :rtype: bool + """ + return self._is_stream + + @is_stream.setter + def is_stream(self, is_stream): + """ + Sets the is_stream of this GenericChatRequest. + Whether to stream back partial progress. If set, tokens are sent as data-only server-sent events as they become available. + + + :param is_stream: The is_stream of this GenericChatRequest. + :type: bool + """ + self._is_stream = is_stream + + @property + def num_generations(self): + """ + Gets the num_generations of this GenericChatRequest. + The number of of generated texts that will be returned. + + + :return: The num_generations of this GenericChatRequest. + :rtype: int + """ + return self._num_generations + + @num_generations.setter + def num_generations(self, num_generations): + """ + Sets the num_generations of this GenericChatRequest. + The number of of generated texts that will be returned. + + + :param num_generations: The num_generations of this GenericChatRequest. + :type: int + """ + self._num_generations = num_generations + + @property + def is_echo(self): + """ + Gets the is_echo of this GenericChatRequest. + Whether or not to return the user prompt in the response. Applies only to non-stream results. + + + :return: The is_echo of this GenericChatRequest. + :rtype: bool + """ + return self._is_echo + + @is_echo.setter + def is_echo(self, is_echo): + """ + Sets the is_echo of this GenericChatRequest. + Whether or not to return the user prompt in the response. Applies only to non-stream results. + + + :param is_echo: The is_echo of this GenericChatRequest. + :type: bool + """ + self._is_echo = is_echo + + @property + def top_k(self): + """ + Gets the top_k of this GenericChatRequest. + An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is -1 which means to consider all tokens. Setting to 0 disables this method and considers all tokens. + + If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen. + + + :return: The top_k of this GenericChatRequest. + :rtype: int + """ + return self._top_k + + @top_k.setter + def top_k(self, top_k): + """ + Sets the top_k of this GenericChatRequest. + An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is -1 which means to consider all tokens. Setting to 0 disables this method and considers all tokens. + + If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen. + + + :param top_k: The top_k of this GenericChatRequest. + :type: int + """ + self._top_k = top_k + + @property + def top_p(self): + """ + Gets the top_p of this GenericChatRequest. + If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. + + To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k. + + + :return: The top_p of this GenericChatRequest. + :rtype: float + """ + return self._top_p + + @top_p.setter + def top_p(self, top_p): + """ + Sets the top_p of this GenericChatRequest. + If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. + + To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k. + + + :param top_p: The top_p of this GenericChatRequest. + :type: float + """ + self._top_p = top_p + + @property + def temperature(self): + """ + Gets the temperature of this GenericChatRequest. + A number that sets the randomness of the generated output. A lower temperature means a less random generations. + + Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs. + + + :return: The temperature of this GenericChatRequest. + :rtype: float + """ + return self._temperature + + @temperature.setter + def temperature(self, temperature): + """ + Sets the temperature of this GenericChatRequest. + A number that sets the randomness of the generated output. A lower temperature means a less random generations. + + Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs. + + + :param temperature: The temperature of this GenericChatRequest. + :type: float + """ + self._temperature = temperature + + @property + def frequency_penalty(self): + """ + Gets the frequency_penalty of this GenericChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens. Set to 0 to disable. + + + :return: The frequency_penalty of this GenericChatRequest. + :rtype: float + """ + return self._frequency_penalty + + @frequency_penalty.setter + def frequency_penalty(self, frequency_penalty): + """ + Sets the frequency_penalty of this GenericChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens. Set to 0 to disable. + + + :param frequency_penalty: The frequency_penalty of this GenericChatRequest. + :type: float + """ + self._frequency_penalty = frequency_penalty + + @property + def presence_penalty(self): + """ + Gets the presence_penalty of this GenericChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens. + + Similar to frequency penalty, a penalty is applied to previously present tokens, except that this penalty is applied equally to all tokens that have already appeared, regardless of how many times they've appeared. Set to 0 to disable. + + + :return: The presence_penalty of this GenericChatRequest. + :rtype: float + """ + return self._presence_penalty + + @presence_penalty.setter + def presence_penalty(self, presence_penalty): + """ + Sets the presence_penalty of this GenericChatRequest. + To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens. + + Similar to frequency penalty, a penalty is applied to previously present tokens, except that this penalty is applied equally to all tokens that have already appeared, regardless of how many times they've appeared. Set to 0 to disable. + + + :param presence_penalty: The presence_penalty of this GenericChatRequest. + :type: float + """ + self._presence_penalty = presence_penalty + + @property + def stop(self): + """ + Gets the stop of this GenericChatRequest. + List of strings that stop the generation if they are generated for the response text. The returned output will not contain the stop strings. + + + :return: The stop of this GenericChatRequest. + :rtype: list[str] + """ + return self._stop + + @stop.setter + def stop(self, stop): + """ + Sets the stop of this GenericChatRequest. + List of strings that stop the generation if they are generated for the response text. The returned output will not contain the stop strings. + + + :param stop: The stop of this GenericChatRequest. + :type: list[str] + """ + self._stop = stop + + @property + def log_probs(self): + """ + Gets the log_probs of this GenericChatRequest. + Includes the logarithmic probabilities for the most likely output tokens and the chosen tokens. + + For example, if the log probability is 5, the API returns a list of the 5 most likely tokens. The API returns the log probability of the sampled token, so there might be up to logprobs+1 elements in the response. + + + :return: The log_probs of this GenericChatRequest. + :rtype: int + """ + return self._log_probs + + @log_probs.setter + def log_probs(self, log_probs): + """ + Sets the log_probs of this GenericChatRequest. + Includes the logarithmic probabilities for the most likely output tokens and the chosen tokens. + + For example, if the log probability is 5, the API returns a list of the 5 most likely tokens. The API returns the log probability of the sampled token, so there might be up to logprobs+1 elements in the response. + + + :param log_probs: The log_probs of this GenericChatRequest. + :type: int + """ + self._log_probs = log_probs + + @property + def max_tokens(self): + """ + Gets the max_tokens of this GenericChatRequest. + The maximum number of tokens that can be generated per output sequence. The token count of your prompt plus max_tokens cannot exceed the model's context length. + + + :return: The max_tokens of this GenericChatRequest. + :rtype: int + """ + return self._max_tokens + + @max_tokens.setter + def max_tokens(self, max_tokens): + """ + Sets the max_tokens of this GenericChatRequest. + The maximum number of tokens that can be generated per output sequence. The token count of your prompt plus max_tokens cannot exceed the model's context length. + + + :param max_tokens: The max_tokens of this GenericChatRequest. + :type: int + """ + self._max_tokens = max_tokens + + @property + def logit_bias(self): + """ + Gets the logit_bias of this GenericChatRequest. + Modify the likelihood of specified tokens appearing in the completion. + + + :return: The logit_bias of this GenericChatRequest. + :rtype: object + """ + return self._logit_bias + + @logit_bias.setter + def logit_bias(self, logit_bias): + """ + Sets the logit_bias of this GenericChatRequest. + Modify the likelihood of specified tokens appearing in the completion. + + + :param logit_bias: The logit_bias of this GenericChatRequest. + :type: object + """ + self._logit_bias = logit_bias + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/generic_chat_response.py b/src/oci/generative_ai_inference/models/generic_chat_response.py new file mode 100644 index 000000000..6740414ed --- /dev/null +++ b/src/oci/generative_ai_inference/models/generic_chat_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + +from .base_chat_response import BaseChatResponse +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class GenericChatResponse(BaseChatResponse): + """ + The response to the chat conversation. + """ + + def __init__(self, **kwargs): + """ + Initializes a new GenericChatResponse object with values from keyword arguments. The default value of the :py:attr:`~oci.generative_ai_inference.models.GenericChatResponse.api_format` attribute + of this class is ``GENERIC`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param api_format: + The value to assign to the api_format property of this GenericChatResponse. + Allowed values for this property are: "COHERE", "GENERIC" + :type api_format: str + + :param time_created: + The value to assign to the time_created property of this GenericChatResponse. + :type time_created: datetime + + :param choices: + The value to assign to the choices property of this GenericChatResponse. + :type choices: list[oci.generative_ai_inference.models.ChatChoice] + + """ + self.swagger_types = { + 'api_format': 'str', + 'time_created': 'datetime', + 'choices': 'list[ChatChoice]' + } + + self.attribute_map = { + 'api_format': 'apiFormat', + 'time_created': 'timeCreated', + 'choices': 'choices' + } + + self._api_format = None + self._time_created = None + self._choices = None + self._api_format = 'GENERIC' + + @property + def time_created(self): + """ + **[Required]** Gets the time_created of this GenericChatResponse. + The Unix timestamp (in seconds) of when the generation was created. + + + :return: The time_created of this GenericChatResponse. + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """ + Sets the time_created of this GenericChatResponse. + The Unix timestamp (in seconds) of when the generation was created. + + + :param time_created: The time_created of this GenericChatResponse. + :type: datetime + """ + self._time_created = time_created + + @property + def choices(self): + """ + **[Required]** Gets the choices of this GenericChatResponse. + A list of generated texts. Can be more than one if n is greater than 1. + + + :return: The choices of this GenericChatResponse. + :rtype: list[oci.generative_ai_inference.models.ChatChoice] + """ + return self._choices + + @choices.setter + def choices(self, choices): + """ + Sets the choices of this GenericChatResponse. + A list of generated texts. Can be more than one if n is greater than 1. + + + :param choices: The choices of this GenericChatResponse. + :type: list[oci.generative_ai_inference.models.ChatChoice] + """ + self._choices = choices + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/llama_llm_inference_request.py b/src/oci/generative_ai_inference/models/llama_llm_inference_request.py index 1b312c381..c7fa81c5d 100644 --- a/src/oci/generative_ai_inference/models/llama_llm_inference_request.py +++ b/src/oci/generative_ai_inference/models/llama_llm_inference_request.py @@ -410,7 +410,7 @@ def log_probs(self, log_probs): def max_tokens(self): """ Gets the max_tokens of this LlamaLlmInferenceRequest. - The maximum number of tokens to predict for each response. Includes input plus output tokens. + The maximum number of tokens that can be generated per output sequence. The token count of your prompt plus max_tokens cannot exceed the model's context length. :return: The max_tokens of this LlamaLlmInferenceRequest. @@ -422,7 +422,7 @@ def max_tokens(self): def max_tokens(self, max_tokens): """ Sets the max_tokens of this LlamaLlmInferenceRequest. - The maximum number of tokens to predict for each response. Includes input plus output tokens. + The maximum number of tokens that can be generated per output sequence. The token count of your prompt plus max_tokens cannot exceed the model's context length. :param max_tokens: The max_tokens of this LlamaLlmInferenceRequest. diff --git a/src/oci/generative_ai_inference/models/llama_llm_inference_response.py b/src/oci/generative_ai_inference/models/llama_llm_inference_response.py index 454fdbfa7..a314d5ea8 100644 --- a/src/oci/generative_ai_inference/models/llama_llm_inference_response.py +++ b/src/oci/generative_ai_inference/models/llama_llm_inference_response.py @@ -23,7 +23,7 @@ def __init__(self, **kwargs): :param runtime_type: The value to assign to the runtime_type property of this LlamaLlmInferenceResponse. - Allowed values for this property are: "COHERE", "LLAMA" + Allowed values for this property are: "COHERE", "LLAMA", "OPENAI", "DALLE3" :type runtime_type: str :param created: diff --git a/src/oci/generative_ai_inference/models/llm_inference_response.py b/src/oci/generative_ai_inference/models/llm_inference_response.py index 6af294f30..3bbe4c241 100644 --- a/src/oci/generative_ai_inference/models/llm_inference_response.py +++ b/src/oci/generative_ai_inference/models/llm_inference_response.py @@ -23,6 +23,14 @@ class LlmInferenceResponse(object): #: This constant has a value of "LLAMA" RUNTIME_TYPE_LLAMA = "LLAMA" + #: A constant which can be used with the runtime_type property of a LlmInferenceResponse. + #: This constant has a value of "OPENAI" + RUNTIME_TYPE_OPENAI = "OPENAI" + + #: A constant which can be used with the runtime_type property of a LlmInferenceResponse. + #: This constant has a value of "DALLE3" + RUNTIME_TYPE_DALLE3 = "DALLE3" + def __init__(self, **kwargs): """ Initializes a new LlmInferenceResponse object with values from keyword arguments. This class has the following subclasses and if you are using this class as input @@ -35,7 +43,7 @@ def __init__(self, **kwargs): :param runtime_type: The value to assign to the runtime_type property of this LlmInferenceResponse. - Allowed values for this property are: "COHERE", "LLAMA", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "COHERE", "LLAMA", "OPENAI", "DALLE3", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type runtime_type: str @@ -72,7 +80,7 @@ def runtime_type(self): **[Required]** Gets the runtime_type of this LlmInferenceResponse. The runtime of the provided model. - Allowed values for this property are: "COHERE", "LLAMA", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "COHERE", "LLAMA", "OPENAI", "DALLE3", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -91,7 +99,7 @@ def runtime_type(self, runtime_type): :param runtime_type: The runtime_type of this LlmInferenceResponse. :type: str """ - allowed_values = ["COHERE", "LLAMA"] + allowed_values = ["COHERE", "LLAMA", "OPENAI", "DALLE3"] if not value_allowed_none_or_none_sentinel(runtime_type, allowed_values): runtime_type = 'UNKNOWN_ENUM_VALUE' self._runtime_type = runtime_type diff --git a/src/oci/generative_ai_inference/models/message.py b/src/oci/generative_ai_inference/models/message.py new file mode 100644 index 000000000..fcbfef3ce --- /dev/null +++ b/src/oci/generative_ai_inference/models/message.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class Message(object): + """ + An message that represents a single dialogue of chat + """ + + def __init__(self, **kwargs): + """ + Initializes a new Message object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param role: + The value to assign to the role property of this Message. + :type role: str + + :param content: + The value to assign to the content property of this Message. + :type content: list[oci.generative_ai_inference.models.ChatContent] + + """ + self.swagger_types = { + 'role': 'str', + 'content': 'list[ChatContent]' + } + + self.attribute_map = { + 'role': 'role', + 'content': 'content' + } + + self._role = None + self._content = None + + @property + def role(self): + """ + **[Required]** Gets the role of this Message. + Indicates who is giving the current message. + + + :return: The role of this Message. + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """ + Sets the role of this Message. + Indicates who is giving the current message. + + + :param role: The role of this Message. + :type: str + """ + self._role = role + + @property + def content(self): + """ + **[Required]** Gets the content of this Message. + Contents of the chat message. + + + :return: The content of this Message. + :rtype: list[oci.generative_ai_inference.models.ChatContent] + """ + return self._content + + @content.setter + def content(self, content): + """ + Sets the content of this Message. + Contents of the chat message. + + + :param content: The content of this Message. + :type: list[oci.generative_ai_inference.models.ChatContent] + """ + self._content = content + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/search_query.py b/src/oci/generative_ai_inference/models/search_query.py new file mode 100644 index 000000000..0b7cf337b --- /dev/null +++ b/src/oci/generative_ai_inference/models/search_query.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class SearchQuery(object): + """ + The generated search query. + """ + + def __init__(self, **kwargs): + """ + Initializes a new SearchQuery object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param text: + The value to assign to the text property of this SearchQuery. + :type text: str + + """ + self.swagger_types = { + 'text': 'str' + } + + self.attribute_map = { + 'text': 'text' + } + + self._text = None + + @property + def text(self): + """ + **[Required]** Gets the text of this SearchQuery. + The text of the search query. + + + :return: The text of this SearchQuery. + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """ + Sets the text of this SearchQuery. + The text of the search query. + + + :param text: The text of this SearchQuery. + :type: str + """ + self._text = text + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/generative_ai_inference/models/text_content.py b/src/oci/generative_ai_inference/models/text_content.py new file mode 100644 index 000000000..7d864ff78 --- /dev/null +++ b/src/oci/generative_ai_inference/models/text_content.py @@ -0,0 +1,82 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 + +from .chat_content import ChatContent +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class TextContent(ChatContent): + """ + Represents a single instance of text chat content. + """ + + def __init__(self, **kwargs): + """ + Initializes a new TextContent object with values from keyword arguments. The default value of the :py:attr:`~oci.generative_ai_inference.models.TextContent.type` attribute + of this class is ``TEXT`` and it should not be changed. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param type: + The value to assign to the type property of this TextContent. + Allowed values for this property are: "TEXT" + :type type: str + + :param text: + The value to assign to the text property of this TextContent. + :type text: str + + """ + self.swagger_types = { + 'type': 'str', + 'text': 'str' + } + + self.attribute_map = { + 'type': 'type', + 'text': 'text' + } + + self._type = None + self._text = None + self._type = 'TEXT' + + @property + def text(self): + """ + Gets the text of this TextContent. + The text content. + + + :return: The text of this TextContent. + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """ + Sets the text of this TextContent. + The text content. + + + :param text: The text of this TextContent. + :type: str + """ + self._text = text + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/opa/models/opa_instance.py b/src/oci/opa/models/opa_instance.py index 5eaba221d..52a62ea67 100644 --- a/src/oci/opa/models/opa_instance.py +++ b/src/oci/opa/models/opa_instance.py @@ -63,6 +63,10 @@ class OpaInstance(object): #: This constant has a value of "ACTIVE" LIFECYCLE_STATE_ACTIVE = "ACTIVE" + #: A constant which can be used with the lifecycle_state property of a OpaInstance. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + #: A constant which can be used with the lifecycle_state property of a OpaInstance. #: This constant has a value of "DELETING" LIFECYCLE_STATE_DELETING = "DELETING" @@ -128,7 +132,7 @@ def __init__(self, **kwargs): :param lifecycle_state: The value to assign to the lifecycle_state property of this OpaInstance. - Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type lifecycle_state: str @@ -500,7 +504,7 @@ def lifecycle_state(self): **[Required]** Gets the lifecycle_state of this OpaInstance. The current state of the OpaInstance. - Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "FAILED", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -519,7 +523,7 @@ def lifecycle_state(self, lifecycle_state): :param lifecycle_state: The lifecycle_state of this OpaInstance. :type: str """ - allowed_values = ["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"] + allowed_values = ["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "FAILED"] if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): lifecycle_state = 'UNKNOWN_ENUM_VALUE' self._lifecycle_state = lifecycle_state diff --git a/src/oci/opa/models/work_request.py b/src/oci/opa/models/work_request.py index cd7dd0772..a548d13ac 100644 --- a/src/oci/opa/models/work_request.py +++ b/src/oci/opa/models/work_request.py @@ -39,6 +39,14 @@ class WorkRequest(object): #: This constant has a value of "DELETE_OPA_INSTANCE_ATTACHMENT" OPERATION_TYPE_DELETE_OPA_INSTANCE_ATTACHMENT = "DELETE_OPA_INSTANCE_ATTACHMENT" + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "START_OPA_INSTANCE" + OPERATION_TYPE_START_OPA_INSTANCE = "START_OPA_INSTANCE" + + #: A constant which can be used with the operation_type property of a WorkRequest. + #: This constant has a value of "STOP_OPA_INSTANCE" + OPERATION_TYPE_STOP_OPA_INSTANCE = "STOP_OPA_INSTANCE" + #: A constant which can be used with the status property of a WorkRequest. #: This constant has a value of "ACCEPTED" STATUS_ACCEPTED = "ACCEPTED" @@ -74,7 +82,7 @@ def __init__(self, **kwargs): :param operation_type: The value to assign to the operation_type property of this WorkRequest. - Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", "START_OPA_INSTANCE", "STOP_OPA_INSTANCE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type operation_type: str @@ -153,7 +161,7 @@ def operation_type(self): **[Required]** Gets the operation_type of this WorkRequest. Type of the work request - Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", "START_OPA_INSTANCE", "STOP_OPA_INSTANCE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -172,7 +180,7 @@ def operation_type(self, operation_type): :param operation_type: The operation_type of this WorkRequest. :type: str """ - allowed_values = ["CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT"] + allowed_values = ["CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", "START_OPA_INSTANCE", "STOP_OPA_INSTANCE"] if not value_allowed_none_or_none_sentinel(operation_type, allowed_values): operation_type = 'UNKNOWN_ENUM_VALUE' self._operation_type = operation_type diff --git a/src/oci/opa/models/work_request_summary.py b/src/oci/opa/models/work_request_summary.py index 3d8a7d378..ffdd088d2 100644 --- a/src/oci/opa/models/work_request_summary.py +++ b/src/oci/opa/models/work_request_summary.py @@ -39,6 +39,14 @@ class WorkRequestSummary(object): #: This constant has a value of "DELETE_OPA_INSTANCE_ATTACHMENT" OPERATION_TYPE_DELETE_OPA_INSTANCE_ATTACHMENT = "DELETE_OPA_INSTANCE_ATTACHMENT" + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "START_OPA_INSTANCE" + OPERATION_TYPE_START_OPA_INSTANCE = "START_OPA_INSTANCE" + + #: A constant which can be used with the operation_type property of a WorkRequestSummary. + #: This constant has a value of "STOP_OPA_INSTANCE" + OPERATION_TYPE_STOP_OPA_INSTANCE = "STOP_OPA_INSTANCE" + #: A constant which can be used with the status property of a WorkRequestSummary. #: This constant has a value of "ACCEPTED" STATUS_ACCEPTED = "ACCEPTED" @@ -74,7 +82,7 @@ def __init__(self, **kwargs): :param operation_type: The value to assign to the operation_type property of this WorkRequestSummary. - Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", "START_OPA_INSTANCE", "STOP_OPA_INSTANCE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. :type operation_type: str @@ -153,7 +161,7 @@ def operation_type(self): **[Required]** Gets the operation_type of this WorkRequestSummary. Type of the work request - Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", 'UNKNOWN_ENUM_VALUE'. + Allowed values for this property are: "CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", "START_OPA_INSTANCE", "STOP_OPA_INSTANCE", 'UNKNOWN_ENUM_VALUE'. Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. @@ -172,7 +180,7 @@ def operation_type(self, operation_type): :param operation_type: The operation_type of this WorkRequestSummary. :type: str """ - allowed_values = ["CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT"] + allowed_values = ["CREATE_OPA_INSTANCE", "UPDATE_OPA_INSTANCE", "DELETE_OPA_INSTANCE", "MOVE_OPA_INSTANCE", "CREATE_OPA_INSTANCE_ATTACHMENT", "DELETE_OPA_INSTANCE_ATTACHMENT", "START_OPA_INSTANCE", "STOP_OPA_INSTANCE"] if not value_allowed_none_or_none_sentinel(operation_type, allowed_values): operation_type = 'UNKNOWN_ENUM_VALUE' self._operation_type = operation_type diff --git a/src/oci/opa/opa_instance_client.py b/src/oci/opa/opa_instance_client.py index 178489f54..44be9b90b 100644 --- a/src/oci/opa/opa_instance_client.py +++ b/src/oci/opa/opa_instance_client.py @@ -739,7 +739,7 @@ def list_opa_instances(self, **kwargs): :param str lifecycle_state: (optional) A filter to return only resources their lifecycleState matches the given lifecycleState. - Allowed values are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED" + Allowed values are: "CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "FAILED" :param str display_name: (optional) A filter to return only resources that match the entire display name given. @@ -811,7 +811,7 @@ def list_opa_instances(self, **kwargs): f"list_opa_instances got unknown kwargs: {extra_kwargs!r}") if 'lifecycle_state' in kwargs: - lifecycle_state_allowed_values = ["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"] + lifecycle_state_allowed_values = ["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "FAILED"] if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: raise ValueError( f"Invalid value for `lifecycle_state`, must be one of { lifecycle_state_allowed_values }" @@ -1324,6 +1324,216 @@ def list_work_requests(self, **kwargs): api_reference_link=api_reference_link, required_arguments=required_arguments) + def start_opa_instance(self, opa_instance_id, **kwargs): + """ + Start an OPA instance that was previously in an INACTIVE state + + + :param str opa_instance_id: (required) + unique OpaInstance identifier + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use start_opa_instance API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['opaInstanceId'] + resource_path = "/opaInstances/{opaInstanceId}/actions/start" + method = "POST" + operation_name = "start_opa_instance" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstance/StartOpaInstance" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"start_opa_instance got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "opaInstanceId": opa_instance_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def stop_opa_instance(self, opa_instance_id, **kwargs): + """ + Stop an OPA instance that was previously in an ACTIVE state + + + :param str opa_instance_id: (required) + unique OpaInstance identifier + + :param str if_match: (optional) + 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. + + :param str opc_request_id: (optional) + The client request ID for tracing. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use stop_opa_instance API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['opaInstanceId'] + resource_path = "/opaInstances/{opaInstanceId}/actions/stop" + method = "POST" + operation_name = "stop_opa_instance" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstance/StopOpaInstance" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "if_match", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"stop_opa_instance got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "opaInstanceId": opa_instance_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "if-match": kwargs.get("if_match", missing), + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + if retry_strategy is None: + retry_strategy = retry.DEFAULT_RETRY_STRATEGY + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def update_opa_instance(self, opa_instance_id, update_opa_instance_details, **kwargs): """ Updates the OpaInstance diff --git a/src/oci/opa/opa_instance_client_composite_operations.py b/src/oci/opa/opa_instance_client_composite_operations.py index 95d3e67af..ca1dd7354 100644 --- a/src/oci/opa/opa_instance_client_composite_operations.py +++ b/src/oci/opa/opa_instance_client_composite_operations.py @@ -153,6 +153,84 @@ def delete_opa_instance_and_wait_for_state(self, opa_instance_id, wait_for_state except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def start_opa_instance_and_wait_for_state(self, opa_instance_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.opa.OpaInstanceClient.start_opa_instance` and waits for the :py:class:`~oci.opa.models.WorkRequest` + to enter the given state(s). + + :param str opa_instance_id: (required) + unique OpaInstance identifier + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.opa.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.opa.OpaInstanceClient.start_opa_instance` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.start_opa_instance(opa_instance_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + + def stop_opa_instance_and_wait_for_state(self, opa_instance_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.opa.OpaInstanceClient.stop_opa_instance` and waits for the :py:class:`~oci.opa.models.WorkRequest` + to enter the given state(s). + + :param str opa_instance_id: (required) + unique OpaInstance identifier + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.opa.models.WorkRequest.status` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.opa.OpaInstanceClient.stop_opa_instance` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.stop_opa_instance(opa_instance_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + if 'opc-work-request-id' not in operation_result.headers: + return operation_result + wait_for_resource_id = operation_result.headers['opc-work-request-id'] + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_work_request(wait_for_resource_id), + evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def update_opa_instance_and_wait_for_state(self, opa_instance_id, update_opa_instance_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.opa.OpaInstanceClient.update_opa_instance` and waits for the :py:class:`~oci.opa.models.WorkRequest` diff --git a/src/oci/redis/models/create_redis_cluster_details.py b/src/oci/redis/models/create_redis_cluster_details.py index b8829f5ed..8e2d3ccdc 100644 --- a/src/oci/redis/models/create_redis_cluster_details.py +++ b/src/oci/redis/models/create_redis_cluster_details.py @@ -46,6 +46,10 @@ def __init__(self, **kwargs): The value to assign to the subnet_id property of this CreateRedisClusterDetails. :type subnet_id: str + :param nsg_ids: + The value to assign to the nsg_ids property of this CreateRedisClusterDetails. + :type nsg_ids: list[str] + :param freeform_tags: The value to assign to the freeform_tags property of this CreateRedisClusterDetails. :type freeform_tags: dict(str, str) @@ -62,6 +66,7 @@ def __init__(self, **kwargs): 'software_version': 'str', 'node_memory_in_gbs': 'float', 'subnet_id': 'str', + 'nsg_ids': 'list[str]', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))' } @@ -73,6 +78,7 @@ def __init__(self, **kwargs): 'software_version': 'softwareVersion', 'node_memory_in_gbs': 'nodeMemoryInGBs', 'subnet_id': 'subnetId', + 'nsg_ids': 'nsgIds', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags' } @@ -83,6 +89,7 @@ def __init__(self, **kwargs): self._software_version = None self._node_memory_in_gbs = None self._subnet_id = None + self._nsg_ids = None self._freeform_tags = None self._defined_tags = None @@ -238,6 +245,30 @@ def subnet_id(self, subnet_id): """ self._subnet_id = subnet_id + @property + def nsg_ids(self): + """ + Gets the nsg_ids of this CreateRedisClusterDetails. + OCIDs of the NSGs to control access in the customer network + + + :return: The nsg_ids of this CreateRedisClusterDetails. + :rtype: list[str] + """ + return self._nsg_ids + + @nsg_ids.setter + def nsg_ids(self, nsg_ids): + """ + Sets the nsg_ids of this CreateRedisClusterDetails. + OCIDs of the NSGs to control access in the customer network + + + :param nsg_ids: The nsg_ids of this CreateRedisClusterDetails. + :type: list[str] + """ + self._nsg_ids = nsg_ids + @property def freeform_tags(self): """ diff --git a/src/oci/redis/models/redis_cluster.py b/src/oci/redis/models/redis_cluster.py index 9a9ae1c80..fc1e37d58 100644 --- a/src/oci/redis/models/redis_cluster.py +++ b/src/oci/redis/models/redis_cluster.py @@ -118,6 +118,10 @@ def __init__(self, **kwargs): The value to assign to the node_collection property of this RedisCluster. :type node_collection: oci.redis.models.NodeCollection + :param nsg_ids: + The value to assign to the nsg_ids property of this RedisCluster. + :type nsg_ids: list[str] + :param freeform_tags: The value to assign to the freeform_tags property of this RedisCluster. :type freeform_tags: dict(str, str) @@ -148,6 +152,7 @@ def __init__(self, **kwargs): 'time_created': 'datetime', 'time_updated': 'datetime', 'node_collection': 'NodeCollection', + 'nsg_ids': 'list[str]', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'system_tags': 'dict(str, dict(str, object))' @@ -170,6 +175,7 @@ def __init__(self, **kwargs): 'time_created': 'timeCreated', 'time_updated': 'timeUpdated', 'node_collection': 'nodeCollection', + 'nsg_ids': 'nsgIds', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'system_tags': 'systemTags' @@ -191,6 +197,7 @@ def __init__(self, **kwargs): self._time_created = None self._time_updated = None self._node_collection = None + self._nsg_ids = None self._freeform_tags = None self._defined_tags = None self._system_tags = None @@ -607,6 +614,30 @@ def node_collection(self, node_collection): """ self._node_collection = node_collection + @property + def nsg_ids(self): + """ + Gets the nsg_ids of this RedisCluster. + OCIDs of the NSGs to control access in the customer network + + + :return: The nsg_ids of this RedisCluster. + :rtype: list[str] + """ + return self._nsg_ids + + @nsg_ids.setter + def nsg_ids(self, nsg_ids): + """ + Sets the nsg_ids of this RedisCluster. + OCIDs of the NSGs to control access in the customer network + + + :param nsg_ids: The nsg_ids of this RedisCluster. + :type: list[str] + """ + self._nsg_ids = nsg_ids + @property def freeform_tags(self): """ diff --git a/src/oci/redis/models/redis_cluster_summary.py b/src/oci/redis/models/redis_cluster_summary.py index 30e756d69..503148dcf 100644 --- a/src/oci/redis/models/redis_cluster_summary.py +++ b/src/oci/redis/models/redis_cluster_summary.py @@ -82,6 +82,10 @@ def __init__(self, **kwargs): The value to assign to the time_updated property of this RedisClusterSummary. :type time_updated: datetime + :param nsg_ids: + The value to assign to the nsg_ids property of this RedisClusterSummary. + :type nsg_ids: list[str] + :param freeform_tags: The value to assign to the freeform_tags property of this RedisClusterSummary. :type freeform_tags: dict(str, str) @@ -111,6 +115,7 @@ def __init__(self, **kwargs): 'subnet_id': 'str', 'time_created': 'datetime', 'time_updated': 'datetime', + 'nsg_ids': 'list[str]', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))', 'system_tags': 'dict(str, dict(str, object))' @@ -132,6 +137,7 @@ def __init__(self, **kwargs): 'subnet_id': 'subnetId', 'time_created': 'timeCreated', 'time_updated': 'timeUpdated', + 'nsg_ids': 'nsgIds', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags', 'system_tags': 'systemTags' @@ -152,6 +158,7 @@ def __init__(self, **kwargs): self._subnet_id = None self._time_created = None self._time_updated = None + self._nsg_ids = None self._freeform_tags = None self._defined_tags = None self._system_tags = None @@ -536,6 +543,30 @@ def time_updated(self, time_updated): """ self._time_updated = time_updated + @property + def nsg_ids(self): + """ + Gets the nsg_ids of this RedisClusterSummary. + OCIDs of the NSGs to control access in the customer network + + + :return: The nsg_ids of this RedisClusterSummary. + :rtype: list[str] + """ + return self._nsg_ids + + @nsg_ids.setter + def nsg_ids(self, nsg_ids): + """ + Sets the nsg_ids of this RedisClusterSummary. + OCIDs of the NSGs to control access in the customer network + + + :param nsg_ids: The nsg_ids of this RedisClusterSummary. + :type: list[str] + """ + self._nsg_ids = nsg_ids + @property def freeform_tags(self): """ diff --git a/src/oci/redis/models/update_redis_cluster_details.py b/src/oci/redis/models/update_redis_cluster_details.py index 8e20771b4..9cb8e91cb 100644 --- a/src/oci/redis/models/update_redis_cluster_details.py +++ b/src/oci/redis/models/update_redis_cluster_details.py @@ -32,6 +32,10 @@ def __init__(self, **kwargs): The value to assign to the node_memory_in_gbs property of this UpdateRedisClusterDetails. :type node_memory_in_gbs: float + :param nsg_ids: + The value to assign to the nsg_ids property of this UpdateRedisClusterDetails. + :type nsg_ids: list[str] + :param freeform_tags: The value to assign to the freeform_tags property of this UpdateRedisClusterDetails. :type freeform_tags: dict(str, str) @@ -45,6 +49,7 @@ def __init__(self, **kwargs): 'display_name': 'str', 'node_count': 'int', 'node_memory_in_gbs': 'float', + 'nsg_ids': 'list[str]', 'freeform_tags': 'dict(str, str)', 'defined_tags': 'dict(str, dict(str, object))' } @@ -53,6 +58,7 @@ def __init__(self, **kwargs): 'display_name': 'displayName', 'node_count': 'nodeCount', 'node_memory_in_gbs': 'nodeMemoryInGBs', + 'nsg_ids': 'nsgIds', 'freeform_tags': 'freeformTags', 'defined_tags': 'definedTags' } @@ -60,6 +66,7 @@ def __init__(self, **kwargs): self._display_name = None self._node_count = None self._node_memory_in_gbs = None + self._nsg_ids = None self._freeform_tags = None self._defined_tags = None @@ -135,6 +142,30 @@ def node_memory_in_gbs(self, node_memory_in_gbs): """ self._node_memory_in_gbs = node_memory_in_gbs + @property + def nsg_ids(self): + """ + Gets the nsg_ids of this UpdateRedisClusterDetails. + OCIDs of the NSGs to control access in the customer network + + + :return: The nsg_ids of this UpdateRedisClusterDetails. + :rtype: list[str] + """ + return self._nsg_ids + + @nsg_ids.setter + def nsg_ids(self, nsg_ids): + """ + Sets the nsg_ids of this UpdateRedisClusterDetails. + OCIDs of the NSGs to control access in the customer network + + + :param nsg_ids: The nsg_ids of this UpdateRedisClusterDetails. + :type: list[str] + """ + self._nsg_ids = nsg_ids + @property def freeform_tags(self): """ diff --git a/src/oci/usage_api/models/__init__.py b/src/oci/usage_api/models/__init__.py index f8c648679..c4259043e 100644 --- a/src/oci/usage_api/models/__init__.py +++ b/src/oci/usage_api/models/__init__.py @@ -12,6 +12,7 @@ from .configuration_aggregation import ConfigurationAggregation from .cost_analysis_ui import CostAnalysisUI from .create_custom_table_details import CreateCustomTableDetails +from .create_email_recipients_group_details import CreateEmailRecipientsGroupDetails from .create_query_details import CreateQueryDetails from .create_schedule_details import CreateScheduleDetails from .create_usage_carbon_emissions_query_details import CreateUsageCarbonEmissionsQueryDetails @@ -21,6 +22,10 @@ from .date_range import DateRange from .dimension import Dimension from .dynamic_date_range import DynamicDateRange +from .email_recipient import EmailRecipient +from .email_recipients_group import EmailRecipientsGroup +from .email_recipients_group_collection import EmailRecipientsGroupCollection +from .email_recipients_group_summary import EmailRecipientsGroupSummary from .filter import Filter from .forecast import Forecast from .object_storage_location import ObjectStorageLocation @@ -43,6 +48,7 @@ from .static_date_range import StaticDateRange from .tag import Tag from .update_custom_table_details import UpdateCustomTableDetails +from .update_email_recipients_group_details import UpdateEmailRecipientsGroupDetails from .update_query_details import UpdateQueryDetails from .update_schedule_details import UpdateScheduleDetails from .update_usage_carbon_emissions_query_details import UpdateUsageCarbonEmissionsQueryDetails @@ -64,6 +70,7 @@ "ConfigurationAggregation": ConfigurationAggregation, "CostAnalysisUI": CostAnalysisUI, "CreateCustomTableDetails": CreateCustomTableDetails, + "CreateEmailRecipientsGroupDetails": CreateEmailRecipientsGroupDetails, "CreateQueryDetails": CreateQueryDetails, "CreateScheduleDetails": CreateScheduleDetails, "CreateUsageCarbonEmissionsQueryDetails": CreateUsageCarbonEmissionsQueryDetails, @@ -73,6 +80,10 @@ "DateRange": DateRange, "Dimension": Dimension, "DynamicDateRange": DynamicDateRange, + "EmailRecipient": EmailRecipient, + "EmailRecipientsGroup": EmailRecipientsGroup, + "EmailRecipientsGroupCollection": EmailRecipientsGroupCollection, + "EmailRecipientsGroupSummary": EmailRecipientsGroupSummary, "Filter": Filter, "Forecast": Forecast, "ObjectStorageLocation": ObjectStorageLocation, @@ -95,6 +106,7 @@ "StaticDateRange": StaticDateRange, "Tag": Tag, "UpdateCustomTableDetails": UpdateCustomTableDetails, + "UpdateEmailRecipientsGroupDetails": UpdateEmailRecipientsGroupDetails, "UpdateQueryDetails": UpdateQueryDetails, "UpdateScheduleDetails": UpdateScheduleDetails, "UpdateUsageCarbonEmissionsQueryDetails": UpdateUsageCarbonEmissionsQueryDetails, diff --git a/src/oci/usage_api/models/create_email_recipients_group_details.py b/src/oci/usage_api/models/create_email_recipients_group_details.py new file mode 100644 index 000000000..d62643d2f --- /dev/null +++ b/src/oci/usage_api/models/create_email_recipients_group_details.py @@ -0,0 +1,103 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20200107 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class CreateEmailRecipientsGroupDetails(object): + """ + The saved email recipient group to receive usage statement email. + """ + + def __init__(self, **kwargs): + """ + Initializes a new CreateEmailRecipientsGroupDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param compartment_id: + The value to assign to the compartment_id property of this CreateEmailRecipientsGroupDetails. + :type compartment_id: str + + :param recipients_list: + The value to assign to the recipients_list property of this CreateEmailRecipientsGroupDetails. + :type recipients_list: list[oci.usage_api.models.EmailRecipient] + + """ + self.swagger_types = { + 'compartment_id': 'str', + 'recipients_list': 'list[EmailRecipient]' + } + + self.attribute_map = { + 'compartment_id': 'compartmentId', + 'recipients_list': 'recipientsList' + } + + self._compartment_id = None + self._recipients_list = None + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this CreateEmailRecipientsGroupDetails. + The customer tenancy. + + + :return: The compartment_id of this CreateEmailRecipientsGroupDetails. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this CreateEmailRecipientsGroupDetails. + The customer tenancy. + + + :param compartment_id: The compartment_id of this CreateEmailRecipientsGroupDetails. + :type: str + """ + self._compartment_id = compartment_id + + @property + def recipients_list(self): + """ + **[Required]** Gets the recipients_list of this CreateEmailRecipientsGroupDetails. + The list of recipient will receive the usage statement email. + + + :return: The recipients_list of this CreateEmailRecipientsGroupDetails. + :rtype: list[oci.usage_api.models.EmailRecipient] + """ + return self._recipients_list + + @recipients_list.setter + def recipients_list(self, recipients_list): + """ + Sets the recipients_list of this CreateEmailRecipientsGroupDetails. + The list of recipient will receive the usage statement email. + + + :param recipients_list: The recipients_list of this CreateEmailRecipientsGroupDetails. + :type: list[oci.usage_api.models.EmailRecipient] + """ + self._recipients_list = recipients_list + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/usage_api/models/email_recipient.py b/src/oci/usage_api/models/email_recipient.py new file mode 100644 index 000000000..b21a11abf --- /dev/null +++ b/src/oci/usage_api/models/email_recipient.py @@ -0,0 +1,181 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20200107 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EmailRecipient(object): + """ + The email recipient to receive usage statements for the subscription. + """ + + #: A constant which can be used with the lifecycle_state property of a EmailRecipient. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a EmailRecipient. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + def __init__(self, **kwargs): + """ + Initializes a new EmailRecipient object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param first_name: + The value to assign to the first_name property of this EmailRecipient. + :type first_name: str + + :param last_name: + The value to assign to the last_name property of this EmailRecipient. + :type last_name: str + + :param email_id: + The value to assign to the email_id property of this EmailRecipient. + :type email_id: str + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this EmailRecipient. + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + """ + self.swagger_types = { + 'first_name': 'str', + 'last_name': 'str', + 'email_id': 'str', + 'lifecycle_state': 'str' + } + + self.attribute_map = { + 'first_name': 'firstName', + 'last_name': 'lastName', + 'email_id': 'emailId', + 'lifecycle_state': 'lifecycleState' + } + + self._first_name = None + self._last_name = None + self._email_id = None + self._lifecycle_state = None + + @property + def first_name(self): + """ + Gets the first_name of this EmailRecipient. + the first name of the recipient. + + + :return: The first_name of this EmailRecipient. + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """ + Sets the first_name of this EmailRecipient. + the first name of the recipient. + + + :param first_name: The first_name of this EmailRecipient. + :type: str + """ + self._first_name = first_name + + @property + def last_name(self): + """ + Gets the last_name of this EmailRecipient. + the last name of the recipient. + + + :return: The last_name of this EmailRecipient. + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """ + Sets the last_name of this EmailRecipient. + the last name of the recipient. + + + :param last_name: The last_name of this EmailRecipient. + :type: str + """ + self._last_name = last_name + + @property + def email_id(self): + """ + **[Required]** Gets the email_id of this EmailRecipient. + the email of the recipient. + + + :return: The email_id of this EmailRecipient. + :rtype: str + """ + return self._email_id + + @email_id.setter + def email_id(self, email_id): + """ + Sets the email_id of this EmailRecipient. + the email of the recipient. + + + :param email_id: The email_id of this EmailRecipient. + :type: str + """ + self._email_id = email_id + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this EmailRecipient. + The email recipient lifecycle state. + + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this EmailRecipient. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this EmailRecipient. + The email recipient lifecycle state. + + + :param lifecycle_state: The lifecycle_state of this EmailRecipient. + :type: str + """ + allowed_values = ["ACTIVE", "INACTIVE"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/usage_api/models/email_recipients_group.py b/src/oci/usage_api/models/email_recipients_group.py new file mode 100644 index 000000000..f33c7150a --- /dev/null +++ b/src/oci/usage_api/models/email_recipients_group.py @@ -0,0 +1,181 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20200107 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EmailRecipientsGroup(object): + """ + The recipients group to receive usage statement email. + """ + + #: A constant which can be used with the lifecycle_state property of a EmailRecipientsGroup. + #: This constant has a value of "ACTIVE" + LIFECYCLE_STATE_ACTIVE = "ACTIVE" + + #: A constant which can be used with the lifecycle_state property of a EmailRecipientsGroup. + #: This constant has a value of "INACTIVE" + LIFECYCLE_STATE_INACTIVE = "INACTIVE" + + def __init__(self, **kwargs): + """ + Initializes a new EmailRecipientsGroup object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this EmailRecipientsGroup. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this EmailRecipientsGroup. + :type compartment_id: str + + :param recipients_list: + The value to assign to the recipients_list property of this EmailRecipientsGroup. + :type recipients_list: list[oci.usage_api.models.EmailRecipient] + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this EmailRecipientsGroup. + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + :type lifecycle_state: str + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'recipients_list': 'list[EmailRecipient]', + 'lifecycle_state': 'str' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'recipients_list': 'recipientsList', + 'lifecycle_state': 'lifecycleState' + } + + self._id = None + self._compartment_id = None + self._recipients_list = None + self._lifecycle_state = None + + @property + def id(self): + """ + **[Required]** Gets the id of this EmailRecipientsGroup. + The usage statement email recipients group OCID. + + + :return: The id of this EmailRecipientsGroup. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this EmailRecipientsGroup. + The usage statement email recipients group OCID. + + + :param id: The id of this EmailRecipientsGroup. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this EmailRecipientsGroup. + The customer tenancy OCID. + + + :return: The compartment_id of this EmailRecipientsGroup. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this EmailRecipientsGroup. + The customer tenancy OCID. + + + :param compartment_id: The compartment_id of this EmailRecipientsGroup. + :type: str + """ + self._compartment_id = compartment_id + + @property + def recipients_list(self): + """ + **[Required]** Gets the recipients_list of this EmailRecipientsGroup. + The list of recipient will receive the usage statement email. + + + :return: The recipients_list of this EmailRecipientsGroup. + :rtype: list[oci.usage_api.models.EmailRecipient] + """ + return self._recipients_list + + @recipients_list.setter + def recipients_list(self, recipients_list): + """ + Sets the recipients_list of this EmailRecipientsGroup. + The list of recipient will receive the usage statement email. + + + :param recipients_list: The recipients_list of this EmailRecipientsGroup. + :type: list[oci.usage_api.models.EmailRecipient] + """ + self._recipients_list = recipients_list + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this EmailRecipientsGroup. + The email recipient group lifecycle state. + + Allowed values for this property are: "ACTIVE", "INACTIVE", 'UNKNOWN_ENUM_VALUE'. + Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. + + + :return: The lifecycle_state of this EmailRecipientsGroup. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this EmailRecipientsGroup. + The email recipient group lifecycle state. + + + :param lifecycle_state: The lifecycle_state of this EmailRecipientsGroup. + :type: str + """ + allowed_values = ["ACTIVE", "INACTIVE"] + if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values): + lifecycle_state = 'UNKNOWN_ENUM_VALUE' + self._lifecycle_state = lifecycle_state + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/usage_api/models/email_recipients_group_collection.py b/src/oci/usage_api/models/email_recipients_group_collection.py new file mode 100644 index 000000000..9c96a41f8 --- /dev/null +++ b/src/oci/usage_api/models/email_recipients_group_collection.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20200107 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EmailRecipientsGroupCollection(object): + """ + An email recipients groups collection + """ + + def __init__(self, **kwargs): + """ + Initializes a new EmailRecipientsGroupCollection object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param items: + The value to assign to the items property of this EmailRecipientsGroupCollection. + :type items: list[oci.usage_api.models.EmailRecipientsGroupSummary] + + """ + self.swagger_types = { + 'items': 'list[EmailRecipientsGroupSummary]' + } + + self.attribute_map = { + 'items': 'items' + } + + self._items = None + + @property + def items(self): + """ + **[Required]** Gets the items of this EmailRecipientsGroupCollection. + An email recipients groups list. + + + :return: The items of this EmailRecipientsGroupCollection. + :rtype: list[oci.usage_api.models.EmailRecipientsGroupSummary] + """ + return self._items + + @items.setter + def items(self, items): + """ + Sets the items of this EmailRecipientsGroupCollection. + An email recipients groups list. + + + :param items: The items of this EmailRecipientsGroupCollection. + :type: list[oci.usage_api.models.EmailRecipientsGroupSummary] + """ + self._items = items + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/usage_api/models/email_recipients_group_summary.py b/src/oci/usage_api/models/email_recipients_group_summary.py new file mode 100644 index 000000000..057abbb70 --- /dev/null +++ b/src/oci/usage_api/models/email_recipients_group_summary.py @@ -0,0 +1,272 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20200107 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class EmailRecipientsGroupSummary(object): + """ + Email recipients group summary for the list recipients groups. + """ + + def __init__(self, **kwargs): + """ + Initializes a new EmailRecipientsGroupSummary object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param id: + The value to assign to the id property of this EmailRecipientsGroupSummary. + :type id: str + + :param compartment_id: + The value to assign to the compartment_id property of this EmailRecipientsGroupSummary. + :type compartment_id: str + + :param recipients_list: + The value to assign to the recipients_list property of this EmailRecipientsGroupSummary. + :type recipients_list: list[oci.usage_api.models.EmailRecipient] + + :param lifecycle_state: + The value to assign to the lifecycle_state property of this EmailRecipientsGroupSummary. + :type lifecycle_state: str + + :param freeform_tags: + The value to assign to the freeform_tags property of this EmailRecipientsGroupSummary. + :type freeform_tags: dict(str, str) + + :param defined_tags: + The value to assign to the defined_tags property of this EmailRecipientsGroupSummary. + :type defined_tags: dict(str, dict(str, object)) + + :param system_tags: + The value to assign to the system_tags property of this EmailRecipientsGroupSummary. + :type system_tags: dict(str, dict(str, object)) + + """ + self.swagger_types = { + 'id': 'str', + 'compartment_id': 'str', + 'recipients_list': 'list[EmailRecipient]', + 'lifecycle_state': 'str', + 'freeform_tags': 'dict(str, str)', + 'defined_tags': 'dict(str, dict(str, object))', + 'system_tags': 'dict(str, dict(str, object))' + } + + self.attribute_map = { + 'id': 'id', + 'compartment_id': 'compartmentId', + 'recipients_list': 'recipientsList', + 'lifecycle_state': 'lifecycleState', + 'freeform_tags': 'freeformTags', + 'defined_tags': 'definedTags', + 'system_tags': 'systemTags' + } + + self._id = None + self._compartment_id = None + self._recipients_list = None + self._lifecycle_state = None + self._freeform_tags = None + self._defined_tags = None + self._system_tags = None + + @property + def id(self): + """ + **[Required]** Gets the id of this EmailRecipientsGroupSummary. + The usage statement email recipients group OCID. + + + :return: The id of this EmailRecipientsGroupSummary. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this EmailRecipientsGroupSummary. + The usage statement email recipients group OCID. + + + :param id: The id of this EmailRecipientsGroupSummary. + :type: str + """ + self._id = id + + @property + def compartment_id(self): + """ + **[Required]** Gets the compartment_id of this EmailRecipientsGroupSummary. + The customer tenancy. + + + :return: The compartment_id of this EmailRecipientsGroupSummary. + :rtype: str + """ + return self._compartment_id + + @compartment_id.setter + def compartment_id(self, compartment_id): + """ + Sets the compartment_id of this EmailRecipientsGroupSummary. + The customer tenancy. + + + :param compartment_id: The compartment_id of this EmailRecipientsGroupSummary. + :type: str + """ + self._compartment_id = compartment_id + + @property + def recipients_list(self): + """ + **[Required]** Gets the recipients_list of this EmailRecipientsGroupSummary. + The list of recipient will receive the usage statement email. + + + :return: The recipients_list of this EmailRecipientsGroupSummary. + :rtype: list[oci.usage_api.models.EmailRecipient] + """ + return self._recipients_list + + @recipients_list.setter + def recipients_list(self, recipients_list): + """ + Sets the recipients_list of this EmailRecipientsGroupSummary. + The list of recipient will receive the usage statement email. + + + :param recipients_list: The recipients_list of this EmailRecipientsGroupSummary. + :type: list[oci.usage_api.models.EmailRecipient] + """ + self._recipients_list = recipients_list + + @property + def lifecycle_state(self): + """ + **[Required]** Gets the lifecycle_state of this EmailRecipientsGroupSummary. + The email recipient group lifecycle state. + + + :return: The lifecycle_state of this EmailRecipientsGroupSummary. + :rtype: str + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state): + """ + Sets the lifecycle_state of this EmailRecipientsGroupSummary. + The email recipient group lifecycle state. + + + :param lifecycle_state: The lifecycle_state of this EmailRecipientsGroupSummary. + :type: str + """ + self._lifecycle_state = lifecycle_state + + @property + def freeform_tags(self): + """ + Gets the freeform_tags of this EmailRecipientsGroupSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + See `Resource Tags`__. Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The freeform_tags of this EmailRecipientsGroupSummary. + :rtype: dict(str, str) + """ + return self._freeform_tags + + @freeform_tags.setter + def freeform_tags(self, freeform_tags): + """ + Sets the freeform_tags of this EmailRecipientsGroupSummary. + Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + See `Resource Tags`__. Example: `{\"bar-key\": \"value\"}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param freeform_tags: The freeform_tags of this EmailRecipientsGroupSummary. + :type: dict(str, str) + """ + self._freeform_tags = freeform_tags + + @property + def defined_tags(self): + """ + Gets the defined_tags of this EmailRecipientsGroupSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. See `Resource Tags`__. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The defined_tags of this EmailRecipientsGroupSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._defined_tags + + @defined_tags.setter + def defined_tags(self, defined_tags): + """ + Sets the defined_tags of this EmailRecipientsGroupSummary. + Defined tags for this resource. Each key is predefined and scoped to a namespace. See `Resource Tags`__. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param defined_tags: The defined_tags of this EmailRecipientsGroupSummary. + :type: dict(str, dict(str, object)) + """ + self._defined_tags = defined_tags + + @property + def system_tags(self): + """ + Gets the system_tags of this EmailRecipientsGroupSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. See `Resource Tags`__. Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :return: The system_tags of this EmailRecipientsGroupSummary. + :rtype: dict(str, dict(str, object)) + """ + return self._system_tags + + @system_tags.setter + def system_tags(self, system_tags): + """ + Sets the system_tags of this EmailRecipientsGroupSummary. + Usage of system tag keys. These predefined keys are scoped to namespaces. See `Resource Tags`__. Example: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}` + + __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm + + + :param system_tags: The system_tags of this EmailRecipientsGroupSummary. + :type: dict(str, dict(str, object)) + """ + self._system_tags = system_tags + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/usage_api/models/update_email_recipients_group_details.py b/src/oci/usage_api/models/update_email_recipients_group_details.py new file mode 100644 index 000000000..d2a4f54b8 --- /dev/null +++ b/src/oci/usage_api/models/update_email_recipients_group_details.py @@ -0,0 +1,72 @@ +# coding: utf-8 +# Copyright (c) 2016, 2024, 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. + +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20200107 + + +from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 +from oci.decorators import init_model_state_from_kwargs + + +@init_model_state_from_kwargs +class UpdateEmailRecipientsGroupDetails(object): + """ + The saved email recipient group to receive usage statement email. + """ + + def __init__(self, **kwargs): + """ + Initializes a new UpdateEmailRecipientsGroupDetails object with values from keyword arguments. + The following keyword arguments are supported (corresponding to the getters/setters of this class): + + :param recipients_list: + The value to assign to the recipients_list property of this UpdateEmailRecipientsGroupDetails. + :type recipients_list: list[oci.usage_api.models.EmailRecipient] + + """ + self.swagger_types = { + 'recipients_list': 'list[EmailRecipient]' + } + + self.attribute_map = { + 'recipients_list': 'recipientsList' + } + + self._recipients_list = None + + @property + def recipients_list(self): + """ + **[Required]** Gets the recipients_list of this UpdateEmailRecipientsGroupDetails. + The list of recipient will receive the usage statement email. + + + :return: The recipients_list of this UpdateEmailRecipientsGroupDetails. + :rtype: list[oci.usage_api.models.EmailRecipient] + """ + return self._recipients_list + + @recipients_list.setter + def recipients_list(self, recipients_list): + """ + Sets the recipients_list of this UpdateEmailRecipientsGroupDetails. + The list of recipient will receive the usage statement email. + + + :param recipients_list: The recipients_list of this UpdateEmailRecipientsGroupDetails. + :type: list[oci.usage_api.models.EmailRecipient] + """ + self._recipients_list = recipients_list + + def __repr__(self): + return formatted_flat_dict(self) + + def __eq__(self, other): + if other is None: + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other diff --git a/src/oci/usage_api/usageapi_client.py b/src/oci/usage_api/usageapi_client.py index 39659237b..37fc0852f 100644 --- a/src/oci/usage_api/usageapi_client.py +++ b/src/oci/usage_api/usageapi_client.py @@ -22,7 +22,7 @@ class UsageapiClient(object): """ - Use the Usage API to view your Oracle Cloud usage and costs. The API allows you to request data that meets the specified filter criteria, and to group that data by the dimension of your choosing. The Usage API is used by the Cost Analysis tool in the Console. Also see [Using the Usage API](/Content/Billing/Concepts/costanalysisoverview.htm#cost_analysis_using_the_api) for more information. + Use the Usage API to view your Oracle Cloud usage and costs. The API allows you to request data that meets the specified filter criteria, and to group that data by the chosen dimension. The Usage API is used by the Cost Analysis and Carbon Emissions Analysis tools in the Console. See [Cost Analysis Overview](/Content/Billing/Concepts/costanalysisoverview.htm) and [Using the Usage API](/Content/Billing/Concepts/costanalysisoverview.htm#cost_analysis_using_the_api) for more information. """ def __init__(self, config, **kwargs): @@ -213,6 +213,118 @@ def create_custom_table(self, create_custom_table_details, **kwargs): api_reference_link=api_reference_link, required_arguments=required_arguments) + def create_email_recipients_group(self, create_email_recipients_group_details, subscription_id, **kwargs): + """ + Add a list of email recipients that can receive usage statements for the subscription. + + + :param oci.usage_api.models.CreateEmailRecipientsGroupDetails create_email_recipients_group_details: (required) + New email recipients group details. + + :param str subscription_id: (required) + The UsageStatement Subscription unique OCID. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str opc_retry_token: (optional) + 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. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.EmailRecipientsGroup` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use create_email_recipients_group API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['subscriptionId'] + resource_path = "/usageStatements/{subscriptionId}/emailRecipientsGroups" + method = "POST" + operation_name = "create_email_recipients_group" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/usage/20200107/EmailRecipientsGroup/CreateEmailRecipientsGroup" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "opc_retry_token" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"create_email_recipients_group got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "subscriptionId": subscription_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=create_email_recipients_group_details, + response_type="EmailRecipientsGroup", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + body=create_email_recipients_group_details, + response_type="EmailRecipientsGroup", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def create_query(self, create_query_details, **kwargs): """ Returns the created query. @@ -608,6 +720,124 @@ def delete_custom_table(self, custom_table_id, **kwargs): api_reference_link=api_reference_link, required_arguments=required_arguments) + def delete_email_recipients_group(self, email_recipients_group_id, subscription_id, compartment_id, **kwargs): + """ + Delete the email recipients group for the usage statement subscription. + + + :param str email_recipients_group_id: (required) + The email recipient group OCID. + + :param str subscription_id: (required) + The UsageStatement Subscription unique OCID. + + :param str compartment_id: (required) + The compartment ID in which to list resources. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str if_match: (optional) + 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. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type None + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use delete_email_recipients_group API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['emailRecipientsGroupId', 'subscriptionId', 'compartmentId'] + resource_path = "/usageStatements/{subscriptionId}/emailRecipientsGroups/{emailRecipientsGroupId}" + method = "DELETE" + operation_name = "delete_email_recipients_group" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/usage/20200107/EmailRecipientsGroup/DeleteEmailRecipientsGroup" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"delete_email_recipients_group got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "emailRecipientsGroupId": email_recipients_group_id, + "subscriptionId": subscription_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def delete_query(self, query_id, **kwargs): """ Delete a saved query by the OCID. @@ -966,10 +1196,114 @@ def get_custom_table(self, custom_table_id, **kwargs): extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( - f"get_custom_table got unknown kwargs: {extra_kwargs!r}") + f"get_custom_table got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "customTableId": custom_table_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="CustomTable", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + header_params=header_params, + response_type="CustomTable", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + + def get_email_recipients_group(self, email_recipients_group_id, subscription_id, compartment_id, **kwargs): + """ + Return the saved usage statement email recipient group. + + + :param str email_recipients_group_id: (required) + The email recipient group OCID. + + :param str subscription_id: (required) + The UsageStatement Subscription unique OCID. + + :param str compartment_id: (required) + The compartment ID in which to list resources. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.EmailRecipientsGroup` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use get_email_recipients_group API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['emailRecipientsGroupId', 'subscriptionId', 'compartmentId'] + resource_path = "/usageStatements/{subscriptionId}/emailRecipientsGroups/{emailRecipientsGroupId}" + method = "GET" + operation_name = "get_email_recipients_group" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/usage/20200107/EmailRecipientsGroup/GetEmailRecipientsGroup" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"get_email_recipients_group got unknown kwargs: {extra_kwargs!r}") path_params = { - "customTableId": custom_table_id + "emailRecipientsGroupId": email_recipients_group_id, + "subscriptionId": subscription_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} @@ -978,6 +1312,11 @@ def get_custom_table(self, custom_table_id, **kwargs): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + header_params = { "accept": "application/json", "content-type": "application/json", @@ -999,8 +1338,9 @@ def get_custom_table(self, custom_table_id, **kwargs): resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params, - response_type="CustomTable", + response_type="EmailRecipientsGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, @@ -1010,8 +1350,9 @@ def get_custom_table(self, custom_table_id, **kwargs): resource_path=resource_path, method=method, path_params=path_params, + query_params=query_params, header_params=header_params, - response_type="CustomTable", + response_type="EmailRecipientsGroup", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, @@ -1217,7 +1558,7 @@ def get_scheduled_run(self, scheduled_run_id, **kwargs): :param str scheduled_run_id: (required) - The scheduledRun unique OCID. + The scheduledRun unique OCID :param str opc_request_id: (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a @@ -1540,6 +1881,162 @@ def list_custom_tables(self, compartment_id, saved_report_id, **kwargs): api_reference_link=api_reference_link, required_arguments=required_arguments) + def list_email_recipients_groups(self, subscription_id, compartment_id, **kwargs): + """ + Return the saved usage statement email recipient group. + + + :param str subscription_id: (required) + The UsageStatement Subscription unique OCID. + + :param str compartment_id: (required) + The compartment ID in which to list resources. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param int limit: (optional) + The maximumimum number of items to return. + + :param str page: (optional) + The page token representing the page at which to start retrieving results. + This is usually retrieved from a previous list call. + + :param str opc_retry_token: (optional) + 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. + + :param str sort_by: (optional) + The field to sort by. If not specified, the default is displayName. + + Allowed values are: "displayName" + + :param str sort_order: (optional) + The sort order to use, whether 'asc' or 'desc'. + + Allowed values are: "ASC", "DESC" + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.EmailRecipientsGroupCollection` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use list_email_recipients_groups API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['subscriptionId', 'compartmentId'] + resource_path = "/usageStatements/{subscriptionId}/emailRecipientsGroups" + method = "GET" + operation_name = "list_email_recipients_groups" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/usage/20200107/EmailRecipientsGroup/ListEmailRecipientsGroups" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "limit", + "page", + "opc_retry_token", + "sort_by", + "sort_order" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"list_email_recipients_groups got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "subscriptionId": subscription_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + if 'sort_by' in kwargs: + sort_by_allowed_values = ["displayName"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" + ) + + if 'sort_order' in kwargs: + sort_order_allowed_values = ["ASC", "DESC"] + if kwargs['sort_order'] not in sort_order_allowed_values: + raise ValueError( + f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" + ) + + query_params = { + "limit": kwargs.get("limit", missing), + "page": kwargs.get("page", missing), + "compartmentId": compartment_id, + "sortBy": kwargs.get("sort_by", missing), + "sortOrder": kwargs.get("sort_order", missing) + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "opc-retry-token": kwargs.get("opc_retry_token", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_retry_token_if_needed(header_params) + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="EmailRecipientsGroupCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + response_type="EmailRecipientsGroupCollection", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def list_queries(self, compartment_id, **kwargs): """ Returns the saved query list. @@ -2777,6 +3274,131 @@ def update_custom_table(self, update_custom_table_details, custom_table_id, **kw api_reference_link=api_reference_link, required_arguments=required_arguments) + def update_email_recipients_group(self, update_email_recipients_group_details, email_recipients_group_id, subscription_id, compartment_id, **kwargs): + """ + Update a saved email recipients group. + + + :param oci.usage_api.models.UpdateEmailRecipientsGroupDetails update_email_recipients_group_details: (required) + The information to be updated. + + :param str email_recipients_group_id: (required) + The email recipient group OCID. + + :param str subscription_id: (required) + The UsageStatement Subscription unique OCID. + + :param str compartment_id: (required) + The compartment ID in which to list resources. + + :param str opc_request_id: (optional) + Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + particular request, please provide the request ID. + + :param str if_match: (optional) + 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. + + :param obj retry_strategy: (optional) + A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. + + This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. + The specifics of the default retry strategy are described `here `__. + + To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. + + :param bool allow_control_chars: (optional) + allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. + By default, the response will not allow control characters in strings + + :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.EmailRecipientsGroup` + :rtype: :class:`~oci.response.Response` + + :example: + Click `here `__ to see an example of how to use update_email_recipients_group API. + """ + # Required path and query arguments. These are in camelCase to replace values in service endpoints. + required_arguments = ['emailRecipientsGroupId', 'subscriptionId', 'compartmentId'] + resource_path = "/usageStatements/{subscriptionId}/emailRecipientsGroups/{emailRecipientsGroupId}" + method = "PUT" + operation_name = "update_email_recipients_group" + api_reference_link = "https://docs.oracle.com/iaas/api/#/en/usage/20200107/EmailRecipientsGroup/UpdateEmailRecipientsGroup" + + # Don't accept unknown kwargs + expected_kwargs = [ + "allow_control_chars", + "retry_strategy", + "opc_request_id", + "if_match" + ] + extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] + if extra_kwargs: + raise ValueError( + f"update_email_recipients_group got unknown kwargs: {extra_kwargs!r}") + + path_params = { + "emailRecipientsGroupId": email_recipients_group_id, + "subscriptionId": subscription_id + } + + path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} + + for (k, v) in six.iteritems(path_params): + if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): + raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') + + query_params = { + "compartmentId": compartment_id + } + query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} + + header_params = { + "accept": "application/json", + "content-type": "application/json", + "opc-request-id": kwargs.get("opc_request_id", missing), + "if-match": kwargs.get("if_match", missing) + } + header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} + + retry_strategy = self.base_client.get_preferred_retry_strategy( + operation_retry_strategy=kwargs.get('retry_strategy'), + client_retry_strategy=self.retry_strategy + ) + + if retry_strategy: + if not isinstance(retry_strategy, retry.NoneRetryStrategy): + self.base_client.add_opc_client_retries_header(header_params) + retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) + return retry_strategy.make_retrying_call( + self.base_client.call_api, + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + body=update_email_recipients_group_details, + response_type="EmailRecipientsGroup", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + else: + return self.base_client.call_api( + resource_path=resource_path, + method=method, + path_params=path_params, + query_params=query_params, + header_params=header_params, + body=update_email_recipients_group_details, + response_type="EmailRecipientsGroup", + allow_control_chars=kwargs.get('allow_control_chars'), + operation_name=operation_name, + api_reference_link=api_reference_link, + required_arguments=required_arguments) + def update_query(self, update_query_details, query_id, **kwargs): """ Update a saved query by the OCID. diff --git a/src/oci/usage_api/usageapi_client_composite_operations.py b/src/oci/usage_api/usageapi_client_composite_operations.py index 671c8dfa8..e6c2e1272 100644 --- a/src/oci/usage_api/usageapi_client_composite_operations.py +++ b/src/oci/usage_api/usageapi_client_composite_operations.py @@ -25,6 +25,51 @@ def __init__(self, client, **kwargs): """ self.client = client + def create_email_recipients_group_and_wait_for_state(self, create_email_recipients_group_details, subscription_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.usage_api.UsageapiClient.create_email_recipients_group` and waits for the :py:class:`~oci.usage_api.models.EmailRecipientsGroup` acted upon + to enter the given state(s). + + :param oci.usage_api.models.CreateEmailRecipientsGroupDetails create_email_recipients_group_details: (required) + New email recipients group details. + + :param str subscription_id: (required) + The UsageStatement Subscription unique OCID. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.usage_api.models.EmailRecipientsGroup.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.usage_api.UsageapiClient.create_email_recipients_group` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.create_email_recipients_group(create_email_recipients_group_details, subscription_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + email_recipients_group_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id), # noqa: F821 + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except (NameError, TypeError) as e: + if not e.args: + e.args = ('',) + e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', ) + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def create_schedule_and_wait_for_state(self, create_schedule_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.usage_api.UsageapiClient.create_schedule` and waits for the :py:class:`~oci.usage_api.models.Schedule` acted upon @@ -126,6 +171,57 @@ def delete_schedule_and_wait_for_state(self, schedule_id, wait_for_states=[], op except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def update_email_recipients_group_and_wait_for_state(self, update_email_recipients_group_details, email_recipients_group_id, subscription_id, compartment_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): + """ + Calls :py:func:`~oci.usage_api.UsageapiClient.update_email_recipients_group` and waits for the :py:class:`~oci.usage_api.models.EmailRecipientsGroup` acted upon + to enter the given state(s). + + :param oci.usage_api.models.UpdateEmailRecipientsGroupDetails update_email_recipients_group_details: (required) + The information to be updated. + + :param str email_recipients_group_id: (required) + The email recipient group OCID. + + :param str subscription_id: (required) + The UsageStatement Subscription unique OCID. + + :param str compartment_id: (required) + The compartment ID in which to list resources. + + :param list[str] wait_for_states: + An array of states to wait on. These should be valid values for :py:attr:`~oci.usage_api.models.EmailRecipientsGroup.lifecycle_state` + + :param dict operation_kwargs: + A dictionary of keyword arguments to pass to :py:func:`~oci.usage_api.UsageapiClient.update_email_recipients_group` + + :param dict waiter_kwargs: + A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` + as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait + """ + operation_result = self.client.update_email_recipients_group(update_email_recipients_group_details, email_recipients_group_id, subscription_id, compartment_id, **operation_kwargs) + if not wait_for_states: + return operation_result + lowered_wait_for_states = [w.lower() for w in wait_for_states] + email_recipients_group_id = operation_result.data.id + + try: + waiter_result = oci.wait_until( + self.client, + self.client.get_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id), # noqa: F821 + evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states, + **waiter_kwargs + ) + result_to_return = waiter_result + + return result_to_return + except (NameError, TypeError) as e: + if not e.args: + e.args = ('',) + e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', ) + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + except Exception as e: + raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) + def update_schedule_and_wait_for_state(self, update_schedule_details, schedule_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.usage_api.UsageapiClient.update_schedule` and waits for the :py:class:`~oci.usage_api.models.Schedule` acted upon diff --git a/src/oci/version.py b/src/oci/version.py index 5ba5e279b..6e79e2985 100644 --- a/src/oci/version.py +++ b/src/oci/version.py @@ -2,4 +2,4 @@ # Copyright (c) 2016, 2024, 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. -__version__ = "2.125.2" +__version__ = "2.125.3"