From cc2051f631deb809124319635f9c1bf70a326d0a Mon Sep 17 00:00:00 2001 From: DEXREQ Automation Date: Fri, 24 May 2024 19:01:27 +0000 Subject: [PATCH] Merge pull request #2761 in SDK/oci-go-sdk from merge_to_github2024-05-24 to github Releasing Version 65.66.0 Squashed commit of the following: commit e0f76adcbd02f6a486a2f0231a5131360a3e552e Author: oci-dex-release-bot Date: Fri May 24 18:43:11 2024 +0000 Releasing version 65 66 0 --- CHANGELOG.md | 13 + Makefile | 2 +- .../capacitymanagement_client.go | 174 ++++++ .../create_occ_capacity_request_details.go | 75 +-- ...amespace_occ_overviews_request_response.go | 250 +++++++++ ...ist_occ_availabilities_request_response.go | 10 +- ...city_requests_internal_request_response.go | 6 + ..._occ_capacity_requests_request_response.go | 6 + .../list_occ_overviews_request_response.go | 247 +++++++++ capacitymanagement/metadata_details.go | 4 + .../occ_availability_catalog.go | 2 +- .../occ_availability_catalog_summary.go | 2 +- .../occ_availability_summary.go | 110 +--- capacitymanagement/occ_capacity_request.go | 113 ++-- .../occ_capacity_request_base_details.go | 145 +---- .../occ_capacity_request_compute_details.go | 100 ---- .../occ_capacity_request_summary.go | 6 + capacitymanagement/occ_overview_collection.go | 39 ++ capacitymanagement/occ_overview_summary.go | 72 +++ ...l_occ_capacity_request_request_response.go | 104 ++++ ...h_occ_capacity_request_request_response.go | 2 +- common/version.go | 4 +- ...abase_connection_credentials_by_details.go | 4 + .../database_ssl_connection_credentials.go | 4 + .../enable_database_management_details.go | 4 + ...e_pluggable_database_management_details.go | 4 + .../modify_database_management_details.go | 4 + ...y_pluggable_database_management_details.go | 4 + databasemanagement/data_points.go | 44 ++ ...abase_connection_credentials_by_details.go | 4 + .../database_password_credential_details.go | 4 + .../database_secret_credential_details.go | 4 + .../database_ssl_connection_credentials.go | 4 + databasemanagement/database_usage_metrics.go | 18 + .../databasemanagement_dbmanagement_client.go | 118 ++++ .../dataguard_performance_metrics.go | 41 ++ databasemanagement/db_role.go | 70 +++ ...rd_performance_metrics_request_response.go | 105 ++++ ..._peer_database_metrics_request_response.go | 157 ++++++ databasemanagement/peer_database_metrics.go | 41 ++ databasemanagement/performance_metrics.go | 50 ++ .../performance_metrics_data.go | 71 +++ databasemanagement/role.go | 4 + ...e_occ_demand_signal_compartment_details.go | 39 ++ ...and_signal_compartment_request_response.go | 103 ++++ .../create_occ_demand_signal_details.go | 58 ++ ...eate_occ_demand_signal_request_response.go | 106 ++++ ...lete_occ_demand_signal_request_response.go | 100 ++++ .../demandsignal_occdemandsignal_client.go | 504 ++++++++++++++++++ .../get_occ_demand_signal_request_response.go | 96 ++++ ...ist_occ_demand_signals_request_response.go | 217 ++++++++ demandsignal/occ_demand_signal.go | 144 +++++ demandsignal/occ_demand_signal_collection.go | 39 ++ demandsignal/occ_demand_signal_data.go | 45 ++ demandsignal/occ_demand_signal_summary.go | 80 +++ demandsignal/occ_demand_signal_value.go | 45 ++ demandsignal/patch_insert_instruction.go | 117 ++++ .../patch_insert_multiple_instruction.go | 117 ++++ demandsignal/patch_instruction.go | 179 +++++++ demandsignal/patch_merge_instruction.go | 70 +++ demandsignal/patch_move_instruction.go | 121 +++++ .../patch_occ_demand_signal_details.go | 66 +++ ...atch_occ_demand_signal_request_response.go | 108 ++++ demandsignal/patch_prohibit_instruction.go | 69 +++ demandsignal/patch_remove_instruction.go | 62 +++ demandsignal/patch_replace_instruction.go | 67 +++ demandsignal/patch_require_instruction.go | 68 +++ demandsignal/sort_order.go | 56 ++ .../update_occ_demand_signal_details.go | 52 ++ ...date_occ_demand_signal_request_response.go | 108 ++++ jmsjavadownloads/action_type.go | 2 +- jmsjavadownloads/aggregation_sort_by.go | 2 +- jmsjavadownloads/checksum_type.go | 2 +- .../create_java_download_report_details.go | 14 +- .../create_java_download_token_details.go | 2 +- ..._java_license_acceptance_record_details.go | 10 +- jmsjavadownloads/download_url.go | 2 +- jmsjavadownloads/download_url_type.go | 2 +- .../generate_artifact_download_url_details.go | 2 +- .../java_download_count_aggregation.go | 4 +- ...a_download_count_aggregation_collection.go | 2 +- .../java_download_count_aggregation_type.go | 2 +- jmsjavadownloads/java_download_record.go | 4 +- .../java_download_record_collection.go | 2 +- .../java_download_record_sort_by.go | 2 +- .../java_download_record_summary.go | 4 +- jmsjavadownloads/java_download_report.go | 22 +- .../java_download_report_collection.go | 2 +- .../java_download_report_format.go | 2 +- .../java_download_report_sort_by.go | 2 +- .../java_download_report_summary.go | 22 +- jmsjavadownloads/java_download_token.go | 10 +- .../java_download_token_collection.go | 2 +- .../java_download_token_summary.go | 10 +- jmsjavadownloads/java_license.go | 2 +- .../java_license_acceptance_record.go | 6 +- ...va_license_acceptance_record_collection.go | 2 +- .../java_license_acceptance_record_summary.go | 6 +- jmsjavadownloads/java_license_collection.go | 2 +- jmsjavadownloads/java_license_summary.go | 2 +- .../jmsjavadownloads_javadownload_client.go | 3 +- .../license_acceptance_sort_by.go | 2 +- jmsjavadownloads/license_acceptance_status.go | 2 +- jmsjavadownloads/license_sort_by.go | 2 +- jmsjavadownloads/license_type.go | 2 +- jmsjavadownloads/lifecycle_state.go | 2 +- jmsjavadownloads/operation_status.go | 2 +- jmsjavadownloads/operation_type.go | 2 +- jmsjavadownloads/principal.go | 2 +- ...summarized_java_download_counts_details.go | 4 +- jmsjavadownloads/sort_order.go | 2 +- jmsjavadownloads/token_lifecycle_details.go | 2 +- jmsjavadownloads/token_sort_by.go | 2 +- .../update_java_download_token_details.go | 2 +- ..._java_license_acceptance_record_details.go | 10 +- jmsjavadownloads/work_request.go | 2 +- jmsjavadownloads/work_request_error.go | 2 +- .../work_request_error_collection.go | 2 +- jmsjavadownloads/work_request_log_entry.go | 2 +- .../work_request_log_entry_collection.go | 2 +- jmsjavadownloads/work_request_resource.go | 2 +- jmsjavadownloads/work_request_summary.go | 2 +- .../work_request_summary_collection.go | 2 +- .../resourcescheduler_schedule_client.go | 26 +- 124 files changed, 4753 insertions(+), 561 deletions(-) create mode 100644 capacitymanagement/list_internal_namespace_occ_overviews_request_response.go create mode 100644 capacitymanagement/list_occ_overviews_request_response.go delete mode 100644 capacitymanagement/occ_capacity_request_compute_details.go create mode 100644 capacitymanagement/occ_overview_collection.go create mode 100644 capacitymanagement/occ_overview_summary.go create mode 100644 capacitymanagement/patch_internal_occ_capacity_request_request_response.go create mode 100644 databasemanagement/data_points.go create mode 100644 databasemanagement/dataguard_performance_metrics.go create mode 100644 databasemanagement/db_role.go create mode 100644 databasemanagement/get_dataguard_performance_metrics_request_response.go create mode 100644 databasemanagement/get_peer_database_metrics_request_response.go create mode 100644 databasemanagement/peer_database_metrics.go create mode 100644 databasemanagement/performance_metrics.go create mode 100644 databasemanagement/performance_metrics_data.go create mode 100644 demandsignal/change_occ_demand_signal_compartment_details.go create mode 100644 demandsignal/change_occ_demand_signal_compartment_request_response.go create mode 100644 demandsignal/create_occ_demand_signal_details.go create mode 100644 demandsignal/create_occ_demand_signal_request_response.go create mode 100644 demandsignal/delete_occ_demand_signal_request_response.go create mode 100644 demandsignal/demandsignal_occdemandsignal_client.go create mode 100644 demandsignal/get_occ_demand_signal_request_response.go create mode 100644 demandsignal/list_occ_demand_signals_request_response.go create mode 100644 demandsignal/occ_demand_signal.go create mode 100644 demandsignal/occ_demand_signal_collection.go create mode 100644 demandsignal/occ_demand_signal_data.go create mode 100644 demandsignal/occ_demand_signal_summary.go create mode 100644 demandsignal/occ_demand_signal_value.go create mode 100644 demandsignal/patch_insert_instruction.go create mode 100644 demandsignal/patch_insert_multiple_instruction.go create mode 100644 demandsignal/patch_instruction.go create mode 100644 demandsignal/patch_merge_instruction.go create mode 100644 demandsignal/patch_move_instruction.go create mode 100644 demandsignal/patch_occ_demand_signal_details.go create mode 100644 demandsignal/patch_occ_demand_signal_request_response.go create mode 100644 demandsignal/patch_prohibit_instruction.go create mode 100644 demandsignal/patch_remove_instruction.go create mode 100644 demandsignal/patch_replace_instruction.go create mode 100644 demandsignal/patch_require_instruction.go create mode 100644 demandsignal/sort_order.go create mode 100644 demandsignal/update_occ_demand_signal_details.go create mode 100644 demandsignal/update_occ_demand_signal_request_response.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6797bee22b..11ce3b3c71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.66.0 - 2024-05-28 +### Added +- Support for Demand Signal service +- Support for external database connectors in the Database service +- Support for monitoring standby databases in the Database Management service +- Support for resource overviews in the Capacity Management service +- Support for optional parameters in the download API in the Java Management Service Downloads service + +### Breaking Changes +- The return type of property `ResourceType` and `WorkloadType` was changed to `*string` in the models `OccAvailabilitySummary`, `ListOccAvailabilitiesRequest`, and `OccCapacityRequestBaseDetails` in the Capacity Management service +- The model `OccCapacityRequestComputeDetails` has been removed in the Capacity Management service + + ## 65.65.3 - 2024-05-21 ### Added - Support for the Resource Scheduler service diff --git a/Makefile b/Makefile index 72a3540da4..413577de62 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com -GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer marketplacepublisher redis jmsjavadownloads psql generativeai generativeaiinference capacitymanagement globallydistributeddatabase desktops emaildataplane clusterplacementgroups marketplaceprivateoffer resourcescheduler ##SPECNAME## +GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer marketplacepublisher redis jmsjavadownloads psql generativeai generativeaiinference capacitymanagement globallydistributeddatabase desktops emaildataplane clusterplacementgroups marketplaceprivateoffer resourcescheduler demandsignal ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/capacitymanagement/capacitymanagement_client.go b/capacitymanagement/capacitymanagement_client.go index 6fa4c364d9..cf7f83aa43 100644 --- a/capacitymanagement/capacitymanagement_client.go +++ b/capacitymanagement/capacitymanagement_client.go @@ -569,6 +569,64 @@ func (client CapacityManagementClient) getOccCustomerGroup(ctx context.Context, return response, err } +// ListInternalNamespaceOccOverviews Lists an overview of all resources in that namespace in a given time interval. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/ListInternalNamespaceOccOverviews.go.html to see an example of how to use ListInternalNamespaceOccOverviews API. +// A default retry strategy applies to this operation ListInternalNamespaceOccOverviews() +func (client CapacityManagementClient) ListInternalNamespaceOccOverviews(ctx context.Context, request ListInternalNamespaceOccOverviewsRequest) (response ListInternalNamespaceOccOverviewsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listInternalNamespaceOccOverviews, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListInternalNamespaceOccOverviewsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListInternalNamespaceOccOverviewsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListInternalNamespaceOccOverviewsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListInternalNamespaceOccOverviewsResponse") + } + return +} + +// listInternalNamespaceOccOverviews implements the OCIOperation interface (enables retrying operations) +func (client CapacityManagementClient) listInternalNamespaceOccOverviews(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/internal/namespace/{namespace}/occOverview", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListInternalNamespaceOccOverviewsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "CapacityManagement", "ListInternalNamespaceOccOverviews", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListOccAvailabilities Lists availabilities for a particular availability catalog. // // # See also @@ -917,6 +975,122 @@ func (client CapacityManagementClient) listOccCustomerGroups(ctx context.Context return response, err } +// ListOccOverviews Lists an overview of all resources in that namespace in a given time interval. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/ListOccOverviews.go.html to see an example of how to use ListOccOverviews API. +// A default retry strategy applies to this operation ListOccOverviews() +func (client CapacityManagementClient) ListOccOverviews(ctx context.Context, request ListOccOverviewsRequest) (response ListOccOverviewsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listOccOverviews, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListOccOverviewsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListOccOverviewsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListOccOverviewsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListOccOverviewsResponse") + } + return +} + +// listOccOverviews implements the OCIOperation interface (enables retrying operations) +func (client CapacityManagementClient) listOccOverviews(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/namespace/{namespace}/occOverview", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListOccOverviewsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "CapacityManagement", "ListOccOverviews", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PatchInternalOccCapacityRequest Updates the OccCapacityRequest by evaluating a sequence of instructions. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/PatchInternalOccCapacityRequest.go.html to see an example of how to use PatchInternalOccCapacityRequest API. +// A default retry strategy applies to this operation PatchInternalOccCapacityRequest() +func (client CapacityManagementClient) PatchInternalOccCapacityRequest(ctx context.Context, request PatchInternalOccCapacityRequestRequest) (response PatchInternalOccCapacityRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.patchInternalOccCapacityRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PatchInternalOccCapacityRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PatchInternalOccCapacityRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PatchInternalOccCapacityRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PatchInternalOccCapacityRequestResponse") + } + return +} + +// patchInternalOccCapacityRequest implements the OCIOperation interface (enables retrying operations) +func (client CapacityManagementClient) patchInternalOccCapacityRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPatch, "/internal/occCapacityRequests/{occCapacityRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PatchInternalOccCapacityRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "CapacityManagement", "PatchInternalOccCapacityRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // PatchOccCapacityRequest Updates the OccCapacityRequest by evaluating a sequence of instructions. // // # See also diff --git a/capacitymanagement/create_occ_capacity_request_details.go b/capacitymanagement/create_occ_capacity_request_details.go index 8256e4f827..3c146ce72c 100644 --- a/capacitymanagement/create_occ_capacity_request_details.go +++ b/capacitymanagement/create_occ_capacity_request_details.go @@ -10,7 +10,6 @@ package capacitymanagement import ( - "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -22,9 +21,6 @@ type CreateOccCapacityRequestDetails struct { // Since all resources are at tenancy level hence this will be the ocid of the tenancy where operation is to be performed. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // The OCID of the availability catalog against which capacity request is made. - OccAvailabilityCatalogId *string `mandatory:"true" json:"occAvailabilityCatalogId"` - // The name of the OCI service in consideration. For example, Compute, Exadata, and so on. Namespace NamespaceEnum `mandatory:"true" json:"namespace"` @@ -43,6 +39,12 @@ type CreateOccCapacityRequestDetails struct { // A list of different resources requested by the user. Details []OccCapacityRequestBaseDetails `mandatory:"true" json:"details"` + // The OCID of the availability catalog against which capacity request is made. + OccAvailabilityCatalogId *string `mandatory:"false" json:"occAvailabilityCatalogId"` + + // Type of Capacity Request(New or Transfer) + RequestType OccCapacityRequestRequestTypeEnum `mandatory:"false" json:"requestType,omitempty"` + // Meaningful text about the capacity request. Description *string `mandatory:"false" json:"description"` @@ -74,6 +76,9 @@ func (m CreateOccCapacityRequestDetails) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Namespace: %s. Supported values are: %s.", m.Namespace, strings.Join(GetNamespaceEnumStringValues(), ","))) } + if _, ok := GetMappingOccCapacityRequestRequestTypeEnum(string(m.RequestType)); !ok && m.RequestType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestType: %s. Supported values are: %s.", m.RequestType, strings.Join(GetOccCapacityRequestRequestTypeEnumStringValues(), ","))) + } if _, ok := GetMappingCreateOccCapacityRequestDetailsRequestStateEnum(string(m.RequestState)); !ok && m.RequestState != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestState: %s. Supported values are: %s.", m.RequestState, strings.Join(GetCreateOccCapacityRequestDetailsRequestStateEnumStringValues(), ","))) } @@ -83,68 +88,6 @@ func (m CreateOccCapacityRequestDetails) ValidateEnumValue() (bool, error) { return false, nil } -// UnmarshalJSON unmarshals from json -func (m *CreateOccCapacityRequestDetails) UnmarshalJSON(data []byte) (e error) { - model := struct { - Description *string `json:"description"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - LifecycleDetails *string `json:"lifecycleDetails"` - RequestState CreateOccCapacityRequestDetailsRequestStateEnum `json:"requestState"` - CompartmentId *string `json:"compartmentId"` - OccAvailabilityCatalogId *string `json:"occAvailabilityCatalogId"` - Namespace NamespaceEnum `json:"namespace"` - Region *string `json:"region"` - DisplayName *string `json:"displayName"` - AvailabilityDomain *string `json:"availabilityDomain"` - DateExpectedCapacityHandover *common.SDKTime `json:"dateExpectedCapacityHandover"` - Details []occcapacityrequestbasedetails `json:"details"` - }{} - - e = json.Unmarshal(data, &model) - if e != nil { - return - } - var nn interface{} - m.Description = model.Description - - m.FreeformTags = model.FreeformTags - - m.DefinedTags = model.DefinedTags - - m.LifecycleDetails = model.LifecycleDetails - - m.RequestState = model.RequestState - - m.CompartmentId = model.CompartmentId - - m.OccAvailabilityCatalogId = model.OccAvailabilityCatalogId - - m.Namespace = model.Namespace - - m.Region = model.Region - - m.DisplayName = model.DisplayName - - m.AvailabilityDomain = model.AvailabilityDomain - - m.DateExpectedCapacityHandover = model.DateExpectedCapacityHandover - - m.Details = make([]OccCapacityRequestBaseDetails, len(model.Details)) - for i, n := range model.Details { - nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) - if e != nil { - return e - } - if nn != nil { - m.Details[i] = nn.(OccCapacityRequestBaseDetails) - } else { - m.Details[i] = nil - } - } - return -} - // CreateOccCapacityRequestDetailsRequestStateEnum Enum with underlying type: string type CreateOccCapacityRequestDetailsRequestStateEnum string diff --git a/capacitymanagement/list_internal_namespace_occ_overviews_request_response.go b/capacitymanagement/list_internal_namespace_occ_overviews_request_response.go new file mode 100644 index 0000000000..fff560d88e --- /dev/null +++ b/capacitymanagement/list_internal_namespace_occ_overviews_request_response.go @@ -0,0 +1,250 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package capacitymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListInternalNamespaceOccOverviewsRequest wrapper for the ListInternalNamespaceOccOverviews operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/ListInternalNamespaceOccOverviews.go.html to see an example of how to use ListInternalNamespaceOccOverviewsRequest. +type ListInternalNamespaceOccOverviewsRequest struct { + + // The namespace by which we would filter the list. + Namespace ListInternalNamespaceOccOverviewsNamespaceEnum `mandatory:"true" contributesTo:"path" name:"namespace"` + + // The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The customer group ocid by which we would filter the list. + OccCustomerGroupId *string `mandatory:"false" contributesTo:"query" name:"occCustomerGroupId"` + + // Workload type using the resources in an availability catalog can be filtered. + WorkloadType *string `mandatory:"false" contributesTo:"query" name:"workloadType"` + + // The month corresponding to this date would be considered as the starting point of the time period against which we would like to perform an aggregation. + From *common.SDKTime `mandatory:"false" contributesTo:"query" name:"from"` + + // The month corresponding to this date would be considered as the ending point of the time period against which we would like to perform an aggregation. + To *common.SDKTime `mandatory:"false" contributesTo:"query" name:"to"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListInternalNamespaceOccOverviewsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. The default order for periodValue is chronological order(latest month item at the end). + SortBy ListInternalNamespaceOccOverviewsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListInternalNamespaceOccOverviewsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListInternalNamespaceOccOverviewsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListInternalNamespaceOccOverviewsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListInternalNamespaceOccOverviewsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListInternalNamespaceOccOverviewsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListInternalNamespaceOccOverviewsNamespaceEnum(string(request.Namespace)); !ok && request.Namespace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Namespace: %s. Supported values are: %s.", request.Namespace, strings.Join(GetListInternalNamespaceOccOverviewsNamespaceEnumStringValues(), ","))) + } + if _, ok := GetMappingListInternalNamespaceOccOverviewsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListInternalNamespaceOccOverviewsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListInternalNamespaceOccOverviewsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListInternalNamespaceOccOverviewsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListInternalNamespaceOccOverviewsResponse wrapper for the ListInternalNamespaceOccOverviews operation +type ListInternalNamespaceOccOverviewsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of OccOverviewCollection instances + OccOverviewCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListInternalNamespaceOccOverviewsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListInternalNamespaceOccOverviewsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListInternalNamespaceOccOverviewsNamespaceEnum Enum with underlying type: string +type ListInternalNamespaceOccOverviewsNamespaceEnum string + +// Set of constants representing the allowable values for ListInternalNamespaceOccOverviewsNamespaceEnum +const ( + ListInternalNamespaceOccOverviewsNamespaceCompute ListInternalNamespaceOccOverviewsNamespaceEnum = "COMPUTE" +) + +var mappingListInternalNamespaceOccOverviewsNamespaceEnum = map[string]ListInternalNamespaceOccOverviewsNamespaceEnum{ + "COMPUTE": ListInternalNamespaceOccOverviewsNamespaceCompute, +} + +var mappingListInternalNamespaceOccOverviewsNamespaceEnumLowerCase = map[string]ListInternalNamespaceOccOverviewsNamespaceEnum{ + "compute": ListInternalNamespaceOccOverviewsNamespaceCompute, +} + +// GetListInternalNamespaceOccOverviewsNamespaceEnumValues Enumerates the set of values for ListInternalNamespaceOccOverviewsNamespaceEnum +func GetListInternalNamespaceOccOverviewsNamespaceEnumValues() []ListInternalNamespaceOccOverviewsNamespaceEnum { + values := make([]ListInternalNamespaceOccOverviewsNamespaceEnum, 0) + for _, v := range mappingListInternalNamespaceOccOverviewsNamespaceEnum { + values = append(values, v) + } + return values +} + +// GetListInternalNamespaceOccOverviewsNamespaceEnumStringValues Enumerates the set of values in String for ListInternalNamespaceOccOverviewsNamespaceEnum +func GetListInternalNamespaceOccOverviewsNamespaceEnumStringValues() []string { + return []string{ + "COMPUTE", + } +} + +// GetMappingListInternalNamespaceOccOverviewsNamespaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListInternalNamespaceOccOverviewsNamespaceEnum(val string) (ListInternalNamespaceOccOverviewsNamespaceEnum, bool) { + enum, ok := mappingListInternalNamespaceOccOverviewsNamespaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListInternalNamespaceOccOverviewsSortOrderEnum Enum with underlying type: string +type ListInternalNamespaceOccOverviewsSortOrderEnum string + +// Set of constants representing the allowable values for ListInternalNamespaceOccOverviewsSortOrderEnum +const ( + ListInternalNamespaceOccOverviewsSortOrderAsc ListInternalNamespaceOccOverviewsSortOrderEnum = "ASC" + ListInternalNamespaceOccOverviewsSortOrderDesc ListInternalNamespaceOccOverviewsSortOrderEnum = "DESC" +) + +var mappingListInternalNamespaceOccOverviewsSortOrderEnum = map[string]ListInternalNamespaceOccOverviewsSortOrderEnum{ + "ASC": ListInternalNamespaceOccOverviewsSortOrderAsc, + "DESC": ListInternalNamespaceOccOverviewsSortOrderDesc, +} + +var mappingListInternalNamespaceOccOverviewsSortOrderEnumLowerCase = map[string]ListInternalNamespaceOccOverviewsSortOrderEnum{ + "asc": ListInternalNamespaceOccOverviewsSortOrderAsc, + "desc": ListInternalNamespaceOccOverviewsSortOrderDesc, +} + +// GetListInternalNamespaceOccOverviewsSortOrderEnumValues Enumerates the set of values for ListInternalNamespaceOccOverviewsSortOrderEnum +func GetListInternalNamespaceOccOverviewsSortOrderEnumValues() []ListInternalNamespaceOccOverviewsSortOrderEnum { + values := make([]ListInternalNamespaceOccOverviewsSortOrderEnum, 0) + for _, v := range mappingListInternalNamespaceOccOverviewsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListInternalNamespaceOccOverviewsSortOrderEnumStringValues Enumerates the set of values in String for ListInternalNamespaceOccOverviewsSortOrderEnum +func GetListInternalNamespaceOccOverviewsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListInternalNamespaceOccOverviewsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListInternalNamespaceOccOverviewsSortOrderEnum(val string) (ListInternalNamespaceOccOverviewsSortOrderEnum, bool) { + enum, ok := mappingListInternalNamespaceOccOverviewsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListInternalNamespaceOccOverviewsSortByEnum Enum with underlying type: string +type ListInternalNamespaceOccOverviewsSortByEnum string + +// Set of constants representing the allowable values for ListInternalNamespaceOccOverviewsSortByEnum +const ( + ListInternalNamespaceOccOverviewsSortByPeriodvalue ListInternalNamespaceOccOverviewsSortByEnum = "periodValue" +) + +var mappingListInternalNamespaceOccOverviewsSortByEnum = map[string]ListInternalNamespaceOccOverviewsSortByEnum{ + "periodValue": ListInternalNamespaceOccOverviewsSortByPeriodvalue, +} + +var mappingListInternalNamespaceOccOverviewsSortByEnumLowerCase = map[string]ListInternalNamespaceOccOverviewsSortByEnum{ + "periodvalue": ListInternalNamespaceOccOverviewsSortByPeriodvalue, +} + +// GetListInternalNamespaceOccOverviewsSortByEnumValues Enumerates the set of values for ListInternalNamespaceOccOverviewsSortByEnum +func GetListInternalNamespaceOccOverviewsSortByEnumValues() []ListInternalNamespaceOccOverviewsSortByEnum { + values := make([]ListInternalNamespaceOccOverviewsSortByEnum, 0) + for _, v := range mappingListInternalNamespaceOccOverviewsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListInternalNamespaceOccOverviewsSortByEnumStringValues Enumerates the set of values in String for ListInternalNamespaceOccOverviewsSortByEnum +func GetListInternalNamespaceOccOverviewsSortByEnumStringValues() []string { + return []string{ + "periodValue", + } +} + +// GetMappingListInternalNamespaceOccOverviewsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListInternalNamespaceOccOverviewsSortByEnum(val string) (ListInternalNamespaceOccOverviewsSortByEnum, bool) { + enum, ok := mappingListInternalNamespaceOccOverviewsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/capacitymanagement/list_occ_availabilities_request_response.go b/capacitymanagement/list_occ_availabilities_request_response.go index b3b8abcf72..111438ffc8 100644 --- a/capacitymanagement/list_occ_availabilities_request_response.go +++ b/capacitymanagement/list_occ_availabilities_request_response.go @@ -28,10 +28,10 @@ type ListOccAvailabilitiesRequest struct { ResourceName *string `mandatory:"false" contributesTo:"query" name:"resourceName"` // Resource type using which the capacity constraints of an availability catalog can be filtered. - ResourceType OccAvailabilitySummaryResourceTypeEnum `mandatory:"false" contributesTo:"query" name:"resourceType" omitEmpty:"true"` + ResourceType *string `mandatory:"false" contributesTo:"query" name:"resourceType"` // Workload type using the resources in an availability catalog can be filtered. - WorkloadType OccAvailabilitySummaryWorkloadTypeEnum `mandatory:"false" contributesTo:"query" name:"workloadType" omitEmpty:"true"` + WorkloadType *string `mandatory:"false" contributesTo:"query" name:"workloadType"` // The maximum number of items to return. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` @@ -85,12 +85,6 @@ func (request ListOccAvailabilitiesRequest) RetryPolicy() *common.RetryPolicy { // Not recommended for calling this function directly func (request ListOccAvailabilitiesRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingOccAvailabilitySummaryResourceTypeEnum(string(request.ResourceType)); !ok && request.ResourceType != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceType: %s. Supported values are: %s.", request.ResourceType, strings.Join(GetOccAvailabilitySummaryResourceTypeEnumStringValues(), ","))) - } - if _, ok := GetMappingOccAvailabilitySummaryWorkloadTypeEnum(string(request.WorkloadType)); !ok && request.WorkloadType != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WorkloadType: %s. Supported values are: %s.", request.WorkloadType, strings.Join(GetOccAvailabilitySummaryWorkloadTypeEnumStringValues(), ","))) - } if _, ok := GetMappingListOccAvailabilitiesSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListOccAvailabilitiesSortOrderEnumStringValues(), ","))) } diff --git a/capacitymanagement/list_occ_capacity_requests_internal_request_response.go b/capacitymanagement/list_occ_capacity_requests_internal_request_response.go index 69db40d40f..ab70ce7a21 100644 --- a/capacitymanagement/list_occ_capacity_requests_internal_request_response.go +++ b/capacitymanagement/list_occ_capacity_requests_internal_request_response.go @@ -33,6 +33,9 @@ type ListOccCapacityRequestsInternalRequest struct { // A filter to return only the resources that match the entire display name. The match is not case sensitive. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + // A filter to return only the resources that match the request type. The match is not case sensitive. + RequestType OccCapacityRequestRequestTypeEnum `mandatory:"false" contributesTo:"query" name:"requestType" omitEmpty:"true"` + // A filter to return the list of capacity requests based on the OCID of the capacity request. This is done for the users who have INSPECT permission on the resource but do not have READ permission. Id *string `mandatory:"false" contributesTo:"query" name:"id"` @@ -91,6 +94,9 @@ func (request ListOccCapacityRequestsInternalRequest) ValidateEnumValue() (bool, if _, ok := GetMappingListOccCapacityRequestsInternalNamespaceEnum(string(request.Namespace)); !ok && request.Namespace != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Namespace: %s. Supported values are: %s.", request.Namespace, strings.Join(GetListOccCapacityRequestsInternalNamespaceEnumStringValues(), ","))) } + if _, ok := GetMappingOccCapacityRequestRequestTypeEnum(string(request.RequestType)); !ok && request.RequestType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestType: %s. Supported values are: %s.", request.RequestType, strings.Join(GetOccCapacityRequestRequestTypeEnumStringValues(), ","))) + } if _, ok := GetMappingListOccCapacityRequestsInternalSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListOccCapacityRequestsInternalSortOrderEnumStringValues(), ","))) } diff --git a/capacitymanagement/list_occ_capacity_requests_request_response.go b/capacitymanagement/list_occ_capacity_requests_request_response.go index 02e4dd8c8d..51d13b5a8b 100644 --- a/capacitymanagement/list_occ_capacity_requests_request_response.go +++ b/capacitymanagement/list_occ_capacity_requests_request_response.go @@ -27,6 +27,9 @@ type ListOccCapacityRequestsRequest struct { // The namespace by which we would filter the list. Namespace ListOccCapacityRequestsNamespaceEnum `mandatory:"false" contributesTo:"query" name:"namespace" omitEmpty:"true"` + // A filter to return only the resources that match the request type. The match is not case sensitive. + RequestType OccCapacityRequestRequestTypeEnum `mandatory:"false" contributesTo:"query" name:"requestType" omitEmpty:"true"` + // A filter to return only the resources that match the entire display name. The match is not case sensitive. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` @@ -88,6 +91,9 @@ func (request ListOccCapacityRequestsRequest) ValidateEnumValue() (bool, error) if _, ok := GetMappingListOccCapacityRequestsNamespaceEnum(string(request.Namespace)); !ok && request.Namespace != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Namespace: %s. Supported values are: %s.", request.Namespace, strings.Join(GetListOccCapacityRequestsNamespaceEnumStringValues(), ","))) } + if _, ok := GetMappingOccCapacityRequestRequestTypeEnum(string(request.RequestType)); !ok && request.RequestType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestType: %s. Supported values are: %s.", request.RequestType, strings.Join(GetOccCapacityRequestRequestTypeEnumStringValues(), ","))) + } if _, ok := GetMappingListOccCapacityRequestsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListOccCapacityRequestsSortOrderEnumStringValues(), ","))) } diff --git a/capacitymanagement/list_occ_overviews_request_response.go b/capacitymanagement/list_occ_overviews_request_response.go new file mode 100644 index 0000000000..1d06b4976e --- /dev/null +++ b/capacitymanagement/list_occ_overviews_request_response.go @@ -0,0 +1,247 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package capacitymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListOccOverviewsRequest wrapper for the ListOccOverviews operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/ListOccOverviews.go.html to see an example of how to use ListOccOverviewsRequest. +type ListOccOverviewsRequest struct { + + // The namespace by which we would filter the list. + Namespace ListOccOverviewsNamespaceEnum `mandatory:"true" contributesTo:"path" name:"namespace"` + + // The ocid of the compartment or tenancy in which resources are to be listed. This will also be used for authorization purposes. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The month corresponding to this date would be considered as the starting point of the time period against which we would like to perform an aggregation. + From *common.SDKTime `mandatory:"false" contributesTo:"query" name:"from"` + + // The month corresponding to this date would be considered as the ending point of the time period against which we would like to perform an aggregation. + To *common.SDKTime `mandatory:"false" contributesTo:"query" name:"to"` + + // Workload type using the resources in an availability catalog can be filtered. + WorkloadType *string `mandatory:"false" contributesTo:"query" name:"workloadType"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListOccOverviewsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. The default order for periodValue is chronological order(latest month item at the end). + SortBy ListOccOverviewsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListOccOverviewsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListOccOverviewsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListOccOverviewsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListOccOverviewsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListOccOverviewsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListOccOverviewsNamespaceEnum(string(request.Namespace)); !ok && request.Namespace != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Namespace: %s. Supported values are: %s.", request.Namespace, strings.Join(GetListOccOverviewsNamespaceEnumStringValues(), ","))) + } + if _, ok := GetMappingListOccOverviewsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListOccOverviewsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListOccOverviewsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListOccOverviewsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListOccOverviewsResponse wrapper for the ListOccOverviews operation +type ListOccOverviewsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of OccOverviewCollection instances + OccOverviewCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListOccOverviewsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListOccOverviewsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListOccOverviewsNamespaceEnum Enum with underlying type: string +type ListOccOverviewsNamespaceEnum string + +// Set of constants representing the allowable values for ListOccOverviewsNamespaceEnum +const ( + ListOccOverviewsNamespaceCompute ListOccOverviewsNamespaceEnum = "COMPUTE" +) + +var mappingListOccOverviewsNamespaceEnum = map[string]ListOccOverviewsNamespaceEnum{ + "COMPUTE": ListOccOverviewsNamespaceCompute, +} + +var mappingListOccOverviewsNamespaceEnumLowerCase = map[string]ListOccOverviewsNamespaceEnum{ + "compute": ListOccOverviewsNamespaceCompute, +} + +// GetListOccOverviewsNamespaceEnumValues Enumerates the set of values for ListOccOverviewsNamespaceEnum +func GetListOccOverviewsNamespaceEnumValues() []ListOccOverviewsNamespaceEnum { + values := make([]ListOccOverviewsNamespaceEnum, 0) + for _, v := range mappingListOccOverviewsNamespaceEnum { + values = append(values, v) + } + return values +} + +// GetListOccOverviewsNamespaceEnumStringValues Enumerates the set of values in String for ListOccOverviewsNamespaceEnum +func GetListOccOverviewsNamespaceEnumStringValues() []string { + return []string{ + "COMPUTE", + } +} + +// GetMappingListOccOverviewsNamespaceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOccOverviewsNamespaceEnum(val string) (ListOccOverviewsNamespaceEnum, bool) { + enum, ok := mappingListOccOverviewsNamespaceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListOccOverviewsSortOrderEnum Enum with underlying type: string +type ListOccOverviewsSortOrderEnum string + +// Set of constants representing the allowable values for ListOccOverviewsSortOrderEnum +const ( + ListOccOverviewsSortOrderAsc ListOccOverviewsSortOrderEnum = "ASC" + ListOccOverviewsSortOrderDesc ListOccOverviewsSortOrderEnum = "DESC" +) + +var mappingListOccOverviewsSortOrderEnum = map[string]ListOccOverviewsSortOrderEnum{ + "ASC": ListOccOverviewsSortOrderAsc, + "DESC": ListOccOverviewsSortOrderDesc, +} + +var mappingListOccOverviewsSortOrderEnumLowerCase = map[string]ListOccOverviewsSortOrderEnum{ + "asc": ListOccOverviewsSortOrderAsc, + "desc": ListOccOverviewsSortOrderDesc, +} + +// GetListOccOverviewsSortOrderEnumValues Enumerates the set of values for ListOccOverviewsSortOrderEnum +func GetListOccOverviewsSortOrderEnumValues() []ListOccOverviewsSortOrderEnum { + values := make([]ListOccOverviewsSortOrderEnum, 0) + for _, v := range mappingListOccOverviewsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListOccOverviewsSortOrderEnumStringValues Enumerates the set of values in String for ListOccOverviewsSortOrderEnum +func GetListOccOverviewsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListOccOverviewsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOccOverviewsSortOrderEnum(val string) (ListOccOverviewsSortOrderEnum, bool) { + enum, ok := mappingListOccOverviewsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListOccOverviewsSortByEnum Enum with underlying type: string +type ListOccOverviewsSortByEnum string + +// Set of constants representing the allowable values for ListOccOverviewsSortByEnum +const ( + ListOccOverviewsSortByPeriodvalue ListOccOverviewsSortByEnum = "periodValue" +) + +var mappingListOccOverviewsSortByEnum = map[string]ListOccOverviewsSortByEnum{ + "periodValue": ListOccOverviewsSortByPeriodvalue, +} + +var mappingListOccOverviewsSortByEnumLowerCase = map[string]ListOccOverviewsSortByEnum{ + "periodvalue": ListOccOverviewsSortByPeriodvalue, +} + +// GetListOccOverviewsSortByEnumValues Enumerates the set of values for ListOccOverviewsSortByEnum +func GetListOccOverviewsSortByEnumValues() []ListOccOverviewsSortByEnum { + values := make([]ListOccOverviewsSortByEnum, 0) + for _, v := range mappingListOccOverviewsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListOccOverviewsSortByEnumStringValues Enumerates the set of values in String for ListOccOverviewsSortByEnum +func GetListOccOverviewsSortByEnumStringValues() []string { + return []string{ + "periodValue", + } +} + +// GetMappingListOccOverviewsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOccOverviewsSortByEnum(val string) (ListOccOverviewsSortByEnum, bool) { + enum, ok := mappingListOccOverviewsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/capacitymanagement/metadata_details.go b/capacitymanagement/metadata_details.go index cfe4423ede..4c2f5a300c 100644 --- a/capacitymanagement/metadata_details.go +++ b/capacitymanagement/metadata_details.go @@ -47,14 +47,17 @@ type MetadataDetailsFormatVersionEnum string // Set of constants representing the allowable values for MetadataDetailsFormatVersionEnum const ( MetadataDetailsFormatVersionV1 MetadataDetailsFormatVersionEnum = "V1" + MetadataDetailsFormatVersionV2 MetadataDetailsFormatVersionEnum = "V2" ) var mappingMetadataDetailsFormatVersionEnum = map[string]MetadataDetailsFormatVersionEnum{ "V1": MetadataDetailsFormatVersionV1, + "V2": MetadataDetailsFormatVersionV2, } var mappingMetadataDetailsFormatVersionEnumLowerCase = map[string]MetadataDetailsFormatVersionEnum{ "v1": MetadataDetailsFormatVersionV1, + "v2": MetadataDetailsFormatVersionV2, } // GetMetadataDetailsFormatVersionEnumValues Enumerates the set of values for MetadataDetailsFormatVersionEnum @@ -70,6 +73,7 @@ func GetMetadataDetailsFormatVersionEnumValues() []MetadataDetailsFormatVersionE func GetMetadataDetailsFormatVersionEnumStringValues() []string { return []string{ "V1", + "V2", } } diff --git a/capacitymanagement/occ_availability_catalog.go b/capacitymanagement/occ_availability_catalog.go index eb4329296f..95a5673f0b 100644 --- a/capacitymanagement/occ_availability_catalog.go +++ b/capacitymanagement/occ_availability_catalog.go @@ -65,7 +65,7 @@ type OccAvailabilityCatalog struct { // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` - // Details about capacity available for different resources in catalog. + // Details about capacity available for different resources in catalog. Details []OccAvailabilitySummary `mandatory:"false" json:"details"` } diff --git a/capacitymanagement/occ_availability_catalog_summary.go b/capacitymanagement/occ_availability_catalog_summary.go index 2c2bae271e..86a84e248b 100644 --- a/capacitymanagement/occ_availability_catalog_summary.go +++ b/capacitymanagement/occ_availability_catalog_summary.go @@ -27,7 +27,7 @@ type OccAvailabilityCatalogSummary struct { // The OCID of the tenancy where the availability catalog resides. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // An user-friendly name for the availability catalog. Does not have to be unique, and it's changeable. Avoid entering confidential information. + // An user-friendly name for the availability catalog. Does not have to be unique, and is changeable. Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The Customer Group OCID to which the availability catalog belongs. diff --git a/capacitymanagement/occ_availability_summary.go b/capacitymanagement/occ_availability_summary.go index cfb15a666e..a683c687ed 100644 --- a/capacitymanagement/occ_availability_summary.go +++ b/capacitymanagement/occ_availability_summary.go @@ -31,19 +31,29 @@ type OccAvailabilitySummary struct { DateExpectedCapacityHandover *common.SDKTime `mandatory:"true" json:"dateExpectedCapacityHandover"` // The different types of resources against which customers can place capacity requests. - ResourceType OccAvailabilitySummaryResourceTypeEnum `mandatory:"true" json:"resourceType"` + ResourceType *string `mandatory:"true" json:"resourceType"` // The type of workload (Generic/ROW). - WorkloadType OccAvailabilitySummaryWorkloadTypeEnum `mandatory:"true" json:"workloadType"` + WorkloadType *string `mandatory:"true" json:"workloadType"` // The name of the resource that the customer can request. ResourceName *string `mandatory:"true" json:"resourceName"` - // The quantity of available resource that the customer can request. + // The quantity of resource currently available that the customer can request. AvailableQuantity *int64 `mandatory:"true" json:"availableQuantity"` + // The total quantity of resource that the customer can request. + TotalAvailableQuantity *int64 `mandatory:"true" json:"totalAvailableQuantity"` + + // The quantity of resource currently demanded by the customer. + DemandedQuantity *int64 `mandatory:"true" json:"demandedQuantity"` + // The unit in which the resource available is measured. Unit *string `mandatory:"true" json:"unit"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m OccAvailabilitySummary) String() string { @@ -58,103 +68,9 @@ func (m OccAvailabilitySummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingNamespaceEnum(string(m.Namespace)); !ok && m.Namespace != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Namespace: %s. Supported values are: %s.", m.Namespace, strings.Join(GetNamespaceEnumStringValues(), ","))) } - if _, ok := GetMappingOccAvailabilitySummaryResourceTypeEnum(string(m.ResourceType)); !ok && m.ResourceType != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceType: %s. Supported values are: %s.", m.ResourceType, strings.Join(GetOccAvailabilitySummaryResourceTypeEnumStringValues(), ","))) - } - if _, ok := GetMappingOccAvailabilitySummaryWorkloadTypeEnum(string(m.WorkloadType)); !ok && m.WorkloadType != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WorkloadType: %s. Supported values are: %s.", m.WorkloadType, strings.Join(GetOccAvailabilitySummaryWorkloadTypeEnumStringValues(), ","))) - } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } - -// OccAvailabilitySummaryResourceTypeEnum Enum with underlying type: string -type OccAvailabilitySummaryResourceTypeEnum string - -// Set of constants representing the allowable values for OccAvailabilitySummaryResourceTypeEnum -const ( - OccAvailabilitySummaryResourceTypeServerHw OccAvailabilitySummaryResourceTypeEnum = "SERVER_HW" - OccAvailabilitySummaryResourceTypeCapacityConstraint OccAvailabilitySummaryResourceTypeEnum = "CAPACITY_CONSTRAINT" -) - -var mappingOccAvailabilitySummaryResourceTypeEnum = map[string]OccAvailabilitySummaryResourceTypeEnum{ - "SERVER_HW": OccAvailabilitySummaryResourceTypeServerHw, - "CAPACITY_CONSTRAINT": OccAvailabilitySummaryResourceTypeCapacityConstraint, -} - -var mappingOccAvailabilitySummaryResourceTypeEnumLowerCase = map[string]OccAvailabilitySummaryResourceTypeEnum{ - "server_hw": OccAvailabilitySummaryResourceTypeServerHw, - "capacity_constraint": OccAvailabilitySummaryResourceTypeCapacityConstraint, -} - -// GetOccAvailabilitySummaryResourceTypeEnumValues Enumerates the set of values for OccAvailabilitySummaryResourceTypeEnum -func GetOccAvailabilitySummaryResourceTypeEnumValues() []OccAvailabilitySummaryResourceTypeEnum { - values := make([]OccAvailabilitySummaryResourceTypeEnum, 0) - for _, v := range mappingOccAvailabilitySummaryResourceTypeEnum { - values = append(values, v) - } - return values -} - -// GetOccAvailabilitySummaryResourceTypeEnumStringValues Enumerates the set of values in String for OccAvailabilitySummaryResourceTypeEnum -func GetOccAvailabilitySummaryResourceTypeEnumStringValues() []string { - return []string{ - "SERVER_HW", - "CAPACITY_CONSTRAINT", - } -} - -// GetMappingOccAvailabilitySummaryResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingOccAvailabilitySummaryResourceTypeEnum(val string) (OccAvailabilitySummaryResourceTypeEnum, bool) { - enum, ok := mappingOccAvailabilitySummaryResourceTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} - -// OccAvailabilitySummaryWorkloadTypeEnum Enum with underlying type: string -type OccAvailabilitySummaryWorkloadTypeEnum string - -// Set of constants representing the allowable values for OccAvailabilitySummaryWorkloadTypeEnum -const ( - OccAvailabilitySummaryWorkloadTypeGeneric OccAvailabilitySummaryWorkloadTypeEnum = "GENERIC" - OccAvailabilitySummaryWorkloadTypeRow OccAvailabilitySummaryWorkloadTypeEnum = "ROW" - OccAvailabilitySummaryWorkloadTypeUsProd OccAvailabilitySummaryWorkloadTypeEnum = "US_PROD" -) - -var mappingOccAvailabilitySummaryWorkloadTypeEnum = map[string]OccAvailabilitySummaryWorkloadTypeEnum{ - "GENERIC": OccAvailabilitySummaryWorkloadTypeGeneric, - "ROW": OccAvailabilitySummaryWorkloadTypeRow, - "US_PROD": OccAvailabilitySummaryWorkloadTypeUsProd, -} - -var mappingOccAvailabilitySummaryWorkloadTypeEnumLowerCase = map[string]OccAvailabilitySummaryWorkloadTypeEnum{ - "generic": OccAvailabilitySummaryWorkloadTypeGeneric, - "row": OccAvailabilitySummaryWorkloadTypeRow, - "us_prod": OccAvailabilitySummaryWorkloadTypeUsProd, -} - -// GetOccAvailabilitySummaryWorkloadTypeEnumValues Enumerates the set of values for OccAvailabilitySummaryWorkloadTypeEnum -func GetOccAvailabilitySummaryWorkloadTypeEnumValues() []OccAvailabilitySummaryWorkloadTypeEnum { - values := make([]OccAvailabilitySummaryWorkloadTypeEnum, 0) - for _, v := range mappingOccAvailabilitySummaryWorkloadTypeEnum { - values = append(values, v) - } - return values -} - -// GetOccAvailabilitySummaryWorkloadTypeEnumStringValues Enumerates the set of values in String for OccAvailabilitySummaryWorkloadTypeEnum -func GetOccAvailabilitySummaryWorkloadTypeEnumStringValues() []string { - return []string{ - "GENERIC", - "ROW", - "US_PROD", - } -} - -// GetMappingOccAvailabilitySummaryWorkloadTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingOccAvailabilitySummaryWorkloadTypeEnum(val string) (OccAvailabilitySummaryWorkloadTypeEnum, bool) { - enum, ok := mappingOccAvailabilitySummaryWorkloadTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/capacitymanagement/occ_capacity_request.go b/capacitymanagement/occ_capacity_request.go index 7e9dd469a6..8132c59463 100644 --- a/capacitymanagement/occ_capacity_request.go +++ b/capacitymanagement/occ_capacity_request.go @@ -10,7 +10,6 @@ package capacitymanagement import ( - "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -64,6 +63,9 @@ type OccCapacityRequest struct { // Meaningful text about the capacity request. Description *string `mandatory:"false" json:"description"` + // Type of Capacity Request(New or Transfer) + RequestType OccCapacityRequestRequestTypeEnum `mandatory:"false" json:"requestType,omitempty"` + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed State. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` @@ -99,90 +101,55 @@ func (m OccCapacityRequest) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetOccCapacityRequestLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingOccCapacityRequestRequestTypeEnum(string(m.RequestType)); !ok && m.RequestType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestType: %s. Supported values are: %s.", m.RequestType, strings.Join(GetOccCapacityRequestRequestTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } -// UnmarshalJSON unmarshals from json -func (m *OccCapacityRequest) UnmarshalJSON(data []byte) (e error) { - model := struct { - Description *string `json:"description"` - LifecycleDetails *string `json:"lifecycleDetails"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - SystemTags map[string]map[string]interface{} `json:"systemTags"` - Id *string `json:"id"` - CompartmentId *string `json:"compartmentId"` - OccAvailabilityCatalogId *string `json:"occAvailabilityCatalogId"` - DisplayName *string `json:"displayName"` - Namespace NamespaceEnum `json:"namespace"` - OccCustomerGroupId *string `json:"occCustomerGroupId"` - Region *string `json:"region"` - AvailabilityDomain *string `json:"availabilityDomain"` - DateExpectedCapacityHandover *common.SDKTime `json:"dateExpectedCapacityHandover"` - RequestState OccCapacityRequestRequestStateEnum `json:"requestState"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - LifecycleState OccCapacityRequestLifecycleStateEnum `json:"lifecycleState"` - Details []occcapacityrequestbasedetails `json:"details"` - }{} - - e = json.Unmarshal(data, &model) - if e != nil { - return - } - var nn interface{} - m.Description = model.Description - - m.LifecycleDetails = model.LifecycleDetails - - m.FreeformTags = model.FreeformTags - - m.DefinedTags = model.DefinedTags - - m.SystemTags = model.SystemTags - - m.Id = model.Id - - m.CompartmentId = model.CompartmentId - - m.OccAvailabilityCatalogId = model.OccAvailabilityCatalogId - - m.DisplayName = model.DisplayName - - m.Namespace = model.Namespace - - m.OccCustomerGroupId = model.OccCustomerGroupId - - m.Region = model.Region +// OccCapacityRequestRequestTypeEnum Enum with underlying type: string +type OccCapacityRequestRequestTypeEnum string - m.AvailabilityDomain = model.AvailabilityDomain - - m.DateExpectedCapacityHandover = model.DateExpectedCapacityHandover - - m.RequestState = model.RequestState +// Set of constants representing the allowable values for OccCapacityRequestRequestTypeEnum +const ( + OccCapacityRequestRequestTypeNew OccCapacityRequestRequestTypeEnum = "NEW" + OccCapacityRequestRequestTypeTransfer OccCapacityRequestRequestTypeEnum = "TRANSFER" +) - m.TimeCreated = model.TimeCreated +var mappingOccCapacityRequestRequestTypeEnum = map[string]OccCapacityRequestRequestTypeEnum{ + "NEW": OccCapacityRequestRequestTypeNew, + "TRANSFER": OccCapacityRequestRequestTypeTransfer, +} - m.TimeUpdated = model.TimeUpdated +var mappingOccCapacityRequestRequestTypeEnumLowerCase = map[string]OccCapacityRequestRequestTypeEnum{ + "new": OccCapacityRequestRequestTypeNew, + "transfer": OccCapacityRequestRequestTypeTransfer, +} - m.LifecycleState = model.LifecycleState +// GetOccCapacityRequestRequestTypeEnumValues Enumerates the set of values for OccCapacityRequestRequestTypeEnum +func GetOccCapacityRequestRequestTypeEnumValues() []OccCapacityRequestRequestTypeEnum { + values := make([]OccCapacityRequestRequestTypeEnum, 0) + for _, v := range mappingOccCapacityRequestRequestTypeEnum { + values = append(values, v) + } + return values +} - m.Details = make([]OccCapacityRequestBaseDetails, len(model.Details)) - for i, n := range model.Details { - nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) - if e != nil { - return e - } - if nn != nil { - m.Details[i] = nn.(OccCapacityRequestBaseDetails) - } else { - m.Details[i] = nil - } +// GetOccCapacityRequestRequestTypeEnumStringValues Enumerates the set of values in String for OccCapacityRequestRequestTypeEnum +func GetOccCapacityRequestRequestTypeEnumStringValues() []string { + return []string{ + "NEW", + "TRANSFER", } - return +} + +// GetMappingOccCapacityRequestRequestTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOccCapacityRequestRequestTypeEnum(val string) (OccCapacityRequestRequestTypeEnum, bool) { + enum, ok := mappingOccCapacityRequestRequestTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok } // OccCapacityRequestRequestStateEnum Enum with underlying type: string diff --git a/capacitymanagement/occ_capacity_request_base_details.go b/capacitymanagement/occ_capacity_request_base_details.go index d949feed2a..eb828ee162 100644 --- a/capacitymanagement/occ_capacity_request_base_details.go +++ b/capacitymanagement/occ_capacity_request_base_details.go @@ -10,159 +10,54 @@ package capacitymanagement import ( - "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" ) // OccCapacityRequestBaseDetails The details of the create capacity request. This model serves as a base for different namespaces. -type OccCapacityRequestBaseDetails interface { +type OccCapacityRequestBaseDetails struct { + + // The type of the resource against which the user wants to place a capacity request. + ResourceType *string `mandatory:"true" json:"resourceType"` // The type of the workload (Generic/ROW). - GetWorkloadType() OccAvailabilitySummaryWorkloadTypeEnum + WorkloadType *string `mandatory:"true" json:"workloadType"` + + // The name of the COMPUTE server shape for which the request is made. Do not use CAPACITY_CONSTRAINT as the resource name. + ResourceName *string `mandatory:"true" json:"resourceName"` + + // The number of compute server's with name required by the user. + DemandQuantity *int64 `mandatory:"true" json:"demandQuantity"` + + // The WorkloadType from where capacity request are to be transferred. + SourceWorkloadType *string `mandatory:"false" json:"sourceWorkloadType"` // The incremental quantity of resources supplied as the provisioning is underway. - GetExpectedHandoverQuantity() *int64 + ExpectedHandoverQuantity *int64 `mandatory:"false" json:"expectedHandoverQuantity"` // The date on which the latest increment to supplied quantity of resources was delivered. - GetDateExpectedHandover() *common.SDKTime + DateExpectedHandover *common.SDKTime `mandatory:"false" json:"dateExpectedHandover"` // The actual handed over quantity of resources at the time of request resolution. - GetActualHandoverQuantity() *int64 + ActualHandoverQuantity *int64 `mandatory:"false" json:"actualHandoverQuantity"` // The date on which the actual handover quantity of resources is delivered. - GetDateActualHandover() *common.SDKTime -} - -type occcapacityrequestbasedetails struct { - JsonData []byte - ExpectedHandoverQuantity *int64 `mandatory:"false" json:"expectedHandoverQuantity"` - DateExpectedHandover *common.SDKTime `mandatory:"false" json:"dateExpectedHandover"` - ActualHandoverQuantity *int64 `mandatory:"false" json:"actualHandoverQuantity"` - DateActualHandover *common.SDKTime `mandatory:"false" json:"dateActualHandover"` - WorkloadType OccAvailabilitySummaryWorkloadTypeEnum `mandatory:"true" json:"workloadType"` - ResourceType string `json:"resourceType"` -} - -// UnmarshalJSON unmarshals json -func (m *occcapacityrequestbasedetails) UnmarshalJSON(data []byte) error { - m.JsonData = data - type Unmarshalerocccapacityrequestbasedetails occcapacityrequestbasedetails - s := struct { - Model Unmarshalerocccapacityrequestbasedetails - }{} - err := json.Unmarshal(data, &s.Model) - if err != nil { - return err - } - m.WorkloadType = s.Model.WorkloadType - m.ExpectedHandoverQuantity = s.Model.ExpectedHandoverQuantity - m.DateExpectedHandover = s.Model.DateExpectedHandover - m.ActualHandoverQuantity = s.Model.ActualHandoverQuantity - m.DateActualHandover = s.Model.DateActualHandover - m.ResourceType = s.Model.ResourceType - - return err -} - -// UnmarshalPolymorphicJSON unmarshals polymorphic json -func (m *occcapacityrequestbasedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { - - if data == nil || string(data) == "null" { - return nil, nil - } - - var err error - switch m.ResourceType { - case "SERVER_HW": - mm := OccCapacityRequestComputeDetails{} - err = json.Unmarshal(data, &mm) - return mm, err - default: - common.Logf("Recieved unsupported enum value for OccCapacityRequestBaseDetails: %s.", m.ResourceType) - return *m, nil - } -} - -// GetExpectedHandoverQuantity returns ExpectedHandoverQuantity -func (m occcapacityrequestbasedetails) GetExpectedHandoverQuantity() *int64 { - return m.ExpectedHandoverQuantity -} - -// GetDateExpectedHandover returns DateExpectedHandover -func (m occcapacityrequestbasedetails) GetDateExpectedHandover() *common.SDKTime { - return m.DateExpectedHandover -} - -// GetActualHandoverQuantity returns ActualHandoverQuantity -func (m occcapacityrequestbasedetails) GetActualHandoverQuantity() *int64 { - return m.ActualHandoverQuantity + DateActualHandover *common.SDKTime `mandatory:"false" json:"dateActualHandover"` } -// GetDateActualHandover returns DateActualHandover -func (m occcapacityrequestbasedetails) GetDateActualHandover() *common.SDKTime { - return m.DateActualHandover -} - -// GetWorkloadType returns WorkloadType -func (m occcapacityrequestbasedetails) GetWorkloadType() OccAvailabilitySummaryWorkloadTypeEnum { - return m.WorkloadType -} - -func (m occcapacityrequestbasedetails) String() string { +func (m OccCapacityRequestBaseDetails) String() string { return common.PointerString(m) } // ValidateEnumValue returns an error when providing an unsupported enum value // This function is being called during constructing API request process // Not recommended for calling this function directly -func (m occcapacityrequestbasedetails) ValidateEnumValue() (bool, error) { +func (m OccCapacityRequestBaseDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} - if _, ok := GetMappingOccAvailabilitySummaryWorkloadTypeEnum(string(m.WorkloadType)); !ok && m.WorkloadType != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WorkloadType: %s. Supported values are: %s.", m.WorkloadType, strings.Join(GetOccAvailabilitySummaryWorkloadTypeEnumStringValues(), ","))) - } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } - -// OccCapacityRequestBaseDetailsResourceTypeEnum Enum with underlying type: string -type OccCapacityRequestBaseDetailsResourceTypeEnum string - -// Set of constants representing the allowable values for OccCapacityRequestBaseDetailsResourceTypeEnum -const ( - OccCapacityRequestBaseDetailsResourceTypeServerHw OccCapacityRequestBaseDetailsResourceTypeEnum = "SERVER_HW" -) - -var mappingOccCapacityRequestBaseDetailsResourceTypeEnum = map[string]OccCapacityRequestBaseDetailsResourceTypeEnum{ - "SERVER_HW": OccCapacityRequestBaseDetailsResourceTypeServerHw, -} - -var mappingOccCapacityRequestBaseDetailsResourceTypeEnumLowerCase = map[string]OccCapacityRequestBaseDetailsResourceTypeEnum{ - "server_hw": OccCapacityRequestBaseDetailsResourceTypeServerHw, -} - -// GetOccCapacityRequestBaseDetailsResourceTypeEnumValues Enumerates the set of values for OccCapacityRequestBaseDetailsResourceTypeEnum -func GetOccCapacityRequestBaseDetailsResourceTypeEnumValues() []OccCapacityRequestBaseDetailsResourceTypeEnum { - values := make([]OccCapacityRequestBaseDetailsResourceTypeEnum, 0) - for _, v := range mappingOccCapacityRequestBaseDetailsResourceTypeEnum { - values = append(values, v) - } - return values -} - -// GetOccCapacityRequestBaseDetailsResourceTypeEnumStringValues Enumerates the set of values in String for OccCapacityRequestBaseDetailsResourceTypeEnum -func GetOccCapacityRequestBaseDetailsResourceTypeEnumStringValues() []string { - return []string{ - "SERVER_HW", - } -} - -// GetMappingOccCapacityRequestBaseDetailsResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingOccCapacityRequestBaseDetailsResourceTypeEnum(val string) (OccCapacityRequestBaseDetailsResourceTypeEnum, bool) { - enum, ok := mappingOccCapacityRequestBaseDetailsResourceTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/capacitymanagement/occ_capacity_request_compute_details.go b/capacitymanagement/occ_capacity_request_compute_details.go deleted file mode 100644 index d261dc5dbc..0000000000 --- a/capacitymanagement/occ_capacity_request_compute_details.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2016, 2018, 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. -// Code generated. DO NOT EDIT. - -// OciControlCenterCp API -// -// A description of the OciControlCenterCp API -// - -package capacitymanagement - -import ( - "encoding/json" - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "strings" -) - -// OccCapacityRequestComputeDetails The details about the compute servers required for creating a capacity request. -type OccCapacityRequestComputeDetails struct { - - // The name of the COMPUTE server shape for which the request is made. Do not use CAPACITY_CONSTRAINT as the resource name. - ResourceName *string `mandatory:"true" json:"resourceName"` - - // The number of compute server's with name required by the user. - DemandQuantity *int64 `mandatory:"true" json:"demandQuantity"` - - // The incremental quantity of resources supplied as the provisioning is underway. - ExpectedHandoverQuantity *int64 `mandatory:"false" json:"expectedHandoverQuantity"` - - // The date on which the latest increment to supplied quantity of resources was delivered. - DateExpectedHandover *common.SDKTime `mandatory:"false" json:"dateExpectedHandover"` - - // The actual handed over quantity of resources at the time of request resolution. - ActualHandoverQuantity *int64 `mandatory:"false" json:"actualHandoverQuantity"` - - // The date on which the actual handover quantity of resources is delivered. - DateActualHandover *common.SDKTime `mandatory:"false" json:"dateActualHandover"` - - // The type of the workload (Generic/ROW). - WorkloadType OccAvailabilitySummaryWorkloadTypeEnum `mandatory:"true" json:"workloadType"` -} - -// GetWorkloadType returns WorkloadType -func (m OccCapacityRequestComputeDetails) GetWorkloadType() OccAvailabilitySummaryWorkloadTypeEnum { - return m.WorkloadType -} - -// GetExpectedHandoverQuantity returns ExpectedHandoverQuantity -func (m OccCapacityRequestComputeDetails) GetExpectedHandoverQuantity() *int64 { - return m.ExpectedHandoverQuantity -} - -// GetDateExpectedHandover returns DateExpectedHandover -func (m OccCapacityRequestComputeDetails) GetDateExpectedHandover() *common.SDKTime { - return m.DateExpectedHandover -} - -// GetActualHandoverQuantity returns ActualHandoverQuantity -func (m OccCapacityRequestComputeDetails) GetActualHandoverQuantity() *int64 { - return m.ActualHandoverQuantity -} - -// GetDateActualHandover returns DateActualHandover -func (m OccCapacityRequestComputeDetails) GetDateActualHandover() *common.SDKTime { - return m.DateActualHandover -} - -func (m OccCapacityRequestComputeDetails) String() string { - return common.PointerString(m) -} - -// ValidateEnumValue returns an error when providing an unsupported enum value -// This function is being called during constructing API request process -// Not recommended for calling this function directly -func (m OccCapacityRequestComputeDetails) ValidateEnumValue() (bool, error) { - errMessage := []string{} - - if _, ok := GetMappingOccAvailabilitySummaryWorkloadTypeEnum(string(m.WorkloadType)); !ok && m.WorkloadType != "" { - errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WorkloadType: %s. Supported values are: %s.", m.WorkloadType, strings.Join(GetOccAvailabilitySummaryWorkloadTypeEnumStringValues(), ","))) - } - if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) - } - return false, nil -} - -// MarshalJSON marshals to json representation -func (m OccCapacityRequestComputeDetails) MarshalJSON() (buff []byte, e error) { - type MarshalTypeOccCapacityRequestComputeDetails OccCapacityRequestComputeDetails - s := struct { - DiscriminatorParam string `json:"resourceType"` - MarshalTypeOccCapacityRequestComputeDetails - }{ - "SERVER_HW", - (MarshalTypeOccCapacityRequestComputeDetails)(m), - } - - return json.Marshal(&s) -} diff --git a/capacitymanagement/occ_capacity_request_summary.go b/capacitymanagement/occ_capacity_request_summary.go index fbcf3ea009..d244601fee 100644 --- a/capacitymanagement/occ_capacity_request_summary.go +++ b/capacitymanagement/occ_capacity_request_summary.go @@ -60,6 +60,9 @@ type OccCapacityRequestSummary struct { // Meaningful text about the capacity request. Description *string `mandatory:"false" json:"description"` + // Type of Capacity Request(New or Transfer) + RequestType OccCapacityRequestRequestTypeEnum `mandatory:"false" json:"requestType,omitempty"` + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in a Failed State. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` @@ -95,6 +98,9 @@ func (m OccCapacityRequestSummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetOccCapacityRequestLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingOccCapacityRequestRequestTypeEnum(string(m.RequestType)); !ok && m.RequestType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestType: %s. Supported values are: %s.", m.RequestType, strings.Join(GetOccCapacityRequestRequestTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/capacitymanagement/occ_overview_collection.go b/capacitymanagement/occ_overview_collection.go new file mode 100644 index 0000000000..1c5a38467c --- /dev/null +++ b/capacitymanagement/occ_overview_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OciControlCenterCp API +// +// A description of the OciControlCenterCp API +// + +package capacitymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OccOverviewCollection A list representing response of overview API. +type OccOverviewCollection struct { + + // An array of overview summary. + Items []OccOverviewSummary `mandatory:"true" json:"items"` +} + +func (m OccOverviewCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OccOverviewCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/capacitymanagement/occ_overview_summary.go b/capacitymanagement/occ_overview_summary.go new file mode 100644 index 0000000000..d2d258e377 --- /dev/null +++ b/capacitymanagement/occ_overview_summary.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OciControlCenterCp API +// +// A description of the OciControlCenterCp API +// + +package capacitymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OccOverviewSummary The overview summary is used to represent an array item that shall be used to represent the overview of the catalog resources along with their corresponding capacity requests. +type OccOverviewSummary struct { + + // The OCID of the compartment from which the api call is made. This will be used for authorizing the request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the month along with year for which this summary corresponds to. + PeriodValue *string `mandatory:"true" json:"periodValue"` + + // The name of the resource for which we have aggregated the value. + ResourceName *string `mandatory:"true" json:"resourceName"` + + // The quantity of the resource which is available at the end of the period of aggregationDetails model in consideration. + TotalAvailable *int64 `mandatory:"true" json:"totalAvailable"` + + // The quantity of the resource which is demanded by customers via capacity requests against the resource name at the end of the time period in consideration for overview. + TotalDemanded *int64 `mandatory:"true" json:"totalDemanded"` + + // The quantity of the resource which is supplied by Oracle to the customer against the resource name at the end of the time period in consideration. + TotalSupplied *int64 `mandatory:"true" json:"totalSupplied"` + + // The quantity of the resource which is rejected by Oracle. + TotalRejected *int64 `mandatory:"true" json:"totalRejected"` + + // The quantity of the resource which is cancelled by the customer. Once the capacity request was submitted, the customer can still cancel it. This field sums up those values. + TotalCancelled *int64 `mandatory:"true" json:"totalCancelled"` + + // The quantity of the resource which Oracle was unable to supply. For a given capacity request, Oracle sometimes cannot supply the entire value demanded by the customer. In such cases a partial value is provided, thereby leaving behind a portion of unfulfilled values. This field sums that up. + TotalUnfulfilled *int64 `mandatory:"true" json:"totalUnfulfilled"` + + // A raw json blob containing breakdown of totalAvailable, totalDemanded, totalSupplied, totalRejected, totalCancelled and totalUnfulfilled by workload types + WorkloadTypeBreakdownBlob *string `mandatory:"true" json:"workloadTypeBreakdownBlob"` + + // The unit e.g SERVER in which the above values like totalAvailable, totalSupplied etc is measured. + Unit *string `mandatory:"true" json:"unit"` + + // A raw json blob containing all the capacity requests corresponding to the resource name + CapacityRequestsBlob *string `mandatory:"false" json:"capacityRequestsBlob"` +} + +func (m OccOverviewSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OccOverviewSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/capacitymanagement/patch_internal_occ_capacity_request_request_response.go b/capacitymanagement/patch_internal_occ_capacity_request_request_response.go new file mode 100644 index 0000000000..b98e41d53c --- /dev/null +++ b/capacitymanagement/patch_internal_occ_capacity_request_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package capacitymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PatchInternalOccCapacityRequestRequest wrapper for the PatchInternalOccCapacityRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/PatchInternalOccCapacityRequest.go.html to see an example of how to use PatchInternalOccCapacityRequestRequest. +type PatchInternalOccCapacityRequestRequest struct { + + // Request to update the details of the capacity request. + PatchOccCapacityRequestDetails `contributesTo:"body"` + + // The OCID of the capacity request. + OccCapacityRequestId *string `mandatory:"true" contributesTo:"path" name:"occCapacityRequestId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PatchInternalOccCapacityRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PatchInternalOccCapacityRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request PatchInternalOccCapacityRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PatchInternalOccCapacityRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request PatchInternalOccCapacityRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PatchInternalOccCapacityRequestResponse wrapper for the PatchInternalOccCapacityRequest operation +type PatchInternalOccCapacityRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OccCapacityRequest instance + OccCapacityRequest `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response PatchInternalOccCapacityRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PatchInternalOccCapacityRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/capacitymanagement/patch_occ_capacity_request_request_response.go b/capacitymanagement/patch_occ_capacity_request_request_response.go index ad6f4280f0..44acbd26a7 100644 --- a/capacitymanagement/patch_occ_capacity_request_request_response.go +++ b/capacitymanagement/patch_occ_capacity_request_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/PatchOccCapacityRequest.go.html to see an example of how to use PatchOccCapacityRequestRequest. type PatchOccCapacityRequestRequest struct { - // Request to update the properties of the capacity request. + // Request to update the details of the capacity request. PatchOccCapacityRequestDetails `contributesTo:"body"` // The OCID of the capacity request. diff --git a/common/version.go b/common/version.go index 3ca799210f..e225db23e4 100644 --- a/common/version.go +++ b/common/version.go @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "65" - patch = "3" + minor = "66" + patch = "0" tag = "" ) diff --git a/database/database_connection_credentials_by_details.go b/database/database_connection_credentials_by_details.go index 15bd77c2b7..150c8ce4de 100644 --- a/database/database_connection_credentials_by_details.go +++ b/database/database_connection_credentials_by_details.go @@ -80,16 +80,19 @@ type DatabaseConnectionCredentialsByDetailsRoleEnum string const ( DatabaseConnectionCredentialsByDetailsRoleSysdba DatabaseConnectionCredentialsByDetailsRoleEnum = "SYSDBA" DatabaseConnectionCredentialsByDetailsRoleNormal DatabaseConnectionCredentialsByDetailsRoleEnum = "NORMAL" + DatabaseConnectionCredentialsByDetailsRoleSysdg DatabaseConnectionCredentialsByDetailsRoleEnum = "SYSDG" ) var mappingDatabaseConnectionCredentialsByDetailsRoleEnum = map[string]DatabaseConnectionCredentialsByDetailsRoleEnum{ "SYSDBA": DatabaseConnectionCredentialsByDetailsRoleSysdba, "NORMAL": DatabaseConnectionCredentialsByDetailsRoleNormal, + "SYSDG": DatabaseConnectionCredentialsByDetailsRoleSysdg, } var mappingDatabaseConnectionCredentialsByDetailsRoleEnumLowerCase = map[string]DatabaseConnectionCredentialsByDetailsRoleEnum{ "sysdba": DatabaseConnectionCredentialsByDetailsRoleSysdba, "normal": DatabaseConnectionCredentialsByDetailsRoleNormal, + "sysdg": DatabaseConnectionCredentialsByDetailsRoleSysdg, } // GetDatabaseConnectionCredentialsByDetailsRoleEnumValues Enumerates the set of values for DatabaseConnectionCredentialsByDetailsRoleEnum @@ -106,6 +109,7 @@ func GetDatabaseConnectionCredentialsByDetailsRoleEnumStringValues() []string { return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/database/database_ssl_connection_credentials.go b/database/database_ssl_connection_credentials.go index 8902b87878..2cc4134318 100644 --- a/database/database_ssl_connection_credentials.go +++ b/database/database_ssl_connection_credentials.go @@ -82,16 +82,19 @@ type DatabaseSslConnectionCredentialsRoleEnum string const ( DatabaseSslConnectionCredentialsRoleSysdba DatabaseSslConnectionCredentialsRoleEnum = "SYSDBA" DatabaseSslConnectionCredentialsRoleNormal DatabaseSslConnectionCredentialsRoleEnum = "NORMAL" + DatabaseSslConnectionCredentialsRoleSysdg DatabaseSslConnectionCredentialsRoleEnum = "SYSDG" ) var mappingDatabaseSslConnectionCredentialsRoleEnum = map[string]DatabaseSslConnectionCredentialsRoleEnum{ "SYSDBA": DatabaseSslConnectionCredentialsRoleSysdba, "NORMAL": DatabaseSslConnectionCredentialsRoleNormal, + "SYSDG": DatabaseSslConnectionCredentialsRoleSysdg, } var mappingDatabaseSslConnectionCredentialsRoleEnumLowerCase = map[string]DatabaseSslConnectionCredentialsRoleEnum{ "sysdba": DatabaseSslConnectionCredentialsRoleSysdba, "normal": DatabaseSslConnectionCredentialsRoleNormal, + "sysdg": DatabaseSslConnectionCredentialsRoleSysdg, } // GetDatabaseSslConnectionCredentialsRoleEnumValues Enumerates the set of values for DatabaseSslConnectionCredentialsRoleEnum @@ -108,6 +111,7 @@ func GetDatabaseSslConnectionCredentialsRoleEnumStringValues() []string { return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/database/enable_database_management_details.go b/database/enable_database_management_details.go index 02e4470bd8..6c9f46e048 100644 --- a/database/enable_database_management_details.go +++ b/database/enable_database_management_details.go @@ -157,16 +157,19 @@ type EnableDatabaseManagementDetailsRoleEnum string const ( EnableDatabaseManagementDetailsRoleSysdba EnableDatabaseManagementDetailsRoleEnum = "SYSDBA" EnableDatabaseManagementDetailsRoleNormal EnableDatabaseManagementDetailsRoleEnum = "NORMAL" + EnableDatabaseManagementDetailsRoleSysdg EnableDatabaseManagementDetailsRoleEnum = "SYSDG" ) var mappingEnableDatabaseManagementDetailsRoleEnum = map[string]EnableDatabaseManagementDetailsRoleEnum{ "SYSDBA": EnableDatabaseManagementDetailsRoleSysdba, "NORMAL": EnableDatabaseManagementDetailsRoleNormal, + "SYSDG": EnableDatabaseManagementDetailsRoleSysdg, } var mappingEnableDatabaseManagementDetailsRoleEnumLowerCase = map[string]EnableDatabaseManagementDetailsRoleEnum{ "sysdba": EnableDatabaseManagementDetailsRoleSysdba, "normal": EnableDatabaseManagementDetailsRoleNormal, + "sysdg": EnableDatabaseManagementDetailsRoleSysdg, } // GetEnableDatabaseManagementDetailsRoleEnumValues Enumerates the set of values for EnableDatabaseManagementDetailsRoleEnum @@ -183,6 +186,7 @@ func GetEnableDatabaseManagementDetailsRoleEnumStringValues() []string { return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/database/enable_pluggable_database_management_details.go b/database/enable_pluggable_database_management_details.go index 85d93ebce9..8f33103a68 100644 --- a/database/enable_pluggable_database_management_details.go +++ b/database/enable_pluggable_database_management_details.go @@ -109,16 +109,19 @@ type EnablePluggableDatabaseManagementDetailsRoleEnum string const ( EnablePluggableDatabaseManagementDetailsRoleSysdba EnablePluggableDatabaseManagementDetailsRoleEnum = "SYSDBA" EnablePluggableDatabaseManagementDetailsRoleNormal EnablePluggableDatabaseManagementDetailsRoleEnum = "NORMAL" + EnablePluggableDatabaseManagementDetailsRoleSysdg EnablePluggableDatabaseManagementDetailsRoleEnum = "SYSDG" ) var mappingEnablePluggableDatabaseManagementDetailsRoleEnum = map[string]EnablePluggableDatabaseManagementDetailsRoleEnum{ "SYSDBA": EnablePluggableDatabaseManagementDetailsRoleSysdba, "NORMAL": EnablePluggableDatabaseManagementDetailsRoleNormal, + "SYSDG": EnablePluggableDatabaseManagementDetailsRoleSysdg, } var mappingEnablePluggableDatabaseManagementDetailsRoleEnumLowerCase = map[string]EnablePluggableDatabaseManagementDetailsRoleEnum{ "sysdba": EnablePluggableDatabaseManagementDetailsRoleSysdba, "normal": EnablePluggableDatabaseManagementDetailsRoleNormal, + "sysdg": EnablePluggableDatabaseManagementDetailsRoleSysdg, } // GetEnablePluggableDatabaseManagementDetailsRoleEnumValues Enumerates the set of values for EnablePluggableDatabaseManagementDetailsRoleEnum @@ -135,6 +138,7 @@ func GetEnablePluggableDatabaseManagementDetailsRoleEnumStringValues() []string return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/database/modify_database_management_details.go b/database/modify_database_management_details.go index 37d626a5b4..f90963a083 100644 --- a/database/modify_database_management_details.go +++ b/database/modify_database_management_details.go @@ -157,16 +157,19 @@ type ModifyDatabaseManagementDetailsRoleEnum string const ( ModifyDatabaseManagementDetailsRoleSysdba ModifyDatabaseManagementDetailsRoleEnum = "SYSDBA" ModifyDatabaseManagementDetailsRoleNormal ModifyDatabaseManagementDetailsRoleEnum = "NORMAL" + ModifyDatabaseManagementDetailsRoleSysdg ModifyDatabaseManagementDetailsRoleEnum = "SYSDG" ) var mappingModifyDatabaseManagementDetailsRoleEnum = map[string]ModifyDatabaseManagementDetailsRoleEnum{ "SYSDBA": ModifyDatabaseManagementDetailsRoleSysdba, "NORMAL": ModifyDatabaseManagementDetailsRoleNormal, + "SYSDG": ModifyDatabaseManagementDetailsRoleSysdg, } var mappingModifyDatabaseManagementDetailsRoleEnumLowerCase = map[string]ModifyDatabaseManagementDetailsRoleEnum{ "sysdba": ModifyDatabaseManagementDetailsRoleSysdba, "normal": ModifyDatabaseManagementDetailsRoleNormal, + "sysdg": ModifyDatabaseManagementDetailsRoleSysdg, } // GetModifyDatabaseManagementDetailsRoleEnumValues Enumerates the set of values for ModifyDatabaseManagementDetailsRoleEnum @@ -183,6 +186,7 @@ func GetModifyDatabaseManagementDetailsRoleEnumStringValues() []string { return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/database/modify_pluggable_database_management_details.go b/database/modify_pluggable_database_management_details.go index 904c76a3ce..93cd1e43fa 100644 --- a/database/modify_pluggable_database_management_details.go +++ b/database/modify_pluggable_database_management_details.go @@ -109,16 +109,19 @@ type ModifyPluggableDatabaseManagementDetailsRoleEnum string const ( ModifyPluggableDatabaseManagementDetailsRoleSysdba ModifyPluggableDatabaseManagementDetailsRoleEnum = "SYSDBA" ModifyPluggableDatabaseManagementDetailsRoleNormal ModifyPluggableDatabaseManagementDetailsRoleEnum = "NORMAL" + ModifyPluggableDatabaseManagementDetailsRoleSysdg ModifyPluggableDatabaseManagementDetailsRoleEnum = "SYSDG" ) var mappingModifyPluggableDatabaseManagementDetailsRoleEnum = map[string]ModifyPluggableDatabaseManagementDetailsRoleEnum{ "SYSDBA": ModifyPluggableDatabaseManagementDetailsRoleSysdba, "NORMAL": ModifyPluggableDatabaseManagementDetailsRoleNormal, + "SYSDG": ModifyPluggableDatabaseManagementDetailsRoleSysdg, } var mappingModifyPluggableDatabaseManagementDetailsRoleEnumLowerCase = map[string]ModifyPluggableDatabaseManagementDetailsRoleEnum{ "sysdba": ModifyPluggableDatabaseManagementDetailsRoleSysdba, "normal": ModifyPluggableDatabaseManagementDetailsRoleNormal, + "sysdg": ModifyPluggableDatabaseManagementDetailsRoleSysdg, } // GetModifyPluggableDatabaseManagementDetailsRoleEnumValues Enumerates the set of values for ModifyPluggableDatabaseManagementDetailsRoleEnum @@ -135,6 +138,7 @@ func GetModifyPluggableDatabaseManagementDetailsRoleEnumStringValues() []string return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/databasemanagement/data_points.go b/databasemanagement/data_points.go new file mode 100644 index 0000000000..de0c843a53 --- /dev/null +++ b/databasemanagement/data_points.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to monitor and manage resources such as +// Oracle Databases, MySQL Databases, and External Database Systems. +// For more information, see Database Management (https://docs.cloud.oracle.com/iaas/database-management/home.htm). +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataPoints The aggregated datapoints of the metric. +type DataPoints struct { + + // The data point date and time in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'". + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` + + // The value of the metric. + Value *float64 `mandatory:"false" json:"value"` +} + +func (m DataPoints) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DataPoints) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/database_connection_credentials_by_details.go b/databasemanagement/database_connection_credentials_by_details.go index 9dedea505b..bae3c879c3 100644 --- a/databasemanagement/database_connection_credentials_by_details.go +++ b/databasemanagement/database_connection_credentials_by_details.go @@ -82,16 +82,19 @@ type DatabaseConnectionCredentialsByDetailsRoleEnum string const ( DatabaseConnectionCredentialsByDetailsRoleSysdba DatabaseConnectionCredentialsByDetailsRoleEnum = "SYSDBA" DatabaseConnectionCredentialsByDetailsRoleNormal DatabaseConnectionCredentialsByDetailsRoleEnum = "NORMAL" + DatabaseConnectionCredentialsByDetailsRoleSysdg DatabaseConnectionCredentialsByDetailsRoleEnum = "SYSDG" ) var mappingDatabaseConnectionCredentialsByDetailsRoleEnum = map[string]DatabaseConnectionCredentialsByDetailsRoleEnum{ "SYSDBA": DatabaseConnectionCredentialsByDetailsRoleSysdba, "NORMAL": DatabaseConnectionCredentialsByDetailsRoleNormal, + "SYSDG": DatabaseConnectionCredentialsByDetailsRoleSysdg, } var mappingDatabaseConnectionCredentialsByDetailsRoleEnumLowerCase = map[string]DatabaseConnectionCredentialsByDetailsRoleEnum{ "sysdba": DatabaseConnectionCredentialsByDetailsRoleSysdba, "normal": DatabaseConnectionCredentialsByDetailsRoleNormal, + "sysdg": DatabaseConnectionCredentialsByDetailsRoleSysdg, } // GetDatabaseConnectionCredentialsByDetailsRoleEnumValues Enumerates the set of values for DatabaseConnectionCredentialsByDetailsRoleEnum @@ -108,6 +111,7 @@ func GetDatabaseConnectionCredentialsByDetailsRoleEnumStringValues() []string { return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/databasemanagement/database_password_credential_details.go b/databasemanagement/database_password_credential_details.go index 50f6a8280c..4fa5ffcfc2 100644 --- a/databasemanagement/database_password_credential_details.go +++ b/databasemanagement/database_password_credential_details.go @@ -71,16 +71,19 @@ type DatabasePasswordCredentialDetailsRoleEnum string const ( DatabasePasswordCredentialDetailsRoleNormal DatabasePasswordCredentialDetailsRoleEnum = "NORMAL" DatabasePasswordCredentialDetailsRoleSysdba DatabasePasswordCredentialDetailsRoleEnum = "SYSDBA" + DatabasePasswordCredentialDetailsRoleSysdg DatabasePasswordCredentialDetailsRoleEnum = "SYSDG" ) var mappingDatabasePasswordCredentialDetailsRoleEnum = map[string]DatabasePasswordCredentialDetailsRoleEnum{ "NORMAL": DatabasePasswordCredentialDetailsRoleNormal, "SYSDBA": DatabasePasswordCredentialDetailsRoleSysdba, + "SYSDG": DatabasePasswordCredentialDetailsRoleSysdg, } var mappingDatabasePasswordCredentialDetailsRoleEnumLowerCase = map[string]DatabasePasswordCredentialDetailsRoleEnum{ "normal": DatabasePasswordCredentialDetailsRoleNormal, "sysdba": DatabasePasswordCredentialDetailsRoleSysdba, + "sysdg": DatabasePasswordCredentialDetailsRoleSysdg, } // GetDatabasePasswordCredentialDetailsRoleEnumValues Enumerates the set of values for DatabasePasswordCredentialDetailsRoleEnum @@ -97,6 +100,7 @@ func GetDatabasePasswordCredentialDetailsRoleEnumStringValues() []string { return []string{ "NORMAL", "SYSDBA", + "SYSDG", } } diff --git a/databasemanagement/database_secret_credential_details.go b/databasemanagement/database_secret_credential_details.go index 3aa1ed7f81..6f8eecc432 100644 --- a/databasemanagement/database_secret_credential_details.go +++ b/databasemanagement/database_secret_credential_details.go @@ -72,16 +72,19 @@ type DatabaseSecretCredentialDetailsRoleEnum string const ( DatabaseSecretCredentialDetailsRoleNormal DatabaseSecretCredentialDetailsRoleEnum = "NORMAL" DatabaseSecretCredentialDetailsRoleSysdba DatabaseSecretCredentialDetailsRoleEnum = "SYSDBA" + DatabaseSecretCredentialDetailsRoleSysdg DatabaseSecretCredentialDetailsRoleEnum = "SYSDG" ) var mappingDatabaseSecretCredentialDetailsRoleEnum = map[string]DatabaseSecretCredentialDetailsRoleEnum{ "NORMAL": DatabaseSecretCredentialDetailsRoleNormal, "SYSDBA": DatabaseSecretCredentialDetailsRoleSysdba, + "SYSDG": DatabaseSecretCredentialDetailsRoleSysdg, } var mappingDatabaseSecretCredentialDetailsRoleEnumLowerCase = map[string]DatabaseSecretCredentialDetailsRoleEnum{ "normal": DatabaseSecretCredentialDetailsRoleNormal, "sysdba": DatabaseSecretCredentialDetailsRoleSysdba, + "sysdg": DatabaseSecretCredentialDetailsRoleSysdg, } // GetDatabaseSecretCredentialDetailsRoleEnumValues Enumerates the set of values for DatabaseSecretCredentialDetailsRoleEnum @@ -98,6 +101,7 @@ func GetDatabaseSecretCredentialDetailsRoleEnumStringValues() []string { return []string{ "NORMAL", "SYSDBA", + "SYSDG", } } diff --git a/databasemanagement/database_ssl_connection_credentials.go b/databasemanagement/database_ssl_connection_credentials.go index aad0a9a2ea..989e7d79a1 100644 --- a/databasemanagement/database_ssl_connection_credentials.go +++ b/databasemanagement/database_ssl_connection_credentials.go @@ -85,16 +85,19 @@ type DatabaseSslConnectionCredentialsRoleEnum string const ( DatabaseSslConnectionCredentialsRoleSysdba DatabaseSslConnectionCredentialsRoleEnum = "SYSDBA" DatabaseSslConnectionCredentialsRoleNormal DatabaseSslConnectionCredentialsRoleEnum = "NORMAL" + DatabaseSslConnectionCredentialsRoleSysdg DatabaseSslConnectionCredentialsRoleEnum = "SYSDG" ) var mappingDatabaseSslConnectionCredentialsRoleEnum = map[string]DatabaseSslConnectionCredentialsRoleEnum{ "SYSDBA": DatabaseSslConnectionCredentialsRoleSysdba, "NORMAL": DatabaseSslConnectionCredentialsRoleNormal, + "SYSDG": DatabaseSslConnectionCredentialsRoleSysdg, } var mappingDatabaseSslConnectionCredentialsRoleEnumLowerCase = map[string]DatabaseSslConnectionCredentialsRoleEnum{ "sysdba": DatabaseSslConnectionCredentialsRoleSysdba, "normal": DatabaseSslConnectionCredentialsRoleNormal, + "sysdg": DatabaseSslConnectionCredentialsRoleSysdg, } // GetDatabaseSslConnectionCredentialsRoleEnumValues Enumerates the set of values for DatabaseSslConnectionCredentialsRoleEnum @@ -111,6 +114,7 @@ func GetDatabaseSslConnectionCredentialsRoleEnumStringValues() []string { return []string{ "SYSDBA", "NORMAL", + "SYSDG", } } diff --git a/databasemanagement/database_usage_metrics.go b/databasemanagement/database_usage_metrics.go index b2480e5f66..ae3865e07e 100644 --- a/databasemanagement/database_usage_metrics.go +++ b/databasemanagement/database_usage_metrics.go @@ -48,6 +48,21 @@ type DatabaseUsageMetrics struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the parent Container Database, in the case of a Pluggable Database. DatabaseContainerId *string `mandatory:"false" json:"databaseContainerId"` + // The Database id of the Managed Database. Every database had its own id and that value is captured here. + DatabaseId *string `mandatory:"false" json:"databaseId"` + + // The Primary Database id of the Managed Database. + PrimaryDbId *string `mandatory:"false" json:"primaryDbId"` + + // The Primary Database unique name of the Managed Database. + PrimaryDbUniqueName *string `mandatory:"false" json:"primaryDbUniqueName"` + + // The Database unique name of the Managed Database. + DbUniqueName *string `mandatory:"false" json:"dbUniqueName"` + + // The Database role of the Managed Database. + DbRole DbRoleEnum `mandatory:"false" json:"dbRole,omitempty"` + // A list of the database health metrics like CPU, Storage, and Memory. Metrics []FleetMetricDefinition `mandatory:"false" json:"metrics"` } @@ -74,6 +89,9 @@ func (m DatabaseUsageMetrics) ValidateEnumValue() (bool, error) { if _, ok := GetMappingWorkloadTypeEnum(string(m.WorkloadType)); !ok && m.WorkloadType != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WorkloadType: %s. Supported values are: %s.", m.WorkloadType, strings.Join(GetWorkloadTypeEnumStringValues(), ","))) } + if _, ok := GetMappingDbRoleEnum(string(m.DbRole)); !ok && m.DbRole != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DbRole: %s. Supported values are: %s.", m.DbRole, strings.Join(GetDbRoleEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/databasemanagement/databasemanagement_dbmanagement_client.go b/databasemanagement/databasemanagement_dbmanagement_client.go index 12a0f83dcd..086c46f077 100644 --- a/databasemanagement/databasemanagement_dbmanagement_client.go +++ b/databasemanagement/databasemanagement_dbmanagement_client.go @@ -4415,6 +4415,65 @@ func (client DbManagementClient) getDatabaseHomeMetrics(ctx context.Context, req return response, err } +// GetDataguardPerformanceMetrics Gets a historical summary of the Database Guard performance metrics for Managed Databases. +// If the peerDatabaseCompartmentId is specified, then the metrics are only retrieved from the specified compartment. +// If the peerDatabaseCompartmentId is not specified, then the metrics are retrieved from the compartment of the Managed Database specified by the ManagedDatabaseId. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetDataguardPerformanceMetrics.go.html to see an example of how to use GetDataguardPerformanceMetrics API. +func (client DbManagementClient) GetDataguardPerformanceMetrics(ctx context.Context, request GetDataguardPerformanceMetricsRequest) (response GetDataguardPerformanceMetricsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getDataguardPerformanceMetrics, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDataguardPerformanceMetricsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDataguardPerformanceMetricsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDataguardPerformanceMetricsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDataguardPerformanceMetricsResponse") + } + return +} + +// getDataguardPerformanceMetrics implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) getDataguardPerformanceMetrics(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/dataguardPerformanceMetrics", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDataguardPerformanceMetricsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/DataguardPerformanceMetrics/GetDataguardPerformanceMetrics" + err = common.PostProcessServiceError(err, "DbManagement", "GetDataguardPerformanceMetrics", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetDbManagementPrivateEndpoint Gets the details of a specific Database Management private endpoint. // // # See also @@ -6033,6 +6092,65 @@ func (client DbManagementClient) getPdbMetrics(ctx context.Context, request comm return response, err } +// GetPeerDatabaseMetrics Gets a comparative summary of the baseline and target values of the Data Guard performance metrics for Managed Databases. +// If the peerDatabaseCompartmentId is specified, then the metrics are only retrieved from the specified compartment. +// If the peerDatabaseCompartmentId is not specified, then the metrics are retrieved from the compartment of the Managed Database specified by the ManagedDatabaseId. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetPeerDatabaseMetrics.go.html to see an example of how to use GetPeerDatabaseMetrics API. +func (client DbManagementClient) GetPeerDatabaseMetrics(ctx context.Context, request GetPeerDatabaseMetricsRequest) (response GetPeerDatabaseMetricsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getPeerDatabaseMetrics, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetPeerDatabaseMetricsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetPeerDatabaseMetricsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetPeerDatabaseMetricsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPeerDatabaseMetricsResponse") + } + return +} + +// getPeerDatabaseMetrics implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) getPeerDatabaseMetrics(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managedDatabases/{managedDatabaseId}/peerDatabaseMetrics", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetPeerDatabaseMetricsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database-management/20201101/PeerDatabaseMetrics/GetPeerDatabaseMetrics" + err = common.PostProcessServiceError(err, "DbManagement", "GetPeerDatabaseMetrics", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetPreferredCredential Gets the preferred credential details for a Managed Database based on credentialName. // // # See also diff --git a/databasemanagement/dataguard_performance_metrics.go b/databasemanagement/dataguard_performance_metrics.go new file mode 100644 index 0000000000..a81e1c7f2b --- /dev/null +++ b/databasemanagement/dataguard_performance_metrics.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to monitor and manage resources such as +// Oracle Databases, MySQL Databases, and External Database Systems. +// For more information, see Database Management (https://docs.cloud.oracle.com/iaas/database-management/home.htm). +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataguardPerformanceMetrics A summary of Data Guard performance metrics for Managed Databases. +type DataguardPerformanceMetrics struct { + + // A summary of Data Guard performance metrics such as ApplyLag, TransportLag and RedoApplyRate, for Managed Databases. + MetricsData []PerformanceMetricsData `mandatory:"true" json:"metricsData"` +} + +func (m DataguardPerformanceMetrics) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DataguardPerformanceMetrics) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/db_role.go b/databasemanagement/db_role.go new file mode 100644 index 0000000000..85862853c0 --- /dev/null +++ b/databasemanagement/db_role.go @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to monitor and manage resources such as +// Oracle Databases, MySQL Databases, and External Database Systems. +// For more information, see Database Management (https://docs.cloud.oracle.com/iaas/database-management/home.htm). +// + +package databasemanagement + +import ( + "strings" +) + +// DbRoleEnum Enum with underlying type: string +type DbRoleEnum string + +// Set of constants representing the allowable values for DbRoleEnum +const ( + DbRoleSnapshotStandby DbRoleEnum = "SNAPSHOT_STANDBY" + DbRoleLogicalStandby DbRoleEnum = "LOGICAL_STANDBY" + DbRolePhysicalStandby DbRoleEnum = "PHYSICAL_STANDBY" + DbRolePrimary DbRoleEnum = "PRIMARY" + DbRoleFarSync DbRoleEnum = "FAR_SYNC" +) + +var mappingDbRoleEnum = map[string]DbRoleEnum{ + "SNAPSHOT_STANDBY": DbRoleSnapshotStandby, + "LOGICAL_STANDBY": DbRoleLogicalStandby, + "PHYSICAL_STANDBY": DbRolePhysicalStandby, + "PRIMARY": DbRolePrimary, + "FAR_SYNC": DbRoleFarSync, +} + +var mappingDbRoleEnumLowerCase = map[string]DbRoleEnum{ + "snapshot_standby": DbRoleSnapshotStandby, + "logical_standby": DbRoleLogicalStandby, + "physical_standby": DbRolePhysicalStandby, + "primary": DbRolePrimary, + "far_sync": DbRoleFarSync, +} + +// GetDbRoleEnumValues Enumerates the set of values for DbRoleEnum +func GetDbRoleEnumValues() []DbRoleEnum { + values := make([]DbRoleEnum, 0) + for _, v := range mappingDbRoleEnum { + values = append(values, v) + } + return values +} + +// GetDbRoleEnumStringValues Enumerates the set of values in String for DbRoleEnum +func GetDbRoleEnumStringValues() []string { + return []string{ + "SNAPSHOT_STANDBY", + "LOGICAL_STANDBY", + "PHYSICAL_STANDBY", + "PRIMARY", + "FAR_SYNC", + } +} + +// GetMappingDbRoleEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDbRoleEnum(val string) (DbRoleEnum, bool) { + enum, ok := mappingDbRoleEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/get_dataguard_performance_metrics_request_response.go b/databasemanagement/get_dataguard_performance_metrics_request_response.go new file mode 100644 index 0000000000..50fe1bb92f --- /dev/null +++ b/databasemanagement/get_dataguard_performance_metrics_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDataguardPerformanceMetricsRequest wrapper for the GetDataguardPerformanceMetrics operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetDataguardPerformanceMetrics.go.html to see an example of how to use GetDataguardPerformanceMetricsRequest. +type GetDataguardPerformanceMetricsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The start time of the time range to retrieve the health metrics of a Managed Database + // in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'". + StartTime *string `mandatory:"true" contributesTo:"query" name:"startTime"` + + // The end time of the time range to retrieve the health metrics of a Managed Database + // in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'". + EndTime *string `mandatory:"true" contributesTo:"query" name:"endTime"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment for which peer database metrics are required. + // This is not a mandatory parameter and in its absence, all the peer database metrics are returned. + PeerDatabaseCompartmentId *string `mandatory:"false" contributesTo:"query" name:"peerDatabaseCompartmentId"` + + // The filter used to retrieve a specific set of metrics by passing the desired metric names with a comma separator. Note that, by default, the service returns all supported metrics. + FilterByMetricNames *string `mandatory:"false" contributesTo:"query" name:"filterByMetricNames"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDataguardPerformanceMetricsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDataguardPerformanceMetricsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetDataguardPerformanceMetricsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDataguardPerformanceMetricsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetDataguardPerformanceMetricsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDataguardPerformanceMetricsResponse wrapper for the GetDataguardPerformanceMetrics operation +type GetDataguardPerformanceMetricsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DataguardPerformanceMetrics instance + DataguardPerformanceMetrics `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetDataguardPerformanceMetricsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDataguardPerformanceMetricsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/get_peer_database_metrics_request_response.go b/databasemanagement/get_peer_database_metrics_request_response.go new file mode 100644 index 0000000000..d459c34b25 --- /dev/null +++ b/databasemanagement/get_peer_database_metrics_request_response.go @@ -0,0 +1,157 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetPeerDatabaseMetricsRequest wrapper for the GetPeerDatabaseMetrics operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/GetPeerDatabaseMetrics.go.html to see an example of how to use GetPeerDatabaseMetricsRequest. +type GetPeerDatabaseMetricsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ManagedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"managedDatabaseId"` + + // The start time of the time range to retrieve the health metrics of a Managed Database + // in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'". + StartTime *string `mandatory:"true" contributesTo:"query" name:"startTime"` + + // The end time of the time range to retrieve the health metrics of a Managed Database + // in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'". + EndTime *string `mandatory:"true" contributesTo:"query" name:"endTime"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment for which peer database metrics are required. + // This is not a mandatory parameter and in its absence, all the peer database metrics are returned. + PeerDatabaseCompartmentId *string `mandatory:"false" contributesTo:"query" name:"peerDatabaseCompartmentId"` + + // The time window used for metrics comparison. + CompareType GetPeerDatabaseMetricsCompareTypeEnum `mandatory:"false" contributesTo:"query" name:"compareType" omitEmpty:"true"` + + // The filter used to retrieve a specific set of metrics by passing the desired metric names with a comma separator. Note that, by default, the service returns all supported metrics. + FilterByMetricNames *string `mandatory:"false" contributesTo:"query" name:"filterByMetricNames"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetPeerDatabaseMetricsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPeerDatabaseMetricsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetPeerDatabaseMetricsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPeerDatabaseMetricsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetPeerDatabaseMetricsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGetPeerDatabaseMetricsCompareTypeEnum(string(request.CompareType)); !ok && request.CompareType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CompareType: %s. Supported values are: %s.", request.CompareType, strings.Join(GetGetPeerDatabaseMetricsCompareTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetPeerDatabaseMetricsResponse wrapper for the GetPeerDatabaseMetrics operation +type GetPeerDatabaseMetricsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PeerDatabaseMetrics instance + PeerDatabaseMetrics `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetPeerDatabaseMetricsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPeerDatabaseMetricsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetPeerDatabaseMetricsCompareTypeEnum Enum with underlying type: string +type GetPeerDatabaseMetricsCompareTypeEnum string + +// Set of constants representing the allowable values for GetPeerDatabaseMetricsCompareTypeEnum +const ( + GetPeerDatabaseMetricsCompareTypeHour GetPeerDatabaseMetricsCompareTypeEnum = "HOUR" + GetPeerDatabaseMetricsCompareTypeDay GetPeerDatabaseMetricsCompareTypeEnum = "DAY" + GetPeerDatabaseMetricsCompareTypeWeek GetPeerDatabaseMetricsCompareTypeEnum = "WEEK" +) + +var mappingGetPeerDatabaseMetricsCompareTypeEnum = map[string]GetPeerDatabaseMetricsCompareTypeEnum{ + "HOUR": GetPeerDatabaseMetricsCompareTypeHour, + "DAY": GetPeerDatabaseMetricsCompareTypeDay, + "WEEK": GetPeerDatabaseMetricsCompareTypeWeek, +} + +var mappingGetPeerDatabaseMetricsCompareTypeEnumLowerCase = map[string]GetPeerDatabaseMetricsCompareTypeEnum{ + "hour": GetPeerDatabaseMetricsCompareTypeHour, + "day": GetPeerDatabaseMetricsCompareTypeDay, + "week": GetPeerDatabaseMetricsCompareTypeWeek, +} + +// GetGetPeerDatabaseMetricsCompareTypeEnumValues Enumerates the set of values for GetPeerDatabaseMetricsCompareTypeEnum +func GetGetPeerDatabaseMetricsCompareTypeEnumValues() []GetPeerDatabaseMetricsCompareTypeEnum { + values := make([]GetPeerDatabaseMetricsCompareTypeEnum, 0) + for _, v := range mappingGetPeerDatabaseMetricsCompareTypeEnum { + values = append(values, v) + } + return values +} + +// GetGetPeerDatabaseMetricsCompareTypeEnumStringValues Enumerates the set of values in String for GetPeerDatabaseMetricsCompareTypeEnum +func GetGetPeerDatabaseMetricsCompareTypeEnumStringValues() []string { + return []string{ + "HOUR", + "DAY", + "WEEK", + } +} + +// GetMappingGetPeerDatabaseMetricsCompareTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetPeerDatabaseMetricsCompareTypeEnum(val string) (GetPeerDatabaseMetricsCompareTypeEnum, bool) { + enum, ok := mappingGetPeerDatabaseMetricsCompareTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/databasemanagement/peer_database_metrics.go b/databasemanagement/peer_database_metrics.go new file mode 100644 index 0000000000..643e836268 --- /dev/null +++ b/databasemanagement/peer_database_metrics.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to monitor and manage resources such as +// Oracle Databases, MySQL Databases, and External Database Systems. +// For more information, see Database Management (https://docs.cloud.oracle.com/iaas/database-management/home.htm). +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PeerDatabaseMetrics The summary of resource usage metrics for the peer database. +type PeerDatabaseMetrics struct { + + // A list of resource usage metrics for the peer database. + PeerDbMetrics []DatabaseUsageMetrics `mandatory:"true" json:"peerDbMetrics"` +} + +func (m PeerDatabaseMetrics) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PeerDatabaseMetrics) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/performance_metrics.go b/databasemanagement/performance_metrics.go new file mode 100644 index 0000000000..6a8e30a498 --- /dev/null +++ b/databasemanagement/performance_metrics.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to monitor and manage resources such as +// Oracle Databases, MySQL Databases, and External Database Systems. +// For more information, see Database Management (https://docs.cloud.oracle.com/iaas/database-management/home.htm). +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PerformanceMetrics The Data Guard performance metric details. +type PerformanceMetrics struct { + + // The name of the metric. + Name *string `mandatory:"false" json:"name"` + + // The dimensions of the Data Guard performance metrics, such as primary database ID, primary database unique name. + Dimensions *interface{} `mandatory:"false" json:"dimensions"` + + // The metadata of the metric, such as Unit. + Metadata *interface{} `mandatory:"false" json:"metadata"` + + // The aggregated datapoints of the metric. + Datapoints []DataPoints `mandatory:"false" json:"datapoints"` +} + +func (m PerformanceMetrics) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PerformanceMetrics) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/performance_metrics_data.go b/databasemanagement/performance_metrics_data.go new file mode 100644 index 0000000000..7b8e644d50 --- /dev/null +++ b/databasemanagement/performance_metrics_data.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// Database Management API +// +// Use the Database Management API to monitor and manage resources such as +// Oracle Databases, MySQL Databases, and External Database Systems. +// For more information, see Database Management (https://docs.cloud.oracle.com/iaas/database-management/home.htm). +// + +package databasemanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PerformanceMetricsData The list of Data Guard performance metrics for Managed Databases. +type PerformanceMetricsData struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment in which the Managed Database resides. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Managed Database. + ResourceId *string `mandatory:"false" json:"resourceId"` + + // The ID of the primary database. + PrimaryDbId *string `mandatory:"false" json:"primaryDbId"` + + // The primary database unique name of the Managed Database. + PrimaryDbUniqueName *string `mandatory:"false" json:"primaryDbUniqueName"` + + // The database ID of the Managed Database. Every database had its own ID and that value is captured here. + DatabaseId *string `mandatory:"false" json:"databaseId"` + + // The database unique name of the Managed Database. + DbUniqueName *string `mandatory:"false" json:"dbUniqueName"` + + // The deployment type of the Managed Database. + DeploymentType *string `mandatory:"false" json:"deploymentType"` + + // The resource name of the Managed Database. + ResourceName *string `mandatory:"false" json:"resourceName"` + + // The database role of the Managed Database. + DbRole DbRoleEnum `mandatory:"false" json:"dbRole,omitempty"` + + // The list of Data Guard performance metrics such as ApplyLag, TransportLag and RedoApplyRate for the Managed Databases. + Metrics []PerformanceMetrics `mandatory:"false" json:"metrics"` +} + +func (m PerformanceMetricsData) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PerformanceMetricsData) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDbRoleEnum(string(m.DbRole)); !ok && m.DbRole != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DbRole: %s. Supported values are: %s.", m.DbRole, strings.Join(GetDbRoleEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/role.go b/databasemanagement/role.go index 274d7bef7e..fe7994c659 100644 --- a/databasemanagement/role.go +++ b/databasemanagement/role.go @@ -22,16 +22,19 @@ type RoleEnum string const ( RoleNormal RoleEnum = "NORMAL" RoleSysdba RoleEnum = "SYSDBA" + RoleSysdg RoleEnum = "SYSDG" ) var mappingRoleEnum = map[string]RoleEnum{ "NORMAL": RoleNormal, "SYSDBA": RoleSysdba, + "SYSDG": RoleSysdg, } var mappingRoleEnumLowerCase = map[string]RoleEnum{ "normal": RoleNormal, "sysdba": RoleSysdba, + "sysdg": RoleSysdg, } // GetRoleEnumValues Enumerates the set of values for RoleEnum @@ -48,6 +51,7 @@ func GetRoleEnumStringValues() []string { return []string{ "NORMAL", "SYSDBA", + "SYSDG", } } diff --git a/demandsignal/change_occ_demand_signal_compartment_details.go b/demandsignal/change_occ_demand_signal_compartment_details.go new file mode 100644 index 0000000000..f71075261f --- /dev/null +++ b/demandsignal/change_occ_demand_signal_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeOccDemandSignalCompartmentDetails The configuration details for the move operation. +type ChangeOccDemandSignalCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the OccDemandSignal to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeOccDemandSignalCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeOccDemandSignalCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/demandsignal/change_occ_demand_signal_compartment_request_response.go b/demandsignal/change_occ_demand_signal_compartment_request_response.go new file mode 100644 index 0000000000..5a1eec0fc4 --- /dev/null +++ b/demandsignal/change_occ_demand_signal_compartment_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeOccDemandSignalCompartmentRequest wrapper for the ChangeOccDemandSignalCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/ChangeOccDemandSignalCompartment.go.html to see an example of how to use ChangeOccDemandSignalCompartmentRequest. +type ChangeOccDemandSignalCompartmentRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + OccDemandSignalId *string `mandatory:"true" contributesTo:"path" name:"occDemandSignalId"` + + // The information to be updated. + ChangeOccDemandSignalCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeOccDemandSignalCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeOccDemandSignalCompartmentRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ChangeOccDemandSignalCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeOccDemandSignalCompartmentRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ChangeOccDemandSignalCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeOccDemandSignalCompartmentResponse wrapper for the ChangeOccDemandSignalCompartment operation +type ChangeOccDemandSignalCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeOccDemandSignalCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeOccDemandSignalCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/demandsignal/create_occ_demand_signal_details.go b/demandsignal/create_occ_demand_signal_details.go new file mode 100644 index 0000000000..79d0b925e2 --- /dev/null +++ b/demandsignal/create_occ_demand_signal_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateOccDemandSignalDetails The data to create a OccDemandSignal. +type CreateOccDemandSignalDetails struct { + + // The OccDemandSignal data. + OccDemandSignals []OccDemandSignalData `mandatory:"true" json:"occDemandSignals"` + + // Indicator of whether to share the data with Oracle. + IsActive *bool `mandatory:"true" json:"isActive"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the OccDemandSignal in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateOccDemandSignalDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateOccDemandSignalDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/demandsignal/create_occ_demand_signal_request_response.go b/demandsignal/create_occ_demand_signal_request_response.go new file mode 100644 index 0000000000..8813bcf280 --- /dev/null +++ b/demandsignal/create_occ_demand_signal_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateOccDemandSignalRequest wrapper for the CreateOccDemandSignal operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/CreateOccDemandSignal.go.html to see an example of how to use CreateOccDemandSignalRequest. +type CreateOccDemandSignalRequest struct { + + // Details for the new OccDemandSignal. + CreateOccDemandSignalDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running 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 removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateOccDemandSignalRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateOccDemandSignalRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateOccDemandSignalRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateOccDemandSignalRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request CreateOccDemandSignalRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateOccDemandSignalResponse wrapper for the CreateOccDemandSignal operation +type CreateOccDemandSignalResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OccDemandSignal instance + OccDemandSignal `presentIn:"body"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateOccDemandSignalResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateOccDemandSignalResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/demandsignal/delete_occ_demand_signal_request_response.go b/demandsignal/delete_occ_demand_signal_request_response.go new file mode 100644 index 0000000000..abdc3dcd11 --- /dev/null +++ b/demandsignal/delete_occ_demand_signal_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteOccDemandSignalRequest wrapper for the DeleteOccDemandSignal operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/DeleteOccDemandSignal.go.html to see an example of how to use DeleteOccDemandSignalRequest. +type DeleteOccDemandSignalRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + OccDemandSignalId *string `mandatory:"true" contributesTo:"path" name:"occDemandSignalId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteOccDemandSignalRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteOccDemandSignalRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request DeleteOccDemandSignalRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteOccDemandSignalRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request DeleteOccDemandSignalRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteOccDemandSignalResponse wrapper for the DeleteOccDemandSignal operation +type DeleteOccDemandSignalResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteOccDemandSignalResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteOccDemandSignalResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/demandsignal/demandsignal_occdemandsignal_client.go b/demandsignal/demandsignal_occdemandsignal_client.go new file mode 100644 index 0000000000..8ed20a6a6c --- /dev/null +++ b/demandsignal/demandsignal_occdemandsignal_client.go @@ -0,0 +1,504 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// OccDemandSignalClient a client for OccDemandSignal +type OccDemandSignalClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewOccDemandSignalClientWithConfigurationProvider Creates a new default OccDemandSignal client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewOccDemandSignalClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client OccDemandSignalClient, err error) { + if enabled := common.CheckForEnabledServices("demandsignal"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newOccDemandSignalClientFromBaseClient(baseClient, provider) +} + +// NewOccDemandSignalClientWithOboToken Creates a new default OccDemandSignal client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewOccDemandSignalClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client OccDemandSignalClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newOccDemandSignalClientFromBaseClient(baseClient, configProvider) +} + +func newOccDemandSignalClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client OccDemandSignalClient, err error) { + // OccDemandSignal service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("OccDemandSignal")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = OccDemandSignalClient{BaseClient: baseClient} + client.BasePath = "20240430" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *OccDemandSignalClient) SetRegion(region string) { + client.Host, _ = common.StringToRegion(region).EndpointForTemplateDottedRegion("demandsignal", "https://control-center-ds.{region}.oci.{secondLevelDomain}", "control-center-ds") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *OccDemandSignalClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *OccDemandSignalClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ChangeOccDemandSignalCompartment Moves a OccDemandSignal into a different compartment within the same tenancy. For information about moving resources between +// compartments, see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/ChangeOccDemandSignalCompartment.go.html to see an example of how to use ChangeOccDemandSignalCompartment API. +// A default retry strategy applies to this operation ChangeOccDemandSignalCompartment() +func (client OccDemandSignalClient) ChangeOccDemandSignalCompartment(ctx context.Context, request ChangeOccDemandSignalCompartmentRequest) (response ChangeOccDemandSignalCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.changeOccDemandSignalCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeOccDemandSignalCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeOccDemandSignalCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeOccDemandSignalCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeOccDemandSignalCompartmentResponse") + } + return +} + +// changeOccDemandSignalCompartment implements the OCIOperation interface (enables retrying operations) +func (client OccDemandSignalClient) changeOccDemandSignalCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/occDemandSignals/{occDemandSignalId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeOccDemandSignalCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "OccDemandSignal", "ChangeOccDemandSignalCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateOccDemandSignal Creates a OccDemandSignal. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/CreateOccDemandSignal.go.html to see an example of how to use CreateOccDemandSignal API. +// A default retry strategy applies to this operation CreateOccDemandSignal() +func (client OccDemandSignalClient) CreateOccDemandSignal(ctx context.Context, request CreateOccDemandSignalRequest) (response CreateOccDemandSignalResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createOccDemandSignal, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateOccDemandSignalResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateOccDemandSignalResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateOccDemandSignalResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateOccDemandSignalResponse") + } + return +} + +// createOccDemandSignal implements the OCIOperation interface (enables retrying operations) +func (client OccDemandSignalClient) createOccDemandSignal(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/occDemandSignals", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateOccDemandSignalResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "OccDemandSignal", "CreateOccDemandSignal", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteOccDemandSignal Deletes a OccDemandSignal. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/DeleteOccDemandSignal.go.html to see an example of how to use DeleteOccDemandSignal API. +// A default retry strategy applies to this operation DeleteOccDemandSignal() +func (client OccDemandSignalClient) DeleteOccDemandSignal(ctx context.Context, request DeleteOccDemandSignalRequest) (response DeleteOccDemandSignalResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.deleteOccDemandSignal, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteOccDemandSignalResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteOccDemandSignalResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteOccDemandSignalResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteOccDemandSignalResponse") + } + return +} + +// deleteOccDemandSignal implements the OCIOperation interface (enables retrying operations) +func (client OccDemandSignalClient) deleteOccDemandSignal(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/occDemandSignals/{occDemandSignalId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteOccDemandSignalResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "OccDemandSignal", "DeleteOccDemandSignal", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetOccDemandSignal Gets information about a OccDemandSignal. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/GetOccDemandSignal.go.html to see an example of how to use GetOccDemandSignal API. +// A default retry strategy applies to this operation GetOccDemandSignal() +func (client OccDemandSignalClient) GetOccDemandSignal(ctx context.Context, request GetOccDemandSignalRequest) (response GetOccDemandSignalResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getOccDemandSignal, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetOccDemandSignalResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetOccDemandSignalResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetOccDemandSignalResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetOccDemandSignalResponse") + } + return +} + +// getOccDemandSignal implements the OCIOperation interface (enables retrying operations) +func (client OccDemandSignalClient) getOccDemandSignal(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/occDemandSignals/{occDemandSignalId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetOccDemandSignalResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "OccDemandSignal", "GetOccDemandSignal", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListOccDemandSignals Gets a list of OccDemandSignals. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/ListOccDemandSignals.go.html to see an example of how to use ListOccDemandSignals API. +// A default retry strategy applies to this operation ListOccDemandSignals() +func (client OccDemandSignalClient) ListOccDemandSignals(ctx context.Context, request ListOccDemandSignalsRequest) (response ListOccDemandSignalsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listOccDemandSignals, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListOccDemandSignalsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListOccDemandSignalsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListOccDemandSignalsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListOccDemandSignalsResponse") + } + return +} + +// listOccDemandSignals implements the OCIOperation interface (enables retrying operations) +func (client OccDemandSignalClient) listOccDemandSignals(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/occDemandSignals", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListOccDemandSignalsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "OccDemandSignal", "ListOccDemandSignals", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PatchOccDemandSignal Updates the data of an OccDemandSignal. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/PatchOccDemandSignal.go.html to see an example of how to use PatchOccDemandSignal API. +// A default retry strategy applies to this operation PatchOccDemandSignal() +func (client OccDemandSignalClient) PatchOccDemandSignal(ctx context.Context, request PatchOccDemandSignalRequest) (response PatchOccDemandSignalResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.patchOccDemandSignal, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PatchOccDemandSignalResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PatchOccDemandSignalResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PatchOccDemandSignalResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PatchOccDemandSignalResponse") + } + return +} + +// patchOccDemandSignal implements the OCIOperation interface (enables retrying operations) +func (client OccDemandSignalClient) patchOccDemandSignal(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPatch, "/occDemandSignals/{occDemandSignalId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PatchOccDemandSignalResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "OccDemandSignal", "PatchOccDemandSignal", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateOccDemandSignal Updates a OccDemandSignal. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/UpdateOccDemandSignal.go.html to see an example of how to use UpdateOccDemandSignal API. +// A default retry strategy applies to this operation UpdateOccDemandSignal() +func (client OccDemandSignalClient) UpdateOccDemandSignal(ctx context.Context, request UpdateOccDemandSignalRequest) (response UpdateOccDemandSignalResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.updateOccDemandSignal, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateOccDemandSignalResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateOccDemandSignalResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateOccDemandSignalResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateOccDemandSignalResponse") + } + return +} + +// updateOccDemandSignal implements the OCIOperation interface (enables retrying operations) +func (client OccDemandSignalClient) updateOccDemandSignal(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/occDemandSignals/{occDemandSignalId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateOccDemandSignalResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "OccDemandSignal", "UpdateOccDemandSignal", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/demandsignal/get_occ_demand_signal_request_response.go b/demandsignal/get_occ_demand_signal_request_response.go new file mode 100644 index 0000000000..53775261f9 --- /dev/null +++ b/demandsignal/get_occ_demand_signal_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetOccDemandSignalRequest wrapper for the GetOccDemandSignal operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/GetOccDemandSignal.go.html to see an example of how to use GetOccDemandSignalRequest. +type GetOccDemandSignalRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + OccDemandSignalId *string `mandatory:"true" contributesTo:"path" name:"occDemandSignalId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetOccDemandSignalRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetOccDemandSignalRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetOccDemandSignalRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetOccDemandSignalRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetOccDemandSignalRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetOccDemandSignalResponse wrapper for the GetOccDemandSignal operation +type GetOccDemandSignalResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OccDemandSignal instance + OccDemandSignal `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetOccDemandSignalResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetOccDemandSignalResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/demandsignal/list_occ_demand_signals_request_response.go b/demandsignal/list_occ_demand_signals_request_response.go new file mode 100644 index 0000000000..c7ba84af27 --- /dev/null +++ b/demandsignal/list_occ_demand_signals_request_response.go @@ -0,0 +1,217 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListOccDemandSignalsRequest wrapper for the ListOccDemandSignals operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/ListOccDemandSignals.go.html to see an example of how to use ListOccDemandSignalsRequest. +type ListOccDemandSignalsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState OccDemandSignalLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListOccDemandSignalsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `displayName` is ascending. + SortBy ListOccDemandSignalsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListOccDemandSignalsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListOccDemandSignalsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListOccDemandSignalsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListOccDemandSignalsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListOccDemandSignalsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOccDemandSignalLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetOccDemandSignalLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListOccDemandSignalsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListOccDemandSignalsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListOccDemandSignalsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListOccDemandSignalsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListOccDemandSignalsResponse wrapper for the ListOccDemandSignals operation +type ListOccDemandSignalsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of OccDemandSignalCollection instances + OccDemandSignalCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListOccDemandSignalsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListOccDemandSignalsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListOccDemandSignalsSortOrderEnum Enum with underlying type: string +type ListOccDemandSignalsSortOrderEnum string + +// Set of constants representing the allowable values for ListOccDemandSignalsSortOrderEnum +const ( + ListOccDemandSignalsSortOrderAsc ListOccDemandSignalsSortOrderEnum = "ASC" + ListOccDemandSignalsSortOrderDesc ListOccDemandSignalsSortOrderEnum = "DESC" +) + +var mappingListOccDemandSignalsSortOrderEnum = map[string]ListOccDemandSignalsSortOrderEnum{ + "ASC": ListOccDemandSignalsSortOrderAsc, + "DESC": ListOccDemandSignalsSortOrderDesc, +} + +var mappingListOccDemandSignalsSortOrderEnumLowerCase = map[string]ListOccDemandSignalsSortOrderEnum{ + "asc": ListOccDemandSignalsSortOrderAsc, + "desc": ListOccDemandSignalsSortOrderDesc, +} + +// GetListOccDemandSignalsSortOrderEnumValues Enumerates the set of values for ListOccDemandSignalsSortOrderEnum +func GetListOccDemandSignalsSortOrderEnumValues() []ListOccDemandSignalsSortOrderEnum { + values := make([]ListOccDemandSignalsSortOrderEnum, 0) + for _, v := range mappingListOccDemandSignalsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListOccDemandSignalsSortOrderEnumStringValues Enumerates the set of values in String for ListOccDemandSignalsSortOrderEnum +func GetListOccDemandSignalsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListOccDemandSignalsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOccDemandSignalsSortOrderEnum(val string) (ListOccDemandSignalsSortOrderEnum, bool) { + enum, ok := mappingListOccDemandSignalsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListOccDemandSignalsSortByEnum Enum with underlying type: string +type ListOccDemandSignalsSortByEnum string + +// Set of constants representing the allowable values for ListOccDemandSignalsSortByEnum +const ( + ListOccDemandSignalsSortByTimecreated ListOccDemandSignalsSortByEnum = "timeCreated" + ListOccDemandSignalsSortByDisplayname ListOccDemandSignalsSortByEnum = "displayName" +) + +var mappingListOccDemandSignalsSortByEnum = map[string]ListOccDemandSignalsSortByEnum{ + "timeCreated": ListOccDemandSignalsSortByTimecreated, + "displayName": ListOccDemandSignalsSortByDisplayname, +} + +var mappingListOccDemandSignalsSortByEnumLowerCase = map[string]ListOccDemandSignalsSortByEnum{ + "timecreated": ListOccDemandSignalsSortByTimecreated, + "displayname": ListOccDemandSignalsSortByDisplayname, +} + +// GetListOccDemandSignalsSortByEnumValues Enumerates the set of values for ListOccDemandSignalsSortByEnum +func GetListOccDemandSignalsSortByEnumValues() []ListOccDemandSignalsSortByEnum { + values := make([]ListOccDemandSignalsSortByEnum, 0) + for _, v := range mappingListOccDemandSignalsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListOccDemandSignalsSortByEnumStringValues Enumerates the set of values in String for ListOccDemandSignalsSortByEnum +func GetListOccDemandSignalsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListOccDemandSignalsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOccDemandSignalsSortByEnum(val string) (ListOccDemandSignalsSortByEnum, bool) { + enum, ok := mappingListOccDemandSignalsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/demandsignal/occ_demand_signal.go b/demandsignal/occ_demand_signal.go new file mode 100644 index 0000000000..4b0a2be802 --- /dev/null +++ b/demandsignal/occ_demand_signal.go @@ -0,0 +1,144 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OccDemandSignal An OccDemandSignal is a forecast created for different Resource Types. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to +// an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/iaas/Content/Identity/policiesgs/get-started-with-policies.htm). +type OccDemandSignal struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OccDemandSignal data. + OccDemandSignals []OccDemandSignalData `mandatory:"true" json:"occDemandSignals"` + + // Indicator of whether to share the data with Oracle. + IsActive *bool `mandatory:"true" json:"isActive"` + + // The current state of the OccDemandSignal. + LifecycleState OccDemandSignalLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the OccDemandSignal was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The date and time the OccDemandSignal was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the OccDemandSignal in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m OccDemandSignal) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OccDemandSignal) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOccDemandSignalLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetOccDemandSignalLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OccDemandSignalLifecycleStateEnum Enum with underlying type: string +type OccDemandSignalLifecycleStateEnum string + +// Set of constants representing the allowable values for OccDemandSignalLifecycleStateEnum +const ( + OccDemandSignalLifecycleStateCreating OccDemandSignalLifecycleStateEnum = "CREATING" + OccDemandSignalLifecycleStateUpdating OccDemandSignalLifecycleStateEnum = "UPDATING" + OccDemandSignalLifecycleStateActive OccDemandSignalLifecycleStateEnum = "ACTIVE" + OccDemandSignalLifecycleStateDeleting OccDemandSignalLifecycleStateEnum = "DELETING" + OccDemandSignalLifecycleStateDeleted OccDemandSignalLifecycleStateEnum = "DELETED" + OccDemandSignalLifecycleStateFailed OccDemandSignalLifecycleStateEnum = "FAILED" +) + +var mappingOccDemandSignalLifecycleStateEnum = map[string]OccDemandSignalLifecycleStateEnum{ + "CREATING": OccDemandSignalLifecycleStateCreating, + "UPDATING": OccDemandSignalLifecycleStateUpdating, + "ACTIVE": OccDemandSignalLifecycleStateActive, + "DELETING": OccDemandSignalLifecycleStateDeleting, + "DELETED": OccDemandSignalLifecycleStateDeleted, + "FAILED": OccDemandSignalLifecycleStateFailed, +} + +var mappingOccDemandSignalLifecycleStateEnumLowerCase = map[string]OccDemandSignalLifecycleStateEnum{ + "creating": OccDemandSignalLifecycleStateCreating, + "updating": OccDemandSignalLifecycleStateUpdating, + "active": OccDemandSignalLifecycleStateActive, + "deleting": OccDemandSignalLifecycleStateDeleting, + "deleted": OccDemandSignalLifecycleStateDeleted, + "failed": OccDemandSignalLifecycleStateFailed, +} + +// GetOccDemandSignalLifecycleStateEnumValues Enumerates the set of values for OccDemandSignalLifecycleStateEnum +func GetOccDemandSignalLifecycleStateEnumValues() []OccDemandSignalLifecycleStateEnum { + values := make([]OccDemandSignalLifecycleStateEnum, 0) + for _, v := range mappingOccDemandSignalLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetOccDemandSignalLifecycleStateEnumStringValues Enumerates the set of values in String for OccDemandSignalLifecycleStateEnum +func GetOccDemandSignalLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingOccDemandSignalLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOccDemandSignalLifecycleStateEnum(val string) (OccDemandSignalLifecycleStateEnum, bool) { + enum, ok := mappingOccDemandSignalLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/demandsignal/occ_demand_signal_collection.go b/demandsignal/occ_demand_signal_collection.go new file mode 100644 index 0000000000..ef41ee50f3 --- /dev/null +++ b/demandsignal/occ_demand_signal_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OccDemandSignalCollection Results of a occDemandSignal search. Contains both OccDemandSignalSummary items and other information, such as metadata. +type OccDemandSignalCollection struct { + + // List of occDemandSignals. + Items []OccDemandSignalSummary `mandatory:"true" json:"items"` +} + +func (m OccDemandSignalCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OccDemandSignalCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/demandsignal/occ_demand_signal_data.go b/demandsignal/occ_demand_signal_data.go new file mode 100644 index 0000000000..2e7b20a183 --- /dev/null +++ b/demandsignal/occ_demand_signal_data.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OccDemandSignalData The Data Object For Demand Signal. +type OccDemandSignalData struct { + + // The name of the resource for the data. + ResourceType *string `mandatory:"true" json:"resourceType"` + + // The units of the data. + Units *string `mandatory:"true" json:"units"` + + // The values of forecast. + Values []OccDemandSignalValue `mandatory:"true" json:"values"` +} + +func (m OccDemandSignalData) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OccDemandSignalData) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/demandsignal/occ_demand_signal_summary.go b/demandsignal/occ_demand_signal_summary.go new file mode 100644 index 0000000000..f7e627cd02 --- /dev/null +++ b/demandsignal/occ_demand_signal_summary.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OccDemandSignalSummary Summary information about a OccDemandSignal. +type OccDemandSignalSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Indicator of whether to share the data with Oracle. + IsActive *bool `mandatory:"true" json:"isActive"` + + // The date and time the OccDemandSignal was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the OccDemandSignal. + LifecycleState OccDemandSignalLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The date and time the OccDemandSignal was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the OccDemandSignal in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m OccDemandSignalSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OccDemandSignalSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOccDemandSignalLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetOccDemandSignalLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/demandsignal/occ_demand_signal_value.go b/demandsignal/occ_demand_signal_value.go new file mode 100644 index 0000000000..adc9274fb0 --- /dev/null +++ b/demandsignal/occ_demand_signal_value.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OccDemandSignalValue The Value of Demand Signal for particular month. +type OccDemandSignalValue struct { + + // The date of the Demand Signal Value. + TimeExpected *common.SDKTime `mandatory:"true" json:"timeExpected"` + + // The Demand Signal Value. + Value *float32 `mandatory:"true" json:"value"` + + // Space provided for users to make comments regarding the value. + Comments *string `mandatory:"false" json:"comments"` +} + +func (m OccDemandSignalValue) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OccDemandSignalValue) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/demandsignal/patch_insert_instruction.go b/demandsignal/patch_insert_instruction.go new file mode 100644 index 0000000000..718b6c3383 --- /dev/null +++ b/demandsignal/patch_insert_instruction.go @@ -0,0 +1,117 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchInsertInstruction An operation that inserts a value into an array, shifting array items as necessary and handling NOT_FOUND exceptions by creating the implied containing structure. +type PatchInsertInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A value to be inserted into the target. + Value *interface{} `mandatory:"true" json:"value"` + + // A selection to be evaluated against the array for identifying a particular reference item within it, with the same format and semantics as `selection`. + SelectedItem *string `mandatory:"false" json:"selectedItem"` + + // Where to insert the value, relative to the first item matched by `selectedItem`. + // If `selectedItem` is unspecified, then "BEFORE" specifies insertion at the first position in an array and "AFTER" specifies insertion at the last position. + // If `selectedItem` is specified but results in an empty selection, then both values specify insertion at the last position. + Position PatchInsertInstructionPositionEnum `mandatory:"false" json:"position,omitempty"` +} + +// GetSelection returns Selection +func (m PatchInsertInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchInsertInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchInsertInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPatchInsertInstructionPositionEnum(string(m.Position)); !ok && m.Position != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Position: %s. Supported values are: %s.", m.Position, strings.Join(GetPatchInsertInstructionPositionEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchInsertInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchInsertInstruction PatchInsertInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchInsertInstruction + }{ + "INSERT", + (MarshalTypePatchInsertInstruction)(m), + } + + return json.Marshal(&s) +} + +// PatchInsertInstructionPositionEnum Enum with underlying type: string +type PatchInsertInstructionPositionEnum string + +// Set of constants representing the allowable values for PatchInsertInstructionPositionEnum +const ( + PatchInsertInstructionPositionBefore PatchInsertInstructionPositionEnum = "BEFORE" + PatchInsertInstructionPositionAfter PatchInsertInstructionPositionEnum = "AFTER" +) + +var mappingPatchInsertInstructionPositionEnum = map[string]PatchInsertInstructionPositionEnum{ + "BEFORE": PatchInsertInstructionPositionBefore, + "AFTER": PatchInsertInstructionPositionAfter, +} + +var mappingPatchInsertInstructionPositionEnumLowerCase = map[string]PatchInsertInstructionPositionEnum{ + "before": PatchInsertInstructionPositionBefore, + "after": PatchInsertInstructionPositionAfter, +} + +// GetPatchInsertInstructionPositionEnumValues Enumerates the set of values for PatchInsertInstructionPositionEnum +func GetPatchInsertInstructionPositionEnumValues() []PatchInsertInstructionPositionEnum { + values := make([]PatchInsertInstructionPositionEnum, 0) + for _, v := range mappingPatchInsertInstructionPositionEnum { + values = append(values, v) + } + return values +} + +// GetPatchInsertInstructionPositionEnumStringValues Enumerates the set of values in String for PatchInsertInstructionPositionEnum +func GetPatchInsertInstructionPositionEnumStringValues() []string { + return []string{ + "BEFORE", + "AFTER", + } +} + +// GetMappingPatchInsertInstructionPositionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPatchInsertInstructionPositionEnum(val string) (PatchInsertInstructionPositionEnum, bool) { + enum, ok := mappingPatchInsertInstructionPositionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/demandsignal/patch_insert_multiple_instruction.go b/demandsignal/patch_insert_multiple_instruction.go new file mode 100644 index 0000000000..7c6b0fcd75 --- /dev/null +++ b/demandsignal/patch_insert_multiple_instruction.go @@ -0,0 +1,117 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchInsertMultipleInstruction An operation that inserts multiple consecutive values into an array, shifting array items as necessary and handling NOT_FOUND exceptions by creating the implied containing structure. +type PatchInsertMultipleInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A list of consecutive values to be inserted into the target. + Values []interface{} `mandatory:"true" json:"values"` + + // A selection to be evaluated against the array for identifying a particular reference item within it, with the same format and semantics as `selection`. + SelectedItem *string `mandatory:"false" json:"selectedItem"` + + // Where to insert the values, relative to the first item matched by `selectedItem`. + // If `selectedItem` is unspecified, then "BEFORE" specifies insertion at the first position in an array and "AFTER" specifies insertion at the last position. + // If `selectedItem` is specified but results in an empty selection, then both values specify insertion at the last position. + Position PatchInsertMultipleInstructionPositionEnum `mandatory:"false" json:"position,omitempty"` +} + +// GetSelection returns Selection +func (m PatchInsertMultipleInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchInsertMultipleInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchInsertMultipleInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPatchInsertMultipleInstructionPositionEnum(string(m.Position)); !ok && m.Position != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Position: %s. Supported values are: %s.", m.Position, strings.Join(GetPatchInsertMultipleInstructionPositionEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchInsertMultipleInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchInsertMultipleInstruction PatchInsertMultipleInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchInsertMultipleInstruction + }{ + "INSERT_MULTIPLE", + (MarshalTypePatchInsertMultipleInstruction)(m), + } + + return json.Marshal(&s) +} + +// PatchInsertMultipleInstructionPositionEnum Enum with underlying type: string +type PatchInsertMultipleInstructionPositionEnum string + +// Set of constants representing the allowable values for PatchInsertMultipleInstructionPositionEnum +const ( + PatchInsertMultipleInstructionPositionBefore PatchInsertMultipleInstructionPositionEnum = "BEFORE" + PatchInsertMultipleInstructionPositionAfter PatchInsertMultipleInstructionPositionEnum = "AFTER" +) + +var mappingPatchInsertMultipleInstructionPositionEnum = map[string]PatchInsertMultipleInstructionPositionEnum{ + "BEFORE": PatchInsertMultipleInstructionPositionBefore, + "AFTER": PatchInsertMultipleInstructionPositionAfter, +} + +var mappingPatchInsertMultipleInstructionPositionEnumLowerCase = map[string]PatchInsertMultipleInstructionPositionEnum{ + "before": PatchInsertMultipleInstructionPositionBefore, + "after": PatchInsertMultipleInstructionPositionAfter, +} + +// GetPatchInsertMultipleInstructionPositionEnumValues Enumerates the set of values for PatchInsertMultipleInstructionPositionEnum +func GetPatchInsertMultipleInstructionPositionEnumValues() []PatchInsertMultipleInstructionPositionEnum { + values := make([]PatchInsertMultipleInstructionPositionEnum, 0) + for _, v := range mappingPatchInsertMultipleInstructionPositionEnum { + values = append(values, v) + } + return values +} + +// GetPatchInsertMultipleInstructionPositionEnumStringValues Enumerates the set of values in String for PatchInsertMultipleInstructionPositionEnum +func GetPatchInsertMultipleInstructionPositionEnumStringValues() []string { + return []string{ + "BEFORE", + "AFTER", + } +} + +// GetMappingPatchInsertMultipleInstructionPositionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPatchInsertMultipleInstructionPositionEnum(val string) (PatchInsertMultipleInstructionPositionEnum, bool) { + enum, ok := mappingPatchInsertMultipleInstructionPositionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/demandsignal/patch_instruction.go b/demandsignal/patch_instruction.go new file mode 100644 index 0000000000..afe5b91125 --- /dev/null +++ b/demandsignal/patch_instruction.go @@ -0,0 +1,179 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchInstruction A single instruction to be included as part of Patch request content. +type PatchInstruction interface { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + GetSelection() *string +} + +type patchinstruction struct { + JsonData []byte + Selection *string `mandatory:"true" json:"selection"` + Operation string `json:"operation"` +} + +// UnmarshalJSON unmarshals json +func (m *patchinstruction) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerpatchinstruction patchinstruction + s := struct { + Model Unmarshalerpatchinstruction + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Selection = s.Model.Selection + m.Operation = s.Model.Operation + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *patchinstruction) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Operation { + case "MOVE": + mm := PatchMoveInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "REMOVE": + mm := PatchRemoveInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "REPLACE": + mm := PatchReplaceInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "INSERT_MULTIPLE": + mm := PatchInsertMultipleInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "INSERT": + mm := PatchInsertInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "REQUIRE": + mm := PatchRequireInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "MERGE": + mm := PatchMergeInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "PROHIBIT": + mm := PatchProhibitInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for PatchInstruction: %s.", m.Operation) + return *m, nil + } +} + +// GetSelection returns Selection +func (m patchinstruction) GetSelection() *string { + return m.Selection +} + +func (m patchinstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m patchinstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PatchInstructionOperationEnum Enum with underlying type: string +type PatchInstructionOperationEnum string + +// Set of constants representing the allowable values for PatchInstructionOperationEnum +const ( + PatchInstructionOperationRequire PatchInstructionOperationEnum = "REQUIRE" + PatchInstructionOperationProhibit PatchInstructionOperationEnum = "PROHIBIT" + PatchInstructionOperationReplace PatchInstructionOperationEnum = "REPLACE" + PatchInstructionOperationInsert PatchInstructionOperationEnum = "INSERT" + PatchInstructionOperationRemove PatchInstructionOperationEnum = "REMOVE" + PatchInstructionOperationMove PatchInstructionOperationEnum = "MOVE" + PatchInstructionOperationMerge PatchInstructionOperationEnum = "MERGE" +) + +var mappingPatchInstructionOperationEnum = map[string]PatchInstructionOperationEnum{ + "REQUIRE": PatchInstructionOperationRequire, + "PROHIBIT": PatchInstructionOperationProhibit, + "REPLACE": PatchInstructionOperationReplace, + "INSERT": PatchInstructionOperationInsert, + "REMOVE": PatchInstructionOperationRemove, + "MOVE": PatchInstructionOperationMove, + "MERGE": PatchInstructionOperationMerge, +} + +var mappingPatchInstructionOperationEnumLowerCase = map[string]PatchInstructionOperationEnum{ + "require": PatchInstructionOperationRequire, + "prohibit": PatchInstructionOperationProhibit, + "replace": PatchInstructionOperationReplace, + "insert": PatchInstructionOperationInsert, + "remove": PatchInstructionOperationRemove, + "move": PatchInstructionOperationMove, + "merge": PatchInstructionOperationMerge, +} + +// GetPatchInstructionOperationEnumValues Enumerates the set of values for PatchInstructionOperationEnum +func GetPatchInstructionOperationEnumValues() []PatchInstructionOperationEnum { + values := make([]PatchInstructionOperationEnum, 0) + for _, v := range mappingPatchInstructionOperationEnum { + values = append(values, v) + } + return values +} + +// GetPatchInstructionOperationEnumStringValues Enumerates the set of values in String for PatchInstructionOperationEnum +func GetPatchInstructionOperationEnumStringValues() []string { + return []string{ + "REQUIRE", + "PROHIBIT", + "REPLACE", + "INSERT", + "REMOVE", + "MOVE", + "MERGE", + } +} + +// GetMappingPatchInstructionOperationEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPatchInstructionOperationEnum(val string) (PatchInstructionOperationEnum, bool) { + enum, ok := mappingPatchInstructionOperationEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/demandsignal/patch_merge_instruction.go b/demandsignal/patch_merge_instruction.go new file mode 100644 index 0000000000..d8006ff760 --- /dev/null +++ b/demandsignal/patch_merge_instruction.go @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchMergeInstruction An operation that recursively updates items of the selection, or adding the value if the selection is empty. +// If the value is not an object, it is used directly, otherwise each key-value member is used +// to create or update a member of the same name in the target and the same process is applied recursively for each object-typed value +// (similar to RFC 7396 (https://tools.ietf.org/html/rfc7396#section-2) JSON Merge Patch, except that null values are copied +// rather than transformed into deletions). +// NOT_FOUND exceptions are handled by creating the implied containing structure. +// To avoid referential errors if an item's descendant is also in the selection, items of the selection are processed in order of decreasing depth. +type PatchMergeInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A value to be merged into the target. + Value *interface{} `mandatory:"false" json:"value"` +} + +// GetSelection returns Selection +func (m PatchMergeInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchMergeInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchMergeInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchMergeInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchMergeInstruction PatchMergeInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchMergeInstruction + }{ + "MERGE", + (MarshalTypePatchMergeInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/demandsignal/patch_move_instruction.go b/demandsignal/patch_move_instruction.go new file mode 100644 index 0000000000..34630d43a7 --- /dev/null +++ b/demandsignal/patch_move_instruction.go @@ -0,0 +1,121 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchMoveInstruction An operation that "puts" values from elsewhere in the target, functionally equivalent to a single add and then a remove. +// The first item of the selection is replaced, or created if the selection is empty. +// NOT_FOUND exceptions in the selection are handled by creating the implied containing structure. +// This operation fails if the `from` selection yields any exceptions, or if an item is moved to any of its descendants. +type PatchMoveInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // The selection that is to be moved, with the same format and semantics as `selection`. + From *string `mandatory:"true" json:"from"` + + // Where to insert the value in an array, relative to the first item in the selection. + // If there is no such item, then "BEFORE" specifies insertion at the first position in an array and "AFTER" specifies insertion at the last position. + // If the first item in the selection is not the child of an array, then this field has no effect. + Position PatchMoveInstructionPositionEnum `mandatory:"false" json:"position,omitempty"` +} + +// GetSelection returns Selection +func (m PatchMoveInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchMoveInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchMoveInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPatchMoveInstructionPositionEnum(string(m.Position)); !ok && m.Position != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Position: %s. Supported values are: %s.", m.Position, strings.Join(GetPatchMoveInstructionPositionEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchMoveInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchMoveInstruction PatchMoveInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchMoveInstruction + }{ + "MOVE", + (MarshalTypePatchMoveInstruction)(m), + } + + return json.Marshal(&s) +} + +// PatchMoveInstructionPositionEnum Enum with underlying type: string +type PatchMoveInstructionPositionEnum string + +// Set of constants representing the allowable values for PatchMoveInstructionPositionEnum +const ( + PatchMoveInstructionPositionAt PatchMoveInstructionPositionEnum = "AT" + PatchMoveInstructionPositionBefore PatchMoveInstructionPositionEnum = "BEFORE" + PatchMoveInstructionPositionAfter PatchMoveInstructionPositionEnum = "AFTER" +) + +var mappingPatchMoveInstructionPositionEnum = map[string]PatchMoveInstructionPositionEnum{ + "AT": PatchMoveInstructionPositionAt, + "BEFORE": PatchMoveInstructionPositionBefore, + "AFTER": PatchMoveInstructionPositionAfter, +} + +var mappingPatchMoveInstructionPositionEnumLowerCase = map[string]PatchMoveInstructionPositionEnum{ + "at": PatchMoveInstructionPositionAt, + "before": PatchMoveInstructionPositionBefore, + "after": PatchMoveInstructionPositionAfter, +} + +// GetPatchMoveInstructionPositionEnumValues Enumerates the set of values for PatchMoveInstructionPositionEnum +func GetPatchMoveInstructionPositionEnumValues() []PatchMoveInstructionPositionEnum { + values := make([]PatchMoveInstructionPositionEnum, 0) + for _, v := range mappingPatchMoveInstructionPositionEnum { + values = append(values, v) + } + return values +} + +// GetPatchMoveInstructionPositionEnumStringValues Enumerates the set of values in String for PatchMoveInstructionPositionEnum +func GetPatchMoveInstructionPositionEnumStringValues() []string { + return []string{ + "AT", + "BEFORE", + "AFTER", + } +} + +// GetMappingPatchMoveInstructionPositionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPatchMoveInstructionPositionEnum(val string) (PatchMoveInstructionPositionEnum, bool) { + enum, ok := mappingPatchMoveInstructionPositionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/demandsignal/patch_occ_demand_signal_details.go b/demandsignal/patch_occ_demand_signal_details.go new file mode 100644 index 0000000000..744795b716 --- /dev/null +++ b/demandsignal/patch_occ_demand_signal_details.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchOccDemandSignalDetails Demand Signal details to patch. +type PatchOccDemandSignalDetails struct { + + // List of patch instructions. + Items []PatchInstruction `mandatory:"false" json:"items"` +} + +func (m PatchOccDemandSignalDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchOccDemandSignalDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *PatchOccDemandSignalDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []patchinstruction `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Items = make([]PatchInstruction, len(model.Items)) + for i, n := range model.Items { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Items[i] = nn.(PatchInstruction) + } else { + m.Items[i] = nil + } + } + return +} diff --git a/demandsignal/patch_occ_demand_signal_request_response.go b/demandsignal/patch_occ_demand_signal_request_response.go new file mode 100644 index 0000000000..8d2edd364c --- /dev/null +++ b/demandsignal/patch_occ_demand_signal_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PatchOccDemandSignalRequest wrapper for the PatchOccDemandSignal operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/PatchOccDemandSignal.go.html to see an example of how to use PatchOccDemandSignalRequest. +type PatchOccDemandSignalRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + OccDemandSignalId *string `mandatory:"true" contributesTo:"path" name:"occDemandSignalId"` + + // The information to be updated. + PatchOccDemandSignalDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request PatchOccDemandSignalRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PatchOccDemandSignalRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request PatchOccDemandSignalRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PatchOccDemandSignalRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request PatchOccDemandSignalRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PatchOccDemandSignalResponse wrapper for the PatchOccDemandSignal operation +type PatchOccDemandSignalResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OccDemandSignal instance + OccDemandSignal `presentIn:"body"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response PatchOccDemandSignalResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PatchOccDemandSignalResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/demandsignal/patch_prohibit_instruction.go b/demandsignal/patch_prohibit_instruction.go new file mode 100644 index 0000000000..4a6c64cb32 --- /dev/null +++ b/demandsignal/patch_prohibit_instruction.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchProhibitInstruction A precondition operation that requires a selection to be empty, or optionally to be non-empty but include no item with a specified value +// (useful for asserting that a value does not exist before attempting to create it, avoiding accidental update). +// It fails if value is provided and the selection includes an item matching it, or if value is not provided and the selection is not empty, +// but ignores NOT_FOUND exceptions. +type PatchProhibitInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A value to be compared against each item of the selection. + // If this value is an object, then it matches any item that would be unaffected by applying this value as a merge operation. + // Otherwise, it matches any item to which it is equal according to the rules of JSON Schema (https://tools.ietf.org/html/draft-handrews-json-schema-00#section-4.2.3). + Value *interface{} `mandatory:"false" json:"value"` +} + +// GetSelection returns Selection +func (m PatchProhibitInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchProhibitInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchProhibitInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchProhibitInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchProhibitInstruction PatchProhibitInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchProhibitInstruction + }{ + "PROHIBIT", + (MarshalTypePatchProhibitInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/demandsignal/patch_remove_instruction.go b/demandsignal/patch_remove_instruction.go new file mode 100644 index 0000000000..e0c5e0e44e --- /dev/null +++ b/demandsignal/patch_remove_instruction.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchRemoveInstruction An operation that deletes items, ignoring NOT_FOUND exceptions. +// To avoid referential errors if an item's descendant is also in the selection, items of the selection are processed in order of decreasing depth. +type PatchRemoveInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` +} + +// GetSelection returns Selection +func (m PatchRemoveInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchRemoveInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchRemoveInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchRemoveInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchRemoveInstruction PatchRemoveInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchRemoveInstruction + }{ + "REMOVE", + (MarshalTypePatchRemoveInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/demandsignal/patch_replace_instruction.go b/demandsignal/patch_replace_instruction.go new file mode 100644 index 0000000000..3a2eb71d74 --- /dev/null +++ b/demandsignal/patch_replace_instruction.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchReplaceInstruction An operation that "puts" a value, replacing every item of the selection with it, or creating it if the selection is empty. +// NOT_FOUND exceptions are handled by creating the implied containing structure (but note that this may put the target in an invalid state, +// which can be prevented by use of precondition operations). +// To avoid referential errors if an item's descendant is also in the selection, items of the selection are processed in order of decreasing depth. +type PatchReplaceInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A value to be added into the target. + Value *interface{} `mandatory:"true" json:"value"` +} + +// GetSelection returns Selection +func (m PatchReplaceInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchReplaceInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchReplaceInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchReplaceInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchReplaceInstruction PatchReplaceInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchReplaceInstruction + }{ + "REPLACE", + (MarshalTypePatchReplaceInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/demandsignal/patch_require_instruction.go b/demandsignal/patch_require_instruction.go new file mode 100644 index 0000000000..b110c56702 --- /dev/null +++ b/demandsignal/patch_require_instruction.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchRequireInstruction A precondition operation that requires a selection to be non-empty, and optionally to include an item with a specified value +// (useful for asserting that a value exists before attempting to update it, avoiding accidental creation). +// It fails if the selection is empty, or if value is provided and no item of the selection matches it. +type PatchRequireInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A value to be compared against each item of the selection. + // If this value is an object, then it matches any item that would be unaffected by applying this value as a merge operation. + // Otherwise, it matches any item to which it is equal according to the rules of JSON Schema (https://tools.ietf.org/html/draft-handrews-json-schema-00#section-4.2.3). + Value *interface{} `mandatory:"false" json:"value"` +} + +// GetSelection returns Selection +func (m PatchRequireInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchRequireInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchRequireInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchRequireInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchRequireInstruction PatchRequireInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchRequireInstruction + }{ + "REQUIRE", + (MarshalTypePatchRequireInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/demandsignal/sort_order.go b/demandsignal/sort_order.go new file mode 100644 index 0000000000..405807a9f7 --- /dev/null +++ b/demandsignal/sort_order.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "strings" +) + +// SortOrderEnum Enum with underlying type: string +type SortOrderEnum string + +// Set of constants representing the allowable values for SortOrderEnum +const ( + SortOrderAsc SortOrderEnum = "ASC" + SortOrderDesc SortOrderEnum = "DESC" +) + +var mappingSortOrderEnum = map[string]SortOrderEnum{ + "ASC": SortOrderAsc, + "DESC": SortOrderDesc, +} + +var mappingSortOrderEnumLowerCase = map[string]SortOrderEnum{ + "asc": SortOrderAsc, + "desc": SortOrderDesc, +} + +// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum +func GetSortOrderEnumValues() []SortOrderEnum { + values := make([]SortOrderEnum, 0) + for _, v := range mappingSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSortOrderEnumStringValues Enumerates the set of values in String for SortOrderEnum +func GetSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrderEnum(val string) (SortOrderEnum, bool) { + enum, ok := mappingSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/demandsignal/update_occ_demand_signal_details.go b/demandsignal/update_occ_demand_signal_details.go new file mode 100644 index 0000000000..ec28eb01bf --- /dev/null +++ b/demandsignal/update_occ_demand_signal_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +// OCI Control Center Demand Signal API +// +// Use the OCI Control Center Demand Signal API to manage Demand Signals. +// + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateOccDemandSignalDetails The data to update a OccDemandSignal. +type UpdateOccDemandSignalDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Indicator of whether to share the data with Oracle. + IsActive *bool `mandatory:"false" json:"isActive"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateOccDemandSignalDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateOccDemandSignalDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/demandsignal/update_occ_demand_signal_request_response.go b/demandsignal/update_occ_demand_signal_request_response.go new file mode 100644 index 0000000000..e0b756b633 --- /dev/null +++ b/demandsignal/update_occ_demand_signal_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 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. +// Code generated. DO NOT EDIT. + +package demandsignal + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateOccDemandSignalRequest wrapper for the UpdateOccDemandSignal operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/demandsignal/UpdateOccDemandSignal.go.html to see an example of how to use UpdateOccDemandSignalRequest. +type UpdateOccDemandSignalRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OccDemandSignal. + OccDemandSignalId *string `mandatory:"true" contributesTo:"path" name:"occDemandSignalId"` + + // The information to be updated. + UpdateOccDemandSignalDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateOccDemandSignalRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateOccDemandSignalRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request UpdateOccDemandSignalRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateOccDemandSignalRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request UpdateOccDemandSignalRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateOccDemandSignalResponse wrapper for the UpdateOccDemandSignal operation +type UpdateOccDemandSignalResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OccDemandSignal instance + OccDemandSignal `presentIn:"body"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateOccDemandSignalResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateOccDemandSignalResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/jmsjavadownloads/action_type.go b/jmsjavadownloads/action_type.go index f686501789..71ccba049a 100644 --- a/jmsjavadownloads/action_type.go +++ b/jmsjavadownloads/action_type.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/aggregation_sort_by.go b/jmsjavadownloads/aggregation_sort_by.go index f5cbcbce25..4b8299adfb 100644 --- a/jmsjavadownloads/aggregation_sort_by.go +++ b/jmsjavadownloads/aggregation_sort_by.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/checksum_type.go b/jmsjavadownloads/checksum_type.go index 3aa196a86e..0a2cb4191b 100644 --- a/jmsjavadownloads/checksum_type.go +++ b/jmsjavadownloads/checksum_type.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/create_java_download_report_details.go b/jmsjavadownloads/create_java_download_report_details.go index 365c334f44..6672f35b8c 100644 --- a/jmsjavadownloads/create_java_download_report_details.go +++ b/jmsjavadownloads/create_java_download_report_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -31,11 +31,19 @@ type CreateJavaDownloadReportDetails struct { // The end time until when the download records have to be included (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` - // The property to be used for sorting the reports. + // The property to be used for sorting the records. SortBy JavaDownloadRecordSortByEnum `mandatory:"false" json:"sortBy,omitempty"` - // The sort order for the reports. + // The sort order for the records. SortOrder SortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}`. (See Managing Tags and Tag Namespaces (https://docs.cloud.oracle.com/Content/Tagging/Concepts/understandingfreeformtags.htm).) + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}`. (See Understanding Free-form Tags (https://docs.cloud.oracle.com/Content/Tagging/Tasks/managingtagsandtagnamespaces.htm)). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateJavaDownloadReportDetails) String() string { diff --git a/jmsjavadownloads/create_java_download_token_details.go b/jmsjavadownloads/create_java_download_token_details.go index 8e61ccb19e..e7e3bf6e01 100644 --- a/jmsjavadownloads/create_java_download_token_details.go +++ b/jmsjavadownloads/create_java_download_token_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/create_java_license_acceptance_record_details.go b/jmsjavadownloads/create_java_license_acceptance_record_details.go index fd8036a31a..e0a86ad46d 100644 --- a/jmsjavadownloads/create_java_license_acceptance_record_details.go +++ b/jmsjavadownloads/create_java_license_acceptance_record_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -26,6 +26,14 @@ type CreateJavaLicenseAcceptanceRecordDetails struct { // Status of license acceptance. LicenseAcceptanceStatus LicenseAcceptanceStatusEnum `mandatory:"true" json:"licenseAcceptanceStatus"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}`. (See Managing Tags and Tag Namespaces (https://docs.cloud.oracle.com/Content/Tagging/Concepts/understandingfreeformtags.htm).) + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}`. (See Understanding Free-form Tags (https://docs.cloud.oracle.com/Content/Tagging/Tasks/managingtagsandtagnamespaces.htm)). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m CreateJavaLicenseAcceptanceRecordDetails) String() string { diff --git a/jmsjavadownloads/download_url.go b/jmsjavadownloads/download_url.go index 962f696899..f3c1806653 100644 --- a/jmsjavadownloads/download_url.go +++ b/jmsjavadownloads/download_url.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/download_url_type.go b/jmsjavadownloads/download_url_type.go index 94e310558a..2e2568a3fa 100644 --- a/jmsjavadownloads/download_url_type.go +++ b/jmsjavadownloads/download_url_type.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/generate_artifact_download_url_details.go b/jmsjavadownloads/generate_artifact_download_url_details.go index 921833e4a0..f8ed857986 100644 --- a/jmsjavadownloads/generate_artifact_download_url_details.go +++ b/jmsjavadownloads/generate_artifact_download_url_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_count_aggregation.go b/jmsjavadownloads/java_download_count_aggregation.go index 50bd9cdf98..0b062b6a1f 100644 --- a/jmsjavadownloads/java_download_count_aggregation.go +++ b/jmsjavadownloads/java_download_count_aggregation.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -36,7 +36,7 @@ type JavaDownloadCountAggregation struct { // The target Operating System architecture for the artifact. Applicable only to `PLATFORM` aggregationType. Architecture *string `mandatory:"false" json:"architecture"` - // The package type(typically the file extension) of the artifact. Applicable only to `PLATFORM` aggregationType. + // The package type (typically the file extension) of the artifact. Applicable only to `PLATFORM` aggregationType. PackageType *string `mandatory:"false" json:"packageType"` // Additional information about the package type. Applicable only to `PLATFORM` aggregationType. diff --git a/jmsjavadownloads/java_download_count_aggregation_collection.go b/jmsjavadownloads/java_download_count_aggregation_collection.go index 8c6a3c539e..2630d7aaa2 100644 --- a/jmsjavadownloads/java_download_count_aggregation_collection.go +++ b/jmsjavadownloads/java_download_count_aggregation_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_count_aggregation_type.go b/jmsjavadownloads/java_download_count_aggregation_type.go index ae510c53d2..87a09219a2 100644 --- a/jmsjavadownloads/java_download_count_aggregation_type.go +++ b/jmsjavadownloads/java_download_count_aggregation_type.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_record.go b/jmsjavadownloads/java_download_record.go index 307948f788..9c9f9e32a1 100644 --- a/jmsjavadownloads/java_download_record.go +++ b/jmsjavadownloads/java_download_record.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -42,7 +42,7 @@ type JavaDownloadRecord struct { // The target Operating System architecture for the artifact. Architecture *string `mandatory:"false" json:"architecture"` - // The package type(typically the file extension) of the artifact. + // The package type (typically the file extension) of the artifact. PackageType *string `mandatory:"false" json:"packageType"` // Additional information about the package type. diff --git a/jmsjavadownloads/java_download_record_collection.go b/jmsjavadownloads/java_download_record_collection.go index 432936aa5e..c549896eca 100644 --- a/jmsjavadownloads/java_download_record_collection.go +++ b/jmsjavadownloads/java_download_record_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_record_sort_by.go b/jmsjavadownloads/java_download_record_sort_by.go index c2d999e127..624e6ca4cd 100644 --- a/jmsjavadownloads/java_download_record_sort_by.go +++ b/jmsjavadownloads/java_download_record_sort_by.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_record_summary.go b/jmsjavadownloads/java_download_record_summary.go index 61b9250d46..5e441ca778 100644 --- a/jmsjavadownloads/java_download_record_summary.go +++ b/jmsjavadownloads/java_download_record_summary.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -42,7 +42,7 @@ type JavaDownloadRecordSummary struct { // The target Operating System architecture for the artifact. Architecture *string `mandatory:"false" json:"architecture"` - // The package type(typically the file extension) of the artifact. + // The package type (typically the file extension) of the artifact. PackageType *string `mandatory:"false" json:"packageType"` // Additional information about the package type. diff --git a/jmsjavadownloads/java_download_report.go b/jmsjavadownloads/java_download_report.go index 98c2dc2aed..b8e2786189 100644 --- a/jmsjavadownloads/java_download_report.go +++ b/jmsjavadownloads/java_download_report.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -42,12 +42,24 @@ type JavaDownloadReport struct { CreatedBy *Principal `mandatory:"true" json:"createdBy"` - // The time the Java download report was created. An RFC3339 formatted datetime string. + // The time the Java download report was created, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The current state of the Java download report. LifecycleState LifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // The start time from when the download records are included (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeStart *common.SDKTime `mandatory:"false" json:"timeStart"` + + // The end time until when the download records are included (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` + + // The property used for sorting the records. + SortBy JavaDownloadRecordSortByEnum `mandatory:"false" json:"sortBy,omitempty"` + + // The sort order for the records. + SortOrder SortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}`. (See Managing Tags and Tag Namespaces (https://docs.cloud.oracle.com/Content/Tagging/Concepts/understandingfreeformtags.htm).) FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -82,6 +94,12 @@ func (m JavaDownloadReport) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingJavaDownloadRecordSortByEnum(string(m.SortBy)); !ok && m.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", m.SortBy, strings.Join(GetJavaDownloadRecordSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingSortOrderEnum(string(m.SortOrder)); !ok && m.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", m.SortOrder, strings.Join(GetSortOrderEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/jmsjavadownloads/java_download_report_collection.go b/jmsjavadownloads/java_download_report_collection.go index d292159104..4324fd334e 100644 --- a/jmsjavadownloads/java_download_report_collection.go +++ b/jmsjavadownloads/java_download_report_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_report_format.go b/jmsjavadownloads/java_download_report_format.go index 67e1212fbd..2f697fd275 100644 --- a/jmsjavadownloads/java_download_report_format.go +++ b/jmsjavadownloads/java_download_report_format.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_report_sort_by.go b/jmsjavadownloads/java_download_report_sort_by.go index c6a0f2791b..4613fa4cfa 100644 --- a/jmsjavadownloads/java_download_report_sort_by.go +++ b/jmsjavadownloads/java_download_report_sort_by.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_report_summary.go b/jmsjavadownloads/java_download_report_summary.go index 2219161e1e..887b654ece 100644 --- a/jmsjavadownloads/java_download_report_summary.go +++ b/jmsjavadownloads/java_download_report_summary.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -41,12 +41,24 @@ type JavaDownloadReportSummary struct { CreatedBy *Principal `mandatory:"true" json:"createdBy"` - // The time the Java download report was created. An RFC3339 formatted datetime string. + // The time the Java download report was created, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The current state of the Java download report. LifecycleState LifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + // The start time from when the download records are included (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeStart *common.SDKTime `mandatory:"false" json:"timeStart"` + + // The end time until when the download records are included (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + TimeEnd *common.SDKTime `mandatory:"false" json:"timeEnd"` + + // The property used for sorting the records. + SortBy JavaDownloadRecordSortByEnum `mandatory:"false" json:"sortBy,omitempty"` + + // The sort order for the records. + SortOrder SortOrderEnum `mandatory:"false" json:"sortOrder,omitempty"` + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}`. (See Managing Tags and Tag Namespaces (https://docs.cloud.oracle.com/Content/Tagging/Concepts/understandingfreeformtags.htm).) FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` @@ -81,6 +93,12 @@ func (m JavaDownloadReportSummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingJavaDownloadRecordSortByEnum(string(m.SortBy)); !ok && m.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", m.SortBy, strings.Join(GetJavaDownloadRecordSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingSortOrderEnum(string(m.SortOrder)); !ok && m.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", m.SortOrder, strings.Join(GetSortOrderEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/jmsjavadownloads/java_download_token.go b/jmsjavadownloads/java_download_token.go index 98968c7bfa..03c823675a 100644 --- a/jmsjavadownloads/java_download_token.go +++ b/jmsjavadownloads/java_download_token.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -35,10 +35,10 @@ type JavaDownloadToken struct { // Uniquely generated value for the JavaDownloadToken. Value *string `mandatory:"true" json:"value"` - // The time the JavaDownloadToken was created. An RFC3339 formatted datetime string. + // The time the JavaDownloadToken was created, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The expiry time of the JavaDownloadToken. An RFC3339 formatted datetime string. + // The expiry time of the JavaDownloadToken, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeExpires *common.SDKTime `mandatory:"true" json:"timeExpires"` // The associated Java version of the JavaDownloadToken. @@ -49,10 +49,10 @@ type JavaDownloadToken struct { LastUpdatedBy *Principal `mandatory:"false" json:"lastUpdatedBy"` - // The time the JavaDownloadToken was updated. An RFC3339 formatted datetime string. + // The time the JavaDownloadToken was updated, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The time the JavaDownloadToken was last used for download. An RFC3339 formatted datetime string. + // The time the JavaDownloadToken was last used for download, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeLastUsed *common.SDKTime `mandatory:"false" json:"timeLastUsed"` // The license type(s) associated with the JavaDownloadToken. diff --git a/jmsjavadownloads/java_download_token_collection.go b/jmsjavadownloads/java_download_token_collection.go index e1767221e9..b07ecb2faa 100644 --- a/jmsjavadownloads/java_download_token_collection.go +++ b/jmsjavadownloads/java_download_token_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_download_token_summary.go b/jmsjavadownloads/java_download_token_summary.go index 7b0bcaa95e..1591856f5a 100644 --- a/jmsjavadownloads/java_download_token_summary.go +++ b/jmsjavadownloads/java_download_token_summary.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -35,10 +35,10 @@ type JavaDownloadTokenSummary struct { // Uniquely generated value for the JavaDownloadToken. Value *string `mandatory:"true" json:"value"` - // The time the JavaDownloadToken was created. An RFC3339 formatted datetime string. + // The time the JavaDownloadToken was created, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The expiry time of the JavaDownloadToken. An RFC3339 formatted datetime string. + // The expiry time of the JavaDownloadToken, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeExpires *common.SDKTime `mandatory:"true" json:"timeExpires"` // The associated Java version of the JavaDownloadToken. @@ -49,10 +49,10 @@ type JavaDownloadTokenSummary struct { LastUpdatedBy *Principal `mandatory:"false" json:"lastUpdatedBy"` - // The time the JavaDownloadToken was updated. An RFC3339 formatted datetime string. + // The time the JavaDownloadToken was updated, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` - // The time the JavaDownloadToken was last used for download. An RFC3339 formatted datetime string. + // The time the JavaDownloadToken was last used for download, displayed as an RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339) formatted datetime string. TimeLastUsed *common.SDKTime `mandatory:"false" json:"timeLastUsed"` // The license type(s) associated with the JavaDownloadToken. diff --git a/jmsjavadownloads/java_license.go b/jmsjavadownloads/java_license.go index a214fcfeb5..97f0f62eb1 100644 --- a/jmsjavadownloads/java_license.go +++ b/jmsjavadownloads/java_license.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_license_acceptance_record.go b/jmsjavadownloads/java_license_acceptance_record.go index 649e45fb4f..c8f0797085 100644 --- a/jmsjavadownloads/java_license_acceptance_record.go +++ b/jmsjavadownloads/java_license_acceptance_record.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -32,12 +32,12 @@ type JavaLicenseAcceptanceRecord struct { CreatedBy *Principal `mandatory:"true" json:"createdBy"` - // The date and time of license acceptance(formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + // The date and time of license acceptance (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` LastUpdatedBy *Principal `mandatory:"false" json:"lastUpdatedBy"` - // The date and time of last update(formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + // The date and time of last update (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeLastUpdated *common.SDKTime `mandatory:"false" json:"timeLastUpdated"` // The current state of the JavaLicenseAcceptanceRecord. diff --git a/jmsjavadownloads/java_license_acceptance_record_collection.go b/jmsjavadownloads/java_license_acceptance_record_collection.go index 0f4f9c5b1e..7fa68264eb 100644 --- a/jmsjavadownloads/java_license_acceptance_record_collection.go +++ b/jmsjavadownloads/java_license_acceptance_record_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_license_acceptance_record_summary.go b/jmsjavadownloads/java_license_acceptance_record_summary.go index 2b652281bf..86f80a4380 100644 --- a/jmsjavadownloads/java_license_acceptance_record_summary.go +++ b/jmsjavadownloads/java_license_acceptance_record_summary.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -32,12 +32,12 @@ type JavaLicenseAcceptanceRecordSummary struct { CreatedBy *Principal `mandatory:"true" json:"createdBy"` - // The date and time of license acceptance(formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + // The date and time of license acceptance (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` LastUpdatedBy *Principal `mandatory:"false" json:"lastUpdatedBy"` - // The date and time of last update(formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). + // The date and time of last update (formatted according to RFC3339 (https://datatracker.ietf.org/doc/html/rfc3339)). TimeLastUpdated *common.SDKTime `mandatory:"false" json:"timeLastUpdated"` // The current state of the JavaLicenseAcceptanceRecord. diff --git a/jmsjavadownloads/java_license_collection.go b/jmsjavadownloads/java_license_collection.go index b87a7ca6a9..cfb3e67cbd 100644 --- a/jmsjavadownloads/java_license_collection.go +++ b/jmsjavadownloads/java_license_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/java_license_summary.go b/jmsjavadownloads/java_license_summary.go index 775e6cb696..b5795cf201 100644 --- a/jmsjavadownloads/java_license_summary.go +++ b/jmsjavadownloads/java_license_summary.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/jmsjavadownloads_javadownload_client.go b/jmsjavadownloads/jmsjavadownloads_javadownload_client.go index 3bfa2d590c..5cb443b98e 100644 --- a/jmsjavadownloads/jmsjavadownloads_javadownload_client.go +++ b/jmsjavadownloads/jmsjavadownloads_javadownload_client.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -214,6 +214,7 @@ func (client JavaDownloadClient) createJavaDownloadReport(ctx context.Context, r } // CreateJavaDownloadToken Creates a new JavaDownloadToken in the tenancy with specified attributes. +// Ensure that you review the license terms before token generation. Visit the Oracle Java Downloads page to understand the license terms of the Java version for which you are generating a token. By generating a token, you agree to the associated license terms. See Oracle JDK Licensing - FAQs for detailed information. // // # See also // diff --git a/jmsjavadownloads/license_acceptance_sort_by.go b/jmsjavadownloads/license_acceptance_sort_by.go index 8f38d47e7a..4766292896 100644 --- a/jmsjavadownloads/license_acceptance_sort_by.go +++ b/jmsjavadownloads/license_acceptance_sort_by.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/license_acceptance_status.go b/jmsjavadownloads/license_acceptance_status.go index 6d937c2df6..3ce37dd4c0 100644 --- a/jmsjavadownloads/license_acceptance_status.go +++ b/jmsjavadownloads/license_acceptance_status.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/license_sort_by.go b/jmsjavadownloads/license_sort_by.go index 523d94a388..243cd91cf0 100644 --- a/jmsjavadownloads/license_sort_by.go +++ b/jmsjavadownloads/license_sort_by.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/license_type.go b/jmsjavadownloads/license_type.go index 32ea91f3da..1e36d1001a 100644 --- a/jmsjavadownloads/license_type.go +++ b/jmsjavadownloads/license_type.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/lifecycle_state.go b/jmsjavadownloads/lifecycle_state.go index ea99598230..3bca713f1a 100644 --- a/jmsjavadownloads/lifecycle_state.go +++ b/jmsjavadownloads/lifecycle_state.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/operation_status.go b/jmsjavadownloads/operation_status.go index 31cdf3eb74..4ba324b35b 100644 --- a/jmsjavadownloads/operation_status.go +++ b/jmsjavadownloads/operation_status.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/operation_type.go b/jmsjavadownloads/operation_type.go index 4f8ceea718..ad29d65ffa 100644 --- a/jmsjavadownloads/operation_type.go +++ b/jmsjavadownloads/operation_type.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/principal.go b/jmsjavadownloads/principal.go index 07fded2d12..f11efeaf16 100644 --- a/jmsjavadownloads/principal.go +++ b/jmsjavadownloads/principal.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/request_summarized_java_download_counts_details.go b/jmsjavadownloads/request_summarized_java_download_counts_details.go index c52aa514b5..be563e09b0 100644 --- a/jmsjavadownloads/request_summarized_java_download_counts_details.go +++ b/jmsjavadownloads/request_summarized_java_download_counts_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -21,7 +21,7 @@ type RequestSummarizedJavaDownloadCountsDetails struct { // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) here should be the tenancy OCID. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Group as property specifying the aggregation type for download counts. + // The property that specifies the aggregation type for the download counts. GroupAs JavaDownloadCountAggregationTypeEnum `mandatory:"true" json:"groupAs"` // Unique Java family version identifier. diff --git a/jmsjavadownloads/sort_order.go b/jmsjavadownloads/sort_order.go index e3a3d9a565..0a9ccb024b 100644 --- a/jmsjavadownloads/sort_order.go +++ b/jmsjavadownloads/sort_order.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/token_lifecycle_details.go b/jmsjavadownloads/token_lifecycle_details.go index 3a942da162..cc2e1676f6 100644 --- a/jmsjavadownloads/token_lifecycle_details.go +++ b/jmsjavadownloads/token_lifecycle_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/token_sort_by.go b/jmsjavadownloads/token_sort_by.go index 32bd7cbc7f..9765a7cb91 100644 --- a/jmsjavadownloads/token_sort_by.go +++ b/jmsjavadownloads/token_sort_by.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/update_java_download_token_details.go b/jmsjavadownloads/update_java_download_token_details.go index 437c8f0312..543f774fc8 100644 --- a/jmsjavadownloads/update_java_download_token_details.go +++ b/jmsjavadownloads/update_java_download_token_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/update_java_license_acceptance_record_details.go b/jmsjavadownloads/update_java_license_acceptance_record_details.go index 8144d19fd2..711fb10543 100644 --- a/jmsjavadownloads/update_java_license_acceptance_record_details.go +++ b/jmsjavadownloads/update_java_license_acceptance_record_details.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads @@ -20,6 +20,14 @@ type UpdateJavaLicenseAcceptanceRecordDetails struct { // Status of license acceptance. LicenseAcceptanceStatus LicenseAcceptanceStatusEnum `mandatory:"true" json:"licenseAcceptanceStatus"` + + // Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}`. (See Managing Tags and Tag Namespaces (https://docs.cloud.oracle.com/Content/Tagging/Concepts/understandingfreeformtags.htm).) + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}`. (See Understanding Free-form Tags (https://docs.cloud.oracle.com/Content/Tagging/Tasks/managingtagsandtagnamespaces.htm)). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` } func (m UpdateJavaLicenseAcceptanceRecordDetails) String() string { diff --git a/jmsjavadownloads/work_request.go b/jmsjavadownloads/work_request.go index b2854bf102..2af760a38e 100644 --- a/jmsjavadownloads/work_request.go +++ b/jmsjavadownloads/work_request.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/work_request_error.go b/jmsjavadownloads/work_request_error.go index f1f089731e..845b3be9cb 100644 --- a/jmsjavadownloads/work_request_error.go +++ b/jmsjavadownloads/work_request_error.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/work_request_error_collection.go b/jmsjavadownloads/work_request_error_collection.go index ba8c520a45..38dc60700a 100644 --- a/jmsjavadownloads/work_request_error_collection.go +++ b/jmsjavadownloads/work_request_error_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/work_request_log_entry.go b/jmsjavadownloads/work_request_log_entry.go index e48fe7d34d..c8aa80f927 100644 --- a/jmsjavadownloads/work_request_log_entry.go +++ b/jmsjavadownloads/work_request_log_entry.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/work_request_log_entry_collection.go b/jmsjavadownloads/work_request_log_entry_collection.go index 57666ab7c3..6980d8cd5b 100644 --- a/jmsjavadownloads/work_request_log_entry_collection.go +++ b/jmsjavadownloads/work_request_log_entry_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/work_request_resource.go b/jmsjavadownloads/work_request_resource.go index c5ad514608..0aaba24de0 100644 --- a/jmsjavadownloads/work_request_resource.go +++ b/jmsjavadownloads/work_request_resource.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/work_request_summary.go b/jmsjavadownloads/work_request_summary.go index f8260cb085..d8a8daf921 100644 --- a/jmsjavadownloads/work_request_summary.go +++ b/jmsjavadownloads/work_request_summary.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/jmsjavadownloads/work_request_summary_collection.go b/jmsjavadownloads/work_request_summary_collection.go index 91e9dd656a..33edcd19a0 100644 --- a/jmsjavadownloads/work_request_summary_collection.go +++ b/jmsjavadownloads/work_request_summary_collection.go @@ -4,7 +4,7 @@ // Java Management Service Download API // -// The APIs for the download engine of the Java Management Service. +// The APIs for the Java Download feature of Java Management Service. // package jmsjavadownloads diff --git a/resourcescheduler/resourcescheduler_schedule_client.go b/resourcescheduler/resourcescheduler_schedule_client.go index f31adc1d67..7f3f9914e2 100644 --- a/resourcescheduler/resourcescheduler_schedule_client.go +++ b/resourcescheduler/resourcescheduler_schedule_client.go @@ -145,7 +145,7 @@ func (client ScheduleClient) activateSchedule(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/Schedule/ActivateSchedule" err = common.PostProcessServiceError(err, "Schedule", "ActivateSchedule", apiReferenceLink) return response, err } @@ -203,7 +203,7 @@ func (client ScheduleClient) cancelWorkRequest(ctx context.Context, request comm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/WorkRequest/CancelWorkRequest" err = common.PostProcessServiceError(err, "Schedule", "CancelWorkRequest", apiReferenceLink) return response, err } @@ -266,7 +266,7 @@ func (client ScheduleClient) createSchedule(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/Schedule/CreateSchedule" err = common.PostProcessServiceError(err, "Schedule", "CreateSchedule", apiReferenceLink) return response, err } @@ -329,7 +329,7 @@ func (client ScheduleClient) deactivateSchedule(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/Schedule/DeactivateSchedule" err = common.PostProcessServiceError(err, "Schedule", "DeactivateSchedule", apiReferenceLink) return response, err } @@ -387,7 +387,7 @@ func (client ScheduleClient) deleteSchedule(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/Schedule/DeleteSchedule" err = common.PostProcessServiceError(err, "Schedule", "DeleteSchedule", apiReferenceLink) return response, err } @@ -445,7 +445,7 @@ func (client ScheduleClient) getSchedule(ctx context.Context, request common.OCI defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/Schedule/GetSchedule" err = common.PostProcessServiceError(err, "Schedule", "GetSchedule", apiReferenceLink) return response, err } @@ -503,7 +503,7 @@ func (client ScheduleClient) getWorkRequest(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/WorkRequest/GetWorkRequest" err = common.PostProcessServiceError(err, "Schedule", "GetWorkRequest", apiReferenceLink) return response, err } @@ -561,7 +561,7 @@ func (client ScheduleClient) listResourceTypes(ctx context.Context, request comm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/ResourceTypeCollection/ListResourceTypes" err = common.PostProcessServiceError(err, "Schedule", "ListResourceTypes", apiReferenceLink) return response, err } @@ -619,7 +619,7 @@ func (client ScheduleClient) listSchedules(ctx context.Context, request common.O defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/Schedule/ListSchedules" err = common.PostProcessServiceError(err, "Schedule", "ListSchedules", apiReferenceLink) return response, err } @@ -677,7 +677,7 @@ func (client ScheduleClient) listWorkRequestErrors(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/WorkRequestError/ListWorkRequestErrors" err = common.PostProcessServiceError(err, "Schedule", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -735,7 +735,7 @@ func (client ScheduleClient) listWorkRequestLogs(ctx context.Context, request co defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/WorkRequestLogEntry/ListWorkRequestLogs" err = common.PostProcessServiceError(err, "Schedule", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -793,7 +793,7 @@ func (client ScheduleClient) listWorkRequests(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/WorkRequest/ListWorkRequests" err = common.PostProcessServiceError(err, "Schedule", "ListWorkRequests", apiReferenceLink) return response, err } @@ -851,7 +851,7 @@ func (client ScheduleClient) updateSchedule(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/resource-scheduler/20240430/Schedule/UpdateSchedule" err = common.PostProcessServiceError(err, "Schedule", "UpdateSchedule", apiReferenceLink) return response, err }