diff --git a/CHANGELOG.md b/CHANGELOG.md index 84fadf82fc..e4e8eed604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.73.0 - 2024-08-27 +### Added +- Support for Delegate Access Control service +- Support for upgrade and downgrade of shapes of high performance mount targets in the File Storage service +- Support for private endpoints in the Object Storage service +- Support for create, update, list and delete operations on scheduling policies and scheduling windows in the Database service +- Support for specifying domains while creating data guard associations in the Database service +- Support for provision of developer autonomous databases in the Database service +- Support for upgrade of developer autonomous databases to paid autonomous databases in the Database service +- Support for scheduling plans, actions, execution windows and execution actions for maintenance scheduling in the Database service +- Support for cross-region replication of virtual vaults in the Key Management service +- Support for listing all active service summaries in the Announcements service +- Support for VMware major and minor version upgrades in VMware Solution service +- Support for updating protected database subscriptions in the Autonomous Recovery service +- Support for health insurance id as an allowed document type in the Document Understanding service +- Support for advanced database management features for autonomous databases in the Database Management service +- Support for propagating request ids to load balancer servers in the Load balancer service +- Support for automatic update orders in Fusion Application as a Service + +### Breaking Changes +- Constant `DocumentTypeInsuranceClaim` was renamed to `DocumentTypeHealthInsuranceId` in models `AnalyzeDocumentDetails` and `GeneralProcessorConfig` in the Document Understanding service +- Property `DocumentId` was removed from model `DetectedDocumentType` in the Document Understanding service +- Property `TenancyId` was removed from models `DocumentClassificationFeature` and `DocumentKeyValueExtractionFeature` in the Document Understanding service + ## 65.72.0 - 2024-08-20 ### Added - Support for Fleet Application Management service diff --git a/Makefile b/Makefile index 334b0501cd..2123b28a7c 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 demandsignal fleetappsmanagement ##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 fleetappsmanagement delegateaccesscontrol ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/aidocument/add_model_lock_details.go b/aidocument/add_model_lock_details.go new file mode 100644 index 0000000000..cffc37709f --- /dev/null +++ b/aidocument/add_model_lock_details.go @@ -0,0 +1,90 @@ +// 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. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddModelLockDetails Request payload to add lock to the resource. +type AddModelLockDetails struct { + + // Type of the lock. + Type AddModelLockDetailsTypeEnum `mandatory:"true" json:"type"` + + // The ID of the resource that is locking this resource. Indicates that deleting this resource will remove the lock. + RelatedResourceId *string `mandatory:"false" json:"relatedResourceId"` + + // A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked. + Message *string `mandatory:"false" json:"message"` +} + +func (m AddModelLockDetails) 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 AddModelLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAddModelLockDetailsTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAddModelLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddModelLockDetailsTypeEnum Enum with underlying type: string +type AddModelLockDetailsTypeEnum string + +// Set of constants representing the allowable values for AddModelLockDetailsTypeEnum +const ( + AddModelLockDetailsTypeFull AddModelLockDetailsTypeEnum = "FULL" + AddModelLockDetailsTypeDelete AddModelLockDetailsTypeEnum = "DELETE" +) + +var mappingAddModelLockDetailsTypeEnum = map[string]AddModelLockDetailsTypeEnum{ + "FULL": AddModelLockDetailsTypeFull, + "DELETE": AddModelLockDetailsTypeDelete, +} + +var mappingAddModelLockDetailsTypeEnumLowerCase = map[string]AddModelLockDetailsTypeEnum{ + "full": AddModelLockDetailsTypeFull, + "delete": AddModelLockDetailsTypeDelete, +} + +// GetAddModelLockDetailsTypeEnumValues Enumerates the set of values for AddModelLockDetailsTypeEnum +func GetAddModelLockDetailsTypeEnumValues() []AddModelLockDetailsTypeEnum { + values := make([]AddModelLockDetailsTypeEnum, 0) + for _, v := range mappingAddModelLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetAddModelLockDetailsTypeEnumStringValues Enumerates the set of values in String for AddModelLockDetailsTypeEnum +func GetAddModelLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingAddModelLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAddModelLockDetailsTypeEnum(val string) (AddModelLockDetailsTypeEnum, bool) { + enum, ok := mappingAddModelLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/add_model_lock_request_response.go b/aidocument/add_model_lock_request_response.go new file mode 100644 index 0000000000..2be06a22fd --- /dev/null +++ b/aidocument/add_model_lock_request_response.go @@ -0,0 +1,113 @@ +// 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 aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddModelLockRequest wrapper for the AddModelLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/AddModelLock.go.html to see an example of how to use AddModelLockRequest. +type AddModelLockRequest struct { + + // A unique model identifier. + ModelId *string `mandatory:"true" contributesTo:"path" name:"modelId"` + + // Request payload to add lock to the resource. + AddModelLockDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without the risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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"` + + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + + // 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 AddModelLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddModelLockRequest) 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 AddModelLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddModelLockRequest) 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 AddModelLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddModelLockResponse wrapper for the AddModelLock operation +type AddModelLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Model instance + Model `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response AddModelLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddModelLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/aidocument/add_project_lock_details.go b/aidocument/add_project_lock_details.go new file mode 100644 index 0000000000..dc8a985114 --- /dev/null +++ b/aidocument/add_project_lock_details.go @@ -0,0 +1,90 @@ +// 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. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddProjectLockDetails Request payload to add lock to the resource. +type AddProjectLockDetails struct { + + // Type of the lock. + Type AddProjectLockDetailsTypeEnum `mandatory:"true" json:"type"` + + // The ID of the resource that is locking this resource. Indicates that deleting this resource will remove the lock. + RelatedResourceId *string `mandatory:"false" json:"relatedResourceId"` + + // A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked. + Message *string `mandatory:"false" json:"message"` +} + +func (m AddProjectLockDetails) 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 AddProjectLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAddProjectLockDetailsTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAddProjectLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddProjectLockDetailsTypeEnum Enum with underlying type: string +type AddProjectLockDetailsTypeEnum string + +// Set of constants representing the allowable values for AddProjectLockDetailsTypeEnum +const ( + AddProjectLockDetailsTypeFull AddProjectLockDetailsTypeEnum = "FULL" + AddProjectLockDetailsTypeDelete AddProjectLockDetailsTypeEnum = "DELETE" +) + +var mappingAddProjectLockDetailsTypeEnum = map[string]AddProjectLockDetailsTypeEnum{ + "FULL": AddProjectLockDetailsTypeFull, + "DELETE": AddProjectLockDetailsTypeDelete, +} + +var mappingAddProjectLockDetailsTypeEnumLowerCase = map[string]AddProjectLockDetailsTypeEnum{ + "full": AddProjectLockDetailsTypeFull, + "delete": AddProjectLockDetailsTypeDelete, +} + +// GetAddProjectLockDetailsTypeEnumValues Enumerates the set of values for AddProjectLockDetailsTypeEnum +func GetAddProjectLockDetailsTypeEnumValues() []AddProjectLockDetailsTypeEnum { + values := make([]AddProjectLockDetailsTypeEnum, 0) + for _, v := range mappingAddProjectLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetAddProjectLockDetailsTypeEnumStringValues Enumerates the set of values in String for AddProjectLockDetailsTypeEnum +func GetAddProjectLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingAddProjectLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAddProjectLockDetailsTypeEnum(val string) (AddProjectLockDetailsTypeEnum, bool) { + enum, ok := mappingAddProjectLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/add_project_lock_request_response.go b/aidocument/add_project_lock_request_response.go new file mode 100644 index 0000000000..d54aee87f2 --- /dev/null +++ b/aidocument/add_project_lock_request_response.go @@ -0,0 +1,113 @@ +// 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 aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddProjectLockRequest wrapper for the AddProjectLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/AddProjectLock.go.html to see an example of how to use AddProjectLockRequest. +type AddProjectLockRequest struct { + + // A unique project identifier. + ProjectId *string `mandatory:"true" contributesTo:"path" name:"projectId"` + + // Request payload to add lock to the resource. + AddProjectLockDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without the risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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"` + + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + + // 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 AddProjectLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddProjectLockRequest) 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 AddProjectLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddProjectLockRequest) 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 AddProjectLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddProjectLockResponse wrapper for the AddProjectLock operation +type AddProjectLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Project instance + Project `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response AddProjectLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddProjectLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/aidocument/aidocument_aiservicedocument_client.go b/aidocument/aidocument_aiservicedocument_client.go index e1d1ca8bcc..3bd8ea81db 100644 --- a/aidocument/aidocument_aiservicedocument_client.go +++ b/aidocument/aidocument_aiservicedocument_client.go @@ -91,6 +91,132 @@ func (client *AIServiceDocumentClient) ConfigurationProvider() *common.Configura return client.config } +// AddModelLock Adds a lock to a resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/AddModelLock.go.html to see an example of how to use AddModelLock API. +// A default retry strategy applies to this operation AddModelLock() +func (client AIServiceDocumentClient) AddModelLock(ctx context.Context, request AddModelLockRequest) (response AddModelLockResponse, 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.addModelLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddModelLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddModelLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddModelLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddModelLockResponse") + } + return +} + +// addModelLock implements the OCIOperation interface (enables retrying operations) +func (client AIServiceDocumentClient) addModelLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/models/{modelId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddModelLockResponse + 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/document-understanding/20221109/Model/AddModelLock" + err = common.PostProcessServiceError(err, "AIServiceDocument", "AddModelLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// AddProjectLock Adds a lock to a resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/AddProjectLock.go.html to see an example of how to use AddProjectLock API. +// A default retry strategy applies to this operation AddProjectLock() +func (client AIServiceDocumentClient) AddProjectLock(ctx context.Context, request AddProjectLockRequest) (response AddProjectLockResponse, 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.addProjectLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddProjectLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddProjectLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddProjectLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddProjectLockResponse") + } + return +} + +// addProjectLock implements the OCIOperation interface (enables retrying operations) +func (client AIServiceDocumentClient) addProjectLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/projects/{projectId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddProjectLockResponse + 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/document-understanding/20221109/Project/AddProjectLock" + err = common.PostProcessServiceError(err, "AIServiceDocument", "AddProjectLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // AnalyzeDocument Perform different types of document analysis. // // # See also @@ -1259,6 +1385,132 @@ func (client AIServiceDocumentClient) patchModel(ctx context.Context, request co return response, err } +// RemoveModelLock Remove a lock from a resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/RemoveModelLock.go.html to see an example of how to use RemoveModelLock API. +// A default retry strategy applies to this operation RemoveModelLock() +func (client AIServiceDocumentClient) RemoveModelLock(ctx context.Context, request RemoveModelLockRequest) (response RemoveModelLockResponse, 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.removeModelLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveModelLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveModelLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveModelLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveModelLockResponse") + } + return +} + +// removeModelLock implements the OCIOperation interface (enables retrying operations) +func (client AIServiceDocumentClient) removeModelLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/models/{modelId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveModelLockResponse + 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/document-understanding/20221109/Model/RemoveModelLock" + err = common.PostProcessServiceError(err, "AIServiceDocument", "RemoveModelLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveProjectLock Remove a lock from a resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/RemoveProjectLock.go.html to see an example of how to use RemoveProjectLock API. +// A default retry strategy applies to this operation RemoveProjectLock() +func (client AIServiceDocumentClient) RemoveProjectLock(ctx context.Context, request RemoveProjectLockRequest) (response RemoveProjectLockResponse, 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.removeProjectLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveProjectLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveProjectLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveProjectLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveProjectLockResponse") + } + return +} + +// removeProjectLock implements the OCIOperation interface (enables retrying operations) +func (client AIServiceDocumentClient) removeProjectLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/projects/{projectId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveProjectLockResponse + 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/document-understanding/20221109/Project/RemoveProjectLock" + err = common.PostProcessServiceError(err, "AIServiceDocument", "RemoveProjectLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateModel Updates the model metadata. // // # See also diff --git a/aidocument/change_model_compartment_request_response.go b/aidocument/change_model_compartment_request_response.go index 423110134b..de24ba23f0 100644 --- a/aidocument/change_model_compartment_request_response.go +++ b/aidocument/change_model_compartment_request_response.go @@ -34,6 +34,9 @@ type ChangeModelCompartmentRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/aidocument/change_project_compartment_request_response.go b/aidocument/change_project_compartment_request_response.go index 2be5031d5b..9a9606af39 100644 --- a/aidocument/change_project_compartment_request_response.go +++ b/aidocument/change_project_compartment_request_response.go @@ -34,6 +34,9 @@ type ChangeProjectCompartmentRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/aidocument/delete_model_request_response.go b/aidocument/delete_model_request_response.go index 87945f74ec..c07c0173ac 100644 --- a/aidocument/delete_model_request_response.go +++ b/aidocument/delete_model_request_response.go @@ -31,6 +31,9 @@ type DeleteModelRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/aidocument/delete_project_request_response.go b/aidocument/delete_project_request_response.go index c25acafef8..eeb6a954b1 100644 --- a/aidocument/delete_project_request_response.go +++ b/aidocument/delete_project_request_response.go @@ -31,6 +31,9 @@ type DeleteProjectRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/aidocument/detected_document_type.go b/aidocument/detected_document_type.go index 32f5855507..31c85ffb48 100644 --- a/aidocument/detected_document_type.go +++ b/aidocument/detected_document_type.go @@ -23,9 +23,6 @@ type DetectedDocumentType struct { // The confidence score between 0 and 1. Confidence *float32 `mandatory:"true" json:"confidence"` - - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Key-Value Extraction model that was used to extract the key-value pairs. - DocumentId *string `mandatory:"false" json:"documentId"` } func (m DetectedDocumentType) String() string { diff --git a/aidocument/document_classification_feature.go b/aidocument/document_classification_feature.go index 1b5da9e685..8c6123b1da 100644 --- a/aidocument/document_classification_feature.go +++ b/aidocument/document_classification_feature.go @@ -24,9 +24,6 @@ type DocumentClassificationFeature struct { // The custom model ID. ModelId *string `mandatory:"false" json:"modelId"` - - // The custom model tenancy ID when modelId represents aliasName. - TenancyId *string `mandatory:"false" json:"tenancyId"` } func (m DocumentClassificationFeature) String() string { diff --git a/aidocument/document_key_value_extraction_feature.go b/aidocument/document_key_value_extraction_feature.go index 0a75547cde..78de2c6637 100644 --- a/aidocument/document_key_value_extraction_feature.go +++ b/aidocument/document_key_value_extraction_feature.go @@ -21,9 +21,6 @@ type DocumentKeyValueExtractionFeature struct { // The custom model ID. ModelId *string `mandatory:"false" json:"modelId"` - - // The custom model tenancy ID when modelId represents aliasName. - TenancyId *string `mandatory:"false" json:"tenancyId"` } func (m DocumentKeyValueExtractionFeature) String() string { diff --git a/aidocument/document_type.go b/aidocument/document_type.go index 626a2d3ccc..9deacef841 100644 --- a/aidocument/document_type.go +++ b/aidocument/document_type.go @@ -18,45 +18,45 @@ type DocumentTypeEnum string // Set of constants representing the allowable values for DocumentTypeEnum const ( - DocumentTypeInvoice DocumentTypeEnum = "INVOICE" - DocumentTypeReceipt DocumentTypeEnum = "RECEIPT" - DocumentTypeResume DocumentTypeEnum = "RESUME" - DocumentTypeTaxForm DocumentTypeEnum = "TAX_FORM" - DocumentTypeDriverLicense DocumentTypeEnum = "DRIVER_LICENSE" - DocumentTypePassport DocumentTypeEnum = "PASSPORT" - DocumentTypeBankStatement DocumentTypeEnum = "BANK_STATEMENT" - DocumentTypeCheck DocumentTypeEnum = "CHECK" - DocumentTypePayslip DocumentTypeEnum = "PAYSLIP" - DocumentTypeOthers DocumentTypeEnum = "OTHERS" - DocumentTypeInsuranceClaim DocumentTypeEnum = "INSURANCE_CLAIM" + DocumentTypeInvoice DocumentTypeEnum = "INVOICE" + DocumentTypeReceipt DocumentTypeEnum = "RECEIPT" + DocumentTypeResume DocumentTypeEnum = "RESUME" + DocumentTypeTaxForm DocumentTypeEnum = "TAX_FORM" + DocumentTypeDriverLicense DocumentTypeEnum = "DRIVER_LICENSE" + DocumentTypePassport DocumentTypeEnum = "PASSPORT" + DocumentTypeBankStatement DocumentTypeEnum = "BANK_STATEMENT" + DocumentTypeCheck DocumentTypeEnum = "CHECK" + DocumentTypePayslip DocumentTypeEnum = "PAYSLIP" + DocumentTypeOthers DocumentTypeEnum = "OTHERS" + DocumentTypeHealthInsuranceId DocumentTypeEnum = "HEALTH_INSURANCE_ID" ) var mappingDocumentTypeEnum = map[string]DocumentTypeEnum{ - "INVOICE": DocumentTypeInvoice, - "RECEIPT": DocumentTypeReceipt, - "RESUME": DocumentTypeResume, - "TAX_FORM": DocumentTypeTaxForm, - "DRIVER_LICENSE": DocumentTypeDriverLicense, - "PASSPORT": DocumentTypePassport, - "BANK_STATEMENT": DocumentTypeBankStatement, - "CHECK": DocumentTypeCheck, - "PAYSLIP": DocumentTypePayslip, - "OTHERS": DocumentTypeOthers, - "INSURANCE_CLAIM": DocumentTypeInsuranceClaim, + "INVOICE": DocumentTypeInvoice, + "RECEIPT": DocumentTypeReceipt, + "RESUME": DocumentTypeResume, + "TAX_FORM": DocumentTypeTaxForm, + "DRIVER_LICENSE": DocumentTypeDriverLicense, + "PASSPORT": DocumentTypePassport, + "BANK_STATEMENT": DocumentTypeBankStatement, + "CHECK": DocumentTypeCheck, + "PAYSLIP": DocumentTypePayslip, + "OTHERS": DocumentTypeOthers, + "HEALTH_INSURANCE_ID": DocumentTypeHealthInsuranceId, } var mappingDocumentTypeEnumLowerCase = map[string]DocumentTypeEnum{ - "invoice": DocumentTypeInvoice, - "receipt": DocumentTypeReceipt, - "resume": DocumentTypeResume, - "tax_form": DocumentTypeTaxForm, - "driver_license": DocumentTypeDriverLicense, - "passport": DocumentTypePassport, - "bank_statement": DocumentTypeBankStatement, - "check": DocumentTypeCheck, - "payslip": DocumentTypePayslip, - "others": DocumentTypeOthers, - "insurance_claim": DocumentTypeInsuranceClaim, + "invoice": DocumentTypeInvoice, + "receipt": DocumentTypeReceipt, + "resume": DocumentTypeResume, + "tax_form": DocumentTypeTaxForm, + "driver_license": DocumentTypeDriverLicense, + "passport": DocumentTypePassport, + "bank_statement": DocumentTypeBankStatement, + "check": DocumentTypeCheck, + "payslip": DocumentTypePayslip, + "others": DocumentTypeOthers, + "health_insurance_id": DocumentTypeHealthInsuranceId, } // GetDocumentTypeEnumValues Enumerates the set of values for DocumentTypeEnum @@ -81,7 +81,7 @@ func GetDocumentTypeEnumStringValues() []string { "CHECK", "PAYSLIP", "OTHERS", - "INSURANCE_CLAIM", + "HEALTH_INSURANCE_ID", } } diff --git a/aidocument/model.go b/aidocument/model.go index 5ec5d8dfec..1c60ed2b7e 100644 --- a/aidocument/model.go +++ b/aidocument/model.go @@ -95,6 +95,9 @@ type Model struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // For example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m Model) String() string { @@ -141,6 +144,7 @@ func (m *Model) UnmarshalJSON(data []byte) (e error) { FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` SystemTags map[string]map[string]interface{} `json:"systemTags"` + Locks []ResourceLock `json:"locks"` Id *string `json:"id"` CompartmentId *string `json:"compartmentId"` ModelType ModelModelTypeEnum `json:"modelType"` @@ -225,6 +229,8 @@ func (m *Model) UnmarshalJSON(data []byte) (e error) { m.SystemTags = model.SystemTags + m.Locks = make([]ResourceLock, len(model.Locks)) + copy(m.Locks, model.Locks) m.Id = model.Id m.CompartmentId = model.CompartmentId diff --git a/aidocument/model_summary.go b/aidocument/model_summary.go index ec724668f6..4123dffd69 100644 --- a/aidocument/model_summary.go +++ b/aidocument/model_summary.go @@ -84,6 +84,9 @@ type ModelSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // For example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m ModelSummary) String() string { @@ -126,6 +129,7 @@ func (m *ModelSummary) UnmarshalJSON(data []byte) (e error) { FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` SystemTags map[string]map[string]interface{} `json:"systemTags"` + Locks []ResourceLock `json:"locks"` Id *string `json:"id"` CompartmentId *string `json:"compartmentId"` ModelType ModelModelTypeEnum `json:"modelType"` @@ -194,6 +198,8 @@ func (m *ModelSummary) UnmarshalJSON(data []byte) (e error) { m.SystemTags = model.SystemTags + m.Locks = make([]ResourceLock, len(model.Locks)) + copy(m.Locks, model.Locks) m.Id = model.Id m.CompartmentId = model.CompartmentId diff --git a/aidocument/output_location.go b/aidocument/output_location.go index a54e6c8a9f..fe1823bc4c 100644 --- a/aidocument/output_location.go +++ b/aidocument/output_location.go @@ -15,7 +15,7 @@ import ( "strings" ) -// OutputLocation The object storage location where to store analysis results. +// OutputLocation The Object Storage Location. type OutputLocation struct { // The Object Storage namespace. diff --git a/aidocument/project.go b/aidocument/project.go index e02fc8e8b5..b9fb20c38f 100644 --- a/aidocument/project.go +++ b/aidocument/project.go @@ -53,6 +53,9 @@ type Project struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // For example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m Project) String() string { diff --git a/aidocument/remove_model_lock_details.go b/aidocument/remove_model_lock_details.go new file mode 100644 index 0000000000..a128967cd7 --- /dev/null +++ b/aidocument/remove_model_lock_details.go @@ -0,0 +1,84 @@ +// 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. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveModelLockDetails Request payload to remove lock to the resource. +type RemoveModelLockDetails struct { + + // Type of the lock. + Type RemoveModelLockDetailsTypeEnum `mandatory:"true" json:"type"` +} + +func (m RemoveModelLockDetails) 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 RemoveModelLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRemoveModelLockDetailsTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetRemoveModelLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveModelLockDetailsTypeEnum Enum with underlying type: string +type RemoveModelLockDetailsTypeEnum string + +// Set of constants representing the allowable values for RemoveModelLockDetailsTypeEnum +const ( + RemoveModelLockDetailsTypeFull RemoveModelLockDetailsTypeEnum = "FULL" + RemoveModelLockDetailsTypeDelete RemoveModelLockDetailsTypeEnum = "DELETE" +) + +var mappingRemoveModelLockDetailsTypeEnum = map[string]RemoveModelLockDetailsTypeEnum{ + "FULL": RemoveModelLockDetailsTypeFull, + "DELETE": RemoveModelLockDetailsTypeDelete, +} + +var mappingRemoveModelLockDetailsTypeEnumLowerCase = map[string]RemoveModelLockDetailsTypeEnum{ + "full": RemoveModelLockDetailsTypeFull, + "delete": RemoveModelLockDetailsTypeDelete, +} + +// GetRemoveModelLockDetailsTypeEnumValues Enumerates the set of values for RemoveModelLockDetailsTypeEnum +func GetRemoveModelLockDetailsTypeEnumValues() []RemoveModelLockDetailsTypeEnum { + values := make([]RemoveModelLockDetailsTypeEnum, 0) + for _, v := range mappingRemoveModelLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetRemoveModelLockDetailsTypeEnumStringValues Enumerates the set of values in String for RemoveModelLockDetailsTypeEnum +func GetRemoveModelLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingRemoveModelLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRemoveModelLockDetailsTypeEnum(val string) (RemoveModelLockDetailsTypeEnum, bool) { + enum, ok := mappingRemoveModelLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/remove_model_lock_request_response.go b/aidocument/remove_model_lock_request_response.go new file mode 100644 index 0000000000..89cae6f5d4 --- /dev/null +++ b/aidocument/remove_model_lock_request_response.go @@ -0,0 +1,113 @@ +// 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 aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveModelLockRequest wrapper for the RemoveModelLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/RemoveModelLock.go.html to see an example of how to use RemoveModelLockRequest. +type RemoveModelLockRequest struct { + + // A unique model identifier. + ModelId *string `mandatory:"true" contributesTo:"path" name:"modelId"` + + // Request payload to remove lock to the resource. + RemoveModelLockDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without the risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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"` + + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + + // 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 RemoveModelLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveModelLockRequest) 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 RemoveModelLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveModelLockRequest) 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 RemoveModelLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveModelLockResponse wrapper for the RemoveModelLock operation +type RemoveModelLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Model instance + Model `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RemoveModelLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveModelLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/aidocument/remove_project_lock_details.go b/aidocument/remove_project_lock_details.go new file mode 100644 index 0000000000..1cc31f75ff --- /dev/null +++ b/aidocument/remove_project_lock_details.go @@ -0,0 +1,84 @@ +// 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. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveProjectLockDetails Request payload to remove lock to the resource. +type RemoveProjectLockDetails struct { + + // Type of the lock. + Type RemoveProjectLockDetailsTypeEnum `mandatory:"true" json:"type"` +} + +func (m RemoveProjectLockDetails) 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 RemoveProjectLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRemoveProjectLockDetailsTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetRemoveProjectLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveProjectLockDetailsTypeEnum Enum with underlying type: string +type RemoveProjectLockDetailsTypeEnum string + +// Set of constants representing the allowable values for RemoveProjectLockDetailsTypeEnum +const ( + RemoveProjectLockDetailsTypeFull RemoveProjectLockDetailsTypeEnum = "FULL" + RemoveProjectLockDetailsTypeDelete RemoveProjectLockDetailsTypeEnum = "DELETE" +) + +var mappingRemoveProjectLockDetailsTypeEnum = map[string]RemoveProjectLockDetailsTypeEnum{ + "FULL": RemoveProjectLockDetailsTypeFull, + "DELETE": RemoveProjectLockDetailsTypeDelete, +} + +var mappingRemoveProjectLockDetailsTypeEnumLowerCase = map[string]RemoveProjectLockDetailsTypeEnum{ + "full": RemoveProjectLockDetailsTypeFull, + "delete": RemoveProjectLockDetailsTypeDelete, +} + +// GetRemoveProjectLockDetailsTypeEnumValues Enumerates the set of values for RemoveProjectLockDetailsTypeEnum +func GetRemoveProjectLockDetailsTypeEnumValues() []RemoveProjectLockDetailsTypeEnum { + values := make([]RemoveProjectLockDetailsTypeEnum, 0) + for _, v := range mappingRemoveProjectLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetRemoveProjectLockDetailsTypeEnumStringValues Enumerates the set of values in String for RemoveProjectLockDetailsTypeEnum +func GetRemoveProjectLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingRemoveProjectLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRemoveProjectLockDetailsTypeEnum(val string) (RemoveProjectLockDetailsTypeEnum, bool) { + enum, ok := mappingRemoveProjectLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/remove_project_lock_request_response.go b/aidocument/remove_project_lock_request_response.go new file mode 100644 index 0000000000..642b2c7354 --- /dev/null +++ b/aidocument/remove_project_lock_request_response.go @@ -0,0 +1,113 @@ +// 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 aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveProjectLockRequest wrapper for the RemoveProjectLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/aidocument/RemoveProjectLock.go.html to see an example of how to use RemoveProjectLockRequest. +type RemoveProjectLockRequest struct { + + // A unique project identifier. + ProjectId *string `mandatory:"true" contributesTo:"path" name:"projectId"` + + // Request payload to remove lock to the resource. + RemoveProjectLockDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without the risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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"` + + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + + // 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 RemoveProjectLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveProjectLockRequest) 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 RemoveProjectLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveProjectLockRequest) 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 RemoveProjectLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveProjectLockResponse wrapper for the RemoveProjectLock operation +type RemoveProjectLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Project instance + Project `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // A unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response RemoveProjectLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveProjectLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/aidocument/resource_lock.go b/aidocument/resource_lock.go new file mode 100644 index 0000000000..68a597a97d --- /dev/null +++ b/aidocument/resource_lock.go @@ -0,0 +1,99 @@ +// 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. + +// Document Understanding API +// +// Document AI helps customers perform various analysis on their documents. If a customer has lots of documents, they can process them in batch using asynchronous API endpoints. +// + +package aidocument + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceLock Resource locks prevent certain APIs from being called for the resource. +// A full lock prevents both updating and deleting the resource. A lock delete +// prevents deleting the resource. +type ResourceLock struct { + + // Lock type. + Type ResourceLockTypeEnum `mandatory:"true" json:"type"` + + // The lock compartment ID. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resource ID that is locking this resource. Indicates that deleting this resource removes the lock. + RelatedResourceId *string `mandatory:"false" json:"relatedResourceId"` + + // A message added by the lock creator. The message typically gives an + // indication of why the resource is locked. + Message *string `mandatory:"false" json:"message"` + + // Indicates when the lock was created, in the format defined by RFC 3339. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m ResourceLock) 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 ResourceLock) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceLockTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetResourceLockTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceLockTypeEnum Enum with underlying type: string +type ResourceLockTypeEnum string + +// Set of constants representing the allowable values for ResourceLockTypeEnum +const ( + ResourceLockTypeFull ResourceLockTypeEnum = "FULL" + ResourceLockTypeDelete ResourceLockTypeEnum = "DELETE" +) + +var mappingResourceLockTypeEnum = map[string]ResourceLockTypeEnum{ + "FULL": ResourceLockTypeFull, + "DELETE": ResourceLockTypeDelete, +} + +var mappingResourceLockTypeEnumLowerCase = map[string]ResourceLockTypeEnum{ + "full": ResourceLockTypeFull, + "delete": ResourceLockTypeDelete, +} + +// GetResourceLockTypeEnumValues Enumerates the set of values for ResourceLockTypeEnum +func GetResourceLockTypeEnumValues() []ResourceLockTypeEnum { + values := make([]ResourceLockTypeEnum, 0) + for _, v := range mappingResourceLockTypeEnum { + values = append(values, v) + } + return values +} + +// GetResourceLockTypeEnumStringValues Enumerates the set of values in String for ResourceLockTypeEnum +func GetResourceLockTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingResourceLockTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceLockTypeEnum(val string) (ResourceLockTypeEnum, bool) { + enum, ok := mappingResourceLockTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/aidocument/update_model_request_response.go b/aidocument/update_model_request_response.go index 28420b5860..ae761a5c26 100644 --- a/aidocument/update_model_request_response.go +++ b/aidocument/update_model_request_response.go @@ -34,6 +34,9 @@ type UpdateModelRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/aidocument/update_project_request_response.go b/aidocument/update_project_request_response.go index 6d82451aa0..059c864851 100644 --- a/aidocument/update_project_request_response.go +++ b/aidocument/update_project_request_response.go @@ -34,6 +34,9 @@ type UpdateProjectRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/announcementsservice/announcement_compartment.go b/announcementsservice/announcement_compartment.go new file mode 100644 index 0000000000..bff3657fe5 --- /dev/null +++ b/announcementsservice/announcement_compartment.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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AnnouncementCompartment Compartment details of an announcement. +type AnnouncementCompartment struct { + + // The OCID of the compartment to which the announcement belongs to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m AnnouncementCompartment) 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 AnnouncementCompartment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/announcementsservice/announcementsservice_announcement_client.go b/announcementsservice/announcementsservice_announcement_client.go index 7f7dfdac31..0216838c76 100644 --- a/announcementsservice/announcementsservice_announcement_client.go +++ b/announcementsservice/announcementsservice_announcement_client.go @@ -149,6 +149,63 @@ func (client AnnouncementClient) getAnnouncement(ctx context.Context, request co return response, err } +// GetAnnouncementCompartment Gets the compartment details of an announcement. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/announcementsservice/GetAnnouncementCompartment.go.html to see an example of how to use GetAnnouncementCompartment API. +func (client AnnouncementClient) GetAnnouncementCompartment(ctx context.Context, request GetAnnouncementCompartmentRequest) (response GetAnnouncementCompartmentResponse, 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.getAnnouncementCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetAnnouncementCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetAnnouncementCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetAnnouncementCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetAnnouncementCompartmentResponse") + } + return +} + +// getAnnouncementCompartment implements the OCIOperation interface (enables retrying operations) +func (client AnnouncementClient) getAnnouncementCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/announcements/{announcementId}/compartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetAnnouncementCompartmentResponse + 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/announcements/0.0.1/AnnouncementCompartment/GetAnnouncementCompartment" + err = common.PostProcessServiceError(err, "Announcement", "GetAnnouncementCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetAnnouncementUserStatus Gets information about whether a specific announcement was acknowledged by a user. // This call is subject to an Announcements limit that applies to the total number of requests across all read or write operations. Announcements might throttle this call to reject an otherwise valid request when the total rate of operations exceeds 20 requests per second for a given user. The service might also throttle this call to reject an otherwise valid request when the total rate of operations exceeds 100 requests per second for a given tenancy. // diff --git a/announcementsservice/announcementsservice_service_client.go b/announcementsservice/announcementsservice_service_client.go new file mode 100644 index 0000000000..a7fec88d4c --- /dev/null +++ b/announcementsservice/announcementsservice_service_client.go @@ -0,0 +1,149 @@ +// 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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ServiceClient a client for Service +type ServiceClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewServiceClientWithConfigurationProvider Creates a new default Service client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewServiceClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ServiceClient, err error) { + if enabled := common.CheckForEnabledServices("announcementsservice"); !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 newServiceClientFromBaseClient(baseClient, provider) +} + +// NewServiceClientWithOboToken Creates a new default Service 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 NewServiceClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ServiceClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newServiceClientFromBaseClient(baseClient, configProvider) +} + +func newServiceClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ServiceClient, err error) { + // Service service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Service")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ServiceClient{BaseClient: baseClient} + client.BasePath = "20180904" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ServiceClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("announcements", "https://announcements.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ServiceClient) 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 *ServiceClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ListServices List all active services +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/announcementsservice/ListServices.go.html to see an example of how to use ListServices API. +func (client ServiceClient) ListServices(ctx context.Context, request ListServicesRequest) (response ListServicesResponse, 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.listServices, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListServicesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListServicesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListServicesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServicesResponse") + } + return +} + +// listServices implements the OCIOperation interface (enables retrying operations) +func (client ServiceClient) listServices(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/services", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListServicesResponse + 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/announcements/0.0.1/Service/ListServices" + err = common.PostProcessServiceError(err, "Service", "ListServices", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/announcementsservice/base_announcement.go b/announcementsservice/base_announcement.go index 0db6d204b3..e3eeabc0f5 100644 --- a/announcementsservice/base_announcement.go +++ b/announcementsservice/base_announcement.go @@ -537,16 +537,19 @@ type BaseAnnouncementPlatformTypeEnum string const ( BaseAnnouncementPlatformTypeIaas BaseAnnouncementPlatformTypeEnum = "IAAS" BaseAnnouncementPlatformTypeSaas BaseAnnouncementPlatformTypeEnum = "SAAS" + BaseAnnouncementPlatformTypePaas BaseAnnouncementPlatformTypeEnum = "PAAS" ) var mappingBaseAnnouncementPlatformTypeEnum = map[string]BaseAnnouncementPlatformTypeEnum{ "IAAS": BaseAnnouncementPlatformTypeIaas, "SAAS": BaseAnnouncementPlatformTypeSaas, + "PAAS": BaseAnnouncementPlatformTypePaas, } var mappingBaseAnnouncementPlatformTypeEnumLowerCase = map[string]BaseAnnouncementPlatformTypeEnum{ "iaas": BaseAnnouncementPlatformTypeIaas, "saas": BaseAnnouncementPlatformTypeSaas, + "paas": BaseAnnouncementPlatformTypePaas, } // GetBaseAnnouncementPlatformTypeEnumValues Enumerates the set of values for BaseAnnouncementPlatformTypeEnum @@ -563,6 +566,7 @@ func GetBaseAnnouncementPlatformTypeEnumStringValues() []string { return []string{ "IAAS", "SAAS", + "PAAS", } } diff --git a/announcementsservice/base_service.go b/announcementsservice/base_service.go new file mode 100644 index 0000000000..d9ef4fcf09 --- /dev/null +++ b/announcementsservice/base_service.go @@ -0,0 +1,246 @@ +// 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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BaseService Object representing a single service. +type BaseService interface { + + // ID of the service object. + GetId() *string + + // Name of the service represented by this object. + GetServiceName() *string + + // Short name of the team to whom this service object is related. + GetShortName() *string + + // Team name to which this service object is related. + GetTeamName() *string + + // The platform type this service object is related to. + GetPlatformType() PlatformTypeEnum + + // Name of the comms manager team that manages Notifications to this service. + GetCommsManagerName() CommsManagerNameEnum + + // The list of realms where this service is not available to be used. + GetExcludedRealms() []string + + // The list of previously used names for this service object. + GetPreviousServiceNames() []string + + // The date and time when the service object was created. + GetTimeCreated() *common.SDKTime + + // The date and time when the service object was updated. + GetTimeUpdated() *common.SDKTime + + // Current state of the service object. + GetLifecycleState() BaseServiceLifecycleStateEnum +} + +type baseservice struct { + JsonData []byte + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + LifecycleState BaseServiceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + Id *string `mandatory:"true" json:"id"` + ServiceName *string `mandatory:"true" json:"serviceName"` + ShortName *string `mandatory:"true" json:"shortName"` + TeamName *string `mandatory:"true" json:"teamName"` + PlatformType PlatformTypeEnum `mandatory:"true" json:"platformType"` + CommsManagerName CommsManagerNameEnum `mandatory:"true" json:"commsManagerName"` + ExcludedRealms []string `mandatory:"true" json:"excludedRealms"` + PreviousServiceNames []string `mandatory:"true" json:"previousServiceNames"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *baseservice) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerbaseservice baseservice + s := struct { + Model Unmarshalerbaseservice + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Id = s.Model.Id + m.ServiceName = s.Model.ServiceName + m.ShortName = s.Model.ShortName + m.TeamName = s.Model.TeamName + m.PlatformType = s.Model.PlatformType + m.CommsManagerName = s.Model.CommsManagerName + m.ExcludedRealms = s.Model.ExcludedRealms + m.PreviousServiceNames = s.Model.PreviousServiceNames + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.LifecycleState = s.Model.LifecycleState + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *baseservice) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "Service": + mm := Service{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ServiceSummary": + mm := ServiceSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NotificationsSummary": + mm := NotificationsSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for BaseService: %s.", m.Type) + return *m, nil + } +} + +// GetTimeCreated returns TimeCreated +func (m baseservice) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m baseservice) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m baseservice) GetLifecycleState() BaseServiceLifecycleStateEnum { + return m.LifecycleState +} + +// GetId returns Id +func (m baseservice) GetId() *string { + return m.Id +} + +// GetServiceName returns ServiceName +func (m baseservice) GetServiceName() *string { + return m.ServiceName +} + +// GetShortName returns ShortName +func (m baseservice) GetShortName() *string { + return m.ShortName +} + +// GetTeamName returns TeamName +func (m baseservice) GetTeamName() *string { + return m.TeamName +} + +// GetPlatformType returns PlatformType +func (m baseservice) GetPlatformType() PlatformTypeEnum { + return m.PlatformType +} + +// GetCommsManagerName returns CommsManagerName +func (m baseservice) GetCommsManagerName() CommsManagerNameEnum { + return m.CommsManagerName +} + +// GetExcludedRealms returns ExcludedRealms +func (m baseservice) GetExcludedRealms() []string { + return m.ExcludedRealms +} + +// GetPreviousServiceNames returns PreviousServiceNames +func (m baseservice) GetPreviousServiceNames() []string { + return m.PreviousServiceNames +} + +func (m baseservice) 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 baseservice) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPlatformTypeEnum(string(m.PlatformType)); !ok && m.PlatformType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlatformType: %s. Supported values are: %s.", m.PlatformType, strings.Join(GetPlatformTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingCommsManagerNameEnum(string(m.CommsManagerName)); !ok && m.CommsManagerName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CommsManagerName: %s. Supported values are: %s.", m.CommsManagerName, strings.Join(GetCommsManagerNameEnumStringValues(), ","))) + } + + if _, ok := GetMappingBaseServiceLifecycleStateEnum(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(GetBaseServiceLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// BaseServiceLifecycleStateEnum Enum with underlying type: string +type BaseServiceLifecycleStateEnum string + +// Set of constants representing the allowable values for BaseServiceLifecycleStateEnum +const ( + BaseServiceLifecycleStateActive BaseServiceLifecycleStateEnum = "ACTIVE" + BaseServiceLifecycleStateDeleted BaseServiceLifecycleStateEnum = "DELETED" +) + +var mappingBaseServiceLifecycleStateEnum = map[string]BaseServiceLifecycleStateEnum{ + "ACTIVE": BaseServiceLifecycleStateActive, + "DELETED": BaseServiceLifecycleStateDeleted, +} + +var mappingBaseServiceLifecycleStateEnumLowerCase = map[string]BaseServiceLifecycleStateEnum{ + "active": BaseServiceLifecycleStateActive, + "deleted": BaseServiceLifecycleStateDeleted, +} + +// GetBaseServiceLifecycleStateEnumValues Enumerates the set of values for BaseServiceLifecycleStateEnum +func GetBaseServiceLifecycleStateEnumValues() []BaseServiceLifecycleStateEnum { + values := make([]BaseServiceLifecycleStateEnum, 0) + for _, v := range mappingBaseServiceLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetBaseServiceLifecycleStateEnumStringValues Enumerates the set of values in String for BaseServiceLifecycleStateEnum +func GetBaseServiceLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "DELETED", + } +} + +// GetMappingBaseServiceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingBaseServiceLifecycleStateEnum(val string) (BaseServiceLifecycleStateEnum, bool) { + enum, ok := mappingBaseServiceLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/announcementsservice/comms_manager_name.go b/announcementsservice/comms_manager_name.go new file mode 100644 index 0000000000..1bbd50b233 --- /dev/null +++ b/announcementsservice/comms_manager_name.go @@ -0,0 +1,64 @@ +// 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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "strings" +) + +// CommsManagerNameEnum Enum with underlying type: string +type CommsManagerNameEnum string + +// Set of constants representing the allowable values for CommsManagerNameEnum +const ( + CommsManagerNameCn CommsManagerNameEnum = "CN" + CommsManagerNameFusion CommsManagerNameEnum = "FUSION" + CommsManagerNameAs CommsManagerNameEnum = "AS" + CommsManagerNameErf CommsManagerNameEnum = "ERF" +) + +var mappingCommsManagerNameEnum = map[string]CommsManagerNameEnum{ + "CN": CommsManagerNameCn, + "FUSION": CommsManagerNameFusion, + "AS": CommsManagerNameAs, + "ERF": CommsManagerNameErf, +} + +var mappingCommsManagerNameEnumLowerCase = map[string]CommsManagerNameEnum{ + "cn": CommsManagerNameCn, + "fusion": CommsManagerNameFusion, + "as": CommsManagerNameAs, + "erf": CommsManagerNameErf, +} + +// GetCommsManagerNameEnumValues Enumerates the set of values for CommsManagerNameEnum +func GetCommsManagerNameEnumValues() []CommsManagerNameEnum { + values := make([]CommsManagerNameEnum, 0) + for _, v := range mappingCommsManagerNameEnum { + values = append(values, v) + } + return values +} + +// GetCommsManagerNameEnumStringValues Enumerates the set of values in String for CommsManagerNameEnum +func GetCommsManagerNameEnumStringValues() []string { + return []string{ + "CN", + "FUSION", + "AS", + "ERF", + } +} + +// GetMappingCommsManagerNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCommsManagerNameEnum(val string) (CommsManagerNameEnum, bool) { + enum, ok := mappingCommsManagerNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/announcementsservice/get_announcement_compartment_request_response.go b/announcementsservice/get_announcement_compartment_request_response.go new file mode 100644 index 0000000000..49dca1d3a9 --- /dev/null +++ b/announcementsservice/get_announcement_compartment_request_response.go @@ -0,0 +1,94 @@ +// 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 announcementsservice + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetAnnouncementCompartmentRequest wrapper for the GetAnnouncementCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/announcementsservice/GetAnnouncementCompartment.go.html to see an example of how to use GetAnnouncementCompartmentRequest. +type GetAnnouncementCompartmentRequest struct { + + // The OCID of the announcement. + AnnouncementId *string `mandatory:"true" contributesTo:"path" name:"announcementId"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the complete request ID. + 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 GetAnnouncementCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetAnnouncementCompartmentRequest) 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 GetAnnouncementCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetAnnouncementCompartmentRequest) 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 GetAnnouncementCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetAnnouncementCompartmentResponse wrapper for the GetAnnouncementCompartment operation +type GetAnnouncementCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The AnnouncementCompartment instance + AnnouncementCompartment `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 GetAnnouncementCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetAnnouncementCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/announcementsservice/list_announcements_request_response.go b/announcementsservice/list_announcements_request_response.go index 55660cc3e3..03f77515a1 100644 --- a/announcementsservice/list_announcements_request_response.go +++ b/announcementsservice/list_announcements_request_response.go @@ -305,16 +305,19 @@ type ListAnnouncementsPlatformTypeEnum string const ( ListAnnouncementsPlatformTypeIaas ListAnnouncementsPlatformTypeEnum = "IAAS" ListAnnouncementsPlatformTypeSaas ListAnnouncementsPlatformTypeEnum = "SAAS" + ListAnnouncementsPlatformTypePaas ListAnnouncementsPlatformTypeEnum = "PAAS" ) var mappingListAnnouncementsPlatformTypeEnum = map[string]ListAnnouncementsPlatformTypeEnum{ "IAAS": ListAnnouncementsPlatformTypeIaas, "SAAS": ListAnnouncementsPlatformTypeSaas, + "PAAS": ListAnnouncementsPlatformTypePaas, } var mappingListAnnouncementsPlatformTypeEnumLowerCase = map[string]ListAnnouncementsPlatformTypeEnum{ "iaas": ListAnnouncementsPlatformTypeIaas, "saas": ListAnnouncementsPlatformTypeSaas, + "paas": ListAnnouncementsPlatformTypePaas, } // GetListAnnouncementsPlatformTypeEnumValues Enumerates the set of values for ListAnnouncementsPlatformTypeEnum @@ -331,6 +334,7 @@ func GetListAnnouncementsPlatformTypeEnumStringValues() []string { return []string{ "IAAS", "SAAS", + "PAAS", } } diff --git a/announcementsservice/list_services_request_response.go b/announcementsservice/list_services_request_response.go new file mode 100644 index 0000000000..fe5dbc323d --- /dev/null +++ b/announcementsservice/list_services_request_response.go @@ -0,0 +1,302 @@ +// 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 announcementsservice + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListServicesRequest wrapper for the ListServices operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/announcementsservice/ListServices.go.html to see an example of how to use ListServicesRequest. +type ListServicesRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only announcements affecting a specific platform. + PlatformType ListServicesPlatformTypeEnum `mandatory:"false" contributesTo:"query" name:"platformType" omitEmpty:"true"` + + // Filter by comms manager name + CommsManagerName ListServicesCommsManagerNameEnum `mandatory:"false" contributesTo:"query" name:"commsManagerName" omitEmpty:"true"` + + // The maximum number of items to return in a paginated "List" call. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The value of the `opc-next-page` response header from the previous "List" call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Sort by service name parameter + SortBy ListServicesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, whether ascending ('ASC') or descending ('DESC'). + SortOrder ListServicesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the complete request ID. + 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 ListServicesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServicesRequest) 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 ListServicesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServicesRequest) 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 ListServicesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListServicesPlatformTypeEnum(string(request.PlatformType)); !ok && request.PlatformType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlatformType: %s. Supported values are: %s.", request.PlatformType, strings.Join(GetListServicesPlatformTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListServicesCommsManagerNameEnum(string(request.CommsManagerName)); !ok && request.CommsManagerName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CommsManagerName: %s. Supported values are: %s.", request.CommsManagerName, strings.Join(GetListServicesCommsManagerNameEnumStringValues(), ","))) + } + if _, ok := GetMappingListServicesSortByEnum(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(GetListServicesSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListServicesSortOrderEnum(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(GetListServicesSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListServicesResponse wrapper for the ListServices operation +type ListServicesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ServicesCollection instances + ServicesCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListServicesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServicesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListServicesPlatformTypeEnum Enum with underlying type: string +type ListServicesPlatformTypeEnum string + +// Set of constants representing the allowable values for ListServicesPlatformTypeEnum +const ( + ListServicesPlatformTypeIaas ListServicesPlatformTypeEnum = "IAAS" + ListServicesPlatformTypeSaas ListServicesPlatformTypeEnum = "SAAS" + ListServicesPlatformTypePaas ListServicesPlatformTypeEnum = "PAAS" +) + +var mappingListServicesPlatformTypeEnum = map[string]ListServicesPlatformTypeEnum{ + "IAAS": ListServicesPlatformTypeIaas, + "SAAS": ListServicesPlatformTypeSaas, + "PAAS": ListServicesPlatformTypePaas, +} + +var mappingListServicesPlatformTypeEnumLowerCase = map[string]ListServicesPlatformTypeEnum{ + "iaas": ListServicesPlatformTypeIaas, + "saas": ListServicesPlatformTypeSaas, + "paas": ListServicesPlatformTypePaas, +} + +// GetListServicesPlatformTypeEnumValues Enumerates the set of values for ListServicesPlatformTypeEnum +func GetListServicesPlatformTypeEnumValues() []ListServicesPlatformTypeEnum { + values := make([]ListServicesPlatformTypeEnum, 0) + for _, v := range mappingListServicesPlatformTypeEnum { + values = append(values, v) + } + return values +} + +// GetListServicesPlatformTypeEnumStringValues Enumerates the set of values in String for ListServicesPlatformTypeEnum +func GetListServicesPlatformTypeEnumStringValues() []string { + return []string{ + "IAAS", + "SAAS", + "PAAS", + } +} + +// GetMappingListServicesPlatformTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServicesPlatformTypeEnum(val string) (ListServicesPlatformTypeEnum, bool) { + enum, ok := mappingListServicesPlatformTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServicesCommsManagerNameEnum Enum with underlying type: string +type ListServicesCommsManagerNameEnum string + +// Set of constants representing the allowable values for ListServicesCommsManagerNameEnum +const ( + ListServicesCommsManagerNameCn ListServicesCommsManagerNameEnum = "CN" + ListServicesCommsManagerNameFusion ListServicesCommsManagerNameEnum = "FUSION" + ListServicesCommsManagerNameAs ListServicesCommsManagerNameEnum = "AS" + ListServicesCommsManagerNameErf ListServicesCommsManagerNameEnum = "ERF" +) + +var mappingListServicesCommsManagerNameEnum = map[string]ListServicesCommsManagerNameEnum{ + "CN": ListServicesCommsManagerNameCn, + "FUSION": ListServicesCommsManagerNameFusion, + "AS": ListServicesCommsManagerNameAs, + "ERF": ListServicesCommsManagerNameErf, +} + +var mappingListServicesCommsManagerNameEnumLowerCase = map[string]ListServicesCommsManagerNameEnum{ + "cn": ListServicesCommsManagerNameCn, + "fusion": ListServicesCommsManagerNameFusion, + "as": ListServicesCommsManagerNameAs, + "erf": ListServicesCommsManagerNameErf, +} + +// GetListServicesCommsManagerNameEnumValues Enumerates the set of values for ListServicesCommsManagerNameEnum +func GetListServicesCommsManagerNameEnumValues() []ListServicesCommsManagerNameEnum { + values := make([]ListServicesCommsManagerNameEnum, 0) + for _, v := range mappingListServicesCommsManagerNameEnum { + values = append(values, v) + } + return values +} + +// GetListServicesCommsManagerNameEnumStringValues Enumerates the set of values in String for ListServicesCommsManagerNameEnum +func GetListServicesCommsManagerNameEnumStringValues() []string { + return []string{ + "CN", + "FUSION", + "AS", + "ERF", + } +} + +// GetMappingListServicesCommsManagerNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServicesCommsManagerNameEnum(val string) (ListServicesCommsManagerNameEnum, bool) { + enum, ok := mappingListServicesCommsManagerNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServicesSortByEnum Enum with underlying type: string +type ListServicesSortByEnum string + +// Set of constants representing the allowable values for ListServicesSortByEnum +const ( + ListServicesSortByServicename ListServicesSortByEnum = "serviceName" +) + +var mappingListServicesSortByEnum = map[string]ListServicesSortByEnum{ + "serviceName": ListServicesSortByServicename, +} + +var mappingListServicesSortByEnumLowerCase = map[string]ListServicesSortByEnum{ + "servicename": ListServicesSortByServicename, +} + +// GetListServicesSortByEnumValues Enumerates the set of values for ListServicesSortByEnum +func GetListServicesSortByEnumValues() []ListServicesSortByEnum { + values := make([]ListServicesSortByEnum, 0) + for _, v := range mappingListServicesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListServicesSortByEnumStringValues Enumerates the set of values in String for ListServicesSortByEnum +func GetListServicesSortByEnumStringValues() []string { + return []string{ + "serviceName", + } +} + +// GetMappingListServicesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServicesSortByEnum(val string) (ListServicesSortByEnum, bool) { + enum, ok := mappingListServicesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServicesSortOrderEnum Enum with underlying type: string +type ListServicesSortOrderEnum string + +// Set of constants representing the allowable values for ListServicesSortOrderEnum +const ( + ListServicesSortOrderAsc ListServicesSortOrderEnum = "ASC" + ListServicesSortOrderDesc ListServicesSortOrderEnum = "DESC" +) + +var mappingListServicesSortOrderEnum = map[string]ListServicesSortOrderEnum{ + "ASC": ListServicesSortOrderAsc, + "DESC": ListServicesSortOrderDesc, +} + +var mappingListServicesSortOrderEnumLowerCase = map[string]ListServicesSortOrderEnum{ + "asc": ListServicesSortOrderAsc, + "desc": ListServicesSortOrderDesc, +} + +// GetListServicesSortOrderEnumValues Enumerates the set of values for ListServicesSortOrderEnum +func GetListServicesSortOrderEnumValues() []ListServicesSortOrderEnum { + values := make([]ListServicesSortOrderEnum, 0) + for _, v := range mappingListServicesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListServicesSortOrderEnumStringValues Enumerates the set of values in String for ListServicesSortOrderEnum +func GetListServicesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListServicesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServicesSortOrderEnum(val string) (ListServicesSortOrderEnum, bool) { + enum, ok := mappingListServicesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/announcementsservice/notifications_summary.go b/announcementsservice/notifications_summary.go new file mode 100644 index 0000000000..f7f2e7f336 --- /dev/null +++ b/announcementsservice/notifications_summary.go @@ -0,0 +1,148 @@ +// 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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NotificationsSummary Summary of notification object, return by List API +type NotificationsSummary struct { + + // ID of the service object. + Id *string `mandatory:"true" json:"id"` + + // Name of the service represented by this object. + ServiceName *string `mandatory:"true" json:"serviceName"` + + // Short name of the team to whom this service object is related. + ShortName *string `mandatory:"true" json:"shortName"` + + // Team name to which this service object is related. + TeamName *string `mandatory:"true" json:"teamName"` + + // The list of realms where this service is not available to be used. + ExcludedRealms []string `mandatory:"true" json:"excludedRealms"` + + // The list of previously used names for this service object. + PreviousServiceNames []string `mandatory:"true" json:"previousServiceNames"` + + // The date and time when the service object was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time when the service object was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The platform type this service object is related to. + PlatformType PlatformTypeEnum `mandatory:"true" json:"platformType"` + + // Name of the comms manager team that manages Notifications to this service. + CommsManagerName CommsManagerNameEnum `mandatory:"true" json:"commsManagerName"` + + // Current state of the service object. + LifecycleState BaseServiceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +// GetId returns Id +func (m NotificationsSummary) GetId() *string { + return m.Id +} + +// GetServiceName returns ServiceName +func (m NotificationsSummary) GetServiceName() *string { + return m.ServiceName +} + +// GetShortName returns ShortName +func (m NotificationsSummary) GetShortName() *string { + return m.ShortName +} + +// GetTeamName returns TeamName +func (m NotificationsSummary) GetTeamName() *string { + return m.TeamName +} + +// GetPlatformType returns PlatformType +func (m NotificationsSummary) GetPlatformType() PlatformTypeEnum { + return m.PlatformType +} + +// GetCommsManagerName returns CommsManagerName +func (m NotificationsSummary) GetCommsManagerName() CommsManagerNameEnum { + return m.CommsManagerName +} + +// GetExcludedRealms returns ExcludedRealms +func (m NotificationsSummary) GetExcludedRealms() []string { + return m.ExcludedRealms +} + +// GetPreviousServiceNames returns PreviousServiceNames +func (m NotificationsSummary) GetPreviousServiceNames() []string { + return m.PreviousServiceNames +} + +// GetTimeCreated returns TimeCreated +func (m NotificationsSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m NotificationsSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m NotificationsSummary) GetLifecycleState() BaseServiceLifecycleStateEnum { + return m.LifecycleState +} + +func (m NotificationsSummary) 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 NotificationsSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingPlatformTypeEnum(string(m.PlatformType)); !ok && m.PlatformType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlatformType: %s. Supported values are: %s.", m.PlatformType, strings.Join(GetPlatformTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingCommsManagerNameEnum(string(m.CommsManagerName)); !ok && m.CommsManagerName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CommsManagerName: %s. Supported values are: %s.", m.CommsManagerName, strings.Join(GetCommsManagerNameEnumStringValues(), ","))) + } + if _, ok := GetMappingBaseServiceLifecycleStateEnum(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(GetBaseServiceLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NotificationsSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNotificationsSummary NotificationsSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeNotificationsSummary + }{ + "NotificationsSummary", + (MarshalTypeNotificationsSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/announcementsservice/platform_type.go b/announcementsservice/platform_type.go new file mode 100644 index 0000000000..17705e1e9e --- /dev/null +++ b/announcementsservice/platform_type.go @@ -0,0 +1,60 @@ +// 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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "strings" +) + +// PlatformTypeEnum Enum with underlying type: string +type PlatformTypeEnum string + +// Set of constants representing the allowable values for PlatformTypeEnum +const ( + PlatformTypeIaas PlatformTypeEnum = "IAAS" + PlatformTypeSaas PlatformTypeEnum = "SAAS" + PlatformTypePaas PlatformTypeEnum = "PAAS" +) + +var mappingPlatformTypeEnum = map[string]PlatformTypeEnum{ + "IAAS": PlatformTypeIaas, + "SAAS": PlatformTypeSaas, + "PAAS": PlatformTypePaas, +} + +var mappingPlatformTypeEnumLowerCase = map[string]PlatformTypeEnum{ + "iaas": PlatformTypeIaas, + "saas": PlatformTypeSaas, + "paas": PlatformTypePaas, +} + +// GetPlatformTypeEnumValues Enumerates the set of values for PlatformTypeEnum +func GetPlatformTypeEnumValues() []PlatformTypeEnum { + values := make([]PlatformTypeEnum, 0) + for _, v := range mappingPlatformTypeEnum { + values = append(values, v) + } + return values +} + +// GetPlatformTypeEnumStringValues Enumerates the set of values in String for PlatformTypeEnum +func GetPlatformTypeEnumStringValues() []string { + return []string{ + "IAAS", + "SAAS", + "PAAS", + } +} + +// GetMappingPlatformTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPlatformTypeEnum(val string) (PlatformTypeEnum, bool) { + enum, ok := mappingPlatformTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/announcementsservice/service.go b/announcementsservice/service.go new file mode 100644 index 0000000000..ec70cd576e --- /dev/null +++ b/announcementsservice/service.go @@ -0,0 +1,148 @@ +// 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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Service Summary of the service object. +type Service struct { + + // ID of the service object. + Id *string `mandatory:"true" json:"id"` + + // Name of the service represented by this object. + ServiceName *string `mandatory:"true" json:"serviceName"` + + // Short name of the team to whom this service object is related. + ShortName *string `mandatory:"true" json:"shortName"` + + // Team name to which this service object is related. + TeamName *string `mandatory:"true" json:"teamName"` + + // The list of realms where this service is not available to be used. + ExcludedRealms []string `mandatory:"true" json:"excludedRealms"` + + // The list of previously used names for this service object. + PreviousServiceNames []string `mandatory:"true" json:"previousServiceNames"` + + // The date and time when the service object was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time when the service object was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The platform type this service object is related to. + PlatformType PlatformTypeEnum `mandatory:"true" json:"platformType"` + + // Name of the comms manager team that manages Notifications to this service. + CommsManagerName CommsManagerNameEnum `mandatory:"true" json:"commsManagerName"` + + // Current state of the service object. + LifecycleState BaseServiceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +// GetId returns Id +func (m Service) GetId() *string { + return m.Id +} + +// GetServiceName returns ServiceName +func (m Service) GetServiceName() *string { + return m.ServiceName +} + +// GetShortName returns ShortName +func (m Service) GetShortName() *string { + return m.ShortName +} + +// GetTeamName returns TeamName +func (m Service) GetTeamName() *string { + return m.TeamName +} + +// GetPlatformType returns PlatformType +func (m Service) GetPlatformType() PlatformTypeEnum { + return m.PlatformType +} + +// GetCommsManagerName returns CommsManagerName +func (m Service) GetCommsManagerName() CommsManagerNameEnum { + return m.CommsManagerName +} + +// GetExcludedRealms returns ExcludedRealms +func (m Service) GetExcludedRealms() []string { + return m.ExcludedRealms +} + +// GetPreviousServiceNames returns PreviousServiceNames +func (m Service) GetPreviousServiceNames() []string { + return m.PreviousServiceNames +} + +// GetTimeCreated returns TimeCreated +func (m Service) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m Service) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m Service) GetLifecycleState() BaseServiceLifecycleStateEnum { + return m.LifecycleState +} + +func (m Service) 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 Service) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingPlatformTypeEnum(string(m.PlatformType)); !ok && m.PlatformType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlatformType: %s. Supported values are: %s.", m.PlatformType, strings.Join(GetPlatformTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingCommsManagerNameEnum(string(m.CommsManagerName)); !ok && m.CommsManagerName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CommsManagerName: %s. Supported values are: %s.", m.CommsManagerName, strings.Join(GetCommsManagerNameEnumStringValues(), ","))) + } + if _, ok := GetMappingBaseServiceLifecycleStateEnum(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(GetBaseServiceLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m Service) MarshalJSON() (buff []byte, e error) { + type MarshalTypeService Service + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeService + }{ + "Service", + (MarshalTypeService)(m), + } + + return json.Marshal(&s) +} diff --git a/announcementsservice/service_summary.go b/announcementsservice/service_summary.go new file mode 100644 index 0000000000..fc85131cb8 --- /dev/null +++ b/announcementsservice/service_summary.go @@ -0,0 +1,148 @@ +// 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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceSummary Summary of the service object. +type ServiceSummary struct { + + // ID of the service object. + Id *string `mandatory:"true" json:"id"` + + // Name of the service represented by this object. + ServiceName *string `mandatory:"true" json:"serviceName"` + + // Short name of the team to whom this service object is related. + ShortName *string `mandatory:"true" json:"shortName"` + + // Team name to which this service object is related. + TeamName *string `mandatory:"true" json:"teamName"` + + // The list of realms where this service is not available to be used. + ExcludedRealms []string `mandatory:"true" json:"excludedRealms"` + + // The list of previously used names for this service object. + PreviousServiceNames []string `mandatory:"true" json:"previousServiceNames"` + + // The date and time when the service object was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The date and time when the service object was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The platform type this service object is related to. + PlatformType PlatformTypeEnum `mandatory:"true" json:"platformType"` + + // Name of the comms manager team that manages Notifications to this service. + CommsManagerName CommsManagerNameEnum `mandatory:"true" json:"commsManagerName"` + + // Current state of the service object. + LifecycleState BaseServiceLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` +} + +// GetId returns Id +func (m ServiceSummary) GetId() *string { + return m.Id +} + +// GetServiceName returns ServiceName +func (m ServiceSummary) GetServiceName() *string { + return m.ServiceName +} + +// GetShortName returns ShortName +func (m ServiceSummary) GetShortName() *string { + return m.ShortName +} + +// GetTeamName returns TeamName +func (m ServiceSummary) GetTeamName() *string { + return m.TeamName +} + +// GetPlatformType returns PlatformType +func (m ServiceSummary) GetPlatformType() PlatformTypeEnum { + return m.PlatformType +} + +// GetCommsManagerName returns CommsManagerName +func (m ServiceSummary) GetCommsManagerName() CommsManagerNameEnum { + return m.CommsManagerName +} + +// GetExcludedRealms returns ExcludedRealms +func (m ServiceSummary) GetExcludedRealms() []string { + return m.ExcludedRealms +} + +// GetPreviousServiceNames returns PreviousServiceNames +func (m ServiceSummary) GetPreviousServiceNames() []string { + return m.PreviousServiceNames +} + +// GetTimeCreated returns TimeCreated +func (m ServiceSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m ServiceSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m ServiceSummary) GetLifecycleState() BaseServiceLifecycleStateEnum { + return m.LifecycleState +} + +func (m ServiceSummary) 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 ServiceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingPlatformTypeEnum(string(m.PlatformType)); !ok && m.PlatformType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlatformType: %s. Supported values are: %s.", m.PlatformType, strings.Join(GetPlatformTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingCommsManagerNameEnum(string(m.CommsManagerName)); !ok && m.CommsManagerName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CommsManagerName: %s. Supported values are: %s.", m.CommsManagerName, strings.Join(GetCommsManagerNameEnumStringValues(), ","))) + } + if _, ok := GetMappingBaseServiceLifecycleStateEnum(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(GetBaseServiceLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ServiceSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeServiceSummary ServiceSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeServiceSummary + }{ + "ServiceSummary", + (MarshalTypeServiceSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/announcementsservice/services_collection.go b/announcementsservice/services_collection.go new file mode 100644 index 0000000000..2f75f59d18 --- /dev/null +++ b/announcementsservice/services_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. + +// Announcements Service API +// +// Manage Oracle Cloud Infrastructure console announcements. +// + +package announcementsservice + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServicesCollection Collection of all services. +type ServicesCollection struct { + + // List of all services. + Items []ServiceSummary `mandatory:"true" json:"items"` +} + +func (m ServicesCollection) 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 ServicesCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/common/version.go b/common/version.go index 2f111c1b0f..d9b21e101f 100644 --- a/common/version.go +++ b/common/version.go @@ -12,7 +12,7 @@ import ( const ( major = "65" - minor = "72" + minor = "73" patch = "0" tag = "" ) diff --git a/database/action_member.go b/database/action_member.go new file mode 100644 index 0000000000..2dd8c61679 --- /dev/null +++ b/database/action_member.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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ActionMember The details of an action member. +type ActionMember struct { + + // The order of the action member in a scheduled action. + MemberOrder *int `mandatory:"true" json:"memberOrder"` + + // The ocid of the action member. + MemberId *string `mandatory:"true" json:"memberId"` + + // The estimated time for the intended action member. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` +} + +func (m ActionMember) 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 ActionMember) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/action_order_details.go b/database/action_order_details.go new file mode 100644 index 0000000000..2ef5551b6b --- /dev/null +++ b/database/action_order_details.go @@ -0,0 +1,42 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ActionOrderDetails Describes the ordering list of action resources. +type ActionOrderDetails struct { + + // The priority order of the action resource. + ActionOrder *int `mandatory:"false" json:"actionOrder"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the action resource. + ActionResourceId *string `mandatory:"false" json:"actionResourceId"` +} + +func (m ActionOrderDetails) 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 ActionOrderDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/action_param_values_collection.go b/database/action_param_values_collection.go new file mode 100644 index 0000000000..c58d15bff6 --- /dev/null +++ b/database/action_param_values_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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ActionParamValuesCollection A list of Action Parameters. Contains ActionParamValues items. +type ActionParamValuesCollection struct { + + // List of Action Parameters and their possible values. + Items []ActionParamValuesSummary `mandatory:"true" json:"items"` +} + +func (m ActionParamValuesCollection) 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 ActionParamValuesCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/action_param_values_summary.go b/database/action_param_values_summary.go new file mode 100644 index 0000000000..aa48b15724 --- /dev/null +++ b/database/action_param_values_summary.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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ActionParamValuesSummary Details of the action parameter and its possible values that is used in listParamsForActionType. +type ActionParamValuesSummary struct { + + // The name of this parameter. + ParameterName *string `mandatory:"true" json:"parameterName"` + + // The type of the parameter. + ParameterType ActionParamValuesSummaryParameterTypeEnum `mandatory:"true" json:"parameterType"` + + // Possible values for this parameter. In case of integer it's min and max values. + ParameterValues []string `mandatory:"true" json:"parameterValues"` + + // Whether this parameter is required or not for this action type.、 + IsRequired *bool `mandatory:"true" json:"isRequired"` + + // The default value for this parameter. + DefaultValue *string `mandatory:"false" json:"defaultValue"` +} + +func (m ActionParamValuesSummary) 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 ActionParamValuesSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionParamValuesSummaryParameterTypeEnum(string(m.ParameterType)); !ok && m.ParameterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ParameterType: %s. Supported values are: %s.", m.ParameterType, strings.Join(GetActionParamValuesSummaryParameterTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ActionParamValuesSummaryParameterTypeEnum Enum with underlying type: string +type ActionParamValuesSummaryParameterTypeEnum string + +// Set of constants representing the allowable values for ActionParamValuesSummaryParameterTypeEnum +const ( + ActionParamValuesSummaryParameterTypeBoolean ActionParamValuesSummaryParameterTypeEnum = "BOOLEAN" + ActionParamValuesSummaryParameterTypeString ActionParamValuesSummaryParameterTypeEnum = "STRING" + ActionParamValuesSummaryParameterTypeInteger ActionParamValuesSummaryParameterTypeEnum = "INTEGER" +) + +var mappingActionParamValuesSummaryParameterTypeEnum = map[string]ActionParamValuesSummaryParameterTypeEnum{ + "BOOLEAN": ActionParamValuesSummaryParameterTypeBoolean, + "STRING": ActionParamValuesSummaryParameterTypeString, + "INTEGER": ActionParamValuesSummaryParameterTypeInteger, +} + +var mappingActionParamValuesSummaryParameterTypeEnumLowerCase = map[string]ActionParamValuesSummaryParameterTypeEnum{ + "boolean": ActionParamValuesSummaryParameterTypeBoolean, + "string": ActionParamValuesSummaryParameterTypeString, + "integer": ActionParamValuesSummaryParameterTypeInteger, +} + +// GetActionParamValuesSummaryParameterTypeEnumValues Enumerates the set of values for ActionParamValuesSummaryParameterTypeEnum +func GetActionParamValuesSummaryParameterTypeEnumValues() []ActionParamValuesSummaryParameterTypeEnum { + values := make([]ActionParamValuesSummaryParameterTypeEnum, 0) + for _, v := range mappingActionParamValuesSummaryParameterTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionParamValuesSummaryParameterTypeEnumStringValues Enumerates the set of values in String for ActionParamValuesSummaryParameterTypeEnum +func GetActionParamValuesSummaryParameterTypeEnumStringValues() []string { + return []string{ + "BOOLEAN", + "STRING", + "INTEGER", + } +} + +// GetMappingActionParamValuesSummaryParameterTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionParamValuesSummaryParameterTypeEnum(val string) (ActionParamValuesSummaryParameterTypeEnum, bool) { + enum, ok := mappingActionParamValuesSummaryParameterTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/autonomous_database.go b/database/autonomous_database.go index 06b1a72447..cee273e0aa 100644 --- a/database/autonomous_database.go +++ b/database/autonomous_database.go @@ -227,7 +227,7 @@ type AutonomousDatabase struct { // This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. DbWorkload AutonomousDatabaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // Indicates if the database-level access control is enabled. @@ -446,6 +446,9 @@ type AutonomousDatabase struct { // Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. NetServicesArchitecture AutonomousDatabaseNetServicesArchitectureEnum `mandatory:"false" json:"netServicesArchitecture,omitempty"` + // The availability domain where the Autonomous Database Serverless instance is located. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the cluster placement group of the Autonomous Serverless Database. ClusterPlacementGroupId *string `mandatory:"false" json:"clusterPlacementGroupId"` } diff --git a/database/autonomous_database_standby_summary.go b/database/autonomous_database_standby_summary.go index 4d1f65c23b..d666e1b875 100644 --- a/database/autonomous_database_standby_summary.go +++ b/database/autonomous_database_standby_summary.go @@ -32,6 +32,9 @@ type AutonomousDatabaseStandbySummary struct { // The date and time the Disaster Recovery role was switched for the standby Autonomous Database. TimeDisasterRecoveryRoleChanged *common.SDKTime `mandatory:"false" json:"timeDisasterRecoveryRoleChanged"` + + // The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` } func (m AutonomousDatabaseStandbySummary) String() string { diff --git a/database/autonomous_database_summary.go b/database/autonomous_database_summary.go index 1483214221..52cc22d972 100644 --- a/database/autonomous_database_summary.go +++ b/database/autonomous_database_summary.go @@ -229,7 +229,7 @@ type AutonomousDatabaseSummary struct { // This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. DbWorkload AutonomousDatabaseSummaryDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // Indicates if the database-level access control is enabled. @@ -448,6 +448,9 @@ type AutonomousDatabaseSummary struct { // Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. NetServicesArchitecture AutonomousDatabaseSummaryNetServicesArchitectureEnum `mandatory:"false" json:"netServicesArchitecture,omitempty"` + // The availability domain where the Autonomous Database Serverless instance is located. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the cluster placement group of the Autonomous Serverless Database. ClusterPlacementGroupId *string `mandatory:"false" json:"clusterPlacementGroupId"` } diff --git a/database/cancel_execution_window_details.go b/database/cancel_execution_window_details.go new file mode 100644 index 0000000000..255d820da5 --- /dev/null +++ b/database/cancel_execution_window_details.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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CancelExecutionWindowDetails Describe the parameters to create a new execution window after this execution window is canceled. +type CancelExecutionWindowDetails struct { + + // New scheduled date and time of the execution window. + TimeScheduledOfNewWindow *common.SDKTime `mandatory:"true" json:"timeScheduledOfNewWindow"` + + // Duration window allows user to set a duration they plan to allocate for Scheduling window. The duration is in minutes. + WindowDurationInMinsOfNewWindow *int `mandatory:"true" json:"windowDurationInMinsOfNewWindow"` + + // Indicates if duration the user plans to allocate for scheduling window is strictly enforced. The default value is `FALSE`. + IsEnforcedDurationOfNewWindow *bool `mandatory:"false" json:"isEnforcedDurationOfNewWindow"` +} + +func (m CancelExecutionWindowDetails) 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 CancelExecutionWindowDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/cancel_execution_window_request_response.go b/database/cancel_execution_window_request_response.go new file mode 100644 index 0000000000..8d333503e1 --- /dev/null +++ b/database/cancel_execution_window_request_response.go @@ -0,0 +1,111 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelExecutionWindowRequest wrapper for the CancelExecutionWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CancelExecutionWindow.go.html to see an example of how to use CancelExecutionWindowRequest. +type CancelExecutionWindowRequest struct { + + // The execution window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionWindowId *string `mandatory:"true" contributesTo:"path" name:"executionWindowId"` + + // Request to cancel the in progress maintenance activity under this execution window. + CancelExecutionWindowDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CancelExecutionWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelExecutionWindowRequest) 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 CancelExecutionWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelExecutionWindowRequest) 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 CancelExecutionWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelExecutionWindowResponse wrapper for the CancelExecutionWindow operation +type CancelExecutionWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionWindow instance + ExecutionWindow `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 CancelExecutionWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelExecutionWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/cascading_delete_scheduling_plan_request_response.go b/database/cascading_delete_scheduling_plan_request_response.go new file mode 100644 index 0000000000..ae897df7fe --- /dev/null +++ b/database/cascading_delete_scheduling_plan_request_response.go @@ -0,0 +1,102 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CascadingDeleteSchedulingPlanRequest wrapper for the CascadingDeleteSchedulingPlan operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CascadingDeleteSchedulingPlan.go.html to see an example of how to use CascadingDeleteSchedulingPlanRequest. +type CascadingDeleteSchedulingPlanRequest struct { + + // The Schedule Plan OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPlanId *string `mandatory:"true" contributesTo:"path" name:"schedulingPlanId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 CascadingDeleteSchedulingPlanRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CascadingDeleteSchedulingPlanRequest) 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 CascadingDeleteSchedulingPlanRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CascadingDeleteSchedulingPlanRequest) 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 CascadingDeleteSchedulingPlanRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CascadingDeleteSchedulingPlanResponse wrapper for the CascadingDeleteSchedulingPlan operation +type CascadingDeleteSchedulingPlanResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CascadingDeleteSchedulingPlanResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CascadingDeleteSchedulingPlanResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/change_scheduling_plan_compartment_details.go b/database/change_scheduling_plan_compartment_details.go new file mode 100644 index 0000000000..8f3472a82f --- /dev/null +++ b/database/change_scheduling_plan_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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeSchedulingPlanCompartmentDetails The configuration details for moving the Scheduling Plan. +type ChangeSchedulingPlanCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeSchedulingPlanCompartmentDetails) 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 ChangeSchedulingPlanCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/change_scheduling_plan_compartment_request_response.go b/database/change_scheduling_plan_compartment_request_response.go new file mode 100644 index 0000000000..e5edf2293c --- /dev/null +++ b/database/change_scheduling_plan_compartment_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeSchedulingPlanCompartmentRequest wrapper for the ChangeSchedulingPlanCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ChangeSchedulingPlanCompartment.go.html to see an example of how to use ChangeSchedulingPlanCompartmentRequest. +type ChangeSchedulingPlanCompartmentRequest struct { + + // Request to move scheduling plan to a different compartment + ChangeSchedulingPlanCompartmentDetails `contributesTo:"body"` + + // The Schedule Plan OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPlanId *string `mandatory:"true" contributesTo:"path" name:"schedulingPlanId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeSchedulingPlanCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeSchedulingPlanCompartmentRequest) 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 ChangeSchedulingPlanCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeSchedulingPlanCompartmentRequest) 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 ChangeSchedulingPlanCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeSchedulingPlanCompartmentResponse wrapper for the ChangeSchedulingPlanCompartment operation +type ChangeSchedulingPlanCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeSchedulingPlanCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeSchedulingPlanCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/change_scheduling_policy_compartment_details.go b/database/change_scheduling_policy_compartment_details.go new file mode 100644 index 0000000000..9906403f04 --- /dev/null +++ b/database/change_scheduling_policy_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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeSchedulingPolicyCompartmentDetails The configuration details for moving the Scheduling Policy. +type ChangeSchedulingPolicyCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeSchedulingPolicyCompartmentDetails) 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 ChangeSchedulingPolicyCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/change_scheduling_policy_compartment_request_response.go b/database/change_scheduling_policy_compartment_request_response.go new file mode 100644 index 0000000000..7ad3b8de8d --- /dev/null +++ b/database/change_scheduling_policy_compartment_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeSchedulingPolicyCompartmentRequest wrapper for the ChangeSchedulingPolicyCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ChangeSchedulingPolicyCompartment.go.html to see an example of how to use ChangeSchedulingPolicyCompartmentRequest. +type ChangeSchedulingPolicyCompartmentRequest struct { + + // Request to move scheduling policy to a different compartment + ChangeSchedulingPolicyCompartmentDetails `contributesTo:"body"` + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeSchedulingPolicyCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeSchedulingPolicyCompartmentRequest) 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 ChangeSchedulingPolicyCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeSchedulingPolicyCompartmentRequest) 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 ChangeSchedulingPolicyCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeSchedulingPolicyCompartmentResponse wrapper for the ChangeSchedulingPolicyCompartment operation +type ChangeSchedulingPolicyCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeSchedulingPolicyCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeSchedulingPolicyCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/cloud_exadata_infrastructure.go b/database/cloud_exadata_infrastructure.go index 6bc2ba4f09..4b20ed47cf 100644 --- a/database/cloud_exadata_infrastructure.go +++ b/database/cloud_exadata_infrastructure.go @@ -134,6 +134,9 @@ type CloudExadataInfrastructure struct { // Details of the file system configuration of the Exadata infrastructure. DefinedFileSystemConfigurations []DefinedFileSystemConfiguration `mandatory:"false" json:"definedFileSystemConfigurations"` + + // If true, the infrastructure is using granular maintenance scheduling preference. + IsSchedulingPolicyAssociated *bool `mandatory:"false" json:"isSchedulingPolicyAssociated"` } func (m CloudExadataInfrastructure) String() string { diff --git a/database/cloud_exadata_infrastructure_summary.go b/database/cloud_exadata_infrastructure_summary.go index 24d50d3344..c5a478d143 100644 --- a/database/cloud_exadata_infrastructure_summary.go +++ b/database/cloud_exadata_infrastructure_summary.go @@ -134,6 +134,9 @@ type CloudExadataInfrastructureSummary struct { // Details of the file system configuration of the Exadata infrastructure. DefinedFileSystemConfigurations []DefinedFileSystemConfiguration `mandatory:"false" json:"definedFileSystemConfigurations"` + + // If true, the infrastructure is using granular maintenance scheduling preference. + IsSchedulingPolicyAssociated *bool `mandatory:"false" json:"isSchedulingPolicyAssociated"` } func (m CloudExadataInfrastructureSummary) String() string { diff --git a/database/create_autonomous_database_base.go b/database/create_autonomous_database_base.go index dd435b5037..0fc08bf04b 100644 --- a/database/create_autonomous_database_base.go +++ b/database/create_autonomous_database_base.go @@ -120,7 +120,7 @@ type CreateAutonomousDatabaseBase interface { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. GetIsAutoScalingEnabled() *bool - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. GetIsDevTier() *bool // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_autonomous_database_clone_details.go b/database/create_autonomous_database_clone_details.go index f3889bd9d5..9511c85efc 100644 --- a/database/create_autonomous_database_clone_details.go +++ b/database/create_autonomous_database_clone_details.go @@ -98,7 +98,7 @@ type CreateAutonomousDatabaseCloneDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_autonomous_database_details.go b/database/create_autonomous_database_details.go index 5c89f800ab..921670de6b 100644 --- a/database/create_autonomous_database_details.go +++ b/database/create_autonomous_database_details.go @@ -95,7 +95,7 @@ type CreateAutonomousDatabaseDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_autonomous_database_from_backup_details.go b/database/create_autonomous_database_from_backup_details.go index d51e8fc13d..5efd9196ec 100644 --- a/database/create_autonomous_database_from_backup_details.go +++ b/database/create_autonomous_database_from_backup_details.go @@ -98,7 +98,7 @@ type CreateAutonomousDatabaseFromBackupDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_autonomous_database_from_backup_timestamp_details.go b/database/create_autonomous_database_from_backup_timestamp_details.go index f577b63881..9ddecc12ac 100644 --- a/database/create_autonomous_database_from_backup_timestamp_details.go +++ b/database/create_autonomous_database_from_backup_timestamp_details.go @@ -98,7 +98,7 @@ type CreateAutonomousDatabaseFromBackupTimestampDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_cross_region_autonomous_database_data_guard_details.go b/database/create_cross_region_autonomous_database_data_guard_details.go index d534ae95e2..625ffabe16 100644 --- a/database/create_cross_region_autonomous_database_data_guard_details.go +++ b/database/create_cross_region_autonomous_database_data_guard_details.go @@ -117,7 +117,7 @@ type CreateCrossRegionAutonomousDatabaseDataGuardDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_cross_region_disaster_recovery_details.go b/database/create_cross_region_disaster_recovery_details.go index 4f9f933b53..7e57eb8554 100644 --- a/database/create_cross_region_disaster_recovery_details.go +++ b/database/create_cross_region_disaster_recovery_details.go @@ -119,7 +119,7 @@ type CreateCrossRegionDisasterRecoveryDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_cross_tenancy_disaster_recovery_details.go b/database/create_cross_tenancy_disaster_recovery_details.go index 0c24414695..c8e41f38a6 100644 --- a/database/create_cross_tenancy_disaster_recovery_details.go +++ b/database/create_cross_tenancy_disaster_recovery_details.go @@ -120,7 +120,7 @@ type CreateCrossTenancyDisasterRecoveryDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_data_guard_association_with_new_db_system_details.go b/database/create_data_guard_association_with_new_db_system_details.go index 06d2e7e118..c813ead44d 100644 --- a/database/create_data_guard_association_with_new_db_system_details.go +++ b/database/create_data_guard_association_with_new_db_system_details.go @@ -77,6 +77,11 @@ type CreateDataGuardAssociationWithNewDbSystemDetails struct { // The hostname for the DB node. Hostname *string `mandatory:"false" json:"hostname"` + // A domain name used for the DB system. If the Oracle-provided Internet and VCN + // Resolver is enabled for the specified subnet, the domain name for the subnet is used + // (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted. + Domain *string `mandatory:"false" json:"domain"` + // The time zone of the dataguard standby DB system. For details, see DB System Time Zones (https://docs.cloud.oracle.com/Content/Database/References/timezones.htm). TimeZone *string `mandatory:"false" json:"timeZone"` diff --git a/database/create_exadb_vm_cluster_details.go b/database/create_exadb_vm_cluster_details.go index 0162e61cf1..534e2e6858 100644 --- a/database/create_exadb_vm_cluster_details.go +++ b/database/create_exadb_vm_cluster_details.go @@ -60,7 +60,11 @@ type CreateExadbVmClusterDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata Database Storage Vault. ExascaleDbStorageVaultId *string `mandatory:"true" json:"exascaleDbStorageVaultId"` - // Grid Setup will be done using this grid image id + // Grid Setup will be done using this grid image id. + // The grid image id can be extracted from + // 1. Obtain the supported major versions using API /20160918/giVersions?compartmentId=&shape=EXADB_XS&availabilityDomain= + // 2. Replace {version} with one of the supported major versions and obtain the supported minor versions using + // API /20160918/giVersions/{version}/minorVersions?compartmentId=&shapeFamily=EXADB_XS&availabilityDomain= GridImageId *string `mandatory:"true" json:"gridImageId"` // The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. diff --git a/database/create_execution_action_details.go b/database/create_execution_action_details.go new file mode 100644 index 0000000000..f25a834adc --- /dev/null +++ b/database/create_execution_action_details.go @@ -0,0 +1,110 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateExecutionActionDetails Request to create execution action resource. +type CreateExecutionActionDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution window resource the execution action belongs to. + ExecutionWindowId *string `mandatory:"true" json:"executionWindowId"` + + // The action type of the execution action being performed + ActionType CreateExecutionActionDetailsActionTypeEnum `mandatory:"true" json:"actionType"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"false" json:"actionParams"` + + // List of action members of this execution action. + ActionMembers []ExecutionActionMember `mandatory:"false" json:"actionMembers"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateExecutionActionDetails) 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 CreateExecutionActionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCreateExecutionActionDetailsActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetCreateExecutionActionDetailsActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateExecutionActionDetailsActionTypeEnum Enum with underlying type: string +type CreateExecutionActionDetailsActionTypeEnum string + +// Set of constants representing the allowable values for CreateExecutionActionDetailsActionTypeEnum +const ( + CreateExecutionActionDetailsActionTypeDbServerFullSoftwareUpdate CreateExecutionActionDetailsActionTypeEnum = "DB_SERVER_FULL_SOFTWARE_UPDATE" + CreateExecutionActionDetailsActionTypeStorageServerFullSoftwareUpdate CreateExecutionActionDetailsActionTypeEnum = "STORAGE_SERVER_FULL_SOFTWARE_UPDATE" + CreateExecutionActionDetailsActionTypeNetworkSwitchFullSoftwareUpdate CreateExecutionActionDetailsActionTypeEnum = "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE" +) + +var mappingCreateExecutionActionDetailsActionTypeEnum = map[string]CreateExecutionActionDetailsActionTypeEnum{ + "DB_SERVER_FULL_SOFTWARE_UPDATE": CreateExecutionActionDetailsActionTypeDbServerFullSoftwareUpdate, + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE": CreateExecutionActionDetailsActionTypeStorageServerFullSoftwareUpdate, + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE": CreateExecutionActionDetailsActionTypeNetworkSwitchFullSoftwareUpdate, +} + +var mappingCreateExecutionActionDetailsActionTypeEnumLowerCase = map[string]CreateExecutionActionDetailsActionTypeEnum{ + "db_server_full_software_update": CreateExecutionActionDetailsActionTypeDbServerFullSoftwareUpdate, + "storage_server_full_software_update": CreateExecutionActionDetailsActionTypeStorageServerFullSoftwareUpdate, + "network_switch_full_software_update": CreateExecutionActionDetailsActionTypeNetworkSwitchFullSoftwareUpdate, +} + +// GetCreateExecutionActionDetailsActionTypeEnumValues Enumerates the set of values for CreateExecutionActionDetailsActionTypeEnum +func GetCreateExecutionActionDetailsActionTypeEnumValues() []CreateExecutionActionDetailsActionTypeEnum { + values := make([]CreateExecutionActionDetailsActionTypeEnum, 0) + for _, v := range mappingCreateExecutionActionDetailsActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetCreateExecutionActionDetailsActionTypeEnumStringValues Enumerates the set of values in String for CreateExecutionActionDetailsActionTypeEnum +func GetCreateExecutionActionDetailsActionTypeEnumStringValues() []string { + return []string{ + "DB_SERVER_FULL_SOFTWARE_UPDATE", + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingCreateExecutionActionDetailsActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateExecutionActionDetailsActionTypeEnum(val string) (CreateExecutionActionDetailsActionTypeEnum, bool) { + enum, ok := mappingCreateExecutionActionDetailsActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/create_execution_action_request_response.go b/database/create_execution_action_request_response.go new file mode 100644 index 0000000000..340f4cdd86 --- /dev/null +++ b/database/create_execution_action_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateExecutionActionRequest wrapper for the CreateExecutionAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExecutionAction.go.html to see an example of how to use CreateExecutionActionRequest. +type CreateExecutionActionRequest struct { + + // Request to create execution action. + CreateExecutionActionDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateExecutionActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateExecutionActionRequest) 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 CreateExecutionActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateExecutionActionRequest) 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 CreateExecutionActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateExecutionActionResponse wrapper for the CreateExecutionAction operation +type CreateExecutionActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionAction instance + ExecutionAction `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 CreateExecutionActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateExecutionActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/create_execution_window_details.go b/database/create_execution_window_details.go new file mode 100644 index 0000000000..3046dd02e6 --- /dev/null +++ b/database/create_execution_window_details.go @@ -0,0 +1,60 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateExecutionWindowDetails Request to create an execution window resource under an execution resource. +type CreateExecutionWindowDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution resource the execution window belongs to. + ExecutionResourceId *string `mandatory:"true" json:"executionResourceId"` + + // The scheduled start date and time of the execution window. + TimeScheduled *common.SDKTime `mandatory:"true" json:"timeScheduled"` + + // Duration window allows user to set a duration they plan to allocate for Scheduling window. The duration is in minutes. + WindowDurationInMins *int `mandatory:"true" json:"windowDurationInMins"` + + // Indicates if duration the user plans to allocate for scheduling window is strictly enforced. The default value is `FALSE`. + IsEnforcedDuration *bool `mandatory:"false" json:"isEnforcedDuration"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateExecutionWindowDetails) 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 CreateExecutionWindowDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/create_execution_window_request_response.go b/database/create_execution_window_request_response.go new file mode 100644 index 0000000000..8b3a5417b8 --- /dev/null +++ b/database/create_execution_window_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateExecutionWindowRequest wrapper for the CreateExecutionWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExecutionWindow.go.html to see an example of how to use CreateExecutionWindowRequest. +type CreateExecutionWindowRequest struct { + + // Request to create execution window. + CreateExecutionWindowDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateExecutionWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateExecutionWindowRequest) 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 CreateExecutionWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateExecutionWindowRequest) 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 CreateExecutionWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateExecutionWindowResponse wrapper for the CreateExecutionWindow operation +type CreateExecutionWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionWindow instance + ExecutionWindow `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 CreateExecutionWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateExecutionWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/create_pluggable_database_creation_type_details.go b/database/create_pluggable_database_creation_type_details.go index edfd54de5e..6fe0fc0db2 100644 --- a/database/create_pluggable_database_creation_type_details.go +++ b/database/create_pluggable_database_creation_type_details.go @@ -20,18 +20,12 @@ import ( // Use `LOCAL_CLONE_PDB` for creating a new PDB using Local Clone on Source Pluggable Database. This will Clone and starts a // pluggable database (PDB) in the same database (CDB) as the source PDB. The source PDB must be in the `READ_WRITE` openMode to // perform the clone operation. -// -// sourcePluggableDatabaseSnapshotId and isThinClone options are supported only for Exadata VM cluster on Exascale Infrastructure. -// // isThinClone options are supported only for Exadata VM cluster on Exascale Infrastructure. // Use `REMOTE_CLONE_PDB` for creating a new PDB using Remote Clone on Source Pluggable Database. This will Clone a pluggable // database (PDB) to a different database from the source PDB. The cloned PDB will be started upon completion of the clone // operation. The source PDB must be in the `READ_WRITE` openMode when performing the clone. // For Exadata Cloud@Customer instances, the source pluggable database (PDB) must be on the same Exadata Infrastructure as the // target container database (CDB) to create a remote clone. -// -// sourcePluggableDatabaseSnapshotId and isThinClone options are supported only for Exadata VM cluster on Exascale Infrastructure. -// // isThinClone options are supported only for Exadata VM cluster on Exascale Infrastructure. // Use `RELOCATE_PDB` for relocating the Pluggable Database from Source CDB and creating it in target CDB. This will relocate a // pluggable database (PDB) to a different database from the source PDB. The source PDB must be in the `READ_WRITE` openMode when diff --git a/database/create_refreshable_autonomous_database_clone_details.go b/database/create_refreshable_autonomous_database_clone_details.go index 592040377e..e4c1d55d65 100644 --- a/database/create_refreshable_autonomous_database_clone_details.go +++ b/database/create_refreshable_autonomous_database_clone_details.go @@ -98,7 +98,7 @@ type CreateRefreshableAutonomousDatabaseCloneDetails struct { // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // True if the database is on dedicated Exadata infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). diff --git a/database/create_scheduled_action_details.go b/database/create_scheduled_action_details.go new file mode 100644 index 0000000000..b126cc27e8 --- /dev/null +++ b/database/create_scheduled_action_details.go @@ -0,0 +1,113 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateScheduledActionDetails Request to create Scheduled Action resource. +type CreateScheduledActionDetails struct { + + // The type of the scheduled action being performed + ActionType CreateScheduledActionDetailsActionTypeEnum `mandatory:"true" json:"actionType"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Plan. + SchedulingPlanId *string `mandatory:"true" json:"schedulingPlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Window. + SchedulingWindowId *string `mandatory:"true" json:"schedulingWindowId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"false" json:"actionParams"` + + // The list of action members in a scheduled action. + ActionMembers []ActionMember `mandatory:"false" json:"actionMembers"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateScheduledActionDetails) 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 CreateScheduledActionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCreateScheduledActionDetailsActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetCreateScheduledActionDetailsActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateScheduledActionDetailsActionTypeEnum Enum with underlying type: string +type CreateScheduledActionDetailsActionTypeEnum string + +// Set of constants representing the allowable values for CreateScheduledActionDetailsActionTypeEnum +const ( + CreateScheduledActionDetailsActionTypeDbServerFullSoftwareUpdate CreateScheduledActionDetailsActionTypeEnum = "DB_SERVER_FULL_SOFTWARE_UPDATE" + CreateScheduledActionDetailsActionTypeStorageServerFullSoftwareUpdate CreateScheduledActionDetailsActionTypeEnum = "STORAGE_SERVER_FULL_SOFTWARE_UPDATE" + CreateScheduledActionDetailsActionTypeNetworkSwitchFullSoftwareUpdate CreateScheduledActionDetailsActionTypeEnum = "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE" +) + +var mappingCreateScheduledActionDetailsActionTypeEnum = map[string]CreateScheduledActionDetailsActionTypeEnum{ + "DB_SERVER_FULL_SOFTWARE_UPDATE": CreateScheduledActionDetailsActionTypeDbServerFullSoftwareUpdate, + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE": CreateScheduledActionDetailsActionTypeStorageServerFullSoftwareUpdate, + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE": CreateScheduledActionDetailsActionTypeNetworkSwitchFullSoftwareUpdate, +} + +var mappingCreateScheduledActionDetailsActionTypeEnumLowerCase = map[string]CreateScheduledActionDetailsActionTypeEnum{ + "db_server_full_software_update": CreateScheduledActionDetailsActionTypeDbServerFullSoftwareUpdate, + "storage_server_full_software_update": CreateScheduledActionDetailsActionTypeStorageServerFullSoftwareUpdate, + "network_switch_full_software_update": CreateScheduledActionDetailsActionTypeNetworkSwitchFullSoftwareUpdate, +} + +// GetCreateScheduledActionDetailsActionTypeEnumValues Enumerates the set of values for CreateScheduledActionDetailsActionTypeEnum +func GetCreateScheduledActionDetailsActionTypeEnumValues() []CreateScheduledActionDetailsActionTypeEnum { + values := make([]CreateScheduledActionDetailsActionTypeEnum, 0) + for _, v := range mappingCreateScheduledActionDetailsActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetCreateScheduledActionDetailsActionTypeEnumStringValues Enumerates the set of values in String for CreateScheduledActionDetailsActionTypeEnum +func GetCreateScheduledActionDetailsActionTypeEnumStringValues() []string { + return []string{ + "DB_SERVER_FULL_SOFTWARE_UPDATE", + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingCreateScheduledActionDetailsActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateScheduledActionDetailsActionTypeEnum(val string) (CreateScheduledActionDetailsActionTypeEnum, bool) { + enum, ok := mappingCreateScheduledActionDetailsActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/create_scheduled_action_request_response.go b/database/create_scheduled_action_request_response.go new file mode 100644 index 0000000000..5ccc5dfeea --- /dev/null +++ b/database/create_scheduled_action_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateScheduledActionRequest wrapper for the CreateScheduledAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateScheduledAction.go.html to see an example of how to use CreateScheduledActionRequest. +type CreateScheduledActionRequest struct { + + // Request to create Scheduled Action. + CreateScheduledActionDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateScheduledActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateScheduledActionRequest) 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 CreateScheduledActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateScheduledActionRequest) 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 CreateScheduledActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateScheduledActionResponse wrapper for the CreateScheduledAction operation +type CreateScheduledActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ScheduledAction instance + ScheduledAction `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 CreateScheduledActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateScheduledActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/create_scheduling_plan_details.go b/database/create_scheduling_plan_details.go new file mode 100644 index 0000000000..db6fa0e248 --- /dev/null +++ b/database/create_scheduling_plan_details.go @@ -0,0 +1,109 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSchedulingPlanDetails Request to create Scheduling Plan. +type CreateSchedulingPlanDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Policy. + SchedulingPolicyId *string `mandatory:"true" json:"schedulingPolicyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the resource. + ResourceId *string `mandatory:"true" json:"resourceId"` + + // The service type of the Scheduling Plan. + ServiceType CreateSchedulingPlanDetailsServiceTypeEnum `mandatory:"true" json:"serviceType"` + + // If true, recommended scheduled actions will be generated for the scheduling plan. + IsUsingRecommendedScheduledActions *bool `mandatory:"false" json:"isUsingRecommendedScheduledActions"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateSchedulingPlanDetails) 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 CreateSchedulingPlanDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCreateSchedulingPlanDetailsServiceTypeEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetCreateSchedulingPlanDetailsServiceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSchedulingPlanDetailsServiceTypeEnum Enum with underlying type: string +type CreateSchedulingPlanDetailsServiceTypeEnum string + +// Set of constants representing the allowable values for CreateSchedulingPlanDetailsServiceTypeEnum +const ( + CreateSchedulingPlanDetailsServiceTypeExacc CreateSchedulingPlanDetailsServiceTypeEnum = "EXACC" + CreateSchedulingPlanDetailsServiceTypeExacs CreateSchedulingPlanDetailsServiceTypeEnum = "EXACS" + CreateSchedulingPlanDetailsServiceTypeFpppcs CreateSchedulingPlanDetailsServiceTypeEnum = "FPPPCS" +) + +var mappingCreateSchedulingPlanDetailsServiceTypeEnum = map[string]CreateSchedulingPlanDetailsServiceTypeEnum{ + "EXACC": CreateSchedulingPlanDetailsServiceTypeExacc, + "EXACS": CreateSchedulingPlanDetailsServiceTypeExacs, + "FPPPCS": CreateSchedulingPlanDetailsServiceTypeFpppcs, +} + +var mappingCreateSchedulingPlanDetailsServiceTypeEnumLowerCase = map[string]CreateSchedulingPlanDetailsServiceTypeEnum{ + "exacc": CreateSchedulingPlanDetailsServiceTypeExacc, + "exacs": CreateSchedulingPlanDetailsServiceTypeExacs, + "fpppcs": CreateSchedulingPlanDetailsServiceTypeFpppcs, +} + +// GetCreateSchedulingPlanDetailsServiceTypeEnumValues Enumerates the set of values for CreateSchedulingPlanDetailsServiceTypeEnum +func GetCreateSchedulingPlanDetailsServiceTypeEnumValues() []CreateSchedulingPlanDetailsServiceTypeEnum { + values := make([]CreateSchedulingPlanDetailsServiceTypeEnum, 0) + for _, v := range mappingCreateSchedulingPlanDetailsServiceTypeEnum { + values = append(values, v) + } + return values +} + +// GetCreateSchedulingPlanDetailsServiceTypeEnumStringValues Enumerates the set of values in String for CreateSchedulingPlanDetailsServiceTypeEnum +func GetCreateSchedulingPlanDetailsServiceTypeEnumStringValues() []string { + return []string{ + "EXACC", + "EXACS", + "FPPPCS", + } +} + +// GetMappingCreateSchedulingPlanDetailsServiceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateSchedulingPlanDetailsServiceTypeEnum(val string) (CreateSchedulingPlanDetailsServiceTypeEnum, bool) { + enum, ok := mappingCreateSchedulingPlanDetailsServiceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/create_scheduling_plan_request_response.go b/database/create_scheduling_plan_request_response.go new file mode 100644 index 0000000000..bbb0a11e5d --- /dev/null +++ b/database/create_scheduling_plan_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateSchedulingPlanRequest wrapper for the CreateSchedulingPlan operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateSchedulingPlan.go.html to see an example of how to use CreateSchedulingPlanRequest. +type CreateSchedulingPlanRequest struct { + + // Request to create Scheduling Plan. + CreateSchedulingPlanDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSchedulingPlanRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSchedulingPlanRequest) 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 CreateSchedulingPlanRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSchedulingPlanRequest) 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 CreateSchedulingPlanRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSchedulingPlanResponse wrapper for the CreateSchedulingPlan operation +type CreateSchedulingPlanResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingPlan instance + SchedulingPlan `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 CreateSchedulingPlanResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSchedulingPlanResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/create_scheduling_policy_details.go b/database/create_scheduling_policy_details.go new file mode 100644 index 0000000000..af96f982b2 --- /dev/null +++ b/database/create_scheduling_policy_details.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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSchedulingPolicyDetails Request to create Scheduling Policy resource with Maintenance windows per cadence. +type CreateSchedulingPolicyDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the Scheduling Policy. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The cadence period. + Cadence CreateSchedulingPolicyDetailsCadenceEnum `mandatory:"true" json:"cadence"` + + // Start of the month to be followed during the cadence period. + CadenceStartMonth *Month `mandatory:"false" json:"cadenceStartMonth"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateSchedulingPolicyDetails) 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 CreateSchedulingPolicyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCreateSchedulingPolicyDetailsCadenceEnum(string(m.Cadence)); !ok && m.Cadence != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Cadence: %s. Supported values are: %s.", m.Cadence, strings.Join(GetCreateSchedulingPolicyDetailsCadenceEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSchedulingPolicyDetailsCadenceEnum Enum with underlying type: string +type CreateSchedulingPolicyDetailsCadenceEnum string + +// Set of constants representing the allowable values for CreateSchedulingPolicyDetailsCadenceEnum +const ( + CreateSchedulingPolicyDetailsCadenceHalfyearly CreateSchedulingPolicyDetailsCadenceEnum = "HALFYEARLY" + CreateSchedulingPolicyDetailsCadenceQuarterly CreateSchedulingPolicyDetailsCadenceEnum = "QUARTERLY" + CreateSchedulingPolicyDetailsCadenceMonthly CreateSchedulingPolicyDetailsCadenceEnum = "MONTHLY" +) + +var mappingCreateSchedulingPolicyDetailsCadenceEnum = map[string]CreateSchedulingPolicyDetailsCadenceEnum{ + "HALFYEARLY": CreateSchedulingPolicyDetailsCadenceHalfyearly, + "QUARTERLY": CreateSchedulingPolicyDetailsCadenceQuarterly, + "MONTHLY": CreateSchedulingPolicyDetailsCadenceMonthly, +} + +var mappingCreateSchedulingPolicyDetailsCadenceEnumLowerCase = map[string]CreateSchedulingPolicyDetailsCadenceEnum{ + "halfyearly": CreateSchedulingPolicyDetailsCadenceHalfyearly, + "quarterly": CreateSchedulingPolicyDetailsCadenceQuarterly, + "monthly": CreateSchedulingPolicyDetailsCadenceMonthly, +} + +// GetCreateSchedulingPolicyDetailsCadenceEnumValues Enumerates the set of values for CreateSchedulingPolicyDetailsCadenceEnum +func GetCreateSchedulingPolicyDetailsCadenceEnumValues() []CreateSchedulingPolicyDetailsCadenceEnum { + values := make([]CreateSchedulingPolicyDetailsCadenceEnum, 0) + for _, v := range mappingCreateSchedulingPolicyDetailsCadenceEnum { + values = append(values, v) + } + return values +} + +// GetCreateSchedulingPolicyDetailsCadenceEnumStringValues Enumerates the set of values in String for CreateSchedulingPolicyDetailsCadenceEnum +func GetCreateSchedulingPolicyDetailsCadenceEnumStringValues() []string { + return []string{ + "HALFYEARLY", + "QUARTERLY", + "MONTHLY", + } +} + +// GetMappingCreateSchedulingPolicyDetailsCadenceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateSchedulingPolicyDetailsCadenceEnum(val string) (CreateSchedulingPolicyDetailsCadenceEnum, bool) { + enum, ok := mappingCreateSchedulingPolicyDetailsCadenceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/create_scheduling_policy_request_response.go b/database/create_scheduling_policy_request_response.go new file mode 100644 index 0000000000..f911a8b8c9 --- /dev/null +++ b/database/create_scheduling_policy_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateSchedulingPolicyRequest wrapper for the CreateSchedulingPolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateSchedulingPolicy.go.html to see an example of how to use CreateSchedulingPolicyRequest. +type CreateSchedulingPolicyRequest struct { + + // Request to create Scheduling Policy. + CreateSchedulingPolicyDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSchedulingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSchedulingPolicyRequest) 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 CreateSchedulingPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSchedulingPolicyRequest) 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 CreateSchedulingPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSchedulingPolicyResponse wrapper for the CreateSchedulingPolicy operation +type CreateSchedulingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingPolicy instance + SchedulingPolicy `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 CreateSchedulingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSchedulingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/create_scheduling_window_details.go b/database/create_scheduling_window_details.go new file mode 100644 index 0000000000..13c53b61b9 --- /dev/null +++ b/database/create_scheduling_window_details.go @@ -0,0 +1,49 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSchedulingWindowDetails Request to create Scheduling Window resource. +type CreateSchedulingWindowDetails struct { + WindowPreference *WindowPreferenceDetail `mandatory:"true" json:"windowPreference"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateSchedulingWindowDetails) 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 CreateSchedulingWindowDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/create_scheduling_window_request_response.go b/database/create_scheduling_window_request_response.go new file mode 100644 index 0000000000..3af3a3eff7 --- /dev/null +++ b/database/create_scheduling_window_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateSchedulingWindowRequest wrapper for the CreateSchedulingWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateSchedulingWindow.go.html to see an example of how to use CreateSchedulingWindowRequest. +type CreateSchedulingWindowRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // Request to create Scheduling Window. + CreateSchedulingWindowDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateSchedulingWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateSchedulingWindowRequest) 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 CreateSchedulingWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateSchedulingWindowRequest) 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 CreateSchedulingWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateSchedulingWindowResponse wrapper for the CreateSchedulingWindow operation +type CreateSchedulingWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingWindow instance + SchedulingWindow `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 CreateSchedulingWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateSchedulingWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/database_client.go b/database/database_client.go index 442082ab1e..f1ec345d1b 100644 --- a/database/database_client.go +++ b/database/database_client.go @@ -525,6 +525,130 @@ func (client DatabaseClient) cancelBackup(ctx context.Context, request common.OC return response, err } +// CancelExecutionWindow Cancels the in progress maintenance activity under this execution window. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CancelExecutionWindow.go.html to see an example of how to use CancelExecutionWindow API. +func (client DatabaseClient) CancelExecutionWindow(ctx context.Context, request CancelExecutionWindowRequest) (response CancelExecutionWindowResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.cancelExecutionWindow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelExecutionWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelExecutionWindowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelExecutionWindowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelExecutionWindowResponse") + } + return +} + +// cancelExecutionWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) cancelExecutionWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/executionWindows/{executionWindowId}/actions/cancel", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelExecutionWindowResponse + 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/20160918/ExecutionWindow/CancelExecutionWindow" + err = common.PostProcessServiceError(err, "Database", "CancelExecutionWindow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CascadingDeleteSchedulingPlan Delete the scheduling plan resource along with all the scheduled actions associated with this resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CascadingDeleteSchedulingPlan.go.html to see an example of how to use CascadingDeleteSchedulingPlan API. +func (client DatabaseClient) CascadingDeleteSchedulingPlan(ctx context.Context, request CascadingDeleteSchedulingPlanRequest) (response CascadingDeleteSchedulingPlanResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.cascadingDeleteSchedulingPlan, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CascadingDeleteSchedulingPlanResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CascadingDeleteSchedulingPlanResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CascadingDeleteSchedulingPlanResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CascadingDeleteSchedulingPlanResponse") + } + return +} + +// cascadingDeleteSchedulingPlan implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) cascadingDeleteSchedulingPlan(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedulingPlans/{schedulingPlanId}/actions/cascadingDeleteSchedulingPlan", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CascadingDeleteSchedulingPlanResponse + 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/20160918/SchedulingPlan/CascadingDeleteSchedulingPlan" + err = common.PostProcessServiceError(err, "Database", "CascadingDeleteSchedulingPlan", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeAutonomousContainerDatabaseCompartment Move the Autonomous Container Database and its dependent resources to the specified compartment. // For more information about moving Autonomous Container Databases, see // Moving Database Resources to a Different Compartment (https://docs.cloud.oracle.com/Content/Database/Concepts/databaseoverview.htm#moveRes). @@ -2095,6 +2219,130 @@ func (client DatabaseClient) changeOneoffPatchCompartment(ctx context.Context, r return response, err } +// ChangeSchedulingPlanCompartment Moves an scheduling plan resource to another compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ChangeSchedulingPlanCompartment.go.html to see an example of how to use ChangeSchedulingPlanCompartment API. +func (client DatabaseClient) ChangeSchedulingPlanCompartment(ctx context.Context, request ChangeSchedulingPlanCompartmentRequest) (response ChangeSchedulingPlanCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.changeSchedulingPlanCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeSchedulingPlanCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeSchedulingPlanCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeSchedulingPlanCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeSchedulingPlanCompartmentResponse") + } + return +} + +// changeSchedulingPlanCompartment implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) changeSchedulingPlanCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedulingPlans/{schedulingPlanId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeSchedulingPlanCompartmentResponse + 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/20160918/SchedulingPlan/ChangeSchedulingPlanCompartment" + err = common.PostProcessServiceError(err, "Database", "ChangeSchedulingPlanCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeSchedulingPolicyCompartment Moves an scheduling policy resource to another compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ChangeSchedulingPolicyCompartment.go.html to see an example of how to use ChangeSchedulingPolicyCompartment API. +func (client DatabaseClient) ChangeSchedulingPolicyCompartment(ctx context.Context, request ChangeSchedulingPolicyCompartmentRequest) (response ChangeSchedulingPolicyCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.changeSchedulingPolicyCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeSchedulingPolicyCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeSchedulingPolicyCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeSchedulingPolicyCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeSchedulingPolicyCompartmentResponse") + } + return +} + +// changeSchedulingPolicyCompartment implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) changeSchedulingPolicyCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedulingPolicies/{schedulingPolicyId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeSchedulingPolicyCompartmentResponse + 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/20160918/SchedulingPolicy/ChangeSchedulingPolicyCompartment" + err = common.PostProcessServiceError(err, "Database", "ChangeSchedulingPolicyCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeVmClusterCompartment Moves a VM cluster and its dependent resources to another compartment. Applies to Exadata Cloud@Customer instances only. // To move a cloud VM cluster in an Exadata Cloud Service instance to another compartment, use the ChangeCloudVmClusterCompartment operation. // @@ -3903,13 +4151,12 @@ func (client DatabaseClient) createExascaleDbStorageVault(ctx context.Context, r return response, err } -// CreateExternalBackupJob Creates a new backup resource and returns the information the caller needs to back up an on-premises Oracle Database to Oracle Cloud Infrastructure. -// **Note:** This API is used by an Oracle Cloud Infrastructure Python script that is packaged with the Oracle Cloud Infrastructure CLI. Oracle recommends that you use the script instead using the API directly. See Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud (https://docs.cloud.oracle.com/Content/Database/Tasks/mig-onprembackup.htm) for more information. +// CreateExecutionAction Creates an execution action resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalBackupJob.go.html to see an example of how to use CreateExternalBackupJob API. -func (client DatabaseClient) CreateExternalBackupJob(ctx context.Context, request CreateExternalBackupJobRequest) (response CreateExternalBackupJobResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExecutionAction.go.html to see an example of how to use CreateExecutionAction API. +func (client DatabaseClient) CreateExecutionAction(ctx context.Context, request CreateExecutionActionRequest) (response CreateExecutionActionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -3923,42 +4170,42 @@ func (client DatabaseClient) CreateExternalBackupJob(ctx context.Context, reques request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createExternalBackupJob, policy) + ociResponse, err = common.Retry(ctx, request, client.createExecutionAction, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateExternalBackupJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateExecutionActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateExternalBackupJobResponse{} + response = CreateExecutionActionResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateExternalBackupJobResponse); ok { + if convertedResponse, ok := ociResponse.(CreateExecutionActionResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateExternalBackupJobResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateExecutionActionResponse") } return } -// createExternalBackupJob implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) createExternalBackupJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createExecutionAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createExecutionAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalBackupJobs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/executionActions", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateExternalBackupJobResponse + var response CreateExecutionActionResponse 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/20160918/ExternalBackupJob/CreateExternalBackupJob" - err = common.PostProcessServiceError(err, "Database", "CreateExternalBackupJob", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ExecutionAction/CreateExecutionAction" + err = common.PostProcessServiceError(err, "Database", "CreateExecutionAction", apiReferenceLink) return response, err } @@ -3966,12 +4213,12 @@ func (client DatabaseClient) createExternalBackupJob(ctx context.Context, reques return response, err } -// CreateExternalContainerDatabase Creates a new external container database resource. +// CreateExecutionWindow Creates an execution window resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalContainerDatabase.go.html to see an example of how to use CreateExternalContainerDatabase API. -func (client DatabaseClient) CreateExternalContainerDatabase(ctx context.Context, request CreateExternalContainerDatabaseRequest) (response CreateExternalContainerDatabaseResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExecutionWindow.go.html to see an example of how to use CreateExecutionWindow API. +func (client DatabaseClient) CreateExecutionWindow(ctx context.Context, request CreateExecutionWindowRequest) (response CreateExecutionWindowResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -3985,42 +4232,42 @@ func (client DatabaseClient) CreateExternalContainerDatabase(ctx context.Context request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createExternalContainerDatabase, policy) + ociResponse, err = common.Retry(ctx, request, client.createExecutionWindow, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateExternalContainerDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateExecutionWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateExternalContainerDatabaseResponse{} + response = CreateExecutionWindowResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateExternalContainerDatabaseResponse); ok { + if convertedResponse, ok := ociResponse.(CreateExecutionWindowResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateExternalContainerDatabaseResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateExecutionWindowResponse") } return } -// createExternalContainerDatabase implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) createExternalContainerDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createExecutionWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createExecutionWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalcontainerdatabases", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/executionWindows", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateExternalContainerDatabaseResponse + var response CreateExecutionWindowResponse 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/20160918/ExternalContainerDatabase/CreateExternalContainerDatabase" - err = common.PostProcessServiceError(err, "Database", "CreateExternalContainerDatabase", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ExecutionWindow/CreateExecutionWindow" + err = common.PostProcessServiceError(err, "Database", "CreateExecutionWindow", apiReferenceLink) return response, err } @@ -4028,12 +4275,13 @@ func (client DatabaseClient) createExternalContainerDatabase(ctx context.Context return response, err } -// CreateExternalDatabaseConnector Creates a new external database connector. +// CreateExternalBackupJob Creates a new backup resource and returns the information the caller needs to back up an on-premises Oracle Database to Oracle Cloud Infrastructure. +// **Note:** This API is used by an Oracle Cloud Infrastructure Python script that is packaged with the Oracle Cloud Infrastructure CLI. Oracle recommends that you use the script instead using the API directly. See Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud (https://docs.cloud.oracle.com/Content/Database/Tasks/mig-onprembackup.htm) for more information. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalDatabaseConnector.go.html to see an example of how to use CreateExternalDatabaseConnector API. -func (client DatabaseClient) CreateExternalDatabaseConnector(ctx context.Context, request CreateExternalDatabaseConnectorRequest) (response CreateExternalDatabaseConnectorResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalBackupJob.go.html to see an example of how to use CreateExternalBackupJob API. +func (client DatabaseClient) CreateExternalBackupJob(ctx context.Context, request CreateExternalBackupJobRequest) (response CreateExternalBackupJobResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4047,55 +4295,179 @@ func (client DatabaseClient) CreateExternalDatabaseConnector(ctx context.Context request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createExternalDatabaseConnector, policy) + ociResponse, err = common.Retry(ctx, request, client.createExternalBackupJob, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateExternalDatabaseConnectorResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateExternalBackupJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateExternalDatabaseConnectorResponse{} + response = CreateExternalBackupJobResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateExternalDatabaseConnectorResponse); ok { + if convertedResponse, ok := ociResponse.(CreateExternalBackupJobResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateExternalDatabaseConnectorResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateExternalBackupJobResponse") } return } -// createExternalDatabaseConnector implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) createExternalDatabaseConnector(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createExternalBackupJob implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createExternalBackupJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externaldatabaseconnectors", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalBackupJobs", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateExternalDatabaseConnectorResponse + var response CreateExternalBackupJobResponse 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/20160918/ExternalDatabaseConnector/CreateExternalDatabaseConnector" - err = common.PostProcessServiceError(err, "Database", "CreateExternalDatabaseConnector", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ExternalBackupJob/CreateExternalBackupJob" + err = common.PostProcessServiceError(err, "Database", "CreateExternalBackupJob", apiReferenceLink) return response, err } - err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &externaldatabaseconnector{}) + err = common.UnmarshalResponse(httpResponse, &response) return response, err } -// CreateExternalNonContainerDatabase Creates a new ExternalNonContainerDatabase resource +// CreateExternalContainerDatabase Creates a new external container database resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalNonContainerDatabase.go.html to see an example of how to use CreateExternalNonContainerDatabase API. -func (client DatabaseClient) CreateExternalNonContainerDatabase(ctx context.Context, request CreateExternalNonContainerDatabaseRequest) (response CreateExternalNonContainerDatabaseResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalContainerDatabase.go.html to see an example of how to use CreateExternalContainerDatabase API. +func (client DatabaseClient) CreateExternalContainerDatabase(ctx context.Context, request CreateExternalContainerDatabaseRequest) (response CreateExternalContainerDatabaseResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.createExternalContainerDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateExternalContainerDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateExternalContainerDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateExternalContainerDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateExternalContainerDatabaseResponse") + } + return +} + +// createExternalContainerDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createExternalContainerDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalcontainerdatabases", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateExternalContainerDatabaseResponse + 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/20160918/ExternalContainerDatabase/CreateExternalContainerDatabase" + err = common.PostProcessServiceError(err, "Database", "CreateExternalContainerDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateExternalDatabaseConnector Creates a new external database connector. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalDatabaseConnector.go.html to see an example of how to use CreateExternalDatabaseConnector API. +func (client DatabaseClient) CreateExternalDatabaseConnector(ctx context.Context, request CreateExternalDatabaseConnectorRequest) (response CreateExternalDatabaseConnectorResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.createExternalDatabaseConnector, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateExternalDatabaseConnectorResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateExternalDatabaseConnectorResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateExternalDatabaseConnectorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateExternalDatabaseConnectorResponse") + } + return +} + +// createExternalDatabaseConnector implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createExternalDatabaseConnector(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externaldatabaseconnectors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateExternalDatabaseConnectorResponse + 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/20160918/ExternalDatabaseConnector/CreateExternalDatabaseConnector" + err = common.PostProcessServiceError(err, "Database", "CreateExternalDatabaseConnector", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &externaldatabaseconnector{}) + return response, err +} + +// CreateExternalNonContainerDatabase Creates a new ExternalNonContainerDatabase resource +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateExternalNonContainerDatabase.go.html to see an example of how to use CreateExternalNonContainerDatabase API. +func (client DatabaseClient) CreateExternalNonContainerDatabase(ctx context.Context, request CreateExternalNonContainerDatabaseRequest) (response CreateExternalNonContainerDatabaseResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4468,12 +4840,12 @@ func (client DatabaseClient) createPluggableDatabase(ctx context.Context, reques return response, err } -// CreateVmCluster Creates an Exadata Cloud@Customer VM cluster. +// CreateScheduledAction Creates a Scheduled Action resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateVmCluster.go.html to see an example of how to use CreateVmCluster API. -func (client DatabaseClient) CreateVmCluster(ctx context.Context, request CreateVmClusterRequest) (response CreateVmClusterResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateScheduledAction.go.html to see an example of how to use CreateScheduledAction API. +func (client DatabaseClient) CreateScheduledAction(ctx context.Context, request CreateScheduledActionRequest) (response CreateScheduledActionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4487,42 +4859,42 @@ func (client DatabaseClient) CreateVmCluster(ctx context.Context, request Create request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createVmCluster, policy) + ociResponse, err = common.Retry(ctx, request, client.createScheduledAction, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateScheduledActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateVmClusterResponse{} + response = CreateScheduledActionResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateVmClusterResponse); ok { + if convertedResponse, ok := ociResponse.(CreateScheduledActionResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateVmClusterResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateScheduledActionResponse") } return } -// createVmCluster implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) createVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createScheduledAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createScheduledAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/vmClusters", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/scheduledActions", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateVmClusterResponse + var response CreateScheduledActionResponse 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/20160918/VmCluster/CreateVmCluster" - err = common.PostProcessServiceError(err, "Database", "CreateVmCluster", apiReferenceLink) + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Database", "CreateScheduledAction", apiReferenceLink) return response, err } @@ -4530,13 +4902,12 @@ func (client DatabaseClient) createVmCluster(ctx context.Context, request common return response, err } -// CreateVmClusterNetwork Creates the VM cluster network. Applies to Exadata Cloud@Customer instances only. -// To create a cloud VM cluster in an Exadata Cloud Service instance, use the CreateCloudVmCluster operation. +// CreateSchedulingPlan Creates a Scheduling Plan resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateVmClusterNetwork.go.html to see an example of how to use CreateVmClusterNetwork API. -func (client DatabaseClient) CreateVmClusterNetwork(ctx context.Context, request CreateVmClusterNetworkRequest) (response CreateVmClusterNetworkResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateSchedulingPlan.go.html to see an example of how to use CreateSchedulingPlan API. +func (client DatabaseClient) CreateSchedulingPlan(ctx context.Context, request CreateSchedulingPlanRequest) (response CreateSchedulingPlanResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4550,42 +4921,42 @@ func (client DatabaseClient) CreateVmClusterNetwork(ctx context.Context, request request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createVmClusterNetwork, policy) + ociResponse, err = common.Retry(ctx, request, client.createSchedulingPlan, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateVmClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateSchedulingPlanResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateVmClusterNetworkResponse{} + response = CreateSchedulingPlanResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateVmClusterNetworkResponse); ok { + if convertedResponse, ok := ociResponse.(CreateSchedulingPlanResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateVmClusterNetworkResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateSchedulingPlanResponse") } return } -// createVmClusterNetwork implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) createVmClusterNetwork(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createSchedulingPlan implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createSchedulingPlan(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/exadataInfrastructures/{exadataInfrastructureId}/vmClusterNetworks", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedulingPlans", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateVmClusterNetworkResponse + var response CreateSchedulingPlanResponse 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/20160918/VmClusterNetwork/CreateVmClusterNetwork" - err = common.PostProcessServiceError(err, "Database", "CreateVmClusterNetwork", apiReferenceLink) + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "Database", "CreateSchedulingPlan", apiReferenceLink) return response, err } @@ -4593,23 +4964,12 @@ func (client DatabaseClient) createVmClusterNetwork(ctx context.Context, request return response, err } -// DbNodeAction Performs one of the following power actions on the specified DB node: -// - start - power on -// - stop - power off -// - softreset - ACPI shutdown and power on -// - reset - power off and power on -// **Note:** Stopping a node affects billing differently, depending on the type of DB system: -// *Bare metal and Exadata systems* - The _stop_ state has no effect on the resources you consume. -// Billing continues for DB nodes that you stop, and related resources continue -// to apply against any relevant quotas. You must terminate the DB system -// (TerminateDbSystem) -// to remove its resources from billing and quotas. -// *Virtual machine DB systems* - Stopping a node stops billing for all OCPUs associated with that node, and billing resumes when you restart the node. +// CreateSchedulingPolicy Creates a Scheduling Policy resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DbNodeAction.go.html to see an example of how to use DbNodeAction API. -func (client DatabaseClient) DbNodeAction(ctx context.Context, request DbNodeActionRequest) (response DbNodeActionResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateSchedulingPolicy.go.html to see an example of how to use CreateSchedulingPolicy API. +func (client DatabaseClient) CreateSchedulingPolicy(ctx context.Context, request CreateSchedulingPolicyRequest) (response CreateSchedulingPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4623,42 +4983,42 @@ func (client DatabaseClient) DbNodeAction(ctx context.Context, request DbNodeAct request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.dbNodeAction, policy) + ociResponse, err = common.Retry(ctx, request, client.createSchedulingPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DbNodeActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateSchedulingPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DbNodeActionResponse{} + response = CreateSchedulingPolicyResponse{} } } return } - if convertedResponse, ok := ociResponse.(DbNodeActionResponse); ok { + if convertedResponse, ok := ociResponse.(CreateSchedulingPolicyResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DbNodeActionResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateSchedulingPolicyResponse") } return } -// dbNodeAction implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) dbNodeAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createSchedulingPolicy implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createSchedulingPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/dbNodes/{dbNodeId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedulingPolicies", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DbNodeActionResponse + var response CreateSchedulingPolicyResponse 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/20160918/DbNode/DbNodeAction" - err = common.PostProcessServiceError(err, "Database", "DbNodeAction", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPolicy/CreateSchedulingPolicy" + err = common.PostProcessServiceError(err, "Database", "CreateSchedulingPolicy", apiReferenceLink) return response, err } @@ -4666,12 +5026,12 @@ func (client DatabaseClient) dbNodeAction(ctx context.Context, request common.OC return response, err } -// DeleteApplicationVip Deletes and deregisters the specified application virtual IP (VIP) address. +// CreateSchedulingWindow Creates a Scheduling Window resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteApplicationVip.go.html to see an example of how to use DeleteApplicationVip API. -func (client DatabaseClient) DeleteApplicationVip(ctx context.Context, request DeleteApplicationVipRequest) (response DeleteApplicationVipResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateSchedulingWindow.go.html to see an example of how to use CreateSchedulingWindow API. +func (client DatabaseClient) CreateSchedulingWindow(ctx context.Context, request CreateSchedulingWindowRequest) (response CreateSchedulingWindowResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4680,42 +5040,47 @@ func (client DatabaseClient) DeleteApplicationVip(ctx context.Context, request D if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteApplicationVip, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createSchedulingWindow, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteApplicationVipResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateSchedulingWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteApplicationVipResponse{} + response = CreateSchedulingWindowResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteApplicationVipResponse); ok { + if convertedResponse, ok := ociResponse.(CreateSchedulingWindowResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteApplicationVipResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateSchedulingWindowResponse") } return } -// deleteApplicationVip implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) deleteApplicationVip(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createSchedulingWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createSchedulingWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/applicationVip/{applicationVipId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedulingPolicies/{schedulingPolicyId}/schedulingWindows", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteApplicationVipResponse + var response CreateSchedulingWindowResponse 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/20160918/ApplicationVip/DeleteApplicationVip" - err = common.PostProcessServiceError(err, "Database", "DeleteApplicationVip", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingWindow/CreateSchedulingWindow" + err = common.PostProcessServiceError(err, "Database", "CreateSchedulingWindow", apiReferenceLink) return response, err } @@ -4723,12 +5088,12 @@ func (client DatabaseClient) deleteApplicationVip(ctx context.Context, request c return response, err } -// DeleteAutonomousDatabase Deletes the specified Autonomous Database. +// CreateVmCluster Creates an Exadata Cloud@Customer VM cluster. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteAutonomousDatabase.go.html to see an example of how to use DeleteAutonomousDatabase API. -func (client DatabaseClient) DeleteAutonomousDatabase(ctx context.Context, request DeleteAutonomousDatabaseRequest) (response DeleteAutonomousDatabaseResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateVmCluster.go.html to see an example of how to use CreateVmCluster API. +func (client DatabaseClient) CreateVmCluster(ctx context.Context, request CreateVmClusterRequest) (response CreateVmClusterResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4737,42 +5102,47 @@ func (client DatabaseClient) DeleteAutonomousDatabase(ctx context.Context, reque if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteAutonomousDatabase, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVmCluster, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteAutonomousDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteAutonomousDatabaseResponse{} + response = CreateVmClusterResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteAutonomousDatabaseResponse); ok { + if convertedResponse, ok := ociResponse.(CreateVmClusterResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteAutonomousDatabaseResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateVmClusterResponse") } return } -// deleteAutonomousDatabase implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) deleteAutonomousDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createVmCluster implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/autonomousDatabases/{autonomousDatabaseId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/vmClusters", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteAutonomousDatabaseResponse + var response CreateVmClusterResponse 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/20160918/AutonomousDatabase/DeleteAutonomousDatabase" - err = common.PostProcessServiceError(err, "Database", "DeleteAutonomousDatabase", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/VmCluster/CreateVmCluster" + err = common.PostProcessServiceError(err, "Database", "CreateVmCluster", apiReferenceLink) return response, err } @@ -4780,12 +5150,13 @@ func (client DatabaseClient) deleteAutonomousDatabase(ctx context.Context, reque return response, err } -// DeleteAutonomousDatabaseBackup Deletes a long-term backup. You cannot delete other backups using this API. +// CreateVmClusterNetwork Creates the VM cluster network. Applies to Exadata Cloud@Customer instances only. +// To create a cloud VM cluster in an Exadata Cloud Service instance, use the CreateCloudVmCluster operation. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteAutonomousDatabaseBackup.go.html to see an example of how to use DeleteAutonomousDatabaseBackup API. -func (client DatabaseClient) DeleteAutonomousDatabaseBackup(ctx context.Context, request DeleteAutonomousDatabaseBackupRequest) (response DeleteAutonomousDatabaseBackupResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/CreateVmClusterNetwork.go.html to see an example of how to use CreateVmClusterNetwork API. +func (client DatabaseClient) CreateVmClusterNetwork(ctx context.Context, request CreateVmClusterNetworkRequest) (response CreateVmClusterNetworkResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -4794,28 +5165,277 @@ func (client DatabaseClient) DeleteAutonomousDatabaseBackup(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteAutonomousDatabaseBackup, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createVmClusterNetwork, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteAutonomousDatabaseBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateVmClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteAutonomousDatabaseBackupResponse{} + response = CreateVmClusterNetworkResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteAutonomousDatabaseBackupResponse); ok { + if convertedResponse, ok := ociResponse.(CreateVmClusterNetworkResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteAutonomousDatabaseBackupResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateVmClusterNetworkResponse") } return } -// deleteAutonomousDatabaseBackup implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) deleteAutonomousDatabaseBackup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createVmClusterNetwork implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) createVmClusterNetwork(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/exadataInfrastructures/{exadataInfrastructureId}/vmClusterNetworks", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateVmClusterNetworkResponse + 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/20160918/VmClusterNetwork/CreateVmClusterNetwork" + err = common.PostProcessServiceError(err, "Database", "CreateVmClusterNetwork", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DbNodeAction Performs one of the following power actions on the specified DB node: +// - start - power on +// - stop - power off +// - softreset - ACPI shutdown and power on +// - reset - power off and power on +// **Note:** Stopping a node affects billing differently, depending on the type of DB system: +// *Bare metal and Exadata systems* - The _stop_ state has no effect on the resources you consume. +// Billing continues for DB nodes that you stop, and related resources continue +// to apply against any relevant quotas. You must terminate the DB system +// (TerminateDbSystem) +// to remove its resources from billing and quotas. +// *Virtual machine DB systems* - Stopping a node stops billing for all OCPUs associated with that node, and billing resumes when you restart the node. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DbNodeAction.go.html to see an example of how to use DbNodeAction API. +func (client DatabaseClient) DbNodeAction(ctx context.Context, request DbNodeActionRequest) (response DbNodeActionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.dbNodeAction, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DbNodeActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DbNodeActionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DbNodeActionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DbNodeActionResponse") + } + return +} + +// dbNodeAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) dbNodeAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dbNodes/{dbNodeId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DbNodeActionResponse + 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/20160918/DbNode/DbNodeAction" + err = common.PostProcessServiceError(err, "Database", "DbNodeAction", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteApplicationVip Deletes and deregisters the specified application virtual IP (VIP) address. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteApplicationVip.go.html to see an example of how to use DeleteApplicationVip API. +func (client DatabaseClient) DeleteApplicationVip(ctx context.Context, request DeleteApplicationVipRequest) (response DeleteApplicationVipResponse, 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.deleteApplicationVip, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteApplicationVipResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteApplicationVipResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteApplicationVipResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteApplicationVipResponse") + } + return +} + +// deleteApplicationVip implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteApplicationVip(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/applicationVip/{applicationVipId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteApplicationVipResponse + 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/20160918/ApplicationVip/DeleteApplicationVip" + err = common.PostProcessServiceError(err, "Database", "DeleteApplicationVip", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAutonomousDatabase Deletes the specified Autonomous Database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteAutonomousDatabase.go.html to see an example of how to use DeleteAutonomousDatabase API. +func (client DatabaseClient) DeleteAutonomousDatabase(ctx context.Context, request DeleteAutonomousDatabaseRequest) (response DeleteAutonomousDatabaseResponse, 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.deleteAutonomousDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteAutonomousDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteAutonomousDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAutonomousDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAutonomousDatabaseResponse") + } + return +} + +// deleteAutonomousDatabase implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteAutonomousDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/autonomousDatabases/{autonomousDatabaseId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteAutonomousDatabaseResponse + 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/20160918/AutonomousDatabase/DeleteAutonomousDatabase" + err = common.PostProcessServiceError(err, "Database", "DeleteAutonomousDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteAutonomousDatabaseBackup Deletes a long-term backup. You cannot delete other backups using this API. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteAutonomousDatabaseBackup.go.html to see an example of how to use DeleteAutonomousDatabaseBackup API. +func (client DatabaseClient) DeleteAutonomousDatabaseBackup(ctx context.Context, request DeleteAutonomousDatabaseBackupRequest) (response DeleteAutonomousDatabaseBackupResponse, 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.deleteAutonomousDatabaseBackup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteAutonomousDatabaseBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteAutonomousDatabaseBackupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteAutonomousDatabaseBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteAutonomousDatabaseBackupResponse") + } + return +} + +// deleteAutonomousDatabaseBackup implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteAutonomousDatabaseBackup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/autonomousDatabaseBackups/{autonomousDatabaseBackupId}", binaryReqBody, extraHeaders) if err != nil { @@ -5694,14 +6314,12 @@ func (client DatabaseClient) deleteExascaleDbStorageVault(ctx context.Context, r return response, err } -// DeleteExternalContainerDatabase Deletes the CreateExternalContainerDatabaseDetails -// resource. Any external pluggable databases registered under this container database must be deleted in -// your Oracle Cloud Infrastructure tenancy prior to this operation. +// DeleteExecutionAction Deletes the execution action. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteExternalContainerDatabase.go.html to see an example of how to use DeleteExternalContainerDatabase API. -func (client DatabaseClient) DeleteExternalContainerDatabase(ctx context.Context, request DeleteExternalContainerDatabaseRequest) (response DeleteExternalContainerDatabaseResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteExecutionAction.go.html to see an example of how to use DeleteExecutionAction API. +func (client DatabaseClient) DeleteExecutionAction(ctx context.Context, request DeleteExecutionActionRequest) (response DeleteExecutionActionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -5710,22 +6328,138 @@ func (client DatabaseClient) DeleteExternalContainerDatabase(ctx context.Context if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteExternalContainerDatabase, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteExecutionAction, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteExternalContainerDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteExecutionActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteExternalContainerDatabaseResponse{} + response = DeleteExecutionActionResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteExternalContainerDatabaseResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteExecutionActionResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteExternalContainerDatabaseResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteExecutionActionResponse") + } + return +} + +// deleteExecutionAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteExecutionAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/executionActions/{executionActionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteExecutionActionResponse + 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/20160918/ExecutionAction/DeleteExecutionAction" + err = common.PostProcessServiceError(err, "Database", "DeleteExecutionAction", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteExecutionWindow Deletes the execution window. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteExecutionWindow.go.html to see an example of how to use DeleteExecutionWindow API. +func (client DatabaseClient) DeleteExecutionWindow(ctx context.Context, request DeleteExecutionWindowRequest) (response DeleteExecutionWindowResponse, 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.deleteExecutionWindow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteExecutionWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteExecutionWindowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteExecutionWindowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteExecutionWindowResponse") + } + return +} + +// deleteExecutionWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteExecutionWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/executionWindows/{executionWindowId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteExecutionWindowResponse + 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/20160918/ExecutionWindow/DeleteExecutionWindow" + err = common.PostProcessServiceError(err, "Database", "DeleteExecutionWindow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteExternalContainerDatabase Deletes the CreateExternalContainerDatabaseDetails +// resource. Any external pluggable databases registered under this container database must be deleted in +// your Oracle Cloud Infrastructure tenancy prior to this operation. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteExternalContainerDatabase.go.html to see an example of how to use DeleteExternalContainerDatabase API. +func (client DatabaseClient) DeleteExternalContainerDatabase(ctx context.Context, request DeleteExternalContainerDatabaseRequest) (response DeleteExternalContainerDatabaseResponse, 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.deleteExternalContainerDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteExternalContainerDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteExternalContainerDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteExternalContainerDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteExternalContainerDatabaseResponse") } return } @@ -6098,12 +6832,12 @@ func (client DatabaseClient) deletePluggableDatabase(ctx context.Context, reques return response, err } -// DeleteVmCluster Deletes the specified VM cluster. Applies to Exadata Cloud@Customer instances only. +// DeleteScheduledAction Deletes the scheduled action. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteVmCluster.go.html to see an example of how to use DeleteVmCluster API. -func (client DatabaseClient) DeleteVmCluster(ctx context.Context, request DeleteVmClusterRequest) (response DeleteVmClusterResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteScheduledAction.go.html to see an example of how to use DeleteScheduledAction API. +func (client DatabaseClient) DeleteScheduledAction(ctx context.Context, request DeleteScheduledActionRequest) (response DeleteScheduledActionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6112,42 +6846,42 @@ func (client DatabaseClient) DeleteVmCluster(ctx context.Context, request Delete if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteVmCluster, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteScheduledAction, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteScheduledActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteVmClusterResponse{} + response = DeleteScheduledActionResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteVmClusterResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteScheduledActionResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteVmClusterResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteScheduledActionResponse") } return } -// deleteVmCluster implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) deleteVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteScheduledAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteScheduledAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/vmClusters/{vmClusterId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/scheduledActions/{scheduledActionId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteVmClusterResponse + var response DeleteScheduledActionResponse 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/20160918/VmCluster/DeleteVmCluster" - err = common.PostProcessServiceError(err, "Database", "DeleteVmCluster", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ScheduledAction/DeleteScheduledAction" + err = common.PostProcessServiceError(err, "Database", "DeleteScheduledAction", apiReferenceLink) return response, err } @@ -6155,13 +6889,12 @@ func (client DatabaseClient) deleteVmCluster(ctx context.Context, request common return response, err } -// DeleteVmClusterNetwork Deletes the specified VM cluster network. Applies to Exadata Cloud@Customer instances only. -// To delete a cloud VM cluster in an Exadata Cloud Service instance, use the DeleteCloudVmCluster operation. +// DeleteSchedulingPlan Deletes the scheduling plan. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteVmClusterNetwork.go.html to see an example of how to use DeleteVmClusterNetwork API. -func (client DatabaseClient) DeleteVmClusterNetwork(ctx context.Context, request DeleteVmClusterNetworkRequest) (response DeleteVmClusterNetworkResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteSchedulingPlan.go.html to see an example of how to use DeleteSchedulingPlan API. +func (client DatabaseClient) DeleteSchedulingPlan(ctx context.Context, request DeleteSchedulingPlanRequest) (response DeleteSchedulingPlanResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6170,42 +6903,42 @@ func (client DatabaseClient) DeleteVmClusterNetwork(ctx context.Context, request if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteVmClusterNetwork, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteSchedulingPlan, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteVmClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteSchedulingPlanResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteVmClusterNetworkResponse{} + response = DeleteSchedulingPlanResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteVmClusterNetworkResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteSchedulingPlanResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteVmClusterNetworkResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteSchedulingPlanResponse") } return } -// deleteVmClusterNetwork implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) deleteVmClusterNetwork(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteSchedulingPlan implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteSchedulingPlan(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/exadataInfrastructures/{exadataInfrastructureId}/vmClusterNetworks/{vmClusterNetworkId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/schedulingPlans/{schedulingPlanId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteVmClusterNetworkResponse + var response DeleteSchedulingPlanResponse 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/20160918/VmClusterNetwork/DeleteVmClusterNetwork" - err = common.PostProcessServiceError(err, "Database", "DeleteVmClusterNetwork", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPlan/DeleteSchedulingPlan" + err = common.PostProcessServiceError(err, "Database", "DeleteSchedulingPlan", apiReferenceLink) return response, err } @@ -6213,12 +6946,12 @@ func (client DatabaseClient) deleteVmClusterNetwork(ctx context.Context, request return response, err } -// DeregisterAutonomousDatabaseDataSafe Asynchronously deregisters this Autonomous Database with Data Safe. +// DeleteSchedulingPolicy Deletes the scheduling policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeregisterAutonomousDatabaseDataSafe.go.html to see an example of how to use DeregisterAutonomousDatabaseDataSafe API. -func (client DatabaseClient) DeregisterAutonomousDatabaseDataSafe(ctx context.Context, request DeregisterAutonomousDatabaseDataSafeRequest) (response DeregisterAutonomousDatabaseDataSafeResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteSchedulingPolicy.go.html to see an example of how to use DeleteSchedulingPolicy API. +func (client DatabaseClient) DeleteSchedulingPolicy(ctx context.Context, request DeleteSchedulingPolicyRequest) (response DeleteSchedulingPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6227,42 +6960,42 @@ func (client DatabaseClient) DeregisterAutonomousDatabaseDataSafe(ctx context.Co if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deregisterAutonomousDatabaseDataSafe, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteSchedulingPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeregisterAutonomousDatabaseDataSafeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteSchedulingPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeregisterAutonomousDatabaseDataSafeResponse{} + response = DeleteSchedulingPolicyResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeregisterAutonomousDatabaseDataSafeResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteSchedulingPolicyResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeregisterAutonomousDatabaseDataSafeResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteSchedulingPolicyResponse") } return } -// deregisterAutonomousDatabaseDataSafe implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) deregisterAutonomousDatabaseDataSafe(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteSchedulingPolicy implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteSchedulingPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/deregisterDataSafe", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/schedulingPolicies/{schedulingPolicyId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeregisterAutonomousDatabaseDataSafeResponse + var response DeleteSchedulingPolicyResponse 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/20160918/AutonomousDatabase/DeregisterAutonomousDatabaseDataSafe" - err = common.PostProcessServiceError(err, "Database", "DeregisterAutonomousDatabaseDataSafe", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPolicy/DeleteSchedulingPolicy" + err = common.PostProcessServiceError(err, "Database", "DeleteSchedulingPolicy", apiReferenceLink) return response, err } @@ -6270,12 +7003,12 @@ func (client DatabaseClient) deregisterAutonomousDatabaseDataSafe(ctx context.Co return response, err } -// DisableAutonomousDatabaseManagement Disables Database Management for the Autonomous Database resource. +// DeleteSchedulingWindow Deletes the scheduling window. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableAutonomousDatabaseManagement.go.html to see an example of how to use DisableAutonomousDatabaseManagement API. -func (client DatabaseClient) DisableAutonomousDatabaseManagement(ctx context.Context, request DisableAutonomousDatabaseManagementRequest) (response DisableAutonomousDatabaseManagementResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteSchedulingWindow.go.html to see an example of how to use DeleteSchedulingWindow API. +func (client DatabaseClient) DeleteSchedulingWindow(ctx context.Context, request DeleteSchedulingWindowRequest) (response DeleteSchedulingWindowResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6284,42 +7017,42 @@ func (client DatabaseClient) DisableAutonomousDatabaseManagement(ctx context.Con if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.disableAutonomousDatabaseManagement, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteSchedulingWindow, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DisableAutonomousDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteSchedulingWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DisableAutonomousDatabaseManagementResponse{} + response = DeleteSchedulingWindowResponse{} } } return } - if convertedResponse, ok := ociResponse.(DisableAutonomousDatabaseManagementResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteSchedulingWindowResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DisableAutonomousDatabaseManagementResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteSchedulingWindowResponse") } return } -// disableAutonomousDatabaseManagement implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) disableAutonomousDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteSchedulingWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteSchedulingWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/schedulingPolicies/{schedulingPolicyId}/schedulingWindows/{schedulingWindowId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DisableAutonomousDatabaseManagementResponse + var response DeleteSchedulingWindowResponse 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/20160918/AutonomousDatabase/DisableAutonomousDatabaseManagement" - err = common.PostProcessServiceError(err, "Database", "DisableAutonomousDatabaseManagement", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingWindow/DeleteSchedulingWindow" + err = common.PostProcessServiceError(err, "Database", "DeleteSchedulingWindow", apiReferenceLink) return response, err } @@ -6327,12 +7060,12 @@ func (client DatabaseClient) disableAutonomousDatabaseManagement(ctx context.Con return response, err } -// DisableAutonomousDatabaseOperationsInsights Disables Operations Insights for the Autonomous Database resource. +// DeleteVmCluster Deletes the specified VM cluster. Applies to Exadata Cloud@Customer instances only. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableAutonomousDatabaseOperationsInsights.go.html to see an example of how to use DisableAutonomousDatabaseOperationsInsights API. -func (client DatabaseClient) DisableAutonomousDatabaseOperationsInsights(ctx context.Context, request DisableAutonomousDatabaseOperationsInsightsRequest) (response DisableAutonomousDatabaseOperationsInsightsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteVmCluster.go.html to see an example of how to use DeleteVmCluster API. +func (client DatabaseClient) DeleteVmCluster(ctx context.Context, request DeleteVmClusterRequest) (response DeleteVmClusterResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6341,42 +7074,42 @@ func (client DatabaseClient) DisableAutonomousDatabaseOperationsInsights(ctx con if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.disableAutonomousDatabaseOperationsInsights, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteVmCluster, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DisableAutonomousDatabaseOperationsInsightsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DisableAutonomousDatabaseOperationsInsightsResponse{} + response = DeleteVmClusterResponse{} } } return } - if convertedResponse, ok := ociResponse.(DisableAutonomousDatabaseOperationsInsightsResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteVmClusterResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DisableAutonomousDatabaseOperationsInsightsResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteVmClusterResponse") } return } -// disableAutonomousDatabaseOperationsInsights implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) disableAutonomousDatabaseOperationsInsights(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteVmCluster implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/disableOperationsInsights", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/vmClusters/{vmClusterId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DisableAutonomousDatabaseOperationsInsightsResponse + var response DeleteVmClusterResponse 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/20160918/AutonomousDatabase/DisableAutonomousDatabaseOperationsInsights" - err = common.PostProcessServiceError(err, "Database", "DisableAutonomousDatabaseOperationsInsights", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/VmCluster/DeleteVmCluster" + err = common.PostProcessServiceError(err, "Database", "DeleteVmCluster", apiReferenceLink) return response, err } @@ -6384,12 +7117,13 @@ func (client DatabaseClient) disableAutonomousDatabaseOperationsInsights(ctx con return response, err } -// DisableDatabaseManagement Disables the Database Management service for the database. +// DeleteVmClusterNetwork Deletes the specified VM cluster network. Applies to Exadata Cloud@Customer instances only. +// To delete a cloud VM cluster in an Exadata Cloud Service instance, use the DeleteCloudVmCluster operation. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableDatabaseManagement.go.html to see an example of how to use DisableDatabaseManagement API. -func (client DatabaseClient) DisableDatabaseManagement(ctx context.Context, request DisableDatabaseManagementRequest) (response DisableDatabaseManagementResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteVmClusterNetwork.go.html to see an example of how to use DeleteVmClusterNetwork API. +func (client DatabaseClient) DeleteVmClusterNetwork(ctx context.Context, request DeleteVmClusterNetworkRequest) (response DeleteVmClusterNetworkResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6398,47 +7132,42 @@ func (client DatabaseClient) DisableDatabaseManagement(ctx context.Context, requ 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.disableDatabaseManagement, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteVmClusterNetwork, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DisableDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteVmClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DisableDatabaseManagementResponse{} + response = DeleteVmClusterNetworkResponse{} } } return } - if convertedResponse, ok := ociResponse.(DisableDatabaseManagementResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteVmClusterNetworkResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DisableDatabaseManagementResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteVmClusterNetworkResponse") } return } -// disableDatabaseManagement implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) disableDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteVmClusterNetwork implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deleteVmClusterNetwork(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/exadataInfrastructures/{exadataInfrastructureId}/vmClusterNetworks/{vmClusterNetworkId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DisableDatabaseManagementResponse + var response DeleteVmClusterNetworkResponse 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/20160918/Database/DisableDatabaseManagement" - err = common.PostProcessServiceError(err, "Database", "DisableDatabaseManagement", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/VmClusterNetwork/DeleteVmClusterNetwork" + err = common.PostProcessServiceError(err, "Database", "DeleteVmClusterNetwork", apiReferenceLink) return response, err } @@ -6446,12 +7175,12 @@ func (client DatabaseClient) disableDatabaseManagement(ctx context.Context, requ return response, err } -// DisableExternalContainerDatabaseDatabaseManagement Disable Database Management service for the external container database. +// DeregisterAutonomousDatabaseDataSafe Asynchronously deregisters this Autonomous Database with Data Safe. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableExternalContainerDatabaseDatabaseManagement.go.html to see an example of how to use DisableExternalContainerDatabaseDatabaseManagement API. -func (client DatabaseClient) DisableExternalContainerDatabaseDatabaseManagement(ctx context.Context, request DisableExternalContainerDatabaseDatabaseManagementRequest) (response DisableExternalContainerDatabaseDatabaseManagementResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeregisterAutonomousDatabaseDataSafe.go.html to see an example of how to use DeregisterAutonomousDatabaseDataSafe API. +func (client DatabaseClient) DeregisterAutonomousDatabaseDataSafe(ctx context.Context, request DeregisterAutonomousDatabaseDataSafeRequest) (response DeregisterAutonomousDatabaseDataSafeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6460,47 +7189,42 @@ func (client DatabaseClient) DisableExternalContainerDatabaseDatabaseManagement( 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.disableExternalContainerDatabaseDatabaseManagement, policy) + ociResponse, err = common.Retry(ctx, request, client.deregisterAutonomousDatabaseDataSafe, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DisableExternalContainerDatabaseDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeregisterAutonomousDatabaseDataSafeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DisableExternalContainerDatabaseDatabaseManagementResponse{} + response = DeregisterAutonomousDatabaseDataSafeResponse{} } } return } - if convertedResponse, ok := ociResponse.(DisableExternalContainerDatabaseDatabaseManagementResponse); ok { + if convertedResponse, ok := ociResponse.(DeregisterAutonomousDatabaseDataSafeResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DisableExternalContainerDatabaseDatabaseManagementResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeregisterAutonomousDatabaseDataSafeResponse") } return } -// disableExternalContainerDatabaseDatabaseManagement implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) disableExternalContainerDatabaseDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deregisterAutonomousDatabaseDataSafe implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) deregisterAutonomousDatabaseDataSafe(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalcontainerdatabases/{externalContainerDatabaseId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/deregisterDataSafe", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DisableExternalContainerDatabaseDatabaseManagementResponse + var response DeregisterAutonomousDatabaseDataSafeResponse 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/20160918/ExternalContainerDatabase/DisableExternalContainerDatabaseDatabaseManagement" - err = common.PostProcessServiceError(err, "Database", "DisableExternalContainerDatabaseDatabaseManagement", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabase/DeregisterAutonomousDatabaseDataSafe" + err = common.PostProcessServiceError(err, "Database", "DeregisterAutonomousDatabaseDataSafe", apiReferenceLink) return response, err } @@ -6508,12 +7232,12 @@ func (client DatabaseClient) disableExternalContainerDatabaseDatabaseManagement( return response, err } -// DisableExternalContainerDatabaseStackMonitoring Disable Stack Monitoring for the external container database. +// DisableAutonomousDatabaseManagement Disables Database Management for the Autonomous Database resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableExternalContainerDatabaseStackMonitoring.go.html to see an example of how to use DisableExternalContainerDatabaseStackMonitoring API. -func (client DatabaseClient) DisableExternalContainerDatabaseStackMonitoring(ctx context.Context, request DisableExternalContainerDatabaseStackMonitoringRequest) (response DisableExternalContainerDatabaseStackMonitoringResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableAutonomousDatabaseManagement.go.html to see an example of how to use DisableAutonomousDatabaseManagement API. +func (client DatabaseClient) DisableAutonomousDatabaseManagement(ctx context.Context, request DisableAutonomousDatabaseManagementRequest) (response DisableAutonomousDatabaseManagementResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -6522,8 +7246,246 @@ func (client DatabaseClient) DisableExternalContainerDatabaseStackMonitoring(ctx if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - - if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + ociResponse, err = common.Retry(ctx, request, client.disableAutonomousDatabaseManagement, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableAutonomousDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableAutonomousDatabaseManagementResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableAutonomousDatabaseManagementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableAutonomousDatabaseManagementResponse") + } + return +} + +// disableAutonomousDatabaseManagement implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) disableAutonomousDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableAutonomousDatabaseManagementResponse + 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/20160918/AutonomousDatabase/DisableAutonomousDatabaseManagement" + err = common.PostProcessServiceError(err, "Database", "DisableAutonomousDatabaseManagement", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableAutonomousDatabaseOperationsInsights Disables Operations Insights for the Autonomous Database resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableAutonomousDatabaseOperationsInsights.go.html to see an example of how to use DisableAutonomousDatabaseOperationsInsights API. +func (client DatabaseClient) DisableAutonomousDatabaseOperationsInsights(ctx context.Context, request DisableAutonomousDatabaseOperationsInsightsRequest) (response DisableAutonomousDatabaseOperationsInsightsResponse, 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.disableAutonomousDatabaseOperationsInsights, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableAutonomousDatabaseOperationsInsightsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableAutonomousDatabaseOperationsInsightsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableAutonomousDatabaseOperationsInsightsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableAutonomousDatabaseOperationsInsightsResponse") + } + return +} + +// disableAutonomousDatabaseOperationsInsights implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) disableAutonomousDatabaseOperationsInsights(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/disableOperationsInsights", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableAutonomousDatabaseOperationsInsightsResponse + 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/20160918/AutonomousDatabase/DisableAutonomousDatabaseOperationsInsights" + err = common.PostProcessServiceError(err, "Database", "DisableAutonomousDatabaseOperationsInsights", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableDatabaseManagement Disables the Database Management service for the database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableDatabaseManagement.go.html to see an example of how to use DisableDatabaseManagement API. +func (client DatabaseClient) DisableDatabaseManagement(ctx context.Context, request DisableDatabaseManagementRequest) (response DisableDatabaseManagementResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.disableDatabaseManagement, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableDatabaseManagementResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableDatabaseManagementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableDatabaseManagementResponse") + } + return +} + +// disableDatabaseManagement implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) disableDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/databases/{databaseId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableDatabaseManagementResponse + 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/20160918/Database/DisableDatabaseManagement" + err = common.PostProcessServiceError(err, "Database", "DisableDatabaseManagement", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableExternalContainerDatabaseDatabaseManagement Disable Database Management service for the external container database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableExternalContainerDatabaseDatabaseManagement.go.html to see an example of how to use DisableExternalContainerDatabaseDatabaseManagement API. +func (client DatabaseClient) DisableExternalContainerDatabaseDatabaseManagement(ctx context.Context, request DisableExternalContainerDatabaseDatabaseManagementRequest) (response DisableExternalContainerDatabaseDatabaseManagementResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.disableExternalContainerDatabaseDatabaseManagement, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableExternalContainerDatabaseDatabaseManagementResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableExternalContainerDatabaseDatabaseManagementResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableExternalContainerDatabaseDatabaseManagementResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableExternalContainerDatabaseDatabaseManagementResponse") + } + return +} + +// disableExternalContainerDatabaseDatabaseManagement implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) disableExternalContainerDatabaseDatabaseManagement(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/externalcontainerdatabases/{externalContainerDatabaseId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableExternalContainerDatabaseDatabaseManagementResponse + 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/20160918/ExternalContainerDatabase/DisableExternalContainerDatabaseDatabaseManagement" + err = common.PostProcessServiceError(err, "Database", "DisableExternalContainerDatabaseDatabaseManagement", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DisableExternalContainerDatabaseStackMonitoring Disable Stack Monitoring for the external container database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DisableExternalContainerDatabaseStackMonitoring.go.html to see an example of how to use DisableExternalContainerDatabaseStackMonitoring API. +func (client DatabaseClient) DisableExternalContainerDatabaseStackMonitoring(ctx context.Context, request DisableExternalContainerDatabaseStackMonitoringRequest) (response DisableExternalContainerDatabaseStackMonitoringResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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()) } @@ -11102,13 +12064,12 @@ func (client DatabaseClient) getExascaleDbStorageVault(ctx context.Context, requ return response, err } -// GetExternalBackupJob Gets information about the specified external backup job. -// **Note:** This API is used by an Oracle Cloud Infrastructure Python script that is packaged with the Oracle Cloud Infrastructure CLI. Oracle recommends that you use the script instead using the API directly. See Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud (https://docs.cloud.oracle.com/Content/Database/Tasks/mig-onprembackup.htm) for more information. +// GetExecutionAction Gets information about the specified execution action. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExternalBackupJob.go.html to see an example of how to use GetExternalBackupJob API. -func (client DatabaseClient) GetExternalBackupJob(ctx context.Context, request GetExternalBackupJobRequest) (response GetExternalBackupJobResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExecutionAction.go.html to see an example of how to use GetExecutionAction API. +func (client DatabaseClient) GetExecutionAction(ctx context.Context, request GetExecutionActionRequest) (response GetExecutionActionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -11117,42 +12078,42 @@ func (client DatabaseClient) GetExternalBackupJob(ctx context.Context, request G if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getExternalBackupJob, policy) + ociResponse, err = common.Retry(ctx, request, client.getExecutionAction, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetExternalBackupJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetExecutionActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetExternalBackupJobResponse{} + response = GetExecutionActionResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetExternalBackupJobResponse); ok { + if convertedResponse, ok := ociResponse.(GetExecutionActionResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetExternalBackupJobResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetExecutionActionResponse") } return } -// getExternalBackupJob implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) getExternalBackupJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getExecutionAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getExecutionAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalBackupJobs/{backupId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/executionActions/{executionActionId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetExternalBackupJobResponse + var response GetExecutionActionResponse 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/20160918/ExternalBackupJob/GetExternalBackupJob" - err = common.PostProcessServiceError(err, "Database", "GetExternalBackupJob", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ExecutionAction/GetExecutionAction" + err = common.PostProcessServiceError(err, "Database", "GetExecutionAction", apiReferenceLink) return response, err } @@ -11160,7 +12121,122 @@ func (client DatabaseClient) getExternalBackupJob(ctx context.Context, request c return response, err } -// GetExternalContainerDatabase Gets information about the specified external container database. +// GetExecutionWindow Gets information about the specified execution window. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExecutionWindow.go.html to see an example of how to use GetExecutionWindow API. +func (client DatabaseClient) GetExecutionWindow(ctx context.Context, request GetExecutionWindowRequest) (response GetExecutionWindowResponse, 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.getExecutionWindow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetExecutionWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetExecutionWindowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetExecutionWindowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetExecutionWindowResponse") + } + return +} + +// getExecutionWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getExecutionWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/executionWindows/{executionWindowId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetExecutionWindowResponse + 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/20160918/ExecutionWindow/GetExecutionWindow" + err = common.PostProcessServiceError(err, "Database", "GetExecutionWindow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetExternalBackupJob Gets information about the specified external backup job. +// **Note:** This API is used by an Oracle Cloud Infrastructure Python script that is packaged with the Oracle Cloud Infrastructure CLI. Oracle recommends that you use the script instead using the API directly. See Migrating an On-Premises Database to Oracle Cloud Infrastructure by Creating a Backup in the Cloud (https://docs.cloud.oracle.com/Content/Database/Tasks/mig-onprembackup.htm) for more information. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExternalBackupJob.go.html to see an example of how to use GetExternalBackupJob API. +func (client DatabaseClient) GetExternalBackupJob(ctx context.Context, request GetExternalBackupJobRequest) (response GetExternalBackupJobResponse, 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.getExternalBackupJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetExternalBackupJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetExternalBackupJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetExternalBackupJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetExternalBackupJobResponse") + } + return +} + +// getExternalBackupJob implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getExternalBackupJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalBackupJobs/{backupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetExternalBackupJobResponse + 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/20160918/ExternalBackupJob/GetExternalBackupJob" + err = common.PostProcessServiceError(err, "Database", "GetExternalBackupJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetExternalContainerDatabase Gets information about the specified external container database. // // # See also // @@ -11789,12 +12865,12 @@ func (client DatabaseClient) getPluggableDatabase(ctx context.Context, request c return response, err } -// GetVmCluster Gets information about the VM cluster. Applies to Exadata Cloud@Customer instances only. +// GetScheduledAction Gets information about the specified Scheduled Action. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmCluster.go.html to see an example of how to use GetVmCluster API. -func (client DatabaseClient) GetVmCluster(ctx context.Context, request GetVmClusterRequest) (response GetVmClusterResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetScheduledAction.go.html to see an example of how to use GetScheduledAction API. +func (client DatabaseClient) GetScheduledAction(ctx context.Context, request GetScheduledActionRequest) (response GetScheduledActionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -11803,42 +12879,42 @@ func (client DatabaseClient) GetVmCluster(ctx context.Context, request GetVmClus if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getVmCluster, policy) + ociResponse, err = common.Retry(ctx, request, client.getScheduledAction, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetScheduledActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetVmClusterResponse{} + response = GetScheduledActionResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetVmClusterResponse); ok { + if convertedResponse, ok := ociResponse.(GetScheduledActionResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetScheduledActionResponse") } return } -// getVmCluster implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) getVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getScheduledAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getScheduledAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/scheduledActions/{scheduledActionId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetVmClusterResponse + var response GetScheduledActionResponse 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/20160918/VmCluster/GetVmCluster" - err = common.PostProcessServiceError(err, "Database", "GetVmCluster", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ScheduledAction/GetScheduledAction" + err = common.PostProcessServiceError(err, "Database", "GetScheduledAction", apiReferenceLink) return response, err } @@ -11846,13 +12922,12 @@ func (client DatabaseClient) getVmCluster(ctx context.Context, request common.OC return response, err } -// GetVmClusterNetwork Gets information about the specified VM cluster network. Applies to Exadata Cloud@Customer instances only. -// To get information about a cloud VM cluster in an Exadata Cloud Service instance, use the GetCloudVmCluster operation. +// GetSchedulingPlan Gets information about the specified Scheduling Plan. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterNetwork.go.html to see an example of how to use GetVmClusterNetwork API. -func (client DatabaseClient) GetVmClusterNetwork(ctx context.Context, request GetVmClusterNetworkRequest) (response GetVmClusterNetworkResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetSchedulingPlan.go.html to see an example of how to use GetSchedulingPlan API. +func (client DatabaseClient) GetSchedulingPlan(ctx context.Context, request GetSchedulingPlanRequest) (response GetSchedulingPlanResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -11861,42 +12936,42 @@ func (client DatabaseClient) GetVmClusterNetwork(ctx context.Context, request Ge if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getVmClusterNetwork, policy) + ociResponse, err = common.Retry(ctx, request, client.getSchedulingPlan, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetVmClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetSchedulingPlanResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetVmClusterNetworkResponse{} + response = GetSchedulingPlanResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetVmClusterNetworkResponse); ok { + if convertedResponse, ok := ociResponse.(GetSchedulingPlanResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterNetworkResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetSchedulingPlanResponse") } return } -// getVmClusterNetwork implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) getVmClusterNetwork(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getSchedulingPlan implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getSchedulingPlan(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/exadataInfrastructures/{exadataInfrastructureId}/vmClusterNetworks/{vmClusterNetworkId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedulingPlans/{schedulingPlanId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetVmClusterNetworkResponse + var response GetSchedulingPlanResponse 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/20160918/VmClusterNetwork/GetVmClusterNetwork" - err = common.PostProcessServiceError(err, "Database", "GetVmClusterNetwork", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPlan/GetSchedulingPlan" + err = common.PostProcessServiceError(err, "Database", "GetSchedulingPlan", apiReferenceLink) return response, err } @@ -11904,12 +12979,12 @@ func (client DatabaseClient) getVmClusterNetwork(ctx context.Context, request co return response, err } -// GetVmClusterPatch Gets information about a specified patch package. +// GetSchedulingPolicy Gets information about the specified Scheduling Policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterPatch.go.html to see an example of how to use GetVmClusterPatch API. -func (client DatabaseClient) GetVmClusterPatch(ctx context.Context, request GetVmClusterPatchRequest) (response GetVmClusterPatchResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetSchedulingPolicy.go.html to see an example of how to use GetSchedulingPolicy API. +func (client DatabaseClient) GetSchedulingPolicy(ctx context.Context, request GetSchedulingPolicyRequest) (response GetSchedulingPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -11918,42 +12993,42 @@ func (client DatabaseClient) GetVmClusterPatch(ctx context.Context, request GetV if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getVmClusterPatch, policy) + ociResponse, err = common.Retry(ctx, request, client.getSchedulingPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetVmClusterPatchResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetSchedulingPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetVmClusterPatchResponse{} + response = GetSchedulingPolicyResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetVmClusterPatchResponse); ok { + if convertedResponse, ok := ociResponse.(GetSchedulingPolicyResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterPatchResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetSchedulingPolicyResponse") } return } -// getVmClusterPatch implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) getVmClusterPatch(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getSchedulingPolicy implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getSchedulingPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/patches/{patchId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedulingPolicies/{schedulingPolicyId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetVmClusterPatchResponse + var response GetSchedulingPolicyResponse 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/20160918/Patch/GetVmClusterPatch" - err = common.PostProcessServiceError(err, "Database", "GetVmClusterPatch", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPolicy/GetSchedulingPolicy" + err = common.PostProcessServiceError(err, "Database", "GetSchedulingPolicy", apiReferenceLink) return response, err } @@ -11961,12 +13036,12 @@ func (client DatabaseClient) getVmClusterPatch(ctx context.Context, request comm return response, err } -// GetVmClusterPatchHistoryEntry Gets the patch history details for the specified patch history entry. +// GetSchedulingWindow Gets information about the specified Scheduling Window. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterPatchHistoryEntry.go.html to see an example of how to use GetVmClusterPatchHistoryEntry API. -func (client DatabaseClient) GetVmClusterPatchHistoryEntry(ctx context.Context, request GetVmClusterPatchHistoryEntryRequest) (response GetVmClusterPatchHistoryEntryResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetSchedulingWindow.go.html to see an example of how to use GetSchedulingWindow API. +func (client DatabaseClient) GetSchedulingWindow(ctx context.Context, request GetSchedulingWindowRequest) (response GetSchedulingWindowResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -11975,42 +13050,42 @@ func (client DatabaseClient) GetVmClusterPatchHistoryEntry(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getVmClusterPatchHistoryEntry, policy) + ociResponse, err = common.Retry(ctx, request, client.getSchedulingWindow, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetVmClusterPatchHistoryEntryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetSchedulingWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetVmClusterPatchHistoryEntryResponse{} + response = GetSchedulingWindowResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetVmClusterPatchHistoryEntryResponse); ok { + if convertedResponse, ok := ociResponse.(GetSchedulingWindowResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterPatchHistoryEntryResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetSchedulingWindowResponse") } return } -// getVmClusterPatchHistoryEntry implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) getVmClusterPatchHistoryEntry(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getSchedulingWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getSchedulingWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/patchHistoryEntries/{patchHistoryEntryId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedulingPolicies/{schedulingPolicyId}/schedulingWindows/{schedulingWindowId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetVmClusterPatchHistoryEntryResponse + var response GetSchedulingWindowResponse 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/20160918/PatchHistoryEntry/GetVmClusterPatchHistoryEntry" - err = common.PostProcessServiceError(err, "Database", "GetVmClusterPatchHistoryEntry", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingWindow/GetSchedulingWindow" + err = common.PostProcessServiceError(err, "Database", "GetSchedulingWindow", apiReferenceLink) return response, err } @@ -12018,12 +13093,12 @@ func (client DatabaseClient) getVmClusterPatchHistoryEntry(ctx context.Context, return response, err } -// GetVmClusterUpdate Gets information about a specified maintenance update package for a VM cluster. Applies to Exadata Cloud@Customer instances only. +// GetVmCluster Gets information about the VM cluster. Applies to Exadata Cloud@Customer instances only. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterUpdate.go.html to see an example of how to use GetVmClusterUpdate API. -func (client DatabaseClient) GetVmClusterUpdate(ctx context.Context, request GetVmClusterUpdateRequest) (response GetVmClusterUpdateResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmCluster.go.html to see an example of how to use GetVmCluster API. +func (client DatabaseClient) GetVmCluster(ctx context.Context, request GetVmClusterRequest) (response GetVmClusterResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -12032,42 +13107,42 @@ func (client DatabaseClient) GetVmClusterUpdate(ctx context.Context, request Get if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getVmClusterUpdate, policy) + ociResponse, err = common.Retry(ctx, request, client.getVmCluster, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetVmClusterUpdateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetVmClusterUpdateResponse{} + response = GetVmClusterResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetVmClusterUpdateResponse); ok { + if convertedResponse, ok := ociResponse.(GetVmClusterResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterUpdateResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterResponse") } return } -// getVmClusterUpdate implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) getVmClusterUpdate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getVmCluster implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/updates/{updateId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetVmClusterUpdateResponse + var response GetVmClusterResponse 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/20160918/VmClusterUpdate/GetVmClusterUpdate" - err = common.PostProcessServiceError(err, "Database", "GetVmClusterUpdate", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/VmCluster/GetVmCluster" + err = common.PostProcessServiceError(err, "Database", "GetVmCluster", apiReferenceLink) return response, err } @@ -12075,12 +13150,13 @@ func (client DatabaseClient) getVmClusterUpdate(ctx context.Context, request com return response, err } -// GetVmClusterUpdateHistoryEntry Gets the maintenance update history details for the specified update history entry. Applies to Exadata Cloud@Customer instances only. +// GetVmClusterNetwork Gets information about the specified VM cluster network. Applies to Exadata Cloud@Customer instances only. +// To get information about a cloud VM cluster in an Exadata Cloud Service instance, use the GetCloudVmCluster operation. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterUpdateHistoryEntry.go.html to see an example of how to use GetVmClusterUpdateHistoryEntry API. -func (client DatabaseClient) GetVmClusterUpdateHistoryEntry(ctx context.Context, request GetVmClusterUpdateHistoryEntryRequest) (response GetVmClusterUpdateHistoryEntryResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterNetwork.go.html to see an example of how to use GetVmClusterNetwork API. +func (client DatabaseClient) GetVmClusterNetwork(ctx context.Context, request GetVmClusterNetworkRequest) (response GetVmClusterNetworkResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -12089,42 +13165,42 @@ func (client DatabaseClient) GetVmClusterUpdateHistoryEntry(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getVmClusterUpdateHistoryEntry, policy) + ociResponse, err = common.Retry(ctx, request, client.getVmClusterNetwork, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetVmClusterUpdateHistoryEntryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetVmClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetVmClusterUpdateHistoryEntryResponse{} + response = GetVmClusterNetworkResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetVmClusterUpdateHistoryEntryResponse); ok { + if convertedResponse, ok := ociResponse.(GetVmClusterNetworkResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterUpdateHistoryEntryResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterNetworkResponse") } return } -// getVmClusterUpdateHistoryEntry implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) getVmClusterUpdateHistoryEntry(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getVmClusterNetwork implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getVmClusterNetwork(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/updateHistoryEntries/{updateHistoryEntryId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/exadataInfrastructures/{exadataInfrastructureId}/vmClusterNetworks/{vmClusterNetworkId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetVmClusterUpdateHistoryEntryResponse + var response GetVmClusterNetworkResponse 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/20160918/VmClusterUpdateHistoryEntry/GetVmClusterUpdateHistoryEntry" - err = common.PostProcessServiceError(err, "Database", "GetVmClusterUpdateHistoryEntry", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/VmClusterNetwork/GetVmClusterNetwork" + err = common.PostProcessServiceError(err, "Database", "GetVmClusterNetwork", apiReferenceLink) return response, err } @@ -12132,12 +13208,12 @@ func (client DatabaseClient) getVmClusterUpdateHistoryEntry(ctx context.Context, return response, err } -// LaunchAutonomousExadataInfrastructure **Deprecated** To create a new Autonomous Database system on dedicated Exadata Infrastructure, use the CreateCloudExadataInfrastructure and CreateCloudAutonomousVmCluster operations instead. Note that to create an Autonomous VM cluster, you must have an existing Exadata Infrastructure resource to contain the VM cluster. +// GetVmClusterPatch Gets information about a specified patch package. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/LaunchAutonomousExadataInfrastructure.go.html to see an example of how to use LaunchAutonomousExadataInfrastructure API. -func (client DatabaseClient) LaunchAutonomousExadataInfrastructure(ctx context.Context, request LaunchAutonomousExadataInfrastructureRequest) (response LaunchAutonomousExadataInfrastructureResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterPatch.go.html to see an example of how to use GetVmClusterPatch API. +func (client DatabaseClient) GetVmClusterPatch(ctx context.Context, request GetVmClusterPatchRequest) (response GetVmClusterPatchResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -12146,47 +13222,42 @@ func (client DatabaseClient) LaunchAutonomousExadataInfrastructure(ctx context.C 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.launchAutonomousExadataInfrastructure, policy) + ociResponse, err = common.Retry(ctx, request, client.getVmClusterPatch, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = LaunchAutonomousExadataInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetVmClusterPatchResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = LaunchAutonomousExadataInfrastructureResponse{} + response = GetVmClusterPatchResponse{} } } return } - if convertedResponse, ok := ociResponse.(LaunchAutonomousExadataInfrastructureResponse); ok { + if convertedResponse, ok := ociResponse.(GetVmClusterPatchResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into LaunchAutonomousExadataInfrastructureResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterPatchResponse") } return } -// launchAutonomousExadataInfrastructure implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) launchAutonomousExadataInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getVmClusterPatch implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getVmClusterPatch(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousExadataInfrastructures", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/patches/{patchId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response LaunchAutonomousExadataInfrastructureResponse + var response GetVmClusterPatchResponse 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/20160918/AutonomousExadataInfrastructure/LaunchAutonomousExadataInfrastructure" - err = common.PostProcessServiceError(err, "Database", "LaunchAutonomousExadataInfrastructure", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/Patch/GetVmClusterPatch" + err = common.PostProcessServiceError(err, "Database", "GetVmClusterPatch", apiReferenceLink) return response, err } @@ -12194,13 +13265,246 @@ func (client DatabaseClient) launchAutonomousExadataInfrastructure(ctx context.C return response, err } -// LaunchDbSystem Creates a new DB system in the specified compartment and availability domain. The Oracle -// Database edition that you specify applies to all the databases on that DB system. The selected edition cannot be changed. -// An initial database is created on the DB system based on the request parameters you provide and some default -// options. For detailed information about default options, see Bare metal and virtual machine DB system default options. (https://docs.cloud.oracle.com/Content/Database/Tasks/creatingDBsystem.htm#Default) -// **Note:** Deprecated for Exadata Cloud Service systems. Use the new resource model APIs (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/exaflexsystem.htm#exaflexsystem_topic-resource_model) instead. -// For Exadata Cloud Service instances, support for this API will end on May 15th, 2021. See Switching an Exadata DB System to the New Resource Model and APIs (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/exaflexsystem_topic-resource_model_conversion.htm) for details on converting existing Exadata DB systems to the new resource model. -// Use the CreateCloudExadataInfrastructure and CreateCloudVmCluster APIs to provision a new Exadata Cloud Service instance. +// GetVmClusterPatchHistoryEntry Gets the patch history details for the specified patch history entry. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterPatchHistoryEntry.go.html to see an example of how to use GetVmClusterPatchHistoryEntry API. +func (client DatabaseClient) GetVmClusterPatchHistoryEntry(ctx context.Context, request GetVmClusterPatchHistoryEntryRequest) (response GetVmClusterPatchHistoryEntryResponse, 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.getVmClusterPatchHistoryEntry, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetVmClusterPatchHistoryEntryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetVmClusterPatchHistoryEntryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetVmClusterPatchHistoryEntryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterPatchHistoryEntryResponse") + } + return +} + +// getVmClusterPatchHistoryEntry implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getVmClusterPatchHistoryEntry(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/patchHistoryEntries/{patchHistoryEntryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetVmClusterPatchHistoryEntryResponse + 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/20160918/PatchHistoryEntry/GetVmClusterPatchHistoryEntry" + err = common.PostProcessServiceError(err, "Database", "GetVmClusterPatchHistoryEntry", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVmClusterUpdate Gets information about a specified maintenance update package for a VM cluster. Applies to Exadata Cloud@Customer instances only. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterUpdate.go.html to see an example of how to use GetVmClusterUpdate API. +func (client DatabaseClient) GetVmClusterUpdate(ctx context.Context, request GetVmClusterUpdateRequest) (response GetVmClusterUpdateResponse, 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.getVmClusterUpdate, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetVmClusterUpdateResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetVmClusterUpdateResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetVmClusterUpdateResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterUpdateResponse") + } + return +} + +// getVmClusterUpdate implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getVmClusterUpdate(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/updates/{updateId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetVmClusterUpdateResponse + 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/20160918/VmClusterUpdate/GetVmClusterUpdate" + err = common.PostProcessServiceError(err, "Database", "GetVmClusterUpdate", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetVmClusterUpdateHistoryEntry Gets the maintenance update history details for the specified update history entry. Applies to Exadata Cloud@Customer instances only. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetVmClusterUpdateHistoryEntry.go.html to see an example of how to use GetVmClusterUpdateHistoryEntry API. +func (client DatabaseClient) GetVmClusterUpdateHistoryEntry(ctx context.Context, request GetVmClusterUpdateHistoryEntryRequest) (response GetVmClusterUpdateHistoryEntryResponse, 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.getVmClusterUpdateHistoryEntry, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetVmClusterUpdateHistoryEntryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetVmClusterUpdateHistoryEntryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetVmClusterUpdateHistoryEntryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetVmClusterUpdateHistoryEntryResponse") + } + return +} + +// getVmClusterUpdateHistoryEntry implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getVmClusterUpdateHistoryEntry(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/vmClusters/{vmClusterId}/updateHistoryEntries/{updateHistoryEntryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetVmClusterUpdateHistoryEntryResponse + 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/20160918/VmClusterUpdateHistoryEntry/GetVmClusterUpdateHistoryEntry" + err = common.PostProcessServiceError(err, "Database", "GetVmClusterUpdateHistoryEntry", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// LaunchAutonomousExadataInfrastructure **Deprecated** To create a new Autonomous Database system on dedicated Exadata Infrastructure, use the CreateCloudExadataInfrastructure and CreateCloudAutonomousVmCluster operations instead. Note that to create an Autonomous VM cluster, you must have an existing Exadata Infrastructure resource to contain the VM cluster. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/LaunchAutonomousExadataInfrastructure.go.html to see an example of how to use LaunchAutonomousExadataInfrastructure API. +func (client DatabaseClient) LaunchAutonomousExadataInfrastructure(ctx context.Context, request LaunchAutonomousExadataInfrastructureRequest) (response LaunchAutonomousExadataInfrastructureResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.launchAutonomousExadataInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = LaunchAutonomousExadataInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = LaunchAutonomousExadataInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(LaunchAutonomousExadataInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into LaunchAutonomousExadataInfrastructureResponse") + } + return +} + +// launchAutonomousExadataInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) launchAutonomousExadataInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousExadataInfrastructures", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response LaunchAutonomousExadataInfrastructureResponse + 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/20160918/AutonomousExadataInfrastructure/LaunchAutonomousExadataInfrastructure" + err = common.PostProcessServiceError(err, "Database", "LaunchAutonomousExadataInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// LaunchDbSystem Creates a new DB system in the specified compartment and availability domain. The Oracle +// Database edition that you specify applies to all the databases on that DB system. The selected edition cannot be changed. +// An initial database is created on the DB system based on the request parameters you provide and some default +// options. For detailed information about default options, see Bare metal and virtual machine DB system default options. (https://docs.cloud.oracle.com/Content/Database/Tasks/creatingDBsystem.htm#Default) +// **Note:** Deprecated for Exadata Cloud Service systems. Use the new resource model APIs (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/exaflexsystem.htm#exaflexsystem_topic-resource_model) instead. +// For Exadata Cloud Service instances, support for this API will end on May 15th, 2021. See Switching an Exadata DB System to the New Resource Model and APIs (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/exaflexsystem_topic-resource_model_conversion.htm) for details on converting existing Exadata DB systems to the new resource model. +// Use the CreateCloudExadataInfrastructure and CreateCloudVmCluster APIs to provision a new Exadata Cloud Service instance. // // # See also // @@ -15231,12 +16535,12 @@ func (client DatabaseClient) listExascaleDbStorageVaults(ctx context.Context, re return response, err } -// ListExternalContainerDatabases Gets a list of the external container databases in the specified compartment. +// ListExecutionActions Lists the execution action resources in the specified compartment. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListExternalContainerDatabases.go.html to see an example of how to use ListExternalContainerDatabases API. -func (client DatabaseClient) ListExternalContainerDatabases(ctx context.Context, request ListExternalContainerDatabasesRequest) (response ListExternalContainerDatabasesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListExecutionActions.go.html to see an example of how to use ListExecutionActions API. +func (client DatabaseClient) ListExecutionActions(ctx context.Context, request ListExecutionActionsRequest) (response ListExecutionActionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -15245,42 +16549,42 @@ func (client DatabaseClient) ListExternalContainerDatabases(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listExternalContainerDatabases, policy) + ociResponse, err = common.Retry(ctx, request, client.listExecutionActions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListExternalContainerDatabasesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListExecutionActionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListExternalContainerDatabasesResponse{} + response = ListExecutionActionsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListExternalContainerDatabasesResponse); ok { + if convertedResponse, ok := ociResponse.(ListExecutionActionsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListExternalContainerDatabasesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListExecutionActionsResponse") } return } -// listExternalContainerDatabases implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) listExternalContainerDatabases(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listExecutionActions implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listExecutionActions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalcontainerdatabases", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/executionActions", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListExternalContainerDatabasesResponse + var response ListExecutionActionsResponse 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/20160918/ExternalContainerDatabase/ListExternalContainerDatabases" - err = common.PostProcessServiceError(err, "Database", "ListExternalContainerDatabases", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ExecutionAction/ListExecutionActions" + err = common.PostProcessServiceError(err, "Database", "ListExecutionActions", apiReferenceLink) return response, err } @@ -15288,8 +16592,122 @@ func (client DatabaseClient) listExternalContainerDatabases(ctx context.Context, return response, err } -// listexternaldatabaseconnectorsummary allows to unmarshal list of polymorphic ExternalDatabaseConnectorSummary -type listexternaldatabaseconnectorsummary []externaldatabaseconnectorsummary +// ListExecutionWindows Lists the execution window resources in the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListExecutionWindows.go.html to see an example of how to use ListExecutionWindows API. +func (client DatabaseClient) ListExecutionWindows(ctx context.Context, request ListExecutionWindowsRequest) (response ListExecutionWindowsResponse, 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.listExecutionWindows, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListExecutionWindowsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListExecutionWindowsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListExecutionWindowsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListExecutionWindowsResponse") + } + return +} + +// listExecutionWindows implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listExecutionWindows(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/executionWindows", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListExecutionWindowsResponse + 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/20160918/ExecutionWindow/ListExecutionWindows" + err = common.PostProcessServiceError(err, "Database", "ListExecutionWindows", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListExternalContainerDatabases Gets a list of the external container databases in the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListExternalContainerDatabases.go.html to see an example of how to use ListExternalContainerDatabases API. +func (client DatabaseClient) ListExternalContainerDatabases(ctx context.Context, request ListExternalContainerDatabasesRequest) (response ListExternalContainerDatabasesResponse, 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.listExternalContainerDatabases, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListExternalContainerDatabasesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListExternalContainerDatabasesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListExternalContainerDatabasesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListExternalContainerDatabasesResponse") + } + return +} + +// listExternalContainerDatabases implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listExternalContainerDatabases(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalcontainerdatabases", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListExternalContainerDatabasesResponse + 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/20160918/ExternalContainerDatabase/ListExternalContainerDatabases" + err = common.PostProcessServiceError(err, "Database", "ListExternalContainerDatabases", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// listexternaldatabaseconnectorsummary allows to unmarshal list of polymorphic ExternalDatabaseConnectorSummary +type listexternaldatabaseconnectorsummary []externaldatabaseconnectorsummary // UnmarshalPolymorphicJSON unmarshals polymorphic json list of items func (m *listexternaldatabaseconnectorsummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { @@ -15676,27 +17094,369 @@ func (client DatabaseClient) ListKeyStores(ctx context.Context, request ListKeyS if convertedResponse, ok := ociResponse.(ListKeyStoresResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListKeyStoresResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListKeyStoresResponse") + } + return +} + +// listKeyStores implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listKeyStores(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/keyStores", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListKeyStoresResponse + 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/20160918/KeyStoreSummary/ListKeyStores" + err = common.PostProcessServiceError(err, "Database", "ListKeyStores", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMaintenanceRunHistory Gets a list of the maintenance run histories in the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListMaintenanceRunHistory.go.html to see an example of how to use ListMaintenanceRunHistory API. +func (client DatabaseClient) ListMaintenanceRunHistory(ctx context.Context, request ListMaintenanceRunHistoryRequest) (response ListMaintenanceRunHistoryResponse, 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.listMaintenanceRunHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMaintenanceRunHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMaintenanceRunHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMaintenanceRunHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMaintenanceRunHistoryResponse") + } + return +} + +// listMaintenanceRunHistory implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listMaintenanceRunHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/maintenanceRunHistory", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMaintenanceRunHistoryResponse + 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/20160918/MaintenanceRunHistory/ListMaintenanceRunHistory" + err = common.PostProcessServiceError(err, "Database", "ListMaintenanceRunHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMaintenanceRuns Gets a list of the maintenance runs in the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListMaintenanceRuns.go.html to see an example of how to use ListMaintenanceRuns API. +func (client DatabaseClient) ListMaintenanceRuns(ctx context.Context, request ListMaintenanceRunsRequest) (response ListMaintenanceRunsResponse, 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.listMaintenanceRuns, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMaintenanceRunsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMaintenanceRunsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMaintenanceRunsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMaintenanceRunsResponse") + } + return +} + +// listMaintenanceRuns implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listMaintenanceRuns(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/maintenanceRuns", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMaintenanceRunsResponse + 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/20160918/MaintenanceRun/ListMaintenanceRuns" + err = common.PostProcessServiceError(err, "Database", "ListMaintenanceRuns", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListOneoffPatches Lists one-off patches in the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListOneoffPatches.go.html to see an example of how to use ListOneoffPatches API. +func (client DatabaseClient) ListOneoffPatches(ctx context.Context, request ListOneoffPatchesRequest) (response ListOneoffPatchesResponse, 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.listOneoffPatches, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListOneoffPatchesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListOneoffPatchesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListOneoffPatchesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListOneoffPatchesResponse") + } + return +} + +// listOneoffPatches implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listOneoffPatches(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/oneoffPatches", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListOneoffPatchesResponse + 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/20160918/OneoffPatch/ListOneoffPatches" + err = common.PostProcessServiceError(err, "Database", "ListOneoffPatches", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListParamsForActionType List all the action params and their possible values for a given action type +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListParamsForActionType.go.html to see an example of how to use ListParamsForActionType API. +func (client DatabaseClient) ListParamsForActionType(ctx context.Context, request ListParamsForActionTypeRequest) (response ListParamsForActionTypeResponse, 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.listParamsForActionType, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListParamsForActionTypeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListParamsForActionTypeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListParamsForActionTypeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListParamsForActionTypeResponse") + } + return +} + +// listParamsForActionType implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listParamsForActionType(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/scheduledActionParams", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListParamsForActionTypeResponse + 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/20160918/ActionParamValuesSummary/ListParamsForActionType" + err = common.PostProcessServiceError(err, "Database", "ListParamsForActionType", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPdbConversionHistoryEntries Gets the pluggable database conversion history for a specified database in a bare metal or virtual machine DB system. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListPdbConversionHistoryEntries.go.html to see an example of how to use ListPdbConversionHistoryEntries API. +func (client DatabaseClient) ListPdbConversionHistoryEntries(ctx context.Context, request ListPdbConversionHistoryEntriesRequest) (response ListPdbConversionHistoryEntriesResponse, 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.listPdbConversionHistoryEntries, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListPdbConversionHistoryEntriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListPdbConversionHistoryEntriesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListPdbConversionHistoryEntriesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPdbConversionHistoryEntriesResponse") + } + return +} + +// listPdbConversionHistoryEntries implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listPdbConversionHistoryEntries(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/databases/{databaseId}/pdbConversionHistoryEntries", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListPdbConversionHistoryEntriesResponse + 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/20160918/Database/ListPdbConversionHistoryEntries" + err = common.PostProcessServiceError(err, "Database", "ListPdbConversionHistoryEntries", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPluggableDatabases Gets a list of the pluggable databases in a database or compartment. You must provide either a `databaseId` or `compartmentId` value. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListPluggableDatabases.go.html to see an example of how to use ListPluggableDatabases API. +func (client DatabaseClient) ListPluggableDatabases(ctx context.Context, request ListPluggableDatabasesRequest) (response ListPluggableDatabasesResponse, 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.listPluggableDatabases, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListPluggableDatabasesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListPluggableDatabasesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListPluggableDatabasesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPluggableDatabasesResponse") } return } -// listKeyStores implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) listKeyStores(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listPluggableDatabases implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listPluggableDatabases(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/keyStores", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/pluggableDatabases", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListKeyStoresResponse + var response ListPluggableDatabasesResponse 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/20160918/KeyStoreSummary/ListKeyStores" - err = common.PostProcessServiceError(err, "Database", "ListKeyStores", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/PluggableDatabase/ListPluggableDatabases" + err = common.PostProcessServiceError(err, "Database", "ListPluggableDatabases", apiReferenceLink) return response, err } @@ -15704,12 +17464,12 @@ func (client DatabaseClient) listKeyStores(ctx context.Context, request common.O return response, err } -// ListMaintenanceRunHistory Gets a list of the maintenance run histories in the specified compartment. +// ListRecommendedScheduledActions Returns a recommended Scheduled Actions configuration for a given resource, plan intent and scheduling policy. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListMaintenanceRunHistory.go.html to see an example of how to use ListMaintenanceRunHistory API. -func (client DatabaseClient) ListMaintenanceRunHistory(ctx context.Context, request ListMaintenanceRunHistoryRequest) (response ListMaintenanceRunHistoryResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListRecommendedScheduledActions.go.html to see an example of how to use ListRecommendedScheduledActions API. +func (client DatabaseClient) ListRecommendedScheduledActions(ctx context.Context, request ListRecommendedScheduledActionsRequest) (response ListRecommendedScheduledActionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -15718,42 +17478,42 @@ func (client DatabaseClient) ListMaintenanceRunHistory(ctx context.Context, requ if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMaintenanceRunHistory, policy) + ociResponse, err = common.Retry(ctx, request, client.listRecommendedScheduledActions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMaintenanceRunHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListRecommendedScheduledActionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMaintenanceRunHistoryResponse{} + response = ListRecommendedScheduledActionsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMaintenanceRunHistoryResponse); ok { + if convertedResponse, ok := ociResponse.(ListRecommendedScheduledActionsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMaintenanceRunHistoryResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListRecommendedScheduledActionsResponse") } return } -// listMaintenanceRunHistory implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) listMaintenanceRunHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listRecommendedScheduledActions implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listRecommendedScheduledActions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/maintenanceRunHistory", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedulingPolicies/{schedulingPolicyId}/recommendedScheduledActions", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMaintenanceRunHistoryResponse + var response ListRecommendedScheduledActionsResponse 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/20160918/MaintenanceRunHistory/ListMaintenanceRunHistory" - err = common.PostProcessServiceError(err, "Database", "ListMaintenanceRunHistory", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/RecommendedScheduledActionSummary/ListRecommendedScheduledActions" + err = common.PostProcessServiceError(err, "Database", "ListRecommendedScheduledActions", apiReferenceLink) return response, err } @@ -15761,12 +17521,12 @@ func (client DatabaseClient) listMaintenanceRunHistory(ctx context.Context, requ return response, err } -// ListMaintenanceRuns Gets a list of the maintenance runs in the specified compartment. +// ListScheduledActions Lists the Scheduled Action resources in the specified compartment. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListMaintenanceRuns.go.html to see an example of how to use ListMaintenanceRuns API. -func (client DatabaseClient) ListMaintenanceRuns(ctx context.Context, request ListMaintenanceRunsRequest) (response ListMaintenanceRunsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListScheduledActions.go.html to see an example of how to use ListScheduledActions API. +func (client DatabaseClient) ListScheduledActions(ctx context.Context, request ListScheduledActionsRequest) (response ListScheduledActionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -15775,42 +17535,42 @@ func (client DatabaseClient) ListMaintenanceRuns(ctx context.Context, request Li if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMaintenanceRuns, policy) + ociResponse, err = common.Retry(ctx, request, client.listScheduledActions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMaintenanceRunsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListScheduledActionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMaintenanceRunsResponse{} + response = ListScheduledActionsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMaintenanceRunsResponse); ok { + if convertedResponse, ok := ociResponse.(ListScheduledActionsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMaintenanceRunsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListScheduledActionsResponse") } return } -// listMaintenanceRuns implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) listMaintenanceRuns(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listScheduledActions implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listScheduledActions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/maintenanceRuns", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/scheduledActions", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMaintenanceRunsResponse + var response ListScheduledActionsResponse 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/20160918/MaintenanceRun/ListMaintenanceRuns" - err = common.PostProcessServiceError(err, "Database", "ListMaintenanceRuns", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ScheduledAction/ListScheduledActions" + err = common.PostProcessServiceError(err, "Database", "ListScheduledActions", apiReferenceLink) return response, err } @@ -15818,12 +17578,12 @@ func (client DatabaseClient) listMaintenanceRuns(ctx context.Context, request co return response, err } -// ListOneoffPatches Lists one-off patches in the specified compartment. +// ListSchedulingPlans Lists the Scheduling Plan resources in the specified compartment. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListOneoffPatches.go.html to see an example of how to use ListOneoffPatches API. -func (client DatabaseClient) ListOneoffPatches(ctx context.Context, request ListOneoffPatchesRequest) (response ListOneoffPatchesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSchedulingPlans.go.html to see an example of how to use ListSchedulingPlans API. +func (client DatabaseClient) ListSchedulingPlans(ctx context.Context, request ListSchedulingPlansRequest) (response ListSchedulingPlansResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -15832,42 +17592,42 @@ func (client DatabaseClient) ListOneoffPatches(ctx context.Context, request List if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listOneoffPatches, policy) + ociResponse, err = common.Retry(ctx, request, client.listSchedulingPlans, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListOneoffPatchesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSchedulingPlansResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListOneoffPatchesResponse{} + response = ListSchedulingPlansResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListOneoffPatchesResponse); ok { + if convertedResponse, ok := ociResponse.(ListSchedulingPlansResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListOneoffPatchesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSchedulingPlansResponse") } return } -// listOneoffPatches implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) listOneoffPatches(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSchedulingPlans implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listSchedulingPlans(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/oneoffPatches", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedulingPlans", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListOneoffPatchesResponse + var response ListSchedulingPlansResponse 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/20160918/OneoffPatch/ListOneoffPatches" - err = common.PostProcessServiceError(err, "Database", "ListOneoffPatches", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPlan/ListSchedulingPlans" + err = common.PostProcessServiceError(err, "Database", "ListSchedulingPlans", apiReferenceLink) return response, err } @@ -15875,12 +17635,12 @@ func (client DatabaseClient) listOneoffPatches(ctx context.Context, request comm return response, err } -// ListPdbConversionHistoryEntries Gets the pluggable database conversion history for a specified database in a bare metal or virtual machine DB system. +// ListSchedulingPolicies Lists the Scheduling Policy resources in the specified compartment. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListPdbConversionHistoryEntries.go.html to see an example of how to use ListPdbConversionHistoryEntries API. -func (client DatabaseClient) ListPdbConversionHistoryEntries(ctx context.Context, request ListPdbConversionHistoryEntriesRequest) (response ListPdbConversionHistoryEntriesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSchedulingPolicies.go.html to see an example of how to use ListSchedulingPolicies API. +func (client DatabaseClient) ListSchedulingPolicies(ctx context.Context, request ListSchedulingPoliciesRequest) (response ListSchedulingPoliciesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -15889,42 +17649,42 @@ func (client DatabaseClient) ListPdbConversionHistoryEntries(ctx context.Context if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listPdbConversionHistoryEntries, policy) + ociResponse, err = common.Retry(ctx, request, client.listSchedulingPolicies, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListPdbConversionHistoryEntriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSchedulingPoliciesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListPdbConversionHistoryEntriesResponse{} + response = ListSchedulingPoliciesResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListPdbConversionHistoryEntriesResponse); ok { + if convertedResponse, ok := ociResponse.(ListSchedulingPoliciesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListPdbConversionHistoryEntriesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSchedulingPoliciesResponse") } return } -// listPdbConversionHistoryEntries implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) listPdbConversionHistoryEntries(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSchedulingPolicies implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listSchedulingPolicies(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/databases/{databaseId}/pdbConversionHistoryEntries", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedulingPolicies", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListPdbConversionHistoryEntriesResponse + var response ListSchedulingPoliciesResponse 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/20160918/Database/ListPdbConversionHistoryEntries" - err = common.PostProcessServiceError(err, "Database", "ListPdbConversionHistoryEntries", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPolicy/ListSchedulingPolicies" + err = common.PostProcessServiceError(err, "Database", "ListSchedulingPolicies", apiReferenceLink) return response, err } @@ -15932,12 +17692,12 @@ func (client DatabaseClient) listPdbConversionHistoryEntries(ctx context.Context return response, err } -// ListPluggableDatabases Gets a list of the pluggable databases in a database or compartment. You must provide either a `databaseId` or `compartmentId` value. +// ListSchedulingWindows Lists the Scheduling Window resources in the specified compartment. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListPluggableDatabases.go.html to see an example of how to use ListPluggableDatabases API. -func (client DatabaseClient) ListPluggableDatabases(ctx context.Context, request ListPluggableDatabasesRequest) (response ListPluggableDatabasesResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSchedulingWindows.go.html to see an example of how to use ListSchedulingWindows API. +func (client DatabaseClient) ListSchedulingWindows(ctx context.Context, request ListSchedulingWindowsRequest) (response ListSchedulingWindowsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -15946,42 +17706,42 @@ func (client DatabaseClient) ListPluggableDatabases(ctx context.Context, request if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listPluggableDatabases, policy) + ociResponse, err = common.Retry(ctx, request, client.listSchedulingWindows, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListPluggableDatabasesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSchedulingWindowsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListPluggableDatabasesResponse{} + response = ListSchedulingWindowsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListPluggableDatabasesResponse); ok { + if convertedResponse, ok := ociResponse.(ListSchedulingWindowsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListPluggableDatabasesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSchedulingWindowsResponse") } return } -// listPluggableDatabases implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) listPluggableDatabases(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSchedulingWindows implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) listSchedulingWindows(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/pluggableDatabases", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/schedulingPolicies/{schedulingPolicyId}/schedulingWindows", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListPluggableDatabasesResponse + var response ListSchedulingWindowsResponse 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/20160918/PluggableDatabase/ListPluggableDatabases" - err = common.PostProcessServiceError(err, "Database", "ListPluggableDatabases", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingWindow/ListSchedulingWindows" + err = common.PostProcessServiceError(err, "Database", "ListSchedulingWindows", apiReferenceLink) return response, err } @@ -16701,6 +18461,68 @@ func (client DatabaseClient) modifyPluggableDatabaseManagement(ctx context.Conte return response, err } +// MoveExecutionActionMember Moves an execution action member to this execution action resource from another. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/MoveExecutionActionMember.go.html to see an example of how to use MoveExecutionActionMember API. +func (client DatabaseClient) MoveExecutionActionMember(ctx context.Context, request MoveExecutionActionMemberRequest) (response MoveExecutionActionMemberResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.moveExecutionActionMember, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = MoveExecutionActionMemberResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = MoveExecutionActionMemberResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(MoveExecutionActionMemberResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into MoveExecutionActionMemberResponse") + } + return +} + +// moveExecutionActionMember implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) moveExecutionActionMember(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/executionActions/{executionActionId}/actions/moveActionMember", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response MoveExecutionActionMemberResponse + 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/20160918/ExecutionAction/MoveExecutionActionMember" + err = common.PostProcessServiceError(err, "Database", "MoveExecutionActionMember", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // RefreshPluggableDatabase Refreshes a pluggable database (PDB) Refreshable clone. // // # See also @@ -17037,22 +18859,146 @@ func (client DatabaseClient) RemoveVirtualMachineFromCloudVmCluster(ctx context. return } -// removeVirtualMachineFromCloudVmCluster implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) removeVirtualMachineFromCloudVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeVirtualMachineFromCloudVmCluster implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) removeVirtualMachineFromCloudVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cloudVmClusters/{cloudVmClusterId}/actions/removeVirtualMachine", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveVirtualMachineFromCloudVmClusterResponse + 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/20160918/CloudVmCluster/RemoveVirtualMachineFromCloudVmCluster" + err = common.PostProcessServiceError(err, "Database", "RemoveVirtualMachineFromCloudVmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveVirtualMachineFromExadbVmCluster Remove Virtual Machines from the Exadata VM cluster on Exascale Infrastructure. Applies to Exadata Cloud instances only. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/RemoveVirtualMachineFromExadbVmCluster.go.html to see an example of how to use RemoveVirtualMachineFromExadbVmCluster API. +func (client DatabaseClient) RemoveVirtualMachineFromExadbVmCluster(ctx context.Context, request RemoveVirtualMachineFromExadbVmClusterRequest) (response RemoveVirtualMachineFromExadbVmClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.removeVirtualMachineFromExadbVmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveVirtualMachineFromExadbVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveVirtualMachineFromExadbVmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveVirtualMachineFromExadbVmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveVirtualMachineFromExadbVmClusterResponse") + } + return +} + +// removeVirtualMachineFromExadbVmCluster implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) removeVirtualMachineFromExadbVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/exadbVmClusters/{exadbVmClusterId}/actions/removeVirtualMachine", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveVirtualMachineFromExadbVmClusterResponse + 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/20160918/ExadbVmCluster/RemoveVirtualMachineFromExadbVmCluster" + err = common.PostProcessServiceError(err, "Database", "RemoveVirtualMachineFromExadbVmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveVirtualMachineFromVmCluster Remove Virtual Machines from the VM cluster. Applies to Exadata Cloud@Customer instances only. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/RemoveVirtualMachineFromVmCluster.go.html to see an example of how to use RemoveVirtualMachineFromVmCluster API. +func (client DatabaseClient) RemoveVirtualMachineFromVmCluster(ctx context.Context, request RemoveVirtualMachineFromVmClusterRequest) (response RemoveVirtualMachineFromVmClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.removeVirtualMachineFromVmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveVirtualMachineFromVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveVirtualMachineFromVmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveVirtualMachineFromVmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveVirtualMachineFromVmClusterResponse") + } + return +} + +// removeVirtualMachineFromVmCluster implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) removeVirtualMachineFromVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/cloudVmClusters/{cloudVmClusterId}/actions/removeVirtualMachine", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/vmClusters/{vmClusterId}/actions/removeVirtualMachine", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response RemoveVirtualMachineFromCloudVmClusterResponse + var response RemoveVirtualMachineFromVmClusterResponse 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/20160918/CloudVmCluster/RemoveVirtualMachineFromCloudVmCluster" - err = common.PostProcessServiceError(err, "Database", "RemoveVirtualMachineFromCloudVmCluster", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/VmCluster/RemoveVirtualMachineFromVmCluster" + err = common.PostProcessServiceError(err, "Database", "RemoveVirtualMachineFromVmCluster", apiReferenceLink) return response, err } @@ -17060,12 +19006,12 @@ func (client DatabaseClient) removeVirtualMachineFromCloudVmCluster(ctx context. return response, err } -// RemoveVirtualMachineFromExadbVmCluster Remove Virtual Machines from the Exadata VM cluster on Exascale Infrastructure. Applies to Exadata Cloud instances only. +// ReorderExecutionActions Reorders the execution actions under this execution window resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/RemoveVirtualMachineFromExadbVmCluster.go.html to see an example of how to use RemoveVirtualMachineFromExadbVmCluster API. -func (client DatabaseClient) RemoveVirtualMachineFromExadbVmCluster(ctx context.Context, request RemoveVirtualMachineFromExadbVmClusterRequest) (response RemoveVirtualMachineFromExadbVmClusterResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ReorderExecutionActions.go.html to see an example of how to use ReorderExecutionActions API. +func (client DatabaseClient) ReorderExecutionActions(ctx context.Context, request ReorderExecutionActionsRequest) (response ReorderExecutionActionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -17079,42 +19025,42 @@ func (client DatabaseClient) RemoveVirtualMachineFromExadbVmCluster(ctx context. request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.removeVirtualMachineFromExadbVmCluster, policy) + ociResponse, err = common.Retry(ctx, request, client.reorderExecutionActions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = RemoveVirtualMachineFromExadbVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ReorderExecutionActionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = RemoveVirtualMachineFromExadbVmClusterResponse{} + response = ReorderExecutionActionsResponse{} } } return } - if convertedResponse, ok := ociResponse.(RemoveVirtualMachineFromExadbVmClusterResponse); ok { + if convertedResponse, ok := ociResponse.(ReorderExecutionActionsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into RemoveVirtualMachineFromExadbVmClusterResponse") + err = fmt.Errorf("failed to convert OCIResponse into ReorderExecutionActionsResponse") } return } -// removeVirtualMachineFromExadbVmCluster implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) removeVirtualMachineFromExadbVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// reorderExecutionActions implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) reorderExecutionActions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/exadbVmClusters/{exadbVmClusterId}/actions/removeVirtualMachine", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/executionWindows/{executionWindowId}/actions/reorder", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response RemoveVirtualMachineFromExadbVmClusterResponse + var response ReorderExecutionActionsResponse 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/20160918/ExadbVmCluster/RemoveVirtualMachineFromExadbVmCluster" - err = common.PostProcessServiceError(err, "Database", "RemoveVirtualMachineFromExadbVmCluster", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ExecutionWindow/ReorderExecutionActions" + err = common.PostProcessServiceError(err, "Database", "ReorderExecutionActions", apiReferenceLink) return response, err } @@ -17122,12 +19068,12 @@ func (client DatabaseClient) removeVirtualMachineFromExadbVmCluster(ctx context. return response, err } -// RemoveVirtualMachineFromVmCluster Remove Virtual Machines from the VM cluster. Applies to Exadata Cloud@Customer instances only. +// ReorderScheduledActions Re-order the scheduled actions under this scheduling plan resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/RemoveVirtualMachineFromVmCluster.go.html to see an example of how to use RemoveVirtualMachineFromVmCluster API. -func (client DatabaseClient) RemoveVirtualMachineFromVmCluster(ctx context.Context, request RemoveVirtualMachineFromVmClusterRequest) (response RemoveVirtualMachineFromVmClusterResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ReorderScheduledActions.go.html to see an example of how to use ReorderScheduledActions API. +func (client DatabaseClient) ReorderScheduledActions(ctx context.Context, request ReorderScheduledActionsRequest) (response ReorderScheduledActionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { @@ -17141,42 +19087,42 @@ func (client DatabaseClient) RemoveVirtualMachineFromVmCluster(ctx context.Conte request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.removeVirtualMachineFromVmCluster, policy) + ociResponse, err = common.Retry(ctx, request, client.reorderScheduledActions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = RemoveVirtualMachineFromVmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ReorderScheduledActionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = RemoveVirtualMachineFromVmClusterResponse{} + response = ReorderScheduledActionsResponse{} } } return } - if convertedResponse, ok := ociResponse.(RemoveVirtualMachineFromVmClusterResponse); ok { + if convertedResponse, ok := ociResponse.(ReorderScheduledActionsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into RemoveVirtualMachineFromVmClusterResponse") + err = fmt.Errorf("failed to convert OCIResponse into ReorderScheduledActionsResponse") } return } -// removeVirtualMachineFromVmCluster implements the OCIOperation interface (enables retrying operations) -func (client DatabaseClient) removeVirtualMachineFromVmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// reorderScheduledActions implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) reorderScheduledActions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/vmClusters/{vmClusterId}/actions/removeVirtualMachine", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/schedulingPlans/{schedulingPlanId}/actions/reorder", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response RemoveVirtualMachineFromVmClusterResponse + var response ReorderScheduledActionsResponse 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/20160918/VmCluster/RemoveVirtualMachineFromVmCluster" - err = common.PostProcessServiceError(err, "Database", "RemoveVirtualMachineFromVmCluster", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/SchedulingPlan/ReorderScheduledActions" + err = common.PostProcessServiceError(err, "Database", "ReorderScheduledActions", apiReferenceLink) return response, err } @@ -20420,6 +22366,120 @@ func (client DatabaseClient) updateExascaleDbStorageVault(ctx context.Context, r return response, err } +// UpdateExecutionAction Updates the execution action resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateExecutionAction.go.html to see an example of how to use UpdateExecutionAction API. +func (client DatabaseClient) UpdateExecutionAction(ctx context.Context, request UpdateExecutionActionRequest) (response UpdateExecutionActionResponse, 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.updateExecutionAction, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateExecutionActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateExecutionActionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateExecutionActionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateExecutionActionResponse") + } + return +} + +// updateExecutionAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateExecutionAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/executionActions/{executionActionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateExecutionActionResponse + 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/20160918/ExecutionAction/UpdateExecutionAction" + err = common.PostProcessServiceError(err, "Database", "UpdateExecutionAction", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateExecutionWindow Updates the execution window resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateExecutionWindow.go.html to see an example of how to use UpdateExecutionWindow API. +func (client DatabaseClient) UpdateExecutionWindow(ctx context.Context, request UpdateExecutionWindowRequest) (response UpdateExecutionWindowResponse, 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.updateExecutionWindow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateExecutionWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateExecutionWindowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateExecutionWindowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateExecutionWindowResponse") + } + return +} + +// updateExecutionWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateExecutionWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/executionWindows/{executionWindowId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateExecutionWindowResponse + 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/20160918/ExecutionWindow/UpdateExecutionWindow" + err = common.PostProcessServiceError(err, "Database", "UpdateExecutionWindow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateExternalContainerDatabase Updates the properties of // an CreateExternalContainerDatabaseDetails resource, // such as the display name. @@ -20880,6 +22940,177 @@ func (client DatabaseClient) updatePluggableDatabase(ctx context.Context, reques return response, err } +// UpdateScheduledAction Updates the Scheduled Action resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateScheduledAction.go.html to see an example of how to use UpdateScheduledAction API. +func (client DatabaseClient) UpdateScheduledAction(ctx context.Context, request UpdateScheduledActionRequest) (response UpdateScheduledActionResponse, 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.updateScheduledAction, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateScheduledActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateScheduledActionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateScheduledActionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateScheduledActionResponse") + } + return +} + +// updateScheduledAction implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateScheduledAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/scheduledActions/{scheduledActionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateScheduledActionResponse + 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, "Database", "UpdateScheduledAction", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSchedulingPolicy Updates the Scheduling Policy resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateSchedulingPolicy.go.html to see an example of how to use UpdateSchedulingPolicy API. +func (client DatabaseClient) UpdateSchedulingPolicy(ctx context.Context, request UpdateSchedulingPolicyRequest) (response UpdateSchedulingPolicyResponse, 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.updateSchedulingPolicy, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateSchedulingPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateSchedulingPolicyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSchedulingPolicyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSchedulingPolicyResponse") + } + return +} + +// updateSchedulingPolicy implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateSchedulingPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/schedulingPolicies/{schedulingPolicyId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateSchedulingPolicyResponse + 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/20160918/SchedulingPolicy/UpdateSchedulingPolicy" + err = common.PostProcessServiceError(err, "Database", "UpdateSchedulingPolicy", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateSchedulingWindow Updates the Scheduling Window resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateSchedulingWindow.go.html to see an example of how to use UpdateSchedulingWindow API. +func (client DatabaseClient) UpdateSchedulingWindow(ctx context.Context, request UpdateSchedulingWindowRequest) (response UpdateSchedulingWindowResponse, 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.updateSchedulingWindow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateSchedulingWindowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateSchedulingWindowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateSchedulingWindowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateSchedulingWindowResponse") + } + return +} + +// updateSchedulingWindow implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) updateSchedulingWindow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/schedulingPolicies/{schedulingPolicyId}/schedulingWindows/{schedulingWindowId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateSchedulingWindowResponse + 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/20160918/SchedulingWindow/UpdateSchedulingWindow" + err = common.PostProcessServiceError(err, "Database", "UpdateSchedulingWindow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateVmCluster Updates the specified VM cluster. Applies to Exadata Cloud@Customer instances only. // // # See also diff --git a/database/delete_execution_action_request_response.go b/database/delete_execution_action_request_response.go new file mode 100644 index 0000000000..ac2c7ebd10 --- /dev/null +++ b/database/delete_execution_action_request_response.go @@ -0,0 +1,95 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteExecutionActionRequest wrapper for the DeleteExecutionAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteExecutionAction.go.html to see an example of how to use DeleteExecutionActionRequest. +type DeleteExecutionActionRequest struct { + + // The execution action OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionActionId *string `mandatory:"true" contributesTo:"path" name:"executionActionId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteExecutionActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteExecutionActionRequest) 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 DeleteExecutionActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteExecutionActionRequest) 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 DeleteExecutionActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteExecutionActionResponse wrapper for the DeleteExecutionAction operation +type DeleteExecutionActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteExecutionActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteExecutionActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/delete_execution_window_request_response.go b/database/delete_execution_window_request_response.go new file mode 100644 index 0000000000..ed799958a3 --- /dev/null +++ b/database/delete_execution_window_request_response.go @@ -0,0 +1,92 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteExecutionWindowRequest wrapper for the DeleteExecutionWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteExecutionWindow.go.html to see an example of how to use DeleteExecutionWindowRequest. +type DeleteExecutionWindowRequest struct { + + // The execution window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionWindowId *string `mandatory:"true" contributesTo:"path" name:"executionWindowId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteExecutionWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteExecutionWindowRequest) 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 DeleteExecutionWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteExecutionWindowRequest) 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 DeleteExecutionWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteExecutionWindowResponse wrapper for the DeleteExecutionWindow operation +type DeleteExecutionWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteExecutionWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteExecutionWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/delete_scheduled_action_request_response.go b/database/delete_scheduled_action_request_response.go new file mode 100644 index 0000000000..7189971ca7 --- /dev/null +++ b/database/delete_scheduled_action_request_response.go @@ -0,0 +1,95 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteScheduledActionRequest wrapper for the DeleteScheduledAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteScheduledAction.go.html to see an example of how to use DeleteScheduledActionRequest. +type DeleteScheduledActionRequest struct { + + // The Scheduled Action OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ScheduledActionId *string `mandatory:"true" contributesTo:"path" name:"scheduledActionId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteScheduledActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteScheduledActionRequest) 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 DeleteScheduledActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteScheduledActionRequest) 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 DeleteScheduledActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteScheduledActionResponse wrapper for the DeleteScheduledAction operation +type DeleteScheduledActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteScheduledActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteScheduledActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/delete_scheduling_plan_request_response.go b/database/delete_scheduling_plan_request_response.go new file mode 100644 index 0000000000..c70772aca2 --- /dev/null +++ b/database/delete_scheduling_plan_request_response.go @@ -0,0 +1,95 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteSchedulingPlanRequest wrapper for the DeleteSchedulingPlan operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteSchedulingPlan.go.html to see an example of how to use DeleteSchedulingPlanRequest. +type DeleteSchedulingPlanRequest struct { + + // The Schedule Plan OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPlanId *string `mandatory:"true" contributesTo:"path" name:"schedulingPlanId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteSchedulingPlanRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSchedulingPlanRequest) 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 DeleteSchedulingPlanRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSchedulingPlanRequest) 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 DeleteSchedulingPlanRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteSchedulingPlanResponse wrapper for the DeleteSchedulingPlan operation +type DeleteSchedulingPlanResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteSchedulingPlanResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSchedulingPlanResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/delete_scheduling_policy_request_response.go b/database/delete_scheduling_policy_request_response.go new file mode 100644 index 0000000000..49aa624c79 --- /dev/null +++ b/database/delete_scheduling_policy_request_response.go @@ -0,0 +1,92 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteSchedulingPolicyRequest wrapper for the DeleteSchedulingPolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteSchedulingPolicy.go.html to see an example of how to use DeleteSchedulingPolicyRequest. +type DeleteSchedulingPolicyRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteSchedulingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSchedulingPolicyRequest) 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 DeleteSchedulingPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSchedulingPolicyRequest) 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 DeleteSchedulingPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteSchedulingPolicyResponse wrapper for the DeleteSchedulingPolicy operation +type DeleteSchedulingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteSchedulingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSchedulingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/delete_scheduling_window_request_response.go b/database/delete_scheduling_window_request_response.go new file mode 100644 index 0000000000..f172eb8b7c --- /dev/null +++ b/database/delete_scheduling_window_request_response.go @@ -0,0 +1,95 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteSchedulingWindowRequest wrapper for the DeleteSchedulingWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/DeleteSchedulingWindow.go.html to see an example of how to use DeleteSchedulingWindowRequest. +type DeleteSchedulingWindowRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // The Scheduling Window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingWindowId *string `mandatory:"true" contributesTo:"path" name:"schedulingWindowId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 DeleteSchedulingWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteSchedulingWindowRequest) 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 DeleteSchedulingWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteSchedulingWindowRequest) 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 DeleteSchedulingWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteSchedulingWindowResponse wrapper for the DeleteSchedulingWindow operation +type DeleteSchedulingWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + // a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteSchedulingWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteSchedulingWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/exadata_infrastructure.go b/database/exadata_infrastructure.go index 9100e8a8e2..5e72e6bf4f 100644 --- a/database/exadata_infrastructure.go +++ b/database/exadata_infrastructure.go @@ -169,6 +169,9 @@ type ExadataInfrastructure struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // If true, the infrastructure is using granular maintenance scheduling preference. + IsSchedulingPolicyAssociated *bool `mandatory:"false" json:"isSchedulingPolicyAssociated"` } func (m ExadataInfrastructure) String() string { diff --git a/database/exadata_infrastructure_summary.go b/database/exadata_infrastructure_summary.go index 75276eec43..8b3149fde8 100644 --- a/database/exadata_infrastructure_summary.go +++ b/database/exadata_infrastructure_summary.go @@ -170,6 +170,9 @@ type ExadataInfrastructureSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // If true, the infrastructure is using granular maintenance scheduling preference. + IsSchedulingPolicyAssociated *bool `mandatory:"false" json:"isSchedulingPolicyAssociated"` } func (m ExadataInfrastructureSummary) String() string { diff --git a/database/exadb_vm_cluster.go b/database/exadb_vm_cluster.go index 9280de39ba..2e47e15b34 100644 --- a/database/exadb_vm_cluster.go +++ b/database/exadb_vm_cluster.go @@ -101,7 +101,11 @@ type ExadbVmCluster struct { // A valid Oracle Grid Infrastructure (GI) software version. GiVersion *string `mandatory:"false" json:"giVersion"` - // Grid Setup will be done using this grid image id + // Grid Setup will be done using this grid image id. + // The grid image id can be extracted from + // 1. Obtain the supported major versions using API /20160918/giVersions?compartmentId=&shape=EXADB_XS&availabilityDomain= + // 2. Replace {version} with one of the supported major versions and obtain the supported minor versions using + // API /20160918/giVersions/{version}/minorVersions?compartmentId=&shapeFamily=EXADB_XS&availabilityDomain= GridImageId *string `mandatory:"false" json:"gridImageId"` // The type of Grid Image diff --git a/database/exadb_vm_cluster_summary.go b/database/exadb_vm_cluster_summary.go index d61ad87f22..65738af801 100644 --- a/database/exadb_vm_cluster_summary.go +++ b/database/exadb_vm_cluster_summary.go @@ -101,7 +101,11 @@ type ExadbVmClusterSummary struct { // A valid Oracle Grid Infrastructure (GI) software version. GiVersion *string `mandatory:"false" json:"giVersion"` - // Grid Setup will be done using this grid image id + // Grid Setup will be done using this grid image id. + // The grid image id can be extracted from + // 1. Obtain the supported major versions using API /20160918/giVersions?compartmentId=&shape=EXADB_XS&availabilityDomain= + // 2. Replace {version} with one of the supported major versions and obtain the supported minor versions using + // API /20160918/giVersions/{version}/minorVersions?compartmentId=&shapeFamily=EXADB_XS&availabilityDomain= GridImageId *string `mandatory:"false" json:"gridImageId"` // The type of Grid Image diff --git a/database/execution_action.go b/database/execution_action.go new file mode 100644 index 0000000000..98654f75c4 --- /dev/null +++ b/database/execution_action.go @@ -0,0 +1,266 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExecutionAction Details of an execution action. +type ExecutionAction struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution action. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution window resource the execution action belongs to. + ExecutionWindowId *string `mandatory:"true" json:"executionWindowId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the execution action. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the execution action. Valid states are SCHEDULED, IN_PROGRESS, FAILED, CANCELED, + // UPDATING, DELETED, SUCCEEDED and PARTIAL_SUCCESS. + LifecycleState ExecutionActionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The action type of the execution action being performed + ActionType ExecutionActionActionTypeEnum `mandatory:"true" json:"actionType"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"true" json:"actionParams"` + + // Description of the execution action. + Description *string `mandatory:"false" json:"description"` + + // The current sub-state of the execution action. Valid states are DURATION_EXCEEDED, MAINTENANCE_IN_PROGRESS and WAITING. + LifecycleSubstate ExecutionActionLifecycleSubstateEnum `mandatory:"false" json:"lifecycleSubstate,omitempty"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the execution action was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the execution action was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The estimated time of the execution action in minutes. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The total time taken by corresponding resource activity in minutes. + TotalTimeTakenInMins *int `mandatory:"false" json:"totalTimeTakenInMins"` + + // The priority order of the execution action. + ExecutionActionOrder *int `mandatory:"false" json:"executionActionOrder"` + + // List of action members of this execution action. + ActionMembers []ExecutionActionMember `mandatory:"false" json:"actionMembers"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m ExecutionAction) 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 ExecutionAction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingExecutionActionLifecycleStateEnum(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(GetExecutionActionLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingExecutionActionActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetExecutionActionActionTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingExecutionActionLifecycleSubstateEnum(string(m.LifecycleSubstate)); !ok && m.LifecycleSubstate != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleSubstate: %s. Supported values are: %s.", m.LifecycleSubstate, strings.Join(GetExecutionActionLifecycleSubstateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ExecutionActionLifecycleStateEnum Enum with underlying type: string +type ExecutionActionLifecycleStateEnum string + +// Set of constants representing the allowable values for ExecutionActionLifecycleStateEnum +const ( + ExecutionActionLifecycleStateScheduled ExecutionActionLifecycleStateEnum = "SCHEDULED" + ExecutionActionLifecycleStateInProgress ExecutionActionLifecycleStateEnum = "IN_PROGRESS" + ExecutionActionLifecycleStateFailed ExecutionActionLifecycleStateEnum = "FAILED" + ExecutionActionLifecycleStateCanceled ExecutionActionLifecycleStateEnum = "CANCELED" + ExecutionActionLifecycleStateUpdating ExecutionActionLifecycleStateEnum = "UPDATING" + ExecutionActionLifecycleStateDeleted ExecutionActionLifecycleStateEnum = "DELETED" + ExecutionActionLifecycleStateSucceeded ExecutionActionLifecycleStateEnum = "SUCCEEDED" + ExecutionActionLifecycleStatePartialSuccess ExecutionActionLifecycleStateEnum = "PARTIAL_SUCCESS" +) + +var mappingExecutionActionLifecycleStateEnum = map[string]ExecutionActionLifecycleStateEnum{ + "SCHEDULED": ExecutionActionLifecycleStateScheduled, + "IN_PROGRESS": ExecutionActionLifecycleStateInProgress, + "FAILED": ExecutionActionLifecycleStateFailed, + "CANCELED": ExecutionActionLifecycleStateCanceled, + "UPDATING": ExecutionActionLifecycleStateUpdating, + "DELETED": ExecutionActionLifecycleStateDeleted, + "SUCCEEDED": ExecutionActionLifecycleStateSucceeded, + "PARTIAL_SUCCESS": ExecutionActionLifecycleStatePartialSuccess, +} + +var mappingExecutionActionLifecycleStateEnumLowerCase = map[string]ExecutionActionLifecycleStateEnum{ + "scheduled": ExecutionActionLifecycleStateScheduled, + "in_progress": ExecutionActionLifecycleStateInProgress, + "failed": ExecutionActionLifecycleStateFailed, + "canceled": ExecutionActionLifecycleStateCanceled, + "updating": ExecutionActionLifecycleStateUpdating, + "deleted": ExecutionActionLifecycleStateDeleted, + "succeeded": ExecutionActionLifecycleStateSucceeded, + "partial_success": ExecutionActionLifecycleStatePartialSuccess, +} + +// GetExecutionActionLifecycleStateEnumValues Enumerates the set of values for ExecutionActionLifecycleStateEnum +func GetExecutionActionLifecycleStateEnumValues() []ExecutionActionLifecycleStateEnum { + values := make([]ExecutionActionLifecycleStateEnum, 0) + for _, v := range mappingExecutionActionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionActionLifecycleStateEnumStringValues Enumerates the set of values in String for ExecutionActionLifecycleStateEnum +func GetExecutionActionLifecycleStateEnumStringValues() []string { + return []string{ + "SCHEDULED", + "IN_PROGRESS", + "FAILED", + "CANCELED", + "UPDATING", + "DELETED", + "SUCCEEDED", + "PARTIAL_SUCCESS", + } +} + +// GetMappingExecutionActionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionActionLifecycleStateEnum(val string) (ExecutionActionLifecycleStateEnum, bool) { + enum, ok := mappingExecutionActionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionActionLifecycleSubstateEnum Enum with underlying type: string +type ExecutionActionLifecycleSubstateEnum string + +// Set of constants representing the allowable values for ExecutionActionLifecycleSubstateEnum +const ( + ExecutionActionLifecycleSubstateDurationExceeded ExecutionActionLifecycleSubstateEnum = "DURATION_EXCEEDED" + ExecutionActionLifecycleSubstateMaintenanceInProgress ExecutionActionLifecycleSubstateEnum = "MAINTENANCE_IN_PROGRESS" + ExecutionActionLifecycleSubstateWaiting ExecutionActionLifecycleSubstateEnum = "WAITING" + ExecutionActionLifecycleSubstateRescheduled ExecutionActionLifecycleSubstateEnum = "RESCHEDULED" +) + +var mappingExecutionActionLifecycleSubstateEnum = map[string]ExecutionActionLifecycleSubstateEnum{ + "DURATION_EXCEEDED": ExecutionActionLifecycleSubstateDurationExceeded, + "MAINTENANCE_IN_PROGRESS": ExecutionActionLifecycleSubstateMaintenanceInProgress, + "WAITING": ExecutionActionLifecycleSubstateWaiting, + "RESCHEDULED": ExecutionActionLifecycleSubstateRescheduled, +} + +var mappingExecutionActionLifecycleSubstateEnumLowerCase = map[string]ExecutionActionLifecycleSubstateEnum{ + "duration_exceeded": ExecutionActionLifecycleSubstateDurationExceeded, + "maintenance_in_progress": ExecutionActionLifecycleSubstateMaintenanceInProgress, + "waiting": ExecutionActionLifecycleSubstateWaiting, + "rescheduled": ExecutionActionLifecycleSubstateRescheduled, +} + +// GetExecutionActionLifecycleSubstateEnumValues Enumerates the set of values for ExecutionActionLifecycleSubstateEnum +func GetExecutionActionLifecycleSubstateEnumValues() []ExecutionActionLifecycleSubstateEnum { + values := make([]ExecutionActionLifecycleSubstateEnum, 0) + for _, v := range mappingExecutionActionLifecycleSubstateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionActionLifecycleSubstateEnumStringValues Enumerates the set of values in String for ExecutionActionLifecycleSubstateEnum +func GetExecutionActionLifecycleSubstateEnumStringValues() []string { + return []string{ + "DURATION_EXCEEDED", + "MAINTENANCE_IN_PROGRESS", + "WAITING", + "RESCHEDULED", + } +} + +// GetMappingExecutionActionLifecycleSubstateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionActionLifecycleSubstateEnum(val string) (ExecutionActionLifecycleSubstateEnum, bool) { + enum, ok := mappingExecutionActionLifecycleSubstateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionActionActionTypeEnum Enum with underlying type: string +type ExecutionActionActionTypeEnum string + +// Set of constants representing the allowable values for ExecutionActionActionTypeEnum +const ( + ExecutionActionActionTypeDbServerFullSoftwareUpdate ExecutionActionActionTypeEnum = "DB_SERVER_FULL_SOFTWARE_UPDATE" + ExecutionActionActionTypeStorageServerFullSoftwareUpdate ExecutionActionActionTypeEnum = "STORAGE_SERVER_FULL_SOFTWARE_UPDATE" + ExecutionActionActionTypeNetworkSwitchFullSoftwareUpdate ExecutionActionActionTypeEnum = "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE" +) + +var mappingExecutionActionActionTypeEnum = map[string]ExecutionActionActionTypeEnum{ + "DB_SERVER_FULL_SOFTWARE_UPDATE": ExecutionActionActionTypeDbServerFullSoftwareUpdate, + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE": ExecutionActionActionTypeStorageServerFullSoftwareUpdate, + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE": ExecutionActionActionTypeNetworkSwitchFullSoftwareUpdate, +} + +var mappingExecutionActionActionTypeEnumLowerCase = map[string]ExecutionActionActionTypeEnum{ + "db_server_full_software_update": ExecutionActionActionTypeDbServerFullSoftwareUpdate, + "storage_server_full_software_update": ExecutionActionActionTypeStorageServerFullSoftwareUpdate, + "network_switch_full_software_update": ExecutionActionActionTypeNetworkSwitchFullSoftwareUpdate, +} + +// GetExecutionActionActionTypeEnumValues Enumerates the set of values for ExecutionActionActionTypeEnum +func GetExecutionActionActionTypeEnumValues() []ExecutionActionActionTypeEnum { + values := make([]ExecutionActionActionTypeEnum, 0) + for _, v := range mappingExecutionActionActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetExecutionActionActionTypeEnumStringValues Enumerates the set of values in String for ExecutionActionActionTypeEnum +func GetExecutionActionActionTypeEnumStringValues() []string { + return []string{ + "DB_SERVER_FULL_SOFTWARE_UPDATE", + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingExecutionActionActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionActionActionTypeEnum(val string) (ExecutionActionActionTypeEnum, bool) { + enum, ok := mappingExecutionActionActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/execution_action_member.go b/database/execution_action_member.go new file mode 100644 index 0000000000..94ca01e61a --- /dev/null +++ b/database/execution_action_member.go @@ -0,0 +1,59 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExecutionActionMember The action member details. +type ExecutionActionMember struct { + + // The priority order of the execution action member. + MemberOrder *int `mandatory:"true" json:"memberOrder"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the parent resource the execution action belongs to. + MemberId *string `mandatory:"true" json:"memberId"` + + // The current status of the execution action member. Valid states are SCHEDULED, IN_PROGRESS, FAILED, CANCELED, DURATION_EXCEEDED, RESCHEDULED and COMPLETED. + // enum: + // - SCHEDULED + // - IN_PROGRESS + // - FAILED + // - CANCELED + // - DURATION_EXCEEDED + // - RESCHEDULED + // - SUCCEEDED + Status *string `mandatory:"false" json:"status"` + + // The estimated time of the execution action member in minutes. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The total time taken by corresponding resource activity in minutes. + TotalTimeTakenInMins *int `mandatory:"false" json:"totalTimeTakenInMins"` +} + +func (m ExecutionActionMember) 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 ExecutionActionMember) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/execution_action_summary.go b/database/execution_action_summary.go new file mode 100644 index 0000000000..562f1ee139 --- /dev/null +++ b/database/execution_action_summary.go @@ -0,0 +1,266 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExecutionActionSummary Details of an execution action. +type ExecutionActionSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution action. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution window resource the execution action belongs to. + ExecutionWindowId *string `mandatory:"true" json:"executionWindowId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the execution action. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the execution action. Valid states are SCHEDULED, IN_PROGRESS, FAILED, CANCELED, + // UPDATING, DELETED, SUCCEEDED and PARTIAL_SUCCESS. + LifecycleState ExecutionActionSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The action type of the execution action being performed + ActionType ExecutionActionSummaryActionTypeEnum `mandatory:"true" json:"actionType"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"true" json:"actionParams"` + + // Description of the execution action. + Description *string `mandatory:"false" json:"description"` + + // The current sub-state of the execution action. Valid states are DURATION_EXCEEDED, MAINTENANCE_IN_PROGRESS and WAITING. + LifecycleSubstate ExecutionActionSummaryLifecycleSubstateEnum `mandatory:"false" json:"lifecycleSubstate,omitempty"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the execution action was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the execution action was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The estimated time of the execution action in minutes. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The total time taken by corresponding resource activity in minutes. + TotalTimeTakenInMins *int `mandatory:"false" json:"totalTimeTakenInMins"` + + // The priority order of the execution action. + ExecutionActionOrder *int `mandatory:"false" json:"executionActionOrder"` + + // List of action members of this execution action. + ActionMembers []ExecutionActionMember `mandatory:"false" json:"actionMembers"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m ExecutionActionSummary) 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 ExecutionActionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingExecutionActionSummaryLifecycleStateEnum(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(GetExecutionActionSummaryLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingExecutionActionSummaryActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetExecutionActionSummaryActionTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingExecutionActionSummaryLifecycleSubstateEnum(string(m.LifecycleSubstate)); !ok && m.LifecycleSubstate != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleSubstate: %s. Supported values are: %s.", m.LifecycleSubstate, strings.Join(GetExecutionActionSummaryLifecycleSubstateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ExecutionActionSummaryLifecycleStateEnum Enum with underlying type: string +type ExecutionActionSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ExecutionActionSummaryLifecycleStateEnum +const ( + ExecutionActionSummaryLifecycleStateScheduled ExecutionActionSummaryLifecycleStateEnum = "SCHEDULED" + ExecutionActionSummaryLifecycleStateInProgress ExecutionActionSummaryLifecycleStateEnum = "IN_PROGRESS" + ExecutionActionSummaryLifecycleStateFailed ExecutionActionSummaryLifecycleStateEnum = "FAILED" + ExecutionActionSummaryLifecycleStateCanceled ExecutionActionSummaryLifecycleStateEnum = "CANCELED" + ExecutionActionSummaryLifecycleStateUpdating ExecutionActionSummaryLifecycleStateEnum = "UPDATING" + ExecutionActionSummaryLifecycleStateDeleted ExecutionActionSummaryLifecycleStateEnum = "DELETED" + ExecutionActionSummaryLifecycleStateSucceeded ExecutionActionSummaryLifecycleStateEnum = "SUCCEEDED" + ExecutionActionSummaryLifecycleStatePartialSuccess ExecutionActionSummaryLifecycleStateEnum = "PARTIAL_SUCCESS" +) + +var mappingExecutionActionSummaryLifecycleStateEnum = map[string]ExecutionActionSummaryLifecycleStateEnum{ + "SCHEDULED": ExecutionActionSummaryLifecycleStateScheduled, + "IN_PROGRESS": ExecutionActionSummaryLifecycleStateInProgress, + "FAILED": ExecutionActionSummaryLifecycleStateFailed, + "CANCELED": ExecutionActionSummaryLifecycleStateCanceled, + "UPDATING": ExecutionActionSummaryLifecycleStateUpdating, + "DELETED": ExecutionActionSummaryLifecycleStateDeleted, + "SUCCEEDED": ExecutionActionSummaryLifecycleStateSucceeded, + "PARTIAL_SUCCESS": ExecutionActionSummaryLifecycleStatePartialSuccess, +} + +var mappingExecutionActionSummaryLifecycleStateEnumLowerCase = map[string]ExecutionActionSummaryLifecycleStateEnum{ + "scheduled": ExecutionActionSummaryLifecycleStateScheduled, + "in_progress": ExecutionActionSummaryLifecycleStateInProgress, + "failed": ExecutionActionSummaryLifecycleStateFailed, + "canceled": ExecutionActionSummaryLifecycleStateCanceled, + "updating": ExecutionActionSummaryLifecycleStateUpdating, + "deleted": ExecutionActionSummaryLifecycleStateDeleted, + "succeeded": ExecutionActionSummaryLifecycleStateSucceeded, + "partial_success": ExecutionActionSummaryLifecycleStatePartialSuccess, +} + +// GetExecutionActionSummaryLifecycleStateEnumValues Enumerates the set of values for ExecutionActionSummaryLifecycleStateEnum +func GetExecutionActionSummaryLifecycleStateEnumValues() []ExecutionActionSummaryLifecycleStateEnum { + values := make([]ExecutionActionSummaryLifecycleStateEnum, 0) + for _, v := range mappingExecutionActionSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionActionSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ExecutionActionSummaryLifecycleStateEnum +func GetExecutionActionSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "SCHEDULED", + "IN_PROGRESS", + "FAILED", + "CANCELED", + "UPDATING", + "DELETED", + "SUCCEEDED", + "PARTIAL_SUCCESS", + } +} + +// GetMappingExecutionActionSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionActionSummaryLifecycleStateEnum(val string) (ExecutionActionSummaryLifecycleStateEnum, bool) { + enum, ok := mappingExecutionActionSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionActionSummaryLifecycleSubstateEnum Enum with underlying type: string +type ExecutionActionSummaryLifecycleSubstateEnum string + +// Set of constants representing the allowable values for ExecutionActionSummaryLifecycleSubstateEnum +const ( + ExecutionActionSummaryLifecycleSubstateDurationExceeded ExecutionActionSummaryLifecycleSubstateEnum = "DURATION_EXCEEDED" + ExecutionActionSummaryLifecycleSubstateMaintenanceInProgress ExecutionActionSummaryLifecycleSubstateEnum = "MAINTENANCE_IN_PROGRESS" + ExecutionActionSummaryLifecycleSubstateWaiting ExecutionActionSummaryLifecycleSubstateEnum = "WAITING" + ExecutionActionSummaryLifecycleSubstateRescheduled ExecutionActionSummaryLifecycleSubstateEnum = "RESCHEDULED" +) + +var mappingExecutionActionSummaryLifecycleSubstateEnum = map[string]ExecutionActionSummaryLifecycleSubstateEnum{ + "DURATION_EXCEEDED": ExecutionActionSummaryLifecycleSubstateDurationExceeded, + "MAINTENANCE_IN_PROGRESS": ExecutionActionSummaryLifecycleSubstateMaintenanceInProgress, + "WAITING": ExecutionActionSummaryLifecycleSubstateWaiting, + "RESCHEDULED": ExecutionActionSummaryLifecycleSubstateRescheduled, +} + +var mappingExecutionActionSummaryLifecycleSubstateEnumLowerCase = map[string]ExecutionActionSummaryLifecycleSubstateEnum{ + "duration_exceeded": ExecutionActionSummaryLifecycleSubstateDurationExceeded, + "maintenance_in_progress": ExecutionActionSummaryLifecycleSubstateMaintenanceInProgress, + "waiting": ExecutionActionSummaryLifecycleSubstateWaiting, + "rescheduled": ExecutionActionSummaryLifecycleSubstateRescheduled, +} + +// GetExecutionActionSummaryLifecycleSubstateEnumValues Enumerates the set of values for ExecutionActionSummaryLifecycleSubstateEnum +func GetExecutionActionSummaryLifecycleSubstateEnumValues() []ExecutionActionSummaryLifecycleSubstateEnum { + values := make([]ExecutionActionSummaryLifecycleSubstateEnum, 0) + for _, v := range mappingExecutionActionSummaryLifecycleSubstateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionActionSummaryLifecycleSubstateEnumStringValues Enumerates the set of values in String for ExecutionActionSummaryLifecycleSubstateEnum +func GetExecutionActionSummaryLifecycleSubstateEnumStringValues() []string { + return []string{ + "DURATION_EXCEEDED", + "MAINTENANCE_IN_PROGRESS", + "WAITING", + "RESCHEDULED", + } +} + +// GetMappingExecutionActionSummaryLifecycleSubstateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionActionSummaryLifecycleSubstateEnum(val string) (ExecutionActionSummaryLifecycleSubstateEnum, bool) { + enum, ok := mappingExecutionActionSummaryLifecycleSubstateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionActionSummaryActionTypeEnum Enum with underlying type: string +type ExecutionActionSummaryActionTypeEnum string + +// Set of constants representing the allowable values for ExecutionActionSummaryActionTypeEnum +const ( + ExecutionActionSummaryActionTypeDbServerFullSoftwareUpdate ExecutionActionSummaryActionTypeEnum = "DB_SERVER_FULL_SOFTWARE_UPDATE" + ExecutionActionSummaryActionTypeStorageServerFullSoftwareUpdate ExecutionActionSummaryActionTypeEnum = "STORAGE_SERVER_FULL_SOFTWARE_UPDATE" + ExecutionActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate ExecutionActionSummaryActionTypeEnum = "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE" +) + +var mappingExecutionActionSummaryActionTypeEnum = map[string]ExecutionActionSummaryActionTypeEnum{ + "DB_SERVER_FULL_SOFTWARE_UPDATE": ExecutionActionSummaryActionTypeDbServerFullSoftwareUpdate, + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE": ExecutionActionSummaryActionTypeStorageServerFullSoftwareUpdate, + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE": ExecutionActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate, +} + +var mappingExecutionActionSummaryActionTypeEnumLowerCase = map[string]ExecutionActionSummaryActionTypeEnum{ + "db_server_full_software_update": ExecutionActionSummaryActionTypeDbServerFullSoftwareUpdate, + "storage_server_full_software_update": ExecutionActionSummaryActionTypeStorageServerFullSoftwareUpdate, + "network_switch_full_software_update": ExecutionActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate, +} + +// GetExecutionActionSummaryActionTypeEnumValues Enumerates the set of values for ExecutionActionSummaryActionTypeEnum +func GetExecutionActionSummaryActionTypeEnumValues() []ExecutionActionSummaryActionTypeEnum { + values := make([]ExecutionActionSummaryActionTypeEnum, 0) + for _, v := range mappingExecutionActionSummaryActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetExecutionActionSummaryActionTypeEnumStringValues Enumerates the set of values in String for ExecutionActionSummaryActionTypeEnum +func GetExecutionActionSummaryActionTypeEnumStringValues() []string { + return []string{ + "DB_SERVER_FULL_SOFTWARE_UPDATE", + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingExecutionActionSummaryActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionActionSummaryActionTypeEnum(val string) (ExecutionActionSummaryActionTypeEnum, bool) { + enum, ok := mappingExecutionActionSummaryActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/execution_window.go b/database/execution_window.go new file mode 100644 index 0000000000..1e17cbbb12 --- /dev/null +++ b/database/execution_window.go @@ -0,0 +1,279 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExecutionWindow Details of an execution window. +type ExecutionWindow struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution window. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution resource the execution window belongs to. + ExecutionResourceId *string `mandatory:"true" json:"executionResourceId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the execution window. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the Schedule Policy. Valid states are CREATED, SCHEDULED, IN_PROGRESS, FAILED, CANCELED, + // UPDATING, DELETED, SUCCEEDED and PARTIAL_SUCCESS. + LifecycleState ExecutionWindowLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The scheduled start date and time of the execution window. + TimeScheduled *common.SDKTime `mandatory:"true" json:"timeScheduled"` + + // Duration window allows user to set a duration they plan to allocate for Scheduling window. The duration is in minutes. + WindowDurationInMins *int `mandatory:"true" json:"windowDurationInMins"` + + // Description of the execution window. + Description *string `mandatory:"false" json:"description"` + + // The current sub-state of the execution window. Valid states are DURATION_EXCEEDED, MAINTENANCE_IN_PROGRESS and WAITING. + LifecycleSubstate ExecutionWindowLifecycleSubstateEnum `mandatory:"false" json:"lifecycleSubstate,omitempty"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the execution window was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the execution window was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The date and time that the execution window was started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time that the execution window ended. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` + + // Indicates if duration the user plans to allocate for scheduling window is strictly enforced. The default value is `FALSE`. + IsEnforcedDuration *bool `mandatory:"false" json:"isEnforcedDuration"` + + // The estimated time of the execution window in minutes. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The total time taken by corresponding resource activity in minutes. + TotalTimeTakenInMins *int `mandatory:"false" json:"totalTimeTakenInMins"` + + // The execution window is of PLANNED or UNPLANNED type. + WindowType ExecutionWindowWindowTypeEnum `mandatory:"false" json:"windowType,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m ExecutionWindow) 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 ExecutionWindow) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingExecutionWindowLifecycleStateEnum(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(GetExecutionWindowLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingExecutionWindowLifecycleSubstateEnum(string(m.LifecycleSubstate)); !ok && m.LifecycleSubstate != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleSubstate: %s. Supported values are: %s.", m.LifecycleSubstate, strings.Join(GetExecutionWindowLifecycleSubstateEnumStringValues(), ","))) + } + if _, ok := GetMappingExecutionWindowWindowTypeEnum(string(m.WindowType)); !ok && m.WindowType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WindowType: %s. Supported values are: %s.", m.WindowType, strings.Join(GetExecutionWindowWindowTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ExecutionWindowLifecycleStateEnum Enum with underlying type: string +type ExecutionWindowLifecycleStateEnum string + +// Set of constants representing the allowable values for ExecutionWindowLifecycleStateEnum +const ( + ExecutionWindowLifecycleStateCreated ExecutionWindowLifecycleStateEnum = "CREATED" + ExecutionWindowLifecycleStateScheduled ExecutionWindowLifecycleStateEnum = "SCHEDULED" + ExecutionWindowLifecycleStateInProgress ExecutionWindowLifecycleStateEnum = "IN_PROGRESS" + ExecutionWindowLifecycleStateFailed ExecutionWindowLifecycleStateEnum = "FAILED" + ExecutionWindowLifecycleStateCanceled ExecutionWindowLifecycleStateEnum = "CANCELED" + ExecutionWindowLifecycleStateUpdating ExecutionWindowLifecycleStateEnum = "UPDATING" + ExecutionWindowLifecycleStateDeleted ExecutionWindowLifecycleStateEnum = "DELETED" + ExecutionWindowLifecycleStateSucceeded ExecutionWindowLifecycleStateEnum = "SUCCEEDED" + ExecutionWindowLifecycleStatePartialSuccess ExecutionWindowLifecycleStateEnum = "PARTIAL_SUCCESS" + ExecutionWindowLifecycleStateCreating ExecutionWindowLifecycleStateEnum = "CREATING" + ExecutionWindowLifecycleStateDeleting ExecutionWindowLifecycleStateEnum = "DELETING" +) + +var mappingExecutionWindowLifecycleStateEnum = map[string]ExecutionWindowLifecycleStateEnum{ + "CREATED": ExecutionWindowLifecycleStateCreated, + "SCHEDULED": ExecutionWindowLifecycleStateScheduled, + "IN_PROGRESS": ExecutionWindowLifecycleStateInProgress, + "FAILED": ExecutionWindowLifecycleStateFailed, + "CANCELED": ExecutionWindowLifecycleStateCanceled, + "UPDATING": ExecutionWindowLifecycleStateUpdating, + "DELETED": ExecutionWindowLifecycleStateDeleted, + "SUCCEEDED": ExecutionWindowLifecycleStateSucceeded, + "PARTIAL_SUCCESS": ExecutionWindowLifecycleStatePartialSuccess, + "CREATING": ExecutionWindowLifecycleStateCreating, + "DELETING": ExecutionWindowLifecycleStateDeleting, +} + +var mappingExecutionWindowLifecycleStateEnumLowerCase = map[string]ExecutionWindowLifecycleStateEnum{ + "created": ExecutionWindowLifecycleStateCreated, + "scheduled": ExecutionWindowLifecycleStateScheduled, + "in_progress": ExecutionWindowLifecycleStateInProgress, + "failed": ExecutionWindowLifecycleStateFailed, + "canceled": ExecutionWindowLifecycleStateCanceled, + "updating": ExecutionWindowLifecycleStateUpdating, + "deleted": ExecutionWindowLifecycleStateDeleted, + "succeeded": ExecutionWindowLifecycleStateSucceeded, + "partial_success": ExecutionWindowLifecycleStatePartialSuccess, + "creating": ExecutionWindowLifecycleStateCreating, + "deleting": ExecutionWindowLifecycleStateDeleting, +} + +// GetExecutionWindowLifecycleStateEnumValues Enumerates the set of values for ExecutionWindowLifecycleStateEnum +func GetExecutionWindowLifecycleStateEnumValues() []ExecutionWindowLifecycleStateEnum { + values := make([]ExecutionWindowLifecycleStateEnum, 0) + for _, v := range mappingExecutionWindowLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionWindowLifecycleStateEnumStringValues Enumerates the set of values in String for ExecutionWindowLifecycleStateEnum +func GetExecutionWindowLifecycleStateEnumStringValues() []string { + return []string{ + "CREATED", + "SCHEDULED", + "IN_PROGRESS", + "FAILED", + "CANCELED", + "UPDATING", + "DELETED", + "SUCCEEDED", + "PARTIAL_SUCCESS", + "CREATING", + "DELETING", + } +} + +// GetMappingExecutionWindowLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionWindowLifecycleStateEnum(val string) (ExecutionWindowLifecycleStateEnum, bool) { + enum, ok := mappingExecutionWindowLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionWindowLifecycleSubstateEnum Enum with underlying type: string +type ExecutionWindowLifecycleSubstateEnum string + +// Set of constants representing the allowable values for ExecutionWindowLifecycleSubstateEnum +const ( + ExecutionWindowLifecycleSubstateDurationExceeded ExecutionWindowLifecycleSubstateEnum = "DURATION_EXCEEDED" + ExecutionWindowLifecycleSubstateMaintenanceInProgress ExecutionWindowLifecycleSubstateEnum = "MAINTENANCE_IN_PROGRESS" + ExecutionWindowLifecycleSubstateWaiting ExecutionWindowLifecycleSubstateEnum = "WAITING" + ExecutionWindowLifecycleSubstateRescheduled ExecutionWindowLifecycleSubstateEnum = "RESCHEDULED" +) + +var mappingExecutionWindowLifecycleSubstateEnum = map[string]ExecutionWindowLifecycleSubstateEnum{ + "DURATION_EXCEEDED": ExecutionWindowLifecycleSubstateDurationExceeded, + "MAINTENANCE_IN_PROGRESS": ExecutionWindowLifecycleSubstateMaintenanceInProgress, + "WAITING": ExecutionWindowLifecycleSubstateWaiting, + "RESCHEDULED": ExecutionWindowLifecycleSubstateRescheduled, +} + +var mappingExecutionWindowLifecycleSubstateEnumLowerCase = map[string]ExecutionWindowLifecycleSubstateEnum{ + "duration_exceeded": ExecutionWindowLifecycleSubstateDurationExceeded, + "maintenance_in_progress": ExecutionWindowLifecycleSubstateMaintenanceInProgress, + "waiting": ExecutionWindowLifecycleSubstateWaiting, + "rescheduled": ExecutionWindowLifecycleSubstateRescheduled, +} + +// GetExecutionWindowLifecycleSubstateEnumValues Enumerates the set of values for ExecutionWindowLifecycleSubstateEnum +func GetExecutionWindowLifecycleSubstateEnumValues() []ExecutionWindowLifecycleSubstateEnum { + values := make([]ExecutionWindowLifecycleSubstateEnum, 0) + for _, v := range mappingExecutionWindowLifecycleSubstateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionWindowLifecycleSubstateEnumStringValues Enumerates the set of values in String for ExecutionWindowLifecycleSubstateEnum +func GetExecutionWindowLifecycleSubstateEnumStringValues() []string { + return []string{ + "DURATION_EXCEEDED", + "MAINTENANCE_IN_PROGRESS", + "WAITING", + "RESCHEDULED", + } +} + +// GetMappingExecutionWindowLifecycleSubstateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionWindowLifecycleSubstateEnum(val string) (ExecutionWindowLifecycleSubstateEnum, bool) { + enum, ok := mappingExecutionWindowLifecycleSubstateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionWindowWindowTypeEnum Enum with underlying type: string +type ExecutionWindowWindowTypeEnum string + +// Set of constants representing the allowable values for ExecutionWindowWindowTypeEnum +const ( + ExecutionWindowWindowTypePlanned ExecutionWindowWindowTypeEnum = "PLANNED" + ExecutionWindowWindowTypeUnplanned ExecutionWindowWindowTypeEnum = "UNPLANNED" +) + +var mappingExecutionWindowWindowTypeEnum = map[string]ExecutionWindowWindowTypeEnum{ + "PLANNED": ExecutionWindowWindowTypePlanned, + "UNPLANNED": ExecutionWindowWindowTypeUnplanned, +} + +var mappingExecutionWindowWindowTypeEnumLowerCase = map[string]ExecutionWindowWindowTypeEnum{ + "planned": ExecutionWindowWindowTypePlanned, + "unplanned": ExecutionWindowWindowTypeUnplanned, +} + +// GetExecutionWindowWindowTypeEnumValues Enumerates the set of values for ExecutionWindowWindowTypeEnum +func GetExecutionWindowWindowTypeEnumValues() []ExecutionWindowWindowTypeEnum { + values := make([]ExecutionWindowWindowTypeEnum, 0) + for _, v := range mappingExecutionWindowWindowTypeEnum { + values = append(values, v) + } + return values +} + +// GetExecutionWindowWindowTypeEnumStringValues Enumerates the set of values in String for ExecutionWindowWindowTypeEnum +func GetExecutionWindowWindowTypeEnumStringValues() []string { + return []string{ + "PLANNED", + "UNPLANNED", + } +} + +// GetMappingExecutionWindowWindowTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionWindowWindowTypeEnum(val string) (ExecutionWindowWindowTypeEnum, bool) { + enum, ok := mappingExecutionWindowWindowTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/execution_window_summary.go b/database/execution_window_summary.go new file mode 100644 index 0000000000..d0901f1e58 --- /dev/null +++ b/database/execution_window_summary.go @@ -0,0 +1,279 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExecutionWindowSummary Details of an execution window. +type ExecutionWindowSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution window. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution resource the execution window belongs to. + ExecutionResourceId *string `mandatory:"true" json:"executionResourceId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the execution window. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the Schedule Policy. Valid states are CREATED, SCHEDULED, IN_PROGRESS, FAILED, CANCELED, + // UPDATING, DELETED, SUCCEEDED and PARTIAL_SUCCESS. + LifecycleState ExecutionWindowSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The scheduled start date and time of the execution window. + TimeScheduled *common.SDKTime `mandatory:"true" json:"timeScheduled"` + + // Duration window allows user to set a duration they plan to allocate for Scheduling window. The duration is in minutes. + WindowDurationInMins *int `mandatory:"true" json:"windowDurationInMins"` + + // Description of the execution window. + Description *string `mandatory:"false" json:"description"` + + // The current sub-state of the execution window. Valid states are DURATION_EXCEEDED, MAINTENANCE_IN_PROGRESS and WAITING. + LifecycleSubstate ExecutionWindowSummaryLifecycleSubstateEnum `mandatory:"false" json:"lifecycleSubstate,omitempty"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the execution window was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the execution window was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The date and time that the execution window was started. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time that the execution window ended. + TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` + + // Indicates if duration the user plans to allocate for scheduling window is strictly enforced. The default value is `FALSE`. + IsEnforcedDuration *bool `mandatory:"false" json:"isEnforcedDuration"` + + // The estimated time of the execution window in minutes. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The total time taken by corresponding resource activity in minutes. + TotalTimeTakenInMins *int `mandatory:"false" json:"totalTimeTakenInMins"` + + // The execution window is of PLANNED or UNPLANNED type. + WindowType ExecutionWindowSummaryWindowTypeEnum `mandatory:"false" json:"windowType,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m ExecutionWindowSummary) 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 ExecutionWindowSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingExecutionWindowSummaryLifecycleStateEnum(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(GetExecutionWindowSummaryLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingExecutionWindowSummaryLifecycleSubstateEnum(string(m.LifecycleSubstate)); !ok && m.LifecycleSubstate != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleSubstate: %s. Supported values are: %s.", m.LifecycleSubstate, strings.Join(GetExecutionWindowSummaryLifecycleSubstateEnumStringValues(), ","))) + } + if _, ok := GetMappingExecutionWindowSummaryWindowTypeEnum(string(m.WindowType)); !ok && m.WindowType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WindowType: %s. Supported values are: %s.", m.WindowType, strings.Join(GetExecutionWindowSummaryWindowTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ExecutionWindowSummaryLifecycleStateEnum Enum with underlying type: string +type ExecutionWindowSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ExecutionWindowSummaryLifecycleStateEnum +const ( + ExecutionWindowSummaryLifecycleStateCreated ExecutionWindowSummaryLifecycleStateEnum = "CREATED" + ExecutionWindowSummaryLifecycleStateScheduled ExecutionWindowSummaryLifecycleStateEnum = "SCHEDULED" + ExecutionWindowSummaryLifecycleStateInProgress ExecutionWindowSummaryLifecycleStateEnum = "IN_PROGRESS" + ExecutionWindowSummaryLifecycleStateFailed ExecutionWindowSummaryLifecycleStateEnum = "FAILED" + ExecutionWindowSummaryLifecycleStateCanceled ExecutionWindowSummaryLifecycleStateEnum = "CANCELED" + ExecutionWindowSummaryLifecycleStateUpdating ExecutionWindowSummaryLifecycleStateEnum = "UPDATING" + ExecutionWindowSummaryLifecycleStateDeleted ExecutionWindowSummaryLifecycleStateEnum = "DELETED" + ExecutionWindowSummaryLifecycleStateSucceeded ExecutionWindowSummaryLifecycleStateEnum = "SUCCEEDED" + ExecutionWindowSummaryLifecycleStatePartialSuccess ExecutionWindowSummaryLifecycleStateEnum = "PARTIAL_SUCCESS" + ExecutionWindowSummaryLifecycleStateCreating ExecutionWindowSummaryLifecycleStateEnum = "CREATING" + ExecutionWindowSummaryLifecycleStateDeleting ExecutionWindowSummaryLifecycleStateEnum = "DELETING" +) + +var mappingExecutionWindowSummaryLifecycleStateEnum = map[string]ExecutionWindowSummaryLifecycleStateEnum{ + "CREATED": ExecutionWindowSummaryLifecycleStateCreated, + "SCHEDULED": ExecutionWindowSummaryLifecycleStateScheduled, + "IN_PROGRESS": ExecutionWindowSummaryLifecycleStateInProgress, + "FAILED": ExecutionWindowSummaryLifecycleStateFailed, + "CANCELED": ExecutionWindowSummaryLifecycleStateCanceled, + "UPDATING": ExecutionWindowSummaryLifecycleStateUpdating, + "DELETED": ExecutionWindowSummaryLifecycleStateDeleted, + "SUCCEEDED": ExecutionWindowSummaryLifecycleStateSucceeded, + "PARTIAL_SUCCESS": ExecutionWindowSummaryLifecycleStatePartialSuccess, + "CREATING": ExecutionWindowSummaryLifecycleStateCreating, + "DELETING": ExecutionWindowSummaryLifecycleStateDeleting, +} + +var mappingExecutionWindowSummaryLifecycleStateEnumLowerCase = map[string]ExecutionWindowSummaryLifecycleStateEnum{ + "created": ExecutionWindowSummaryLifecycleStateCreated, + "scheduled": ExecutionWindowSummaryLifecycleStateScheduled, + "in_progress": ExecutionWindowSummaryLifecycleStateInProgress, + "failed": ExecutionWindowSummaryLifecycleStateFailed, + "canceled": ExecutionWindowSummaryLifecycleStateCanceled, + "updating": ExecutionWindowSummaryLifecycleStateUpdating, + "deleted": ExecutionWindowSummaryLifecycleStateDeleted, + "succeeded": ExecutionWindowSummaryLifecycleStateSucceeded, + "partial_success": ExecutionWindowSummaryLifecycleStatePartialSuccess, + "creating": ExecutionWindowSummaryLifecycleStateCreating, + "deleting": ExecutionWindowSummaryLifecycleStateDeleting, +} + +// GetExecutionWindowSummaryLifecycleStateEnumValues Enumerates the set of values for ExecutionWindowSummaryLifecycleStateEnum +func GetExecutionWindowSummaryLifecycleStateEnumValues() []ExecutionWindowSummaryLifecycleStateEnum { + values := make([]ExecutionWindowSummaryLifecycleStateEnum, 0) + for _, v := range mappingExecutionWindowSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionWindowSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ExecutionWindowSummaryLifecycleStateEnum +func GetExecutionWindowSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATED", + "SCHEDULED", + "IN_PROGRESS", + "FAILED", + "CANCELED", + "UPDATING", + "DELETED", + "SUCCEEDED", + "PARTIAL_SUCCESS", + "CREATING", + "DELETING", + } +} + +// GetMappingExecutionWindowSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionWindowSummaryLifecycleStateEnum(val string) (ExecutionWindowSummaryLifecycleStateEnum, bool) { + enum, ok := mappingExecutionWindowSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionWindowSummaryLifecycleSubstateEnum Enum with underlying type: string +type ExecutionWindowSummaryLifecycleSubstateEnum string + +// Set of constants representing the allowable values for ExecutionWindowSummaryLifecycleSubstateEnum +const ( + ExecutionWindowSummaryLifecycleSubstateDurationExceeded ExecutionWindowSummaryLifecycleSubstateEnum = "DURATION_EXCEEDED" + ExecutionWindowSummaryLifecycleSubstateMaintenanceInProgress ExecutionWindowSummaryLifecycleSubstateEnum = "MAINTENANCE_IN_PROGRESS" + ExecutionWindowSummaryLifecycleSubstateWaiting ExecutionWindowSummaryLifecycleSubstateEnum = "WAITING" + ExecutionWindowSummaryLifecycleSubstateRescheduled ExecutionWindowSummaryLifecycleSubstateEnum = "RESCHEDULED" +) + +var mappingExecutionWindowSummaryLifecycleSubstateEnum = map[string]ExecutionWindowSummaryLifecycleSubstateEnum{ + "DURATION_EXCEEDED": ExecutionWindowSummaryLifecycleSubstateDurationExceeded, + "MAINTENANCE_IN_PROGRESS": ExecutionWindowSummaryLifecycleSubstateMaintenanceInProgress, + "WAITING": ExecutionWindowSummaryLifecycleSubstateWaiting, + "RESCHEDULED": ExecutionWindowSummaryLifecycleSubstateRescheduled, +} + +var mappingExecutionWindowSummaryLifecycleSubstateEnumLowerCase = map[string]ExecutionWindowSummaryLifecycleSubstateEnum{ + "duration_exceeded": ExecutionWindowSummaryLifecycleSubstateDurationExceeded, + "maintenance_in_progress": ExecutionWindowSummaryLifecycleSubstateMaintenanceInProgress, + "waiting": ExecutionWindowSummaryLifecycleSubstateWaiting, + "rescheduled": ExecutionWindowSummaryLifecycleSubstateRescheduled, +} + +// GetExecutionWindowSummaryLifecycleSubstateEnumValues Enumerates the set of values for ExecutionWindowSummaryLifecycleSubstateEnum +func GetExecutionWindowSummaryLifecycleSubstateEnumValues() []ExecutionWindowSummaryLifecycleSubstateEnum { + values := make([]ExecutionWindowSummaryLifecycleSubstateEnum, 0) + for _, v := range mappingExecutionWindowSummaryLifecycleSubstateEnum { + values = append(values, v) + } + return values +} + +// GetExecutionWindowSummaryLifecycleSubstateEnumStringValues Enumerates the set of values in String for ExecutionWindowSummaryLifecycleSubstateEnum +func GetExecutionWindowSummaryLifecycleSubstateEnumStringValues() []string { + return []string{ + "DURATION_EXCEEDED", + "MAINTENANCE_IN_PROGRESS", + "WAITING", + "RESCHEDULED", + } +} + +// GetMappingExecutionWindowSummaryLifecycleSubstateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionWindowSummaryLifecycleSubstateEnum(val string) (ExecutionWindowSummaryLifecycleSubstateEnum, bool) { + enum, ok := mappingExecutionWindowSummaryLifecycleSubstateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ExecutionWindowSummaryWindowTypeEnum Enum with underlying type: string +type ExecutionWindowSummaryWindowTypeEnum string + +// Set of constants representing the allowable values for ExecutionWindowSummaryWindowTypeEnum +const ( + ExecutionWindowSummaryWindowTypePlanned ExecutionWindowSummaryWindowTypeEnum = "PLANNED" + ExecutionWindowSummaryWindowTypeUnplanned ExecutionWindowSummaryWindowTypeEnum = "UNPLANNED" +) + +var mappingExecutionWindowSummaryWindowTypeEnum = map[string]ExecutionWindowSummaryWindowTypeEnum{ + "PLANNED": ExecutionWindowSummaryWindowTypePlanned, + "UNPLANNED": ExecutionWindowSummaryWindowTypeUnplanned, +} + +var mappingExecutionWindowSummaryWindowTypeEnumLowerCase = map[string]ExecutionWindowSummaryWindowTypeEnum{ + "planned": ExecutionWindowSummaryWindowTypePlanned, + "unplanned": ExecutionWindowSummaryWindowTypeUnplanned, +} + +// GetExecutionWindowSummaryWindowTypeEnumValues Enumerates the set of values for ExecutionWindowSummaryWindowTypeEnum +func GetExecutionWindowSummaryWindowTypeEnumValues() []ExecutionWindowSummaryWindowTypeEnum { + values := make([]ExecutionWindowSummaryWindowTypeEnum, 0) + for _, v := range mappingExecutionWindowSummaryWindowTypeEnum { + values = append(values, v) + } + return values +} + +// GetExecutionWindowSummaryWindowTypeEnumStringValues Enumerates the set of values in String for ExecutionWindowSummaryWindowTypeEnum +func GetExecutionWindowSummaryWindowTypeEnumStringValues() []string { + return []string{ + "PLANNED", + "UNPLANNED", + } +} + +// GetMappingExecutionWindowSummaryWindowTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExecutionWindowSummaryWindowTypeEnum(val string) (ExecutionWindowSummaryWindowTypeEnum, bool) { + enum, ok := mappingExecutionWindowSummaryWindowTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/get_execution_action_request_response.go b/database/get_execution_action_request_response.go new file mode 100644 index 0000000000..e40f4837c6 --- /dev/null +++ b/database/get_execution_action_request_response.go @@ -0,0 +1,93 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetExecutionActionRequest wrapper for the GetExecutionAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExecutionAction.go.html to see an example of how to use GetExecutionActionRequest. +type GetExecutionActionRequest struct { + + // The execution action OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionActionId *string `mandatory:"true" contributesTo:"path" name:"executionActionId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetExecutionActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetExecutionActionRequest) 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 GetExecutionActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetExecutionActionRequest) 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 GetExecutionActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetExecutionActionResponse wrapper for the GetExecutionAction operation +type GetExecutionActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionAction instance + ExecutionAction `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 GetExecutionActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetExecutionActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/get_execution_window_request_response.go b/database/get_execution_window_request_response.go new file mode 100644 index 0000000000..3362136662 --- /dev/null +++ b/database/get_execution_window_request_response.go @@ -0,0 +1,93 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetExecutionWindowRequest wrapper for the GetExecutionWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExecutionWindow.go.html to see an example of how to use GetExecutionWindowRequest. +type GetExecutionWindowRequest struct { + + // The execution window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionWindowId *string `mandatory:"true" contributesTo:"path" name:"executionWindowId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetExecutionWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetExecutionWindowRequest) 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 GetExecutionWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetExecutionWindowRequest) 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 GetExecutionWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetExecutionWindowResponse wrapper for the GetExecutionWindow operation +type GetExecutionWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionWindow instance + ExecutionWindow `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 GetExecutionWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetExecutionWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/get_scheduled_action_request_response.go b/database/get_scheduled_action_request_response.go new file mode 100644 index 0000000000..e6b84b3f74 --- /dev/null +++ b/database/get_scheduled_action_request_response.go @@ -0,0 +1,93 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetScheduledActionRequest wrapper for the GetScheduledAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetScheduledAction.go.html to see an example of how to use GetScheduledActionRequest. +type GetScheduledActionRequest struct { + + // The Scheduled Action OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ScheduledActionId *string `mandatory:"true" contributesTo:"path" name:"scheduledActionId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetScheduledActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetScheduledActionRequest) 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 GetScheduledActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetScheduledActionRequest) 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 GetScheduledActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetScheduledActionResponse wrapper for the GetScheduledAction operation +type GetScheduledActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ScheduledAction instance + ScheduledAction `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 GetScheduledActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetScheduledActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/get_scheduling_plan_request_response.go b/database/get_scheduling_plan_request_response.go new file mode 100644 index 0000000000..7e7d60c7ab --- /dev/null +++ b/database/get_scheduling_plan_request_response.go @@ -0,0 +1,93 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSchedulingPlanRequest wrapper for the GetSchedulingPlan operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetSchedulingPlan.go.html to see an example of how to use GetSchedulingPlanRequest. +type GetSchedulingPlanRequest struct { + + // The Schedule Plan OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPlanId *string `mandatory:"true" contributesTo:"path" name:"schedulingPlanId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSchedulingPlanRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSchedulingPlanRequest) 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 GetSchedulingPlanRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSchedulingPlanRequest) 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 GetSchedulingPlanRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSchedulingPlanResponse wrapper for the GetSchedulingPlan operation +type GetSchedulingPlanResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingPlan instance + SchedulingPlan `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 GetSchedulingPlanResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSchedulingPlanResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/get_scheduling_policy_request_response.go b/database/get_scheduling_policy_request_response.go new file mode 100644 index 0000000000..b255e03772 --- /dev/null +++ b/database/get_scheduling_policy_request_response.go @@ -0,0 +1,93 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSchedulingPolicyRequest wrapper for the GetSchedulingPolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetSchedulingPolicy.go.html to see an example of how to use GetSchedulingPolicyRequest. +type GetSchedulingPolicyRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSchedulingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSchedulingPolicyRequest) 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 GetSchedulingPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSchedulingPolicyRequest) 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 GetSchedulingPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSchedulingPolicyResponse wrapper for the GetSchedulingPolicy operation +type GetSchedulingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingPolicy instance + SchedulingPolicy `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 GetSchedulingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSchedulingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/get_scheduling_window_request_response.go b/database/get_scheduling_window_request_response.go new file mode 100644 index 0000000000..806f055f0d --- /dev/null +++ b/database/get_scheduling_window_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetSchedulingWindowRequest wrapper for the GetSchedulingWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetSchedulingWindow.go.html to see an example of how to use GetSchedulingWindowRequest. +type GetSchedulingWindowRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // The Scheduling Window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingWindowId *string `mandatory:"true" contributesTo:"path" name:"schedulingWindowId"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetSchedulingWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetSchedulingWindowRequest) 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 GetSchedulingWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetSchedulingWindowRequest) 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 GetSchedulingWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetSchedulingWindowResponse wrapper for the GetSchedulingWindow operation +type GetSchedulingWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingWindow instance + SchedulingWindow `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 GetSchedulingWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetSchedulingWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/granular_maintenance_history_details.go b/database/granular_maintenance_history_details.go new file mode 100644 index 0000000000..f06889c16b --- /dev/null +++ b/database/granular_maintenance_history_details.go @@ -0,0 +1,40 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GranularMaintenanceHistoryDetails Details of a granular maintenance history. +type GranularMaintenanceHistoryDetails struct { + ExecutionWindow *ExecutionWindow `mandatory:"true" json:"executionWindow"` + + // The list of execution actions for this granular maintenance history. + ExecutionActions []ExecutionAction `mandatory:"true" json:"executionActions"` +} + +func (m GranularMaintenanceHistoryDetails) 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 GranularMaintenanceHistoryDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/list_execution_actions_request_response.go b/database/list_execution_actions_request_response.go new file mode 100644 index 0000000000..595469ca78 --- /dev/null +++ b/database/list_execution_actions_request_response.go @@ -0,0 +1,210 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListExecutionActionsRequest wrapper for the ListExecutionActions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListExecutionActions.go.html to see an example of how to use ListExecutionActionsRequest. +type ListExecutionActionsRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + SortBy ListExecutionActionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListExecutionActionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState ExecutionActionSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given execution wondow id. + ExecutionWindowId *string `mandatory:"false" contributesTo:"query" name:"executionWindowId"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // 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 ListExecutionActionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListExecutionActionsRequest) 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 ListExecutionActionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListExecutionActionsRequest) 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 ListExecutionActionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListExecutionActionsSortByEnum(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(GetListExecutionActionsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListExecutionActionsSortOrderEnum(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(GetListExecutionActionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingExecutionActionSummaryLifecycleStateEnum(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(GetExecutionActionSummaryLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListExecutionActionsResponse wrapper for the ListExecutionActions operation +type ListExecutionActionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ExecutionActionSummary instances + Items []ExecutionActionSummary `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListExecutionActionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListExecutionActionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListExecutionActionsSortByEnum Enum with underlying type: string +type ListExecutionActionsSortByEnum string + +// Set of constants representing the allowable values for ListExecutionActionsSortByEnum +const ( + ListExecutionActionsSortByTimecreated ListExecutionActionsSortByEnum = "TIMECREATED" + ListExecutionActionsSortByDisplayname ListExecutionActionsSortByEnum = "DISPLAYNAME" +) + +var mappingListExecutionActionsSortByEnum = map[string]ListExecutionActionsSortByEnum{ + "TIMECREATED": ListExecutionActionsSortByTimecreated, + "DISPLAYNAME": ListExecutionActionsSortByDisplayname, +} + +var mappingListExecutionActionsSortByEnumLowerCase = map[string]ListExecutionActionsSortByEnum{ + "timecreated": ListExecutionActionsSortByTimecreated, + "displayname": ListExecutionActionsSortByDisplayname, +} + +// GetListExecutionActionsSortByEnumValues Enumerates the set of values for ListExecutionActionsSortByEnum +func GetListExecutionActionsSortByEnumValues() []ListExecutionActionsSortByEnum { + values := make([]ListExecutionActionsSortByEnum, 0) + for _, v := range mappingListExecutionActionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListExecutionActionsSortByEnumStringValues Enumerates the set of values in String for ListExecutionActionsSortByEnum +func GetListExecutionActionsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListExecutionActionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExecutionActionsSortByEnum(val string) (ListExecutionActionsSortByEnum, bool) { + enum, ok := mappingListExecutionActionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExecutionActionsSortOrderEnum Enum with underlying type: string +type ListExecutionActionsSortOrderEnum string + +// Set of constants representing the allowable values for ListExecutionActionsSortOrderEnum +const ( + ListExecutionActionsSortOrderAsc ListExecutionActionsSortOrderEnum = "ASC" + ListExecutionActionsSortOrderDesc ListExecutionActionsSortOrderEnum = "DESC" +) + +var mappingListExecutionActionsSortOrderEnum = map[string]ListExecutionActionsSortOrderEnum{ + "ASC": ListExecutionActionsSortOrderAsc, + "DESC": ListExecutionActionsSortOrderDesc, +} + +var mappingListExecutionActionsSortOrderEnumLowerCase = map[string]ListExecutionActionsSortOrderEnum{ + "asc": ListExecutionActionsSortOrderAsc, + "desc": ListExecutionActionsSortOrderDesc, +} + +// GetListExecutionActionsSortOrderEnumValues Enumerates the set of values for ListExecutionActionsSortOrderEnum +func GetListExecutionActionsSortOrderEnumValues() []ListExecutionActionsSortOrderEnum { + values := make([]ListExecutionActionsSortOrderEnum, 0) + for _, v := range mappingListExecutionActionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListExecutionActionsSortOrderEnumStringValues Enumerates the set of values in String for ListExecutionActionsSortOrderEnum +func GetListExecutionActionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListExecutionActionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExecutionActionsSortOrderEnum(val string) (ListExecutionActionsSortOrderEnum, bool) { + enum, ok := mappingListExecutionActionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/list_execution_windows_request_response.go b/database/list_execution_windows_request_response.go new file mode 100644 index 0000000000..f25f03648e --- /dev/null +++ b/database/list_execution_windows_request_response.go @@ -0,0 +1,210 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListExecutionWindowsRequest wrapper for the ListExecutionWindows operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListExecutionWindows.go.html to see an example of how to use ListExecutionWindowsRequest. +type ListExecutionWindowsRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + SortBy ListExecutionWindowsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // A filter to return only resources that match the given resource id exactly. + ExecutionResourceId *string `mandatory:"false" contributesTo:"query" name:"executionResourceId"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListExecutionWindowsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState ExecutionWindowSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // 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 ListExecutionWindowsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListExecutionWindowsRequest) 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 ListExecutionWindowsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListExecutionWindowsRequest) 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 ListExecutionWindowsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListExecutionWindowsSortByEnum(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(GetListExecutionWindowsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListExecutionWindowsSortOrderEnum(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(GetListExecutionWindowsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingExecutionWindowSummaryLifecycleStateEnum(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(GetExecutionWindowSummaryLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListExecutionWindowsResponse wrapper for the ListExecutionWindows operation +type ListExecutionWindowsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ExecutionWindowSummary instances + Items []ExecutionWindowSummary `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListExecutionWindowsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListExecutionWindowsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListExecutionWindowsSortByEnum Enum with underlying type: string +type ListExecutionWindowsSortByEnum string + +// Set of constants representing the allowable values for ListExecutionWindowsSortByEnum +const ( + ListExecutionWindowsSortByTimecreated ListExecutionWindowsSortByEnum = "TIMECREATED" + ListExecutionWindowsSortByDisplayname ListExecutionWindowsSortByEnum = "DISPLAYNAME" +) + +var mappingListExecutionWindowsSortByEnum = map[string]ListExecutionWindowsSortByEnum{ + "TIMECREATED": ListExecutionWindowsSortByTimecreated, + "DISPLAYNAME": ListExecutionWindowsSortByDisplayname, +} + +var mappingListExecutionWindowsSortByEnumLowerCase = map[string]ListExecutionWindowsSortByEnum{ + "timecreated": ListExecutionWindowsSortByTimecreated, + "displayname": ListExecutionWindowsSortByDisplayname, +} + +// GetListExecutionWindowsSortByEnumValues Enumerates the set of values for ListExecutionWindowsSortByEnum +func GetListExecutionWindowsSortByEnumValues() []ListExecutionWindowsSortByEnum { + values := make([]ListExecutionWindowsSortByEnum, 0) + for _, v := range mappingListExecutionWindowsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListExecutionWindowsSortByEnumStringValues Enumerates the set of values in String for ListExecutionWindowsSortByEnum +func GetListExecutionWindowsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListExecutionWindowsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExecutionWindowsSortByEnum(val string) (ListExecutionWindowsSortByEnum, bool) { + enum, ok := mappingListExecutionWindowsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExecutionWindowsSortOrderEnum Enum with underlying type: string +type ListExecutionWindowsSortOrderEnum string + +// Set of constants representing the allowable values for ListExecutionWindowsSortOrderEnum +const ( + ListExecutionWindowsSortOrderAsc ListExecutionWindowsSortOrderEnum = "ASC" + ListExecutionWindowsSortOrderDesc ListExecutionWindowsSortOrderEnum = "DESC" +) + +var mappingListExecutionWindowsSortOrderEnum = map[string]ListExecutionWindowsSortOrderEnum{ + "ASC": ListExecutionWindowsSortOrderAsc, + "DESC": ListExecutionWindowsSortOrderDesc, +} + +var mappingListExecutionWindowsSortOrderEnumLowerCase = map[string]ListExecutionWindowsSortOrderEnum{ + "asc": ListExecutionWindowsSortOrderAsc, + "desc": ListExecutionWindowsSortOrderDesc, +} + +// GetListExecutionWindowsSortOrderEnumValues Enumerates the set of values for ListExecutionWindowsSortOrderEnum +func GetListExecutionWindowsSortOrderEnumValues() []ListExecutionWindowsSortOrderEnum { + values := make([]ListExecutionWindowsSortOrderEnum, 0) + for _, v := range mappingListExecutionWindowsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListExecutionWindowsSortOrderEnumStringValues Enumerates the set of values in String for ListExecutionWindowsSortOrderEnum +func GetListExecutionWindowsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListExecutionWindowsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExecutionWindowsSortOrderEnum(val string) (ListExecutionWindowsSortOrderEnum, bool) { + enum, ok := mappingListExecutionWindowsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/list_params_for_action_type_request_response.go b/database/list_params_for_action_type_request_response.go new file mode 100644 index 0000000000..b64c86cb2b --- /dev/null +++ b/database/list_params_for_action_type_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListParamsForActionTypeRequest wrapper for the ListParamsForActionType operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListParamsForActionType.go.html to see an example of how to use ListParamsForActionTypeRequest. +type ListParamsForActionTypeRequest struct { + + // The type of the scheduled action + Type RecommendedScheduledActionSummaryActionTypeEnum `mandatory:"true" contributesTo:"query" name:"type" omitEmpty:"true"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListParamsForActionTypeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListParamsForActionTypeRequest) 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 ListParamsForActionTypeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListParamsForActionTypeRequest) 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 ListParamsForActionTypeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRecommendedScheduledActionSummaryActionTypeEnum(string(request.Type)); !ok && request.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", request.Type, strings.Join(GetRecommendedScheduledActionSummaryActionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListParamsForActionTypeResponse wrapper for the ListParamsForActionType operation +type ListParamsForActionTypeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ActionParamValuesCollection instances + ActionParamValuesCollection `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListParamsForActionTypeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListParamsForActionTypeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/list_recommended_scheduled_actions_request_response.go b/database/list_recommended_scheduled_actions_request_response.go new file mode 100644 index 0000000000..18a0964e8b --- /dev/null +++ b/database/list_recommended_scheduled_actions_request_response.go @@ -0,0 +1,149 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListRecommendedScheduledActionsRequest wrapper for the ListRecommendedScheduledActions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListRecommendedScheduledActions.go.html to see an example of how to use ListRecommendedScheduledActionsRequest. +type ListRecommendedScheduledActionsRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // The target resource OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) the scheduled actions will be for. + SchedulingPolicyTargetResourceId *string `mandatory:"true" contributesTo:"query" name:"schedulingPolicyTargetResourceId"` + + // The scheduling plan intent the scheduled actions will be for. + PlanIntent ListRecommendedScheduledActionsPlanIntentEnum `mandatory:"true" contributesTo:"query" name:"planIntent" omitEmpty:"true"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListRecommendedScheduledActionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListRecommendedScheduledActionsRequest) 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 ListRecommendedScheduledActionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListRecommendedScheduledActionsRequest) 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 ListRecommendedScheduledActionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListRecommendedScheduledActionsPlanIntentEnum(string(request.PlanIntent)); !ok && request.PlanIntent != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlanIntent: %s. Supported values are: %s.", request.PlanIntent, strings.Join(GetListRecommendedScheduledActionsPlanIntentEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListRecommendedScheduledActionsResponse wrapper for the ListRecommendedScheduledActions operation +type ListRecommendedScheduledActionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of RecommendedScheduledActionsCollection instances + RecommendedScheduledActionsCollection `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListRecommendedScheduledActionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListRecommendedScheduledActionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListRecommendedScheduledActionsPlanIntentEnum Enum with underlying type: string +type ListRecommendedScheduledActionsPlanIntentEnum string + +// Set of constants representing the allowable values for ListRecommendedScheduledActionsPlanIntentEnum +const ( + ListRecommendedScheduledActionsPlanIntentExadataInfrastructureFullSoftwareUpdate ListRecommendedScheduledActionsPlanIntentEnum = "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE" +) + +var mappingListRecommendedScheduledActionsPlanIntentEnum = map[string]ListRecommendedScheduledActionsPlanIntentEnum{ + "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE": ListRecommendedScheduledActionsPlanIntentExadataInfrastructureFullSoftwareUpdate, +} + +var mappingListRecommendedScheduledActionsPlanIntentEnumLowerCase = map[string]ListRecommendedScheduledActionsPlanIntentEnum{ + "exadata_infrastructure_full_software_update": ListRecommendedScheduledActionsPlanIntentExadataInfrastructureFullSoftwareUpdate, +} + +// GetListRecommendedScheduledActionsPlanIntentEnumValues Enumerates the set of values for ListRecommendedScheduledActionsPlanIntentEnum +func GetListRecommendedScheduledActionsPlanIntentEnumValues() []ListRecommendedScheduledActionsPlanIntentEnum { + values := make([]ListRecommendedScheduledActionsPlanIntentEnum, 0) + for _, v := range mappingListRecommendedScheduledActionsPlanIntentEnum { + values = append(values, v) + } + return values +} + +// GetListRecommendedScheduledActionsPlanIntentEnumStringValues Enumerates the set of values in String for ListRecommendedScheduledActionsPlanIntentEnum +func GetListRecommendedScheduledActionsPlanIntentEnumStringValues() []string { + return []string{ + "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingListRecommendedScheduledActionsPlanIntentEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListRecommendedScheduledActionsPlanIntentEnum(val string) (ListRecommendedScheduledActionsPlanIntentEnum, bool) { + enum, ok := mappingListRecommendedScheduledActionsPlanIntentEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/list_scheduled_actions_request_response.go b/database/list_scheduled_actions_request_response.go new file mode 100644 index 0000000000..1712a6363d --- /dev/null +++ b/database/list_scheduled_actions_request_response.go @@ -0,0 +1,216 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListScheduledActionsRequest wrapper for the ListScheduledActions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListScheduledActions.go.html to see an example of how to use ListScheduledActionsRequest. +type ListScheduledActionsRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListScheduledActionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given service type exactly. + ServiceType *string `mandatory:"false" contributesTo:"query" name:"serviceType"` + + // A filter to return only resources that match the given scheduling policy id exactly. + SchedulingPlanId *string `mandatory:"false" contributesTo:"query" name:"schedulingPlanId"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. + SortBy ListScheduledActionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // A filter to return only resources that match the given Scheduled Action id exactly. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState ScheduledActionSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" 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 ListScheduledActionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListScheduledActionsRequest) 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 ListScheduledActionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListScheduledActionsRequest) 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 ListScheduledActionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListScheduledActionsSortOrderEnum(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(GetListScheduledActionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListScheduledActionsSortByEnum(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(GetListScheduledActionsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduledActionSummaryLifecycleStateEnum(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(GetScheduledActionSummaryLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListScheduledActionsResponse wrapper for the ListScheduledActions operation +type ListScheduledActionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ScheduledActionCollection instances + ScheduledActionCollection `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListScheduledActionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListScheduledActionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListScheduledActionsSortOrderEnum Enum with underlying type: string +type ListScheduledActionsSortOrderEnum string + +// Set of constants representing the allowable values for ListScheduledActionsSortOrderEnum +const ( + ListScheduledActionsSortOrderAsc ListScheduledActionsSortOrderEnum = "ASC" + ListScheduledActionsSortOrderDesc ListScheduledActionsSortOrderEnum = "DESC" +) + +var mappingListScheduledActionsSortOrderEnum = map[string]ListScheduledActionsSortOrderEnum{ + "ASC": ListScheduledActionsSortOrderAsc, + "DESC": ListScheduledActionsSortOrderDesc, +} + +var mappingListScheduledActionsSortOrderEnumLowerCase = map[string]ListScheduledActionsSortOrderEnum{ + "asc": ListScheduledActionsSortOrderAsc, + "desc": ListScheduledActionsSortOrderDesc, +} + +// GetListScheduledActionsSortOrderEnumValues Enumerates the set of values for ListScheduledActionsSortOrderEnum +func GetListScheduledActionsSortOrderEnumValues() []ListScheduledActionsSortOrderEnum { + values := make([]ListScheduledActionsSortOrderEnum, 0) + for _, v := range mappingListScheduledActionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListScheduledActionsSortOrderEnumStringValues Enumerates the set of values in String for ListScheduledActionsSortOrderEnum +func GetListScheduledActionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListScheduledActionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListScheduledActionsSortOrderEnum(val string) (ListScheduledActionsSortOrderEnum, bool) { + enum, ok := mappingListScheduledActionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListScheduledActionsSortByEnum Enum with underlying type: string +type ListScheduledActionsSortByEnum string + +// Set of constants representing the allowable values for ListScheduledActionsSortByEnum +const ( + ListScheduledActionsSortByTimecreated ListScheduledActionsSortByEnum = "TIMECREATED" + ListScheduledActionsSortByDisplayname ListScheduledActionsSortByEnum = "DISPLAYNAME" +) + +var mappingListScheduledActionsSortByEnum = map[string]ListScheduledActionsSortByEnum{ + "TIMECREATED": ListScheduledActionsSortByTimecreated, + "DISPLAYNAME": ListScheduledActionsSortByDisplayname, +} + +var mappingListScheduledActionsSortByEnumLowerCase = map[string]ListScheduledActionsSortByEnum{ + "timecreated": ListScheduledActionsSortByTimecreated, + "displayname": ListScheduledActionsSortByDisplayname, +} + +// GetListScheduledActionsSortByEnumValues Enumerates the set of values for ListScheduledActionsSortByEnum +func GetListScheduledActionsSortByEnumValues() []ListScheduledActionsSortByEnum { + values := make([]ListScheduledActionsSortByEnum, 0) + for _, v := range mappingListScheduledActionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListScheduledActionsSortByEnumStringValues Enumerates the set of values in String for ListScheduledActionsSortByEnum +func GetListScheduledActionsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListScheduledActionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListScheduledActionsSortByEnum(val string) (ListScheduledActionsSortByEnum, bool) { + enum, ok := mappingListScheduledActionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/list_scheduling_plans_request_response.go b/database/list_scheduling_plans_request_response.go new file mode 100644 index 0000000000..59e8494f0c --- /dev/null +++ b/database/list_scheduling_plans_request_response.go @@ -0,0 +1,216 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSchedulingPlansRequest wrapper for the ListSchedulingPlans operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSchedulingPlans.go.html to see an example of how to use ListSchedulingPlansRequest. +type ListSchedulingPlansRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. + SortBy ListSchedulingPlansSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListSchedulingPlansSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState SchedulingPlanSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given scheduling policy id exactly. + SchedulingPolicyId *string `mandatory:"false" contributesTo:"query" name:"schedulingPolicyId"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only resources that match the given resource id exactly. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // A filter to return only resources that match the given Schedule Plan id exactly. + Id *string `mandatory:"false" contributesTo:"query" name:"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 ListSchedulingPlansRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSchedulingPlansRequest) 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 ListSchedulingPlansRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSchedulingPlansRequest) 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 ListSchedulingPlansRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSchedulingPlansSortByEnum(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(GetListSchedulingPlansSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListSchedulingPlansSortOrderEnum(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(GetListSchedulingPlansSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSchedulingPlanSummaryLifecycleStateEnum(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(GetSchedulingPlanSummaryLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSchedulingPlansResponse wrapper for the ListSchedulingPlans operation +type ListSchedulingPlansResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of SchedulingPlanCollection instances + SchedulingPlanCollection `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListSchedulingPlansResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSchedulingPlansResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSchedulingPlansSortByEnum Enum with underlying type: string +type ListSchedulingPlansSortByEnum string + +// Set of constants representing the allowable values for ListSchedulingPlansSortByEnum +const ( + ListSchedulingPlansSortByTimecreated ListSchedulingPlansSortByEnum = "TIMECREATED" + ListSchedulingPlansSortByDisplayname ListSchedulingPlansSortByEnum = "DISPLAYNAME" +) + +var mappingListSchedulingPlansSortByEnum = map[string]ListSchedulingPlansSortByEnum{ + "TIMECREATED": ListSchedulingPlansSortByTimecreated, + "DISPLAYNAME": ListSchedulingPlansSortByDisplayname, +} + +var mappingListSchedulingPlansSortByEnumLowerCase = map[string]ListSchedulingPlansSortByEnum{ + "timecreated": ListSchedulingPlansSortByTimecreated, + "displayname": ListSchedulingPlansSortByDisplayname, +} + +// GetListSchedulingPlansSortByEnumValues Enumerates the set of values for ListSchedulingPlansSortByEnum +func GetListSchedulingPlansSortByEnumValues() []ListSchedulingPlansSortByEnum { + values := make([]ListSchedulingPlansSortByEnum, 0) + for _, v := range mappingListSchedulingPlansSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulingPlansSortByEnumStringValues Enumerates the set of values in String for ListSchedulingPlansSortByEnum +func GetListSchedulingPlansSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListSchedulingPlansSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulingPlansSortByEnum(val string) (ListSchedulingPlansSortByEnum, bool) { + enum, ok := mappingListSchedulingPlansSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSchedulingPlansSortOrderEnum Enum with underlying type: string +type ListSchedulingPlansSortOrderEnum string + +// Set of constants representing the allowable values for ListSchedulingPlansSortOrderEnum +const ( + ListSchedulingPlansSortOrderAsc ListSchedulingPlansSortOrderEnum = "ASC" + ListSchedulingPlansSortOrderDesc ListSchedulingPlansSortOrderEnum = "DESC" +) + +var mappingListSchedulingPlansSortOrderEnum = map[string]ListSchedulingPlansSortOrderEnum{ + "ASC": ListSchedulingPlansSortOrderAsc, + "DESC": ListSchedulingPlansSortOrderDesc, +} + +var mappingListSchedulingPlansSortOrderEnumLowerCase = map[string]ListSchedulingPlansSortOrderEnum{ + "asc": ListSchedulingPlansSortOrderAsc, + "desc": ListSchedulingPlansSortOrderDesc, +} + +// GetListSchedulingPlansSortOrderEnumValues Enumerates the set of values for ListSchedulingPlansSortOrderEnum +func GetListSchedulingPlansSortOrderEnumValues() []ListSchedulingPlansSortOrderEnum { + values := make([]ListSchedulingPlansSortOrderEnum, 0) + for _, v := range mappingListSchedulingPlansSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulingPlansSortOrderEnumStringValues Enumerates the set of values in String for ListSchedulingPlansSortOrderEnum +func GetListSchedulingPlansSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSchedulingPlansSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulingPlansSortOrderEnum(val string) (ListSchedulingPlansSortOrderEnum, bool) { + enum, ok := mappingListSchedulingPlansSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/list_scheduling_policies_request_response.go b/database/list_scheduling_policies_request_response.go new file mode 100644 index 0000000000..7a47bfebd4 --- /dev/null +++ b/database/list_scheduling_policies_request_response.go @@ -0,0 +1,207 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSchedulingPoliciesRequest wrapper for the ListSchedulingPolicies operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSchedulingPolicies.go.html to see an example of how to use ListSchedulingPoliciesRequest. +type ListSchedulingPoliciesRequest struct { + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + SortBy ListSchedulingPoliciesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListSchedulingPoliciesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState SchedulingPolicySummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // 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 ListSchedulingPoliciesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSchedulingPoliciesRequest) 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 ListSchedulingPoliciesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSchedulingPoliciesRequest) 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 ListSchedulingPoliciesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSchedulingPoliciesSortByEnum(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(GetListSchedulingPoliciesSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListSchedulingPoliciesSortOrderEnum(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(GetListSchedulingPoliciesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSchedulingPolicySummaryLifecycleStateEnum(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(GetSchedulingPolicySummaryLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSchedulingPoliciesResponse wrapper for the ListSchedulingPolicies operation +type ListSchedulingPoliciesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []SchedulingPolicySummary instances + Items []SchedulingPolicySummary `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListSchedulingPoliciesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSchedulingPoliciesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSchedulingPoliciesSortByEnum Enum with underlying type: string +type ListSchedulingPoliciesSortByEnum string + +// Set of constants representing the allowable values for ListSchedulingPoliciesSortByEnum +const ( + ListSchedulingPoliciesSortByTimecreated ListSchedulingPoliciesSortByEnum = "TIMECREATED" + ListSchedulingPoliciesSortByDisplayname ListSchedulingPoliciesSortByEnum = "DISPLAYNAME" +) + +var mappingListSchedulingPoliciesSortByEnum = map[string]ListSchedulingPoliciesSortByEnum{ + "TIMECREATED": ListSchedulingPoliciesSortByTimecreated, + "DISPLAYNAME": ListSchedulingPoliciesSortByDisplayname, +} + +var mappingListSchedulingPoliciesSortByEnumLowerCase = map[string]ListSchedulingPoliciesSortByEnum{ + "timecreated": ListSchedulingPoliciesSortByTimecreated, + "displayname": ListSchedulingPoliciesSortByDisplayname, +} + +// GetListSchedulingPoliciesSortByEnumValues Enumerates the set of values for ListSchedulingPoliciesSortByEnum +func GetListSchedulingPoliciesSortByEnumValues() []ListSchedulingPoliciesSortByEnum { + values := make([]ListSchedulingPoliciesSortByEnum, 0) + for _, v := range mappingListSchedulingPoliciesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulingPoliciesSortByEnumStringValues Enumerates the set of values in String for ListSchedulingPoliciesSortByEnum +func GetListSchedulingPoliciesSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListSchedulingPoliciesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulingPoliciesSortByEnum(val string) (ListSchedulingPoliciesSortByEnum, bool) { + enum, ok := mappingListSchedulingPoliciesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSchedulingPoliciesSortOrderEnum Enum with underlying type: string +type ListSchedulingPoliciesSortOrderEnum string + +// Set of constants representing the allowable values for ListSchedulingPoliciesSortOrderEnum +const ( + ListSchedulingPoliciesSortOrderAsc ListSchedulingPoliciesSortOrderEnum = "ASC" + ListSchedulingPoliciesSortOrderDesc ListSchedulingPoliciesSortOrderEnum = "DESC" +) + +var mappingListSchedulingPoliciesSortOrderEnum = map[string]ListSchedulingPoliciesSortOrderEnum{ + "ASC": ListSchedulingPoliciesSortOrderAsc, + "DESC": ListSchedulingPoliciesSortOrderDesc, +} + +var mappingListSchedulingPoliciesSortOrderEnumLowerCase = map[string]ListSchedulingPoliciesSortOrderEnum{ + "asc": ListSchedulingPoliciesSortOrderAsc, + "desc": ListSchedulingPoliciesSortOrderDesc, +} + +// GetListSchedulingPoliciesSortOrderEnumValues Enumerates the set of values for ListSchedulingPoliciesSortOrderEnum +func GetListSchedulingPoliciesSortOrderEnumValues() []ListSchedulingPoliciesSortOrderEnum { + values := make([]ListSchedulingPoliciesSortOrderEnum, 0) + for _, v := range mappingListSchedulingPoliciesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulingPoliciesSortOrderEnumStringValues Enumerates the set of values in String for ListSchedulingPoliciesSortOrderEnum +func GetListSchedulingPoliciesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSchedulingPoliciesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulingPoliciesSortOrderEnum(val string) (ListSchedulingPoliciesSortOrderEnum, bool) { + enum, ok := mappingListSchedulingPoliciesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/list_scheduling_windows_request_response.go b/database/list_scheduling_windows_request_response.go new file mode 100644 index 0000000000..2366bedfbe --- /dev/null +++ b/database/list_scheduling_windows_request_response.go @@ -0,0 +1,210 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListSchedulingWindowsRequest wrapper for the ListSchedulingWindows operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSchedulingWindows.go.html to see an example of how to use ListSchedulingWindowsRequest. +type ListSchedulingWindowsRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // The compartment OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. + SortBy ListSchedulingWindowsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListSchedulingWindowsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter to return only resources that match the given lifecycle state exactly. + LifecycleState SchedulingWindowSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. The match is not case sensitive. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // 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 ListSchedulingWindowsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListSchedulingWindowsRequest) 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 ListSchedulingWindowsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListSchedulingWindowsRequest) 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 ListSchedulingWindowsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListSchedulingWindowsSortByEnum(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(GetListSchedulingWindowsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListSchedulingWindowsSortOrderEnum(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(GetListSchedulingWindowsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingSchedulingWindowSummaryLifecycleStateEnum(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(GetSchedulingWindowSummaryLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListSchedulingWindowsResponse wrapper for the ListSchedulingWindows operation +type ListSchedulingWindowsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []SchedulingWindowSummary instances + Items []SchedulingWindowSummary `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 there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListSchedulingWindowsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListSchedulingWindowsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListSchedulingWindowsSortByEnum Enum with underlying type: string +type ListSchedulingWindowsSortByEnum string + +// Set of constants representing the allowable values for ListSchedulingWindowsSortByEnum +const ( + ListSchedulingWindowsSortByTimecreated ListSchedulingWindowsSortByEnum = "TIMECREATED" + ListSchedulingWindowsSortByDisplayname ListSchedulingWindowsSortByEnum = "DISPLAYNAME" +) + +var mappingListSchedulingWindowsSortByEnum = map[string]ListSchedulingWindowsSortByEnum{ + "TIMECREATED": ListSchedulingWindowsSortByTimecreated, + "DISPLAYNAME": ListSchedulingWindowsSortByDisplayname, +} + +var mappingListSchedulingWindowsSortByEnumLowerCase = map[string]ListSchedulingWindowsSortByEnum{ + "timecreated": ListSchedulingWindowsSortByTimecreated, + "displayname": ListSchedulingWindowsSortByDisplayname, +} + +// GetListSchedulingWindowsSortByEnumValues Enumerates the set of values for ListSchedulingWindowsSortByEnum +func GetListSchedulingWindowsSortByEnumValues() []ListSchedulingWindowsSortByEnum { + values := make([]ListSchedulingWindowsSortByEnum, 0) + for _, v := range mappingListSchedulingWindowsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulingWindowsSortByEnumStringValues Enumerates the set of values in String for ListSchedulingWindowsSortByEnum +func GetListSchedulingWindowsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListSchedulingWindowsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulingWindowsSortByEnum(val string) (ListSchedulingWindowsSortByEnum, bool) { + enum, ok := mappingListSchedulingWindowsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListSchedulingWindowsSortOrderEnum Enum with underlying type: string +type ListSchedulingWindowsSortOrderEnum string + +// Set of constants representing the allowable values for ListSchedulingWindowsSortOrderEnum +const ( + ListSchedulingWindowsSortOrderAsc ListSchedulingWindowsSortOrderEnum = "ASC" + ListSchedulingWindowsSortOrderDesc ListSchedulingWindowsSortOrderEnum = "DESC" +) + +var mappingListSchedulingWindowsSortOrderEnum = map[string]ListSchedulingWindowsSortOrderEnum{ + "ASC": ListSchedulingWindowsSortOrderAsc, + "DESC": ListSchedulingWindowsSortOrderDesc, +} + +var mappingListSchedulingWindowsSortOrderEnumLowerCase = map[string]ListSchedulingWindowsSortOrderEnum{ + "asc": ListSchedulingWindowsSortOrderAsc, + "desc": ListSchedulingWindowsSortOrderDesc, +} + +// GetListSchedulingWindowsSortOrderEnumValues Enumerates the set of values for ListSchedulingWindowsSortOrderEnum +func GetListSchedulingWindowsSortOrderEnumValues() []ListSchedulingWindowsSortOrderEnum { + values := make([]ListSchedulingWindowsSortOrderEnum, 0) + for _, v := range mappingListSchedulingWindowsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListSchedulingWindowsSortOrderEnumStringValues Enumerates the set of values in String for ListSchedulingWindowsSortOrderEnum +func GetListSchedulingWindowsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListSchedulingWindowsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListSchedulingWindowsSortOrderEnum(val string) (ListSchedulingWindowsSortOrderEnum, bool) { + enum, ok := mappingListSchedulingWindowsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/maintenance_run.go b/database/maintenance_run.go index 5fd1502945..8dd49f43d4 100644 --- a/database/maintenance_run.go +++ b/database/maintenance_run.go @@ -106,6 +106,12 @@ type MaintenanceRun struct { // The estimated start time of the next infrastruture component patching operation. EstimatedComponentPatchingStartTime *common.SDKTime `mandatory:"false" json:"estimatedComponentPatchingStartTime"` + // If `FALSE`, the maintenance run doesn't support granular maintenance. + IsMaintenanceRunGranular *bool `mandatory:"false" json:"isMaintenanceRunGranular"` + + // The total time taken by corresponding resource activity in minutes. + TotalTimeTakenInMins *int `mandatory:"false" json:"totalTimeTakenInMins"` + // The Autonomous Database Software Image OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) DatabaseSoftwareImageId *string `mandatory:"false" json:"databaseSoftwareImageId"` } diff --git a/database/maintenance_run_history.go b/database/maintenance_run_history.go index 7fde9573d4..02e5484bfb 100644 --- a/database/maintenance_run_history.go +++ b/database/maintenance_run_history.go @@ -25,6 +25,12 @@ type MaintenanceRunHistory struct { // List of database server history details. DbServersHistoryDetails []DbServerHistorySummary `mandatory:"false" json:"dbServersHistoryDetails"` + + // The OCID of the current execution window. + CurrentExecutionWindow *string `mandatory:"false" json:"currentExecutionWindow"` + + // The list of granular maintenance history details. + GranularMaintenanceHistory []GranularMaintenanceHistoryDetails `mandatory:"false" json:"granularMaintenanceHistory"` } func (m MaintenanceRunHistory) String() string { diff --git a/database/maintenance_run_history_summary.go b/database/maintenance_run_history_summary.go index b8c5c5a12d..38b2d6b808 100644 --- a/database/maintenance_run_history_summary.go +++ b/database/maintenance_run_history_summary.go @@ -25,6 +25,12 @@ type MaintenanceRunHistorySummary struct { // List of database server history details. DbServersHistoryDetails []DbServerHistorySummary `mandatory:"false" json:"dbServersHistoryDetails"` + + // The OCID of the current execution window. + CurrentExecutionWindow *string `mandatory:"false" json:"currentExecutionWindow"` + + // The list of granular maintenance history details. + GranularMaintenanceHistory []GranularMaintenanceHistoryDetails `mandatory:"false" json:"granularMaintenanceHistory"` } func (m MaintenanceRunHistorySummary) String() string { diff --git a/database/maintenance_run_summary.go b/database/maintenance_run_summary.go index 456b2c780c..500139e475 100644 --- a/database/maintenance_run_summary.go +++ b/database/maintenance_run_summary.go @@ -106,6 +106,12 @@ type MaintenanceRunSummary struct { // The estimated start time of the next infrastruture component patching operation. EstimatedComponentPatchingStartTime *common.SDKTime `mandatory:"false" json:"estimatedComponentPatchingStartTime"` + // If `FALSE`, the maintenance run doesn't support granular maintenance. + IsMaintenanceRunGranular *bool `mandatory:"false" json:"isMaintenanceRunGranular"` + + // The total time taken by corresponding resource activity in minutes. + TotalTimeTakenInMins *int `mandatory:"false" json:"totalTimeTakenInMins"` + // The Autonomous Database Software Image OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) DatabaseSoftwareImageId *string `mandatory:"false" json:"databaseSoftwareImageId"` } diff --git a/database/move_execution_action_member_details.go b/database/move_execution_action_member_details.go new file mode 100644 index 0000000000..4af9804236 --- /dev/null +++ b/database/move_execution_action_member_details.go @@ -0,0 +1,54 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MoveExecutionActionMemberDetails Request to move an execution action member to an execution action resource from another. +type MoveExecutionActionMemberDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the source execution action resource. + SourceExecutionActionId *string `mandatory:"false" json:"sourceExecutionActionId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution action member to be moved. + ExecutionActionMemberId *string `mandatory:"false" json:"executionActionMemberId"` + + // The number of execution action member without ocids to be moved. + ExecutionActionMemberCount *int `mandatory:"false" json:"executionActionMemberCount"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m MoveExecutionActionMemberDetails) 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 MoveExecutionActionMemberDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/move_execution_action_member_request_response.go b/database/move_execution_action_member_request_response.go new file mode 100644 index 0000000000..0bdd02b8fb --- /dev/null +++ b/database/move_execution_action_member_request_response.go @@ -0,0 +1,111 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// MoveExecutionActionMemberRequest wrapper for the MoveExecutionActionMember operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/MoveExecutionActionMember.go.html to see an example of how to use MoveExecutionActionMemberRequest. +type MoveExecutionActionMemberRequest struct { + + // The execution action OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionActionId *string `mandatory:"true" contributesTo:"path" name:"executionActionId"` + + // Request to move an execution action member to this execution action resource from another. + MoveExecutionActionMemberDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request MoveExecutionActionMemberRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request MoveExecutionActionMemberRequest) 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 MoveExecutionActionMemberRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request MoveExecutionActionMemberRequest) 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 MoveExecutionActionMemberRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MoveExecutionActionMemberResponse wrapper for the MoveExecutionActionMember operation +type MoveExecutionActionMemberResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionAction instance + ExecutionAction `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 MoveExecutionActionMemberResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response MoveExecutionActionMemberResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/recommended_scheduled_action_summary.go b/database/recommended_scheduled_action_summary.go new file mode 100644 index 0000000000..b3fe44f9bc --- /dev/null +++ b/database/recommended_scheduled_action_summary.go @@ -0,0 +1,107 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RecommendedScheduledActionSummary Details of the scheduled action that is used in getRecommendedScheduledActions. +type RecommendedScheduledActionSummary struct { + + // The order of the scheduled action. + ActionOrder *int `mandatory:"true" json:"actionOrder"` + + // The type of the scheduled action being performed + ActionType RecommendedScheduledActionSummaryActionTypeEnum `mandatory:"true" json:"actionType"` + + // The id of the scheduling window this scheduled action belongs to. + SchedulingWindowId *string `mandatory:"true" json:"schedulingWindowId"` + + // Description of the scheduled action being performed, i.e. apply full update to DB Servers 1,2,3,4. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The estimated patching time in minutes for the entire scheduled action. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The list of action members in a scheduled action. + ActionMembers []ActionMember `mandatory:"false" json:"actionMembers"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"false" json:"actionParams"` +} + +func (m RecommendedScheduledActionSummary) 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 RecommendedScheduledActionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRecommendedScheduledActionSummaryActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetRecommendedScheduledActionSummaryActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RecommendedScheduledActionSummaryActionTypeEnum Enum with underlying type: string +type RecommendedScheduledActionSummaryActionTypeEnum string + +// Set of constants representing the allowable values for RecommendedScheduledActionSummaryActionTypeEnum +const ( + RecommendedScheduledActionSummaryActionTypeDbServerFullSoftwareUpdate RecommendedScheduledActionSummaryActionTypeEnum = "DB_SERVER_FULL_SOFTWARE_UPDATE" + RecommendedScheduledActionSummaryActionTypeStorageServerFullSoftwareUpdate RecommendedScheduledActionSummaryActionTypeEnum = "STORAGE_SERVER_FULL_SOFTWARE_UPDATE" + RecommendedScheduledActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate RecommendedScheduledActionSummaryActionTypeEnum = "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE" +) + +var mappingRecommendedScheduledActionSummaryActionTypeEnum = map[string]RecommendedScheduledActionSummaryActionTypeEnum{ + "DB_SERVER_FULL_SOFTWARE_UPDATE": RecommendedScheduledActionSummaryActionTypeDbServerFullSoftwareUpdate, + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE": RecommendedScheduledActionSummaryActionTypeStorageServerFullSoftwareUpdate, + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE": RecommendedScheduledActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate, +} + +var mappingRecommendedScheduledActionSummaryActionTypeEnumLowerCase = map[string]RecommendedScheduledActionSummaryActionTypeEnum{ + "db_server_full_software_update": RecommendedScheduledActionSummaryActionTypeDbServerFullSoftwareUpdate, + "storage_server_full_software_update": RecommendedScheduledActionSummaryActionTypeStorageServerFullSoftwareUpdate, + "network_switch_full_software_update": RecommendedScheduledActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate, +} + +// GetRecommendedScheduledActionSummaryActionTypeEnumValues Enumerates the set of values for RecommendedScheduledActionSummaryActionTypeEnum +func GetRecommendedScheduledActionSummaryActionTypeEnumValues() []RecommendedScheduledActionSummaryActionTypeEnum { + values := make([]RecommendedScheduledActionSummaryActionTypeEnum, 0) + for _, v := range mappingRecommendedScheduledActionSummaryActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetRecommendedScheduledActionSummaryActionTypeEnumStringValues Enumerates the set of values in String for RecommendedScheduledActionSummaryActionTypeEnum +func GetRecommendedScheduledActionSummaryActionTypeEnumStringValues() []string { + return []string{ + "DB_SERVER_FULL_SOFTWARE_UPDATE", + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingRecommendedScheduledActionSummaryActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRecommendedScheduledActionSummaryActionTypeEnum(val string) (RecommendedScheduledActionSummaryActionTypeEnum, bool) { + enum, ok := mappingRecommendedScheduledActionSummaryActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/recommended_scheduled_actions_collection.go b/database/recommended_scheduled_actions_collection.go new file mode 100644 index 0000000000..edbc63186d --- /dev/null +++ b/database/recommended_scheduled_actions_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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RecommendedScheduledActionsCollection A list of scheduled actions. Contains RecommendedScheduledAction items. +type RecommendedScheduledActionsCollection struct { + + // List of scheduled actions. + Items []RecommendedScheduledActionSummary `mandatory:"true" json:"items"` +} + +func (m RecommendedScheduledActionsCollection) 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 RecommendedScheduledActionsCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/reorder_execution_action_details.go b/database/reorder_execution_action_details.go new file mode 100644 index 0000000000..4f8ba52906 --- /dev/null +++ b/database/reorder_execution_action_details.go @@ -0,0 +1,49 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReorderExecutionActionDetails Describes the ordering list of execution actions for the execution window. +type ReorderExecutionActionDetails struct { + + // List of action resources in a specific order. + // Example: [{actionOrder: 1, actionResourceId: "resourceId1"}, {actionOrder: 2, actionResourceId: "resourceId2"}] + ExecutionActionOrderList []ActionOrderDetails `mandatory:"false" json:"executionActionOrderList"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m ReorderExecutionActionDetails) 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 ReorderExecutionActionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/reorder_execution_actions_request_response.go b/database/reorder_execution_actions_request_response.go new file mode 100644 index 0000000000..23da9b6a0a --- /dev/null +++ b/database/reorder_execution_actions_request_response.go @@ -0,0 +1,111 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ReorderExecutionActionsRequest wrapper for the ReorderExecutionActions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ReorderExecutionActions.go.html to see an example of how to use ReorderExecutionActionsRequest. +type ReorderExecutionActionsRequest struct { + + // The execution window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionWindowId *string `mandatory:"true" contributesTo:"path" name:"executionWindowId"` + + // Request to reorder the execution actions under this execution window resource. + ReorderExecutionActionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ReorderExecutionActionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ReorderExecutionActionsRequest) 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 ReorderExecutionActionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ReorderExecutionActionsRequest) 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 ReorderExecutionActionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReorderExecutionActionsResponse wrapper for the ReorderExecutionActions operation +type ReorderExecutionActionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionWindow instance + ExecutionWindow `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 ReorderExecutionActionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ReorderExecutionActionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/reorder_scheduled_actions_details.go b/database/reorder_scheduled_actions_details.go new file mode 100644 index 0000000000..a9147d4290 --- /dev/null +++ b/database/reorder_scheduled_actions_details.go @@ -0,0 +1,43 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReorderScheduledActionsDetails Describes the re-order parameters for the Scheduled Action resources. +type ReorderScheduledActionsDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Window. + SchedulingWindowId *string `mandatory:"true" json:"schedulingWindowId"` + + // List of action resources in a specific order. + // Example: [{actionOrder: 1, actionResourceId: "resourceId1"}, {actionOrder: 2, actionResourceId: "resourceId2"}] + ScheduledActionIdOrders []ActionOrderDetails `mandatory:"true" json:"scheduledActionIdOrders"` +} + +func (m ReorderScheduledActionsDetails) 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 ReorderScheduledActionsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/reorder_scheduled_actions_request_response.go b/database/reorder_scheduled_actions_request_response.go new file mode 100644 index 0000000000..3c0238c4a3 --- /dev/null +++ b/database/reorder_scheduled_actions_request_response.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. + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ReorderScheduledActionsRequest wrapper for the ReorderScheduledActions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ReorderScheduledActions.go.html to see an example of how to use ReorderScheduledActionsRequest. +type ReorderScheduledActionsRequest struct { + + // Request to re-order Scheduled Action resources. + ReorderScheduledActionsDetails `contributesTo:"body"` + + // The Schedule Plan OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPlanId *string `mandatory:"true" contributesTo:"path" name:"schedulingPlanId"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ReorderScheduledActionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ReorderScheduledActionsRequest) 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 ReorderScheduledActionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ReorderScheduledActionsRequest) 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 ReorderScheduledActionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ReorderScheduledActionsResponse wrapper for the ReorderScheduledActions operation +type ReorderScheduledActionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingPlan instance + SchedulingPlan `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"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response ReorderScheduledActionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ReorderScheduledActionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/scheduled_action.go b/database/scheduled_action.go new file mode 100644 index 0000000000..bd880e8dc0 --- /dev/null +++ b/database/scheduled_action.go @@ -0,0 +1,203 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduledAction Details of a Scheduled Action. +type ScheduledAction struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduled Action. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Plan. + SchedulingPlanId *string `mandatory:"true" json:"schedulingPlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The display name of the Scheduled Action. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The order of the scheduled action. + ActionOrder *int `mandatory:"true" json:"actionOrder"` + + // The type of the scheduled action being performed + ActionType ScheduledActionActionTypeEnum `mandatory:"true" json:"actionType"` + + // The current state of the Scheduled Action. Valid states are CREATING, NEEDS_ATTENTION, AVAILABLE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState ScheduledActionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the Scheduled Action Resource was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Window. + SchedulingWindowId *string `mandatory:"false" json:"schedulingWindowId"` + + // The estimated patching time for the scheduled action. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"false" json:"actionParams"` + + // The list of action members in a scheduled action. + ActionMembers []ActionMember `mandatory:"false" json:"actionMembers"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The date and time the Scheduled Action Resource was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m ScheduledAction) 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 ScheduledAction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduledActionActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetScheduledActionActionTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduledActionLifecycleStateEnum(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(GetScheduledActionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScheduledActionActionTypeEnum Enum with underlying type: string +type ScheduledActionActionTypeEnum string + +// Set of constants representing the allowable values for ScheduledActionActionTypeEnum +const ( + ScheduledActionActionTypeDbServerFullSoftwareUpdate ScheduledActionActionTypeEnum = "DB_SERVER_FULL_SOFTWARE_UPDATE" + ScheduledActionActionTypeStorageServerFullSoftwareUpdate ScheduledActionActionTypeEnum = "STORAGE_SERVER_FULL_SOFTWARE_UPDATE" + ScheduledActionActionTypeNetworkSwitchFullSoftwareUpdate ScheduledActionActionTypeEnum = "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE" +) + +var mappingScheduledActionActionTypeEnum = map[string]ScheduledActionActionTypeEnum{ + "DB_SERVER_FULL_SOFTWARE_UPDATE": ScheduledActionActionTypeDbServerFullSoftwareUpdate, + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE": ScheduledActionActionTypeStorageServerFullSoftwareUpdate, + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE": ScheduledActionActionTypeNetworkSwitchFullSoftwareUpdate, +} + +var mappingScheduledActionActionTypeEnumLowerCase = map[string]ScheduledActionActionTypeEnum{ + "db_server_full_software_update": ScheduledActionActionTypeDbServerFullSoftwareUpdate, + "storage_server_full_software_update": ScheduledActionActionTypeStorageServerFullSoftwareUpdate, + "network_switch_full_software_update": ScheduledActionActionTypeNetworkSwitchFullSoftwareUpdate, +} + +// GetScheduledActionActionTypeEnumValues Enumerates the set of values for ScheduledActionActionTypeEnum +func GetScheduledActionActionTypeEnumValues() []ScheduledActionActionTypeEnum { + values := make([]ScheduledActionActionTypeEnum, 0) + for _, v := range mappingScheduledActionActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetScheduledActionActionTypeEnumStringValues Enumerates the set of values in String for ScheduledActionActionTypeEnum +func GetScheduledActionActionTypeEnumStringValues() []string { + return []string{ + "DB_SERVER_FULL_SOFTWARE_UPDATE", + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingScheduledActionActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduledActionActionTypeEnum(val string) (ScheduledActionActionTypeEnum, bool) { + enum, ok := mappingScheduledActionActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ScheduledActionLifecycleStateEnum Enum with underlying type: string +type ScheduledActionLifecycleStateEnum string + +// Set of constants representing the allowable values for ScheduledActionLifecycleStateEnum +const ( + ScheduledActionLifecycleStateCreating ScheduledActionLifecycleStateEnum = "CREATING" + ScheduledActionLifecycleStateNeedsAttention ScheduledActionLifecycleStateEnum = "NEEDS_ATTENTION" + ScheduledActionLifecycleStateAvailable ScheduledActionLifecycleStateEnum = "AVAILABLE" + ScheduledActionLifecycleStateUpdating ScheduledActionLifecycleStateEnum = "UPDATING" + ScheduledActionLifecycleStateFailed ScheduledActionLifecycleStateEnum = "FAILED" + ScheduledActionLifecycleStateDeleting ScheduledActionLifecycleStateEnum = "DELETING" + ScheduledActionLifecycleStateDeleted ScheduledActionLifecycleStateEnum = "DELETED" +) + +var mappingScheduledActionLifecycleStateEnum = map[string]ScheduledActionLifecycleStateEnum{ + "CREATING": ScheduledActionLifecycleStateCreating, + "NEEDS_ATTENTION": ScheduledActionLifecycleStateNeedsAttention, + "AVAILABLE": ScheduledActionLifecycleStateAvailable, + "UPDATING": ScheduledActionLifecycleStateUpdating, + "FAILED": ScheduledActionLifecycleStateFailed, + "DELETING": ScheduledActionLifecycleStateDeleting, + "DELETED": ScheduledActionLifecycleStateDeleted, +} + +var mappingScheduledActionLifecycleStateEnumLowerCase = map[string]ScheduledActionLifecycleStateEnum{ + "creating": ScheduledActionLifecycleStateCreating, + "needs_attention": ScheduledActionLifecycleStateNeedsAttention, + "available": ScheduledActionLifecycleStateAvailable, + "updating": ScheduledActionLifecycleStateUpdating, + "failed": ScheduledActionLifecycleStateFailed, + "deleting": ScheduledActionLifecycleStateDeleting, + "deleted": ScheduledActionLifecycleStateDeleted, +} + +// GetScheduledActionLifecycleStateEnumValues Enumerates the set of values for ScheduledActionLifecycleStateEnum +func GetScheduledActionLifecycleStateEnumValues() []ScheduledActionLifecycleStateEnum { + values := make([]ScheduledActionLifecycleStateEnum, 0) + for _, v := range mappingScheduledActionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetScheduledActionLifecycleStateEnumStringValues Enumerates the set of values in String for ScheduledActionLifecycleStateEnum +func GetScheduledActionLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "NEEDS_ATTENTION", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingScheduledActionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduledActionLifecycleStateEnum(val string) (ScheduledActionLifecycleStateEnum, bool) { + enum, ok := mappingScheduledActionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scheduled_action_collection.go b/database/scheduled_action_collection.go new file mode 100644 index 0000000000..0add0791c0 --- /dev/null +++ b/database/scheduled_action_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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduledActionCollection Results of Scheduled Action resources lists. Contains ScheduledActionSummary items. +type ScheduledActionCollection struct { + + // List of Scheduled Action resources. + Items []ScheduledActionSummary `mandatory:"true" json:"items"` +} + +func (m ScheduledActionCollection) 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 ScheduledActionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/scheduled_action_summary.go b/database/scheduled_action_summary.go new file mode 100644 index 0000000000..eb73ccbd84 --- /dev/null +++ b/database/scheduled_action_summary.go @@ -0,0 +1,203 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduledActionSummary Details of a scheduled action. +type ScheduledActionSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduled Action. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Plan. + SchedulingPlanId *string `mandatory:"true" json:"schedulingPlanId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The display name of the Scheduled Action. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The order of the scheduled action. + ActionOrder *int `mandatory:"true" json:"actionOrder"` + + // The type of the scheduled action being performed + ActionType ScheduledActionSummaryActionTypeEnum `mandatory:"true" json:"actionType"` + + // The current state of the Scheduled Action. Valid states are CREATING, NEEDS_ATTENTION, AVAILABLE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState ScheduledActionSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the Scheduled Action Resource was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Window. + SchedulingWindowId *string `mandatory:"false" json:"schedulingWindowId"` + + // The estimated patching time for the scheduled action. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"false" json:"actionParams"` + + // The list of action members in a scheduled action. + ActionMembers []ActionMember `mandatory:"false" json:"actionMembers"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The date and time the Scheduled Action Resource was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m ScheduledActionSummary) 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 ScheduledActionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingScheduledActionSummaryActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetScheduledActionSummaryActionTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingScheduledActionSummaryLifecycleStateEnum(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(GetScheduledActionSummaryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScheduledActionSummaryActionTypeEnum Enum with underlying type: string +type ScheduledActionSummaryActionTypeEnum string + +// Set of constants representing the allowable values for ScheduledActionSummaryActionTypeEnum +const ( + ScheduledActionSummaryActionTypeDbServerFullSoftwareUpdate ScheduledActionSummaryActionTypeEnum = "DB_SERVER_FULL_SOFTWARE_UPDATE" + ScheduledActionSummaryActionTypeStorageServerFullSoftwareUpdate ScheduledActionSummaryActionTypeEnum = "STORAGE_SERVER_FULL_SOFTWARE_UPDATE" + ScheduledActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate ScheduledActionSummaryActionTypeEnum = "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE" +) + +var mappingScheduledActionSummaryActionTypeEnum = map[string]ScheduledActionSummaryActionTypeEnum{ + "DB_SERVER_FULL_SOFTWARE_UPDATE": ScheduledActionSummaryActionTypeDbServerFullSoftwareUpdate, + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE": ScheduledActionSummaryActionTypeStorageServerFullSoftwareUpdate, + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE": ScheduledActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate, +} + +var mappingScheduledActionSummaryActionTypeEnumLowerCase = map[string]ScheduledActionSummaryActionTypeEnum{ + "db_server_full_software_update": ScheduledActionSummaryActionTypeDbServerFullSoftwareUpdate, + "storage_server_full_software_update": ScheduledActionSummaryActionTypeStorageServerFullSoftwareUpdate, + "network_switch_full_software_update": ScheduledActionSummaryActionTypeNetworkSwitchFullSoftwareUpdate, +} + +// GetScheduledActionSummaryActionTypeEnumValues Enumerates the set of values for ScheduledActionSummaryActionTypeEnum +func GetScheduledActionSummaryActionTypeEnumValues() []ScheduledActionSummaryActionTypeEnum { + values := make([]ScheduledActionSummaryActionTypeEnum, 0) + for _, v := range mappingScheduledActionSummaryActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetScheduledActionSummaryActionTypeEnumStringValues Enumerates the set of values in String for ScheduledActionSummaryActionTypeEnum +func GetScheduledActionSummaryActionTypeEnumStringValues() []string { + return []string{ + "DB_SERVER_FULL_SOFTWARE_UPDATE", + "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", + "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingScheduledActionSummaryActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduledActionSummaryActionTypeEnum(val string) (ScheduledActionSummaryActionTypeEnum, bool) { + enum, ok := mappingScheduledActionSummaryActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ScheduledActionSummaryLifecycleStateEnum Enum with underlying type: string +type ScheduledActionSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ScheduledActionSummaryLifecycleStateEnum +const ( + ScheduledActionSummaryLifecycleStateCreating ScheduledActionSummaryLifecycleStateEnum = "CREATING" + ScheduledActionSummaryLifecycleStateNeedsAttention ScheduledActionSummaryLifecycleStateEnum = "NEEDS_ATTENTION" + ScheduledActionSummaryLifecycleStateAvailable ScheduledActionSummaryLifecycleStateEnum = "AVAILABLE" + ScheduledActionSummaryLifecycleStateUpdating ScheduledActionSummaryLifecycleStateEnum = "UPDATING" + ScheduledActionSummaryLifecycleStateFailed ScheduledActionSummaryLifecycleStateEnum = "FAILED" + ScheduledActionSummaryLifecycleStateDeleting ScheduledActionSummaryLifecycleStateEnum = "DELETING" + ScheduledActionSummaryLifecycleStateDeleted ScheduledActionSummaryLifecycleStateEnum = "DELETED" +) + +var mappingScheduledActionSummaryLifecycleStateEnum = map[string]ScheduledActionSummaryLifecycleStateEnum{ + "CREATING": ScheduledActionSummaryLifecycleStateCreating, + "NEEDS_ATTENTION": ScheduledActionSummaryLifecycleStateNeedsAttention, + "AVAILABLE": ScheduledActionSummaryLifecycleStateAvailable, + "UPDATING": ScheduledActionSummaryLifecycleStateUpdating, + "FAILED": ScheduledActionSummaryLifecycleStateFailed, + "DELETING": ScheduledActionSummaryLifecycleStateDeleting, + "DELETED": ScheduledActionSummaryLifecycleStateDeleted, +} + +var mappingScheduledActionSummaryLifecycleStateEnumLowerCase = map[string]ScheduledActionSummaryLifecycleStateEnum{ + "creating": ScheduledActionSummaryLifecycleStateCreating, + "needs_attention": ScheduledActionSummaryLifecycleStateNeedsAttention, + "available": ScheduledActionSummaryLifecycleStateAvailable, + "updating": ScheduledActionSummaryLifecycleStateUpdating, + "failed": ScheduledActionSummaryLifecycleStateFailed, + "deleting": ScheduledActionSummaryLifecycleStateDeleting, + "deleted": ScheduledActionSummaryLifecycleStateDeleted, +} + +// GetScheduledActionSummaryLifecycleStateEnumValues Enumerates the set of values for ScheduledActionSummaryLifecycleStateEnum +func GetScheduledActionSummaryLifecycleStateEnumValues() []ScheduledActionSummaryLifecycleStateEnum { + values := make([]ScheduledActionSummaryLifecycleStateEnum, 0) + for _, v := range mappingScheduledActionSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetScheduledActionSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ScheduledActionSummaryLifecycleStateEnum +func GetScheduledActionSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "NEEDS_ATTENTION", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingScheduledActionSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduledActionSummaryLifecycleStateEnum(val string) (ScheduledActionSummaryLifecycleStateEnum, bool) { + enum, ok := mappingScheduledActionSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scheduling_plan.go b/database/scheduling_plan.go new file mode 100644 index 0000000000..700098ea45 --- /dev/null +++ b/database/scheduling_plan.go @@ -0,0 +1,243 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SchedulingPlan Details of a Scheduling Plan. +type SchedulingPlan struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Plan. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Policy. + SchedulingPolicyId *string `mandatory:"true" json:"schedulingPolicyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the resource. + ResourceId *string `mandatory:"true" json:"resourceId"` + + // The current state of the Scheduling Plan. Valid states are CREATING, NEEDS_ATTENTION, AVAILABLE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState SchedulingPlanLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The service type of the Scheduling Plan. + ServiceType SchedulingPlanServiceTypeEnum `mandatory:"true" json:"serviceType"` + + // The date and time the Scheduling Plan Resource was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The display name of the Scheduling Plan. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // If true, recommended scheduled actions will be generated for the scheduling plan. + IsUsingRecommendedScheduledActions *bool `mandatory:"false" json:"isUsingRecommendedScheduledActions"` + + // The current intent the Scheduling Plan. Valid states is EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE. + PlanIntent SchedulingPlanPlanIntentEnum `mandatory:"false" json:"planIntent,omitempty"` + + // The estimated time for the Scheduling Plan. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The date and time the Scheduling Plan Resource was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m SchedulingPlan) 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 SchedulingPlan) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSchedulingPlanLifecycleStateEnum(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(GetSchedulingPlanLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingSchedulingPlanServiceTypeEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetSchedulingPlanServiceTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingSchedulingPlanPlanIntentEnum(string(m.PlanIntent)); !ok && m.PlanIntent != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlanIntent: %s. Supported values are: %s.", m.PlanIntent, strings.Join(GetSchedulingPlanPlanIntentEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SchedulingPlanLifecycleStateEnum Enum with underlying type: string +type SchedulingPlanLifecycleStateEnum string + +// Set of constants representing the allowable values for SchedulingPlanLifecycleStateEnum +const ( + SchedulingPlanLifecycleStateCreating SchedulingPlanLifecycleStateEnum = "CREATING" + SchedulingPlanLifecycleStateNeedsAttention SchedulingPlanLifecycleStateEnum = "NEEDS_ATTENTION" + SchedulingPlanLifecycleStateAvailable SchedulingPlanLifecycleStateEnum = "AVAILABLE" + SchedulingPlanLifecycleStateUpdating SchedulingPlanLifecycleStateEnum = "UPDATING" + SchedulingPlanLifecycleStateFailed SchedulingPlanLifecycleStateEnum = "FAILED" + SchedulingPlanLifecycleStateDeleting SchedulingPlanLifecycleStateEnum = "DELETING" + SchedulingPlanLifecycleStateDeleted SchedulingPlanLifecycleStateEnum = "DELETED" +) + +var mappingSchedulingPlanLifecycleStateEnum = map[string]SchedulingPlanLifecycleStateEnum{ + "CREATING": SchedulingPlanLifecycleStateCreating, + "NEEDS_ATTENTION": SchedulingPlanLifecycleStateNeedsAttention, + "AVAILABLE": SchedulingPlanLifecycleStateAvailable, + "UPDATING": SchedulingPlanLifecycleStateUpdating, + "FAILED": SchedulingPlanLifecycleStateFailed, + "DELETING": SchedulingPlanLifecycleStateDeleting, + "DELETED": SchedulingPlanLifecycleStateDeleted, +} + +var mappingSchedulingPlanLifecycleStateEnumLowerCase = map[string]SchedulingPlanLifecycleStateEnum{ + "creating": SchedulingPlanLifecycleStateCreating, + "needs_attention": SchedulingPlanLifecycleStateNeedsAttention, + "available": SchedulingPlanLifecycleStateAvailable, + "updating": SchedulingPlanLifecycleStateUpdating, + "failed": SchedulingPlanLifecycleStateFailed, + "deleting": SchedulingPlanLifecycleStateDeleting, + "deleted": SchedulingPlanLifecycleStateDeleted, +} + +// GetSchedulingPlanLifecycleStateEnumValues Enumerates the set of values for SchedulingPlanLifecycleStateEnum +func GetSchedulingPlanLifecycleStateEnumValues() []SchedulingPlanLifecycleStateEnum { + values := make([]SchedulingPlanLifecycleStateEnum, 0) + for _, v := range mappingSchedulingPlanLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPlanLifecycleStateEnumStringValues Enumerates the set of values in String for SchedulingPlanLifecycleStateEnum +func GetSchedulingPlanLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "NEEDS_ATTENTION", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingSchedulingPlanLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPlanLifecycleStateEnum(val string) (SchedulingPlanLifecycleStateEnum, bool) { + enum, ok := mappingSchedulingPlanLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SchedulingPlanPlanIntentEnum Enum with underlying type: string +type SchedulingPlanPlanIntentEnum string + +// Set of constants representing the allowable values for SchedulingPlanPlanIntentEnum +const ( + SchedulingPlanPlanIntentExadataInfrastructureFullSoftwareUpdate SchedulingPlanPlanIntentEnum = "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE" +) + +var mappingSchedulingPlanPlanIntentEnum = map[string]SchedulingPlanPlanIntentEnum{ + "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE": SchedulingPlanPlanIntentExadataInfrastructureFullSoftwareUpdate, +} + +var mappingSchedulingPlanPlanIntentEnumLowerCase = map[string]SchedulingPlanPlanIntentEnum{ + "exadata_infrastructure_full_software_update": SchedulingPlanPlanIntentExadataInfrastructureFullSoftwareUpdate, +} + +// GetSchedulingPlanPlanIntentEnumValues Enumerates the set of values for SchedulingPlanPlanIntentEnum +func GetSchedulingPlanPlanIntentEnumValues() []SchedulingPlanPlanIntentEnum { + values := make([]SchedulingPlanPlanIntentEnum, 0) + for _, v := range mappingSchedulingPlanPlanIntentEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPlanPlanIntentEnumStringValues Enumerates the set of values in String for SchedulingPlanPlanIntentEnum +func GetSchedulingPlanPlanIntentEnumStringValues() []string { + return []string{ + "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingSchedulingPlanPlanIntentEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPlanPlanIntentEnum(val string) (SchedulingPlanPlanIntentEnum, bool) { + enum, ok := mappingSchedulingPlanPlanIntentEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SchedulingPlanServiceTypeEnum Enum with underlying type: string +type SchedulingPlanServiceTypeEnum string + +// Set of constants representing the allowable values for SchedulingPlanServiceTypeEnum +const ( + SchedulingPlanServiceTypeExacc SchedulingPlanServiceTypeEnum = "EXACC" + SchedulingPlanServiceTypeExacs SchedulingPlanServiceTypeEnum = "EXACS" + SchedulingPlanServiceTypeFpppcs SchedulingPlanServiceTypeEnum = "FPPPCS" +) + +var mappingSchedulingPlanServiceTypeEnum = map[string]SchedulingPlanServiceTypeEnum{ + "EXACC": SchedulingPlanServiceTypeExacc, + "EXACS": SchedulingPlanServiceTypeExacs, + "FPPPCS": SchedulingPlanServiceTypeFpppcs, +} + +var mappingSchedulingPlanServiceTypeEnumLowerCase = map[string]SchedulingPlanServiceTypeEnum{ + "exacc": SchedulingPlanServiceTypeExacc, + "exacs": SchedulingPlanServiceTypeExacs, + "fpppcs": SchedulingPlanServiceTypeFpppcs, +} + +// GetSchedulingPlanServiceTypeEnumValues Enumerates the set of values for SchedulingPlanServiceTypeEnum +func GetSchedulingPlanServiceTypeEnumValues() []SchedulingPlanServiceTypeEnum { + values := make([]SchedulingPlanServiceTypeEnum, 0) + for _, v := range mappingSchedulingPlanServiceTypeEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPlanServiceTypeEnumStringValues Enumerates the set of values in String for SchedulingPlanServiceTypeEnum +func GetSchedulingPlanServiceTypeEnumStringValues() []string { + return []string{ + "EXACC", + "EXACS", + "FPPPCS", + } +} + +// GetMappingSchedulingPlanServiceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPlanServiceTypeEnum(val string) (SchedulingPlanServiceTypeEnum, bool) { + enum, ok := mappingSchedulingPlanServiceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scheduling_plan_collection.go b/database/scheduling_plan_collection.go new file mode 100644 index 0000000000..d306829371 --- /dev/null +++ b/database/scheduling_plan_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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SchedulingPlanCollection Results of Scheduling Plan resources lists. Contains ScheduledActionSummary items. +type SchedulingPlanCollection struct { + + // List of Scheduling Plan resources. + Items []SchedulingPlanSummary `mandatory:"true" json:"items"` +} + +func (m SchedulingPlanCollection) 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 SchedulingPlanCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/scheduling_plan_summary.go b/database/scheduling_plan_summary.go new file mode 100644 index 0000000000..436fa4d8f3 --- /dev/null +++ b/database/scheduling_plan_summary.go @@ -0,0 +1,243 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SchedulingPlanSummary Details of a Scheduling Plan. +type SchedulingPlanSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Plan. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Policy. + SchedulingPolicyId *string `mandatory:"true" json:"schedulingPolicyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the resource. + ResourceId *string `mandatory:"true" json:"resourceId"` + + // The current state of the Scheduling Plan. Valid states are CREATING, NEEDS_ATTENTION, AVAILABLE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState SchedulingPlanSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The service type of the Scheduling Plan. + ServiceType SchedulingPlanSummaryServiceTypeEnum `mandatory:"true" json:"serviceType"` + + // The date and time the Scheduling Plan Resource was created. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The display name of the Scheduling Plan. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // If true, recommended scheduled actions will be generated for the scheduling plan. + IsUsingRecommendedScheduledActions *bool `mandatory:"false" json:"isUsingRecommendedScheduledActions"` + + // The current intent the Scheduling Plan. Valid states is EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE. + PlanIntent SchedulingPlanSummaryPlanIntentEnum `mandatory:"false" json:"planIntent,omitempty"` + + // The estimated time for the Scheduling Plan. + EstimatedTimeInMins *int `mandatory:"false" json:"estimatedTimeInMins"` + + // The date and time the Scheduling Plan Resource was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m SchedulingPlanSummary) 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 SchedulingPlanSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSchedulingPlanSummaryLifecycleStateEnum(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(GetSchedulingPlanSummaryLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingSchedulingPlanSummaryServiceTypeEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetSchedulingPlanSummaryServiceTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingSchedulingPlanSummaryPlanIntentEnum(string(m.PlanIntent)); !ok && m.PlanIntent != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PlanIntent: %s. Supported values are: %s.", m.PlanIntent, strings.Join(GetSchedulingPlanSummaryPlanIntentEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SchedulingPlanSummaryLifecycleStateEnum Enum with underlying type: string +type SchedulingPlanSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for SchedulingPlanSummaryLifecycleStateEnum +const ( + SchedulingPlanSummaryLifecycleStateCreating SchedulingPlanSummaryLifecycleStateEnum = "CREATING" + SchedulingPlanSummaryLifecycleStateNeedsAttention SchedulingPlanSummaryLifecycleStateEnum = "NEEDS_ATTENTION" + SchedulingPlanSummaryLifecycleStateAvailable SchedulingPlanSummaryLifecycleStateEnum = "AVAILABLE" + SchedulingPlanSummaryLifecycleStateUpdating SchedulingPlanSummaryLifecycleStateEnum = "UPDATING" + SchedulingPlanSummaryLifecycleStateFailed SchedulingPlanSummaryLifecycleStateEnum = "FAILED" + SchedulingPlanSummaryLifecycleStateDeleting SchedulingPlanSummaryLifecycleStateEnum = "DELETING" + SchedulingPlanSummaryLifecycleStateDeleted SchedulingPlanSummaryLifecycleStateEnum = "DELETED" +) + +var mappingSchedulingPlanSummaryLifecycleStateEnum = map[string]SchedulingPlanSummaryLifecycleStateEnum{ + "CREATING": SchedulingPlanSummaryLifecycleStateCreating, + "NEEDS_ATTENTION": SchedulingPlanSummaryLifecycleStateNeedsAttention, + "AVAILABLE": SchedulingPlanSummaryLifecycleStateAvailable, + "UPDATING": SchedulingPlanSummaryLifecycleStateUpdating, + "FAILED": SchedulingPlanSummaryLifecycleStateFailed, + "DELETING": SchedulingPlanSummaryLifecycleStateDeleting, + "DELETED": SchedulingPlanSummaryLifecycleStateDeleted, +} + +var mappingSchedulingPlanSummaryLifecycleStateEnumLowerCase = map[string]SchedulingPlanSummaryLifecycleStateEnum{ + "creating": SchedulingPlanSummaryLifecycleStateCreating, + "needs_attention": SchedulingPlanSummaryLifecycleStateNeedsAttention, + "available": SchedulingPlanSummaryLifecycleStateAvailable, + "updating": SchedulingPlanSummaryLifecycleStateUpdating, + "failed": SchedulingPlanSummaryLifecycleStateFailed, + "deleting": SchedulingPlanSummaryLifecycleStateDeleting, + "deleted": SchedulingPlanSummaryLifecycleStateDeleted, +} + +// GetSchedulingPlanSummaryLifecycleStateEnumValues Enumerates the set of values for SchedulingPlanSummaryLifecycleStateEnum +func GetSchedulingPlanSummaryLifecycleStateEnumValues() []SchedulingPlanSummaryLifecycleStateEnum { + values := make([]SchedulingPlanSummaryLifecycleStateEnum, 0) + for _, v := range mappingSchedulingPlanSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPlanSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for SchedulingPlanSummaryLifecycleStateEnum +func GetSchedulingPlanSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "NEEDS_ATTENTION", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingSchedulingPlanSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPlanSummaryLifecycleStateEnum(val string) (SchedulingPlanSummaryLifecycleStateEnum, bool) { + enum, ok := mappingSchedulingPlanSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SchedulingPlanSummaryPlanIntentEnum Enum with underlying type: string +type SchedulingPlanSummaryPlanIntentEnum string + +// Set of constants representing the allowable values for SchedulingPlanSummaryPlanIntentEnum +const ( + SchedulingPlanSummaryPlanIntentExadataInfrastructureFullSoftwareUpdate SchedulingPlanSummaryPlanIntentEnum = "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE" +) + +var mappingSchedulingPlanSummaryPlanIntentEnum = map[string]SchedulingPlanSummaryPlanIntentEnum{ + "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE": SchedulingPlanSummaryPlanIntentExadataInfrastructureFullSoftwareUpdate, +} + +var mappingSchedulingPlanSummaryPlanIntentEnumLowerCase = map[string]SchedulingPlanSummaryPlanIntentEnum{ + "exadata_infrastructure_full_software_update": SchedulingPlanSummaryPlanIntentExadataInfrastructureFullSoftwareUpdate, +} + +// GetSchedulingPlanSummaryPlanIntentEnumValues Enumerates the set of values for SchedulingPlanSummaryPlanIntentEnum +func GetSchedulingPlanSummaryPlanIntentEnumValues() []SchedulingPlanSummaryPlanIntentEnum { + values := make([]SchedulingPlanSummaryPlanIntentEnum, 0) + for _, v := range mappingSchedulingPlanSummaryPlanIntentEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPlanSummaryPlanIntentEnumStringValues Enumerates the set of values in String for SchedulingPlanSummaryPlanIntentEnum +func GetSchedulingPlanSummaryPlanIntentEnumStringValues() []string { + return []string{ + "EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE", + } +} + +// GetMappingSchedulingPlanSummaryPlanIntentEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPlanSummaryPlanIntentEnum(val string) (SchedulingPlanSummaryPlanIntentEnum, bool) { + enum, ok := mappingSchedulingPlanSummaryPlanIntentEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SchedulingPlanSummaryServiceTypeEnum Enum with underlying type: string +type SchedulingPlanSummaryServiceTypeEnum string + +// Set of constants representing the allowable values for SchedulingPlanSummaryServiceTypeEnum +const ( + SchedulingPlanSummaryServiceTypeExacc SchedulingPlanSummaryServiceTypeEnum = "EXACC" + SchedulingPlanSummaryServiceTypeExacs SchedulingPlanSummaryServiceTypeEnum = "EXACS" + SchedulingPlanSummaryServiceTypeFpppcs SchedulingPlanSummaryServiceTypeEnum = "FPPPCS" +) + +var mappingSchedulingPlanSummaryServiceTypeEnum = map[string]SchedulingPlanSummaryServiceTypeEnum{ + "EXACC": SchedulingPlanSummaryServiceTypeExacc, + "EXACS": SchedulingPlanSummaryServiceTypeExacs, + "FPPPCS": SchedulingPlanSummaryServiceTypeFpppcs, +} + +var mappingSchedulingPlanSummaryServiceTypeEnumLowerCase = map[string]SchedulingPlanSummaryServiceTypeEnum{ + "exacc": SchedulingPlanSummaryServiceTypeExacc, + "exacs": SchedulingPlanSummaryServiceTypeExacs, + "fpppcs": SchedulingPlanSummaryServiceTypeFpppcs, +} + +// GetSchedulingPlanSummaryServiceTypeEnumValues Enumerates the set of values for SchedulingPlanSummaryServiceTypeEnum +func GetSchedulingPlanSummaryServiceTypeEnumValues() []SchedulingPlanSummaryServiceTypeEnum { + values := make([]SchedulingPlanSummaryServiceTypeEnum, 0) + for _, v := range mappingSchedulingPlanSummaryServiceTypeEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPlanSummaryServiceTypeEnumStringValues Enumerates the set of values in String for SchedulingPlanSummaryServiceTypeEnum +func GetSchedulingPlanSummaryServiceTypeEnumStringValues() []string { + return []string{ + "EXACC", + "EXACS", + "FPPPCS", + } +} + +// GetMappingSchedulingPlanSummaryServiceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPlanSummaryServiceTypeEnum(val string) (SchedulingPlanSummaryServiceTypeEnum, bool) { + enum, ok := mappingSchedulingPlanSummaryServiceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scheduling_policy.go b/database/scheduling_policy.go new file mode 100644 index 0000000000..5eaeac6d42 --- /dev/null +++ b/database/scheduling_policy.go @@ -0,0 +1,189 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SchedulingPolicy Details of a Scheduling Policy. +type SchedulingPolicy struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Policy. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the Scheduling Policy. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the Scheduling Policy. Valid states are CREATING, NEEDS_ATTENTION, ACTIVE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState SchedulingPolicyLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The cadence period. + Cadence SchedulingPolicyCadenceEnum `mandatory:"true" json:"cadence"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the Scheduling Policy was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the Scheduling Policy was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Start of the month to be followed during the cadence period. + CadenceStartMonth *Month `mandatory:"false" json:"cadenceStartMonth"` + + // The date and time of the next scheduling window associated with the schedulingPolicy is planned to start. + TimeNextWindowStarts *common.SDKTime `mandatory:"false" json:"timeNextWindowStarts"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m SchedulingPolicy) 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 SchedulingPolicy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSchedulingPolicyLifecycleStateEnum(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(GetSchedulingPolicyLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingSchedulingPolicyCadenceEnum(string(m.Cadence)); !ok && m.Cadence != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Cadence: %s. Supported values are: %s.", m.Cadence, strings.Join(GetSchedulingPolicyCadenceEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SchedulingPolicyLifecycleStateEnum Enum with underlying type: string +type SchedulingPolicyLifecycleStateEnum string + +// Set of constants representing the allowable values for SchedulingPolicyLifecycleStateEnum +const ( + SchedulingPolicyLifecycleStateCreating SchedulingPolicyLifecycleStateEnum = "CREATING" + SchedulingPolicyLifecycleStateNeedsAttention SchedulingPolicyLifecycleStateEnum = "NEEDS_ATTENTION" + SchedulingPolicyLifecycleStateAvailable SchedulingPolicyLifecycleStateEnum = "AVAILABLE" + SchedulingPolicyLifecycleStateUpdating SchedulingPolicyLifecycleStateEnum = "UPDATING" + SchedulingPolicyLifecycleStateFailed SchedulingPolicyLifecycleStateEnum = "FAILED" + SchedulingPolicyLifecycleStateDeleting SchedulingPolicyLifecycleStateEnum = "DELETING" + SchedulingPolicyLifecycleStateDeleted SchedulingPolicyLifecycleStateEnum = "DELETED" +) + +var mappingSchedulingPolicyLifecycleStateEnum = map[string]SchedulingPolicyLifecycleStateEnum{ + "CREATING": SchedulingPolicyLifecycleStateCreating, + "NEEDS_ATTENTION": SchedulingPolicyLifecycleStateNeedsAttention, + "AVAILABLE": SchedulingPolicyLifecycleStateAvailable, + "UPDATING": SchedulingPolicyLifecycleStateUpdating, + "FAILED": SchedulingPolicyLifecycleStateFailed, + "DELETING": SchedulingPolicyLifecycleStateDeleting, + "DELETED": SchedulingPolicyLifecycleStateDeleted, +} + +var mappingSchedulingPolicyLifecycleStateEnumLowerCase = map[string]SchedulingPolicyLifecycleStateEnum{ + "creating": SchedulingPolicyLifecycleStateCreating, + "needs_attention": SchedulingPolicyLifecycleStateNeedsAttention, + "available": SchedulingPolicyLifecycleStateAvailable, + "updating": SchedulingPolicyLifecycleStateUpdating, + "failed": SchedulingPolicyLifecycleStateFailed, + "deleting": SchedulingPolicyLifecycleStateDeleting, + "deleted": SchedulingPolicyLifecycleStateDeleted, +} + +// GetSchedulingPolicyLifecycleStateEnumValues Enumerates the set of values for SchedulingPolicyLifecycleStateEnum +func GetSchedulingPolicyLifecycleStateEnumValues() []SchedulingPolicyLifecycleStateEnum { + values := make([]SchedulingPolicyLifecycleStateEnum, 0) + for _, v := range mappingSchedulingPolicyLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPolicyLifecycleStateEnumStringValues Enumerates the set of values in String for SchedulingPolicyLifecycleStateEnum +func GetSchedulingPolicyLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "NEEDS_ATTENTION", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingSchedulingPolicyLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPolicyLifecycleStateEnum(val string) (SchedulingPolicyLifecycleStateEnum, bool) { + enum, ok := mappingSchedulingPolicyLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SchedulingPolicyCadenceEnum Enum with underlying type: string +type SchedulingPolicyCadenceEnum string + +// Set of constants representing the allowable values for SchedulingPolicyCadenceEnum +const ( + SchedulingPolicyCadenceHalfyearly SchedulingPolicyCadenceEnum = "HALFYEARLY" + SchedulingPolicyCadenceQuarterly SchedulingPolicyCadenceEnum = "QUARTERLY" + SchedulingPolicyCadenceMonthly SchedulingPolicyCadenceEnum = "MONTHLY" +) + +var mappingSchedulingPolicyCadenceEnum = map[string]SchedulingPolicyCadenceEnum{ + "HALFYEARLY": SchedulingPolicyCadenceHalfyearly, + "QUARTERLY": SchedulingPolicyCadenceQuarterly, + "MONTHLY": SchedulingPolicyCadenceMonthly, +} + +var mappingSchedulingPolicyCadenceEnumLowerCase = map[string]SchedulingPolicyCadenceEnum{ + "halfyearly": SchedulingPolicyCadenceHalfyearly, + "quarterly": SchedulingPolicyCadenceQuarterly, + "monthly": SchedulingPolicyCadenceMonthly, +} + +// GetSchedulingPolicyCadenceEnumValues Enumerates the set of values for SchedulingPolicyCadenceEnum +func GetSchedulingPolicyCadenceEnumValues() []SchedulingPolicyCadenceEnum { + values := make([]SchedulingPolicyCadenceEnum, 0) + for _, v := range mappingSchedulingPolicyCadenceEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPolicyCadenceEnumStringValues Enumerates the set of values in String for SchedulingPolicyCadenceEnum +func GetSchedulingPolicyCadenceEnumStringValues() []string { + return []string{ + "HALFYEARLY", + "QUARTERLY", + "MONTHLY", + } +} + +// GetMappingSchedulingPolicyCadenceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPolicyCadenceEnum(val string) (SchedulingPolicyCadenceEnum, bool) { + enum, ok := mappingSchedulingPolicyCadenceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scheduling_policy_summary.go b/database/scheduling_policy_summary.go new file mode 100644 index 0000000000..dea69cf4be --- /dev/null +++ b/database/scheduling_policy_summary.go @@ -0,0 +1,189 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SchedulingPolicySummary Details of a Scheduling Policy. +type SchedulingPolicySummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Policy. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the Scheduling Policy. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the Scheduling Policy. Valid states are CREATING, NEEDS_ATTENTION, ACTIVE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState SchedulingPolicySummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The cadence period. + Cadence SchedulingPolicySummaryCadenceEnum `mandatory:"true" json:"cadence"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the Scheduling Policy was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the Scheduling Policy was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Start of the month to be followed during the cadence period. + CadenceStartMonth *Month `mandatory:"false" json:"cadenceStartMonth"` + + // The date and time of the next scheduling window associated with the schedulingPolicy is planned to start. + TimeNextWindowStarts *common.SDKTime `mandatory:"false" json:"timeNextWindowStarts"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m SchedulingPolicySummary) 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 SchedulingPolicySummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSchedulingPolicySummaryLifecycleStateEnum(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(GetSchedulingPolicySummaryLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingSchedulingPolicySummaryCadenceEnum(string(m.Cadence)); !ok && m.Cadence != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Cadence: %s. Supported values are: %s.", m.Cadence, strings.Join(GetSchedulingPolicySummaryCadenceEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SchedulingPolicySummaryLifecycleStateEnum Enum with underlying type: string +type SchedulingPolicySummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for SchedulingPolicySummaryLifecycleStateEnum +const ( + SchedulingPolicySummaryLifecycleStateCreating SchedulingPolicySummaryLifecycleStateEnum = "CREATING" + SchedulingPolicySummaryLifecycleStateNeedsAttention SchedulingPolicySummaryLifecycleStateEnum = "NEEDS_ATTENTION" + SchedulingPolicySummaryLifecycleStateAvailable SchedulingPolicySummaryLifecycleStateEnum = "AVAILABLE" + SchedulingPolicySummaryLifecycleStateUpdating SchedulingPolicySummaryLifecycleStateEnum = "UPDATING" + SchedulingPolicySummaryLifecycleStateFailed SchedulingPolicySummaryLifecycleStateEnum = "FAILED" + SchedulingPolicySummaryLifecycleStateDeleting SchedulingPolicySummaryLifecycleStateEnum = "DELETING" + SchedulingPolicySummaryLifecycleStateDeleted SchedulingPolicySummaryLifecycleStateEnum = "DELETED" +) + +var mappingSchedulingPolicySummaryLifecycleStateEnum = map[string]SchedulingPolicySummaryLifecycleStateEnum{ + "CREATING": SchedulingPolicySummaryLifecycleStateCreating, + "NEEDS_ATTENTION": SchedulingPolicySummaryLifecycleStateNeedsAttention, + "AVAILABLE": SchedulingPolicySummaryLifecycleStateAvailable, + "UPDATING": SchedulingPolicySummaryLifecycleStateUpdating, + "FAILED": SchedulingPolicySummaryLifecycleStateFailed, + "DELETING": SchedulingPolicySummaryLifecycleStateDeleting, + "DELETED": SchedulingPolicySummaryLifecycleStateDeleted, +} + +var mappingSchedulingPolicySummaryLifecycleStateEnumLowerCase = map[string]SchedulingPolicySummaryLifecycleStateEnum{ + "creating": SchedulingPolicySummaryLifecycleStateCreating, + "needs_attention": SchedulingPolicySummaryLifecycleStateNeedsAttention, + "available": SchedulingPolicySummaryLifecycleStateAvailable, + "updating": SchedulingPolicySummaryLifecycleStateUpdating, + "failed": SchedulingPolicySummaryLifecycleStateFailed, + "deleting": SchedulingPolicySummaryLifecycleStateDeleting, + "deleted": SchedulingPolicySummaryLifecycleStateDeleted, +} + +// GetSchedulingPolicySummaryLifecycleStateEnumValues Enumerates the set of values for SchedulingPolicySummaryLifecycleStateEnum +func GetSchedulingPolicySummaryLifecycleStateEnumValues() []SchedulingPolicySummaryLifecycleStateEnum { + values := make([]SchedulingPolicySummaryLifecycleStateEnum, 0) + for _, v := range mappingSchedulingPolicySummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPolicySummaryLifecycleStateEnumStringValues Enumerates the set of values in String for SchedulingPolicySummaryLifecycleStateEnum +func GetSchedulingPolicySummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "NEEDS_ATTENTION", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingSchedulingPolicySummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPolicySummaryLifecycleStateEnum(val string) (SchedulingPolicySummaryLifecycleStateEnum, bool) { + enum, ok := mappingSchedulingPolicySummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// SchedulingPolicySummaryCadenceEnum Enum with underlying type: string +type SchedulingPolicySummaryCadenceEnum string + +// Set of constants representing the allowable values for SchedulingPolicySummaryCadenceEnum +const ( + SchedulingPolicySummaryCadenceHalfyearly SchedulingPolicySummaryCadenceEnum = "HALFYEARLY" + SchedulingPolicySummaryCadenceQuarterly SchedulingPolicySummaryCadenceEnum = "QUARTERLY" + SchedulingPolicySummaryCadenceMonthly SchedulingPolicySummaryCadenceEnum = "MONTHLY" +) + +var mappingSchedulingPolicySummaryCadenceEnum = map[string]SchedulingPolicySummaryCadenceEnum{ + "HALFYEARLY": SchedulingPolicySummaryCadenceHalfyearly, + "QUARTERLY": SchedulingPolicySummaryCadenceQuarterly, + "MONTHLY": SchedulingPolicySummaryCadenceMonthly, +} + +var mappingSchedulingPolicySummaryCadenceEnumLowerCase = map[string]SchedulingPolicySummaryCadenceEnum{ + "halfyearly": SchedulingPolicySummaryCadenceHalfyearly, + "quarterly": SchedulingPolicySummaryCadenceQuarterly, + "monthly": SchedulingPolicySummaryCadenceMonthly, +} + +// GetSchedulingPolicySummaryCadenceEnumValues Enumerates the set of values for SchedulingPolicySummaryCadenceEnum +func GetSchedulingPolicySummaryCadenceEnumValues() []SchedulingPolicySummaryCadenceEnum { + values := make([]SchedulingPolicySummaryCadenceEnum, 0) + for _, v := range mappingSchedulingPolicySummaryCadenceEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingPolicySummaryCadenceEnumStringValues Enumerates the set of values in String for SchedulingPolicySummaryCadenceEnum +func GetSchedulingPolicySummaryCadenceEnumStringValues() []string { + return []string{ + "HALFYEARLY", + "QUARTERLY", + "MONTHLY", + } +} + +// GetMappingSchedulingPolicySummaryCadenceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingPolicySummaryCadenceEnum(val string) (SchedulingPolicySummaryCadenceEnum, bool) { + enum, ok := mappingSchedulingPolicySummaryCadenceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scheduling_window.go b/database/scheduling_window.go new file mode 100644 index 0000000000..3fd3cd3f66 --- /dev/null +++ b/database/scheduling_window.go @@ -0,0 +1,135 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SchedulingWindow Details of a Scheduling Window. +type SchedulingWindow struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Window. + Id *string `mandatory:"true" json:"id"` + + // The current state of the Scheduling Window. Valid states are CREATING, ACTIVE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState SchedulingWindowLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + WindowPreference *WindowPreferenceDetail `mandatory:"true" json:"windowPreference"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Policy. + SchedulingPolicyId *string `mandatory:"true" json:"schedulingPolicyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The user-friendly name for the Scheduling Window. The name does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The date and time of the next upcoming window associated within the schedulingWindow is planned to start. + TimeNextSchedulingWindowStarts *common.SDKTime `mandatory:"false" json:"timeNextSchedulingWindowStarts"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the Scheduling Window was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the Scheduling Window was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m SchedulingWindow) 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 SchedulingWindow) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSchedulingWindowLifecycleStateEnum(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(GetSchedulingWindowLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SchedulingWindowLifecycleStateEnum Enum with underlying type: string +type SchedulingWindowLifecycleStateEnum string + +// Set of constants representing the allowable values for SchedulingWindowLifecycleStateEnum +const ( + SchedulingWindowLifecycleStateCreating SchedulingWindowLifecycleStateEnum = "CREATING" + SchedulingWindowLifecycleStateAvailable SchedulingWindowLifecycleStateEnum = "AVAILABLE" + SchedulingWindowLifecycleStateUpdating SchedulingWindowLifecycleStateEnum = "UPDATING" + SchedulingWindowLifecycleStateFailed SchedulingWindowLifecycleStateEnum = "FAILED" + SchedulingWindowLifecycleStateDeleting SchedulingWindowLifecycleStateEnum = "DELETING" + SchedulingWindowLifecycleStateDeleted SchedulingWindowLifecycleStateEnum = "DELETED" +) + +var mappingSchedulingWindowLifecycleStateEnum = map[string]SchedulingWindowLifecycleStateEnum{ + "CREATING": SchedulingWindowLifecycleStateCreating, + "AVAILABLE": SchedulingWindowLifecycleStateAvailable, + "UPDATING": SchedulingWindowLifecycleStateUpdating, + "FAILED": SchedulingWindowLifecycleStateFailed, + "DELETING": SchedulingWindowLifecycleStateDeleting, + "DELETED": SchedulingWindowLifecycleStateDeleted, +} + +var mappingSchedulingWindowLifecycleStateEnumLowerCase = map[string]SchedulingWindowLifecycleStateEnum{ + "creating": SchedulingWindowLifecycleStateCreating, + "available": SchedulingWindowLifecycleStateAvailable, + "updating": SchedulingWindowLifecycleStateUpdating, + "failed": SchedulingWindowLifecycleStateFailed, + "deleting": SchedulingWindowLifecycleStateDeleting, + "deleted": SchedulingWindowLifecycleStateDeleted, +} + +// GetSchedulingWindowLifecycleStateEnumValues Enumerates the set of values for SchedulingWindowLifecycleStateEnum +func GetSchedulingWindowLifecycleStateEnumValues() []SchedulingWindowLifecycleStateEnum { + values := make([]SchedulingWindowLifecycleStateEnum, 0) + for _, v := range mappingSchedulingWindowLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingWindowLifecycleStateEnumStringValues Enumerates the set of values in String for SchedulingWindowLifecycleStateEnum +func GetSchedulingWindowLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingSchedulingWindowLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingWindowLifecycleStateEnum(val string) (SchedulingWindowLifecycleStateEnum, bool) { + enum, ok := mappingSchedulingWindowLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/scheduling_window_summary.go b/database/scheduling_window_summary.go new file mode 100644 index 0000000000..df13942c7f --- /dev/null +++ b/database/scheduling_window_summary.go @@ -0,0 +1,135 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SchedulingWindowSummary Details of a Scheduling Window. +type SchedulingWindowSummary struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Window. + Id *string `mandatory:"true" json:"id"` + + // The current state of the Scheduling Window. Valid states are CREATING, ACTIVE, UPDATING, FAILED, DELETING and DELETED. + LifecycleState SchedulingWindowSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + WindowPreference *WindowPreferenceDetail `mandatory:"true" json:"windowPreference"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Policy. + SchedulingPolicyId *string `mandatory:"true" json:"schedulingPolicyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // The user-friendly name for the Scheduling Window. The name does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The date and time of the next upcoming window associated within the schedulingWindow is planned to start. + TimeNextSchedulingWindowStarts *common.SDKTime `mandatory:"false" json:"timeNextSchedulingWindowStarts"` + + // Additional information about the current lifecycle state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The date and time the Scheduling Window was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The last date and time that the Scheduling Window was updated. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m SchedulingWindowSummary) 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 SchedulingWindowSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingSchedulingWindowSummaryLifecycleStateEnum(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(GetSchedulingWindowSummaryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SchedulingWindowSummaryLifecycleStateEnum Enum with underlying type: string +type SchedulingWindowSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for SchedulingWindowSummaryLifecycleStateEnum +const ( + SchedulingWindowSummaryLifecycleStateCreating SchedulingWindowSummaryLifecycleStateEnum = "CREATING" + SchedulingWindowSummaryLifecycleStateAvailable SchedulingWindowSummaryLifecycleStateEnum = "AVAILABLE" + SchedulingWindowSummaryLifecycleStateUpdating SchedulingWindowSummaryLifecycleStateEnum = "UPDATING" + SchedulingWindowSummaryLifecycleStateFailed SchedulingWindowSummaryLifecycleStateEnum = "FAILED" + SchedulingWindowSummaryLifecycleStateDeleting SchedulingWindowSummaryLifecycleStateEnum = "DELETING" + SchedulingWindowSummaryLifecycleStateDeleted SchedulingWindowSummaryLifecycleStateEnum = "DELETED" +) + +var mappingSchedulingWindowSummaryLifecycleStateEnum = map[string]SchedulingWindowSummaryLifecycleStateEnum{ + "CREATING": SchedulingWindowSummaryLifecycleStateCreating, + "AVAILABLE": SchedulingWindowSummaryLifecycleStateAvailable, + "UPDATING": SchedulingWindowSummaryLifecycleStateUpdating, + "FAILED": SchedulingWindowSummaryLifecycleStateFailed, + "DELETING": SchedulingWindowSummaryLifecycleStateDeleting, + "DELETED": SchedulingWindowSummaryLifecycleStateDeleted, +} + +var mappingSchedulingWindowSummaryLifecycleStateEnumLowerCase = map[string]SchedulingWindowSummaryLifecycleStateEnum{ + "creating": SchedulingWindowSummaryLifecycleStateCreating, + "available": SchedulingWindowSummaryLifecycleStateAvailable, + "updating": SchedulingWindowSummaryLifecycleStateUpdating, + "failed": SchedulingWindowSummaryLifecycleStateFailed, + "deleting": SchedulingWindowSummaryLifecycleStateDeleting, + "deleted": SchedulingWindowSummaryLifecycleStateDeleted, +} + +// GetSchedulingWindowSummaryLifecycleStateEnumValues Enumerates the set of values for SchedulingWindowSummaryLifecycleStateEnum +func GetSchedulingWindowSummaryLifecycleStateEnumValues() []SchedulingWindowSummaryLifecycleStateEnum { + values := make([]SchedulingWindowSummaryLifecycleStateEnum, 0) + for _, v := range mappingSchedulingWindowSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetSchedulingWindowSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for SchedulingWindowSummaryLifecycleStateEnum +func GetSchedulingWindowSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "AVAILABLE", + "UPDATING", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingSchedulingWindowSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSchedulingWindowSummaryLifecycleStateEnum(val string) (SchedulingWindowSummaryLifecycleStateEnum, bool) { + enum, ok := mappingSchedulingWindowSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/update_autonomous_database_details.go b/database/update_autonomous_database_details.go index 57c05621ea..3260f20994 100644 --- a/database/update_autonomous_database_details.go +++ b/database/update_autonomous_database_details.go @@ -45,7 +45,7 @@ type UpdateAutonomousDatabaseDetails struct { LongTermBackupSchedule *LongTermBackUpScheduleDetails `mandatory:"false" json:"longTermBackupSchedule"` - // Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See Autonomous Database documentation (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + // Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. IsDevTier *bool `mandatory:"false" json:"isDevTier"` // The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. diff --git a/database/update_exadb_vm_cluster_details.go b/database/update_exadb_vm_cluster_details.go index 3f7a30859c..5476d04f0d 100644 --- a/database/update_exadb_vm_cluster_details.go +++ b/database/update_exadb_vm_cluster_details.go @@ -60,7 +60,11 @@ type UpdateExadbVmClusterDetails struct { // Operating system version of the image. SystemVersion *string `mandatory:"false" json:"systemVersion"` - // Grid Setup will be done using this grid image id + // Grid Setup will be done using this grid image id. + // The grid image id can be extracted from + // 1. Obtain the supported major versions using API /20160918/giVersions?compartmentId=&shape=EXADB_XS&availabilityDomain= + // 2. Replace {version} with one of the supported major versions and obtain the supported minor versions using + // API /20160918/giVersions/{version}/minorVersions?compartmentId=&shapeFamily=EXADB_XS&availabilityDomain= GridImageId *string `mandatory:"false" json:"gridImageId"` // The update action. diff --git a/database/update_execution_action_details.go b/database/update_execution_action_details.go new file mode 100644 index 0000000000..60cfddd5d5 --- /dev/null +++ b/database/update_execution_action_details.go @@ -0,0 +1,55 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateExecutionActionDetails Describes the modification parameters for the execution action. +type UpdateExecutionActionDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the execution window resource the execution action belongs to. + ExecutionWindowId *string `mandatory:"false" json:"executionWindowId"` + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"false" json:"actionParams"` + + // List of action members of this execution action. + ActionMembers []ExecutionActionMember `mandatory:"false" json:"actionMembers"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateExecutionActionDetails) 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 UpdateExecutionActionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/update_execution_action_request_response.go b/database/update_execution_action_request_response.go new file mode 100644 index 0000000000..d8eb1b4be9 --- /dev/null +++ b/database/update_execution_action_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateExecutionActionRequest wrapper for the UpdateExecutionAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateExecutionAction.go.html to see an example of how to use UpdateExecutionActionRequest. +type UpdateExecutionActionRequest struct { + + // The execution action OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionActionId *string `mandatory:"true" contributesTo:"path" name:"executionActionId"` + + // Request to update the properties of a execution action. + UpdateExecutionActionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateExecutionActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateExecutionActionRequest) 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 UpdateExecutionActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateExecutionActionRequest) 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 UpdateExecutionActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateExecutionActionResponse wrapper for the UpdateExecutionAction operation +type UpdateExecutionActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionAction instance + ExecutionAction `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 UpdateExecutionActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateExecutionActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/update_execution_window_details.go b/database/update_execution_window_details.go new file mode 100644 index 0000000000..0d16b7a53e --- /dev/null +++ b/database/update_execution_window_details.go @@ -0,0 +1,54 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateExecutionWindowDetails Describes the modification parameters for the execution window. +type UpdateExecutionWindowDetails struct { + + // The scheduled start date and time of the execution window. + TimeScheduled *common.SDKTime `mandatory:"false" json:"timeScheduled"` + + // Duration window allows user to set a duration they plan to allocate for Scheduling window. The duration is in minutes. + WindowDurationInMins *int `mandatory:"false" json:"windowDurationInMins"` + + // Indicates if duration the user plans to allocate for scheduling window is strictly enforced. The default value is `FALSE`. + IsEnforcedDuration *bool `mandatory:"false" json:"isEnforcedDuration"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateExecutionWindowDetails) 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 UpdateExecutionWindowDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/update_execution_window_request_response.go b/database/update_execution_window_request_response.go new file mode 100644 index 0000000000..4a41b8ea8f --- /dev/null +++ b/database/update_execution_window_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateExecutionWindowRequest wrapper for the UpdateExecutionWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateExecutionWindow.go.html to see an example of how to use UpdateExecutionWindowRequest. +type UpdateExecutionWindowRequest struct { + + // The execution window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExecutionWindowId *string `mandatory:"true" contributesTo:"path" name:"executionWindowId"` + + // Request to update the properties of a execution window. + UpdateExecutionWindowDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateExecutionWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateExecutionWindowRequest) 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 UpdateExecutionWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateExecutionWindowRequest) 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 UpdateExecutionWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateExecutionWindowResponse wrapper for the UpdateExecutionWindow operation +type UpdateExecutionWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ExecutionWindow instance + ExecutionWindow `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 UpdateExecutionWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateExecutionWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/update_scheduled_action_details.go b/database/update_scheduled_action_details.go new file mode 100644 index 0000000000..a6e88bb685 --- /dev/null +++ b/database/update_scheduled_action_details.go @@ -0,0 +1,46 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateScheduledActionDetails Describes the modification parameters for the Scheduled Action. +type UpdateScheduledActionDetails struct { + + // Map where a key value pair describes the specific action parameter. + // Example: `{"count": "3"}` + ActionParams map[string]string `mandatory:"false" json:"actionParams"` + + // The list of action members in a scheduled action. + ActionMembers []ActionMember `mandatory:"false" json:"actionMembers"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Scheduling Window. + SchedulingWindowId *string `mandatory:"false" json:"schedulingWindowId"` +} + +func (m UpdateScheduledActionDetails) 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 UpdateScheduledActionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/update_scheduled_action_request_response.go b/database/update_scheduled_action_request_response.go new file mode 100644 index 0000000000..85ad73b6b6 --- /dev/null +++ b/database/update_scheduled_action_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateScheduledActionRequest wrapper for the UpdateScheduledAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateScheduledAction.go.html to see an example of how to use UpdateScheduledActionRequest. +type UpdateScheduledActionRequest struct { + + // The Scheduled Action OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ScheduledActionId *string `mandatory:"true" contributesTo:"path" name:"scheduledActionId"` + + // Request to update the properties of a Scheduled Action. + UpdateScheduledActionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateScheduledActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateScheduledActionRequest) 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 UpdateScheduledActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateScheduledActionRequest) 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 UpdateScheduledActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateScheduledActionResponse wrapper for the UpdateScheduledAction operation +type UpdateScheduledActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ScheduledAction instance + ScheduledAction `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 UpdateScheduledActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateScheduledActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/update_scheduling_policy_details.go b/database/update_scheduling_policy_details.go new file mode 100644 index 0000000000..87755de013 --- /dev/null +++ b/database/update_scheduling_policy_details.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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateSchedulingPolicyDetails Describes the modification parameters for the Scheduling Policy. +type UpdateSchedulingPolicyDetails struct { + + // The user-friendly name for the Scheduling Policy. The name does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The cadence period. + Cadence UpdateSchedulingPolicyDetailsCadenceEnum `mandatory:"false" json:"cadence,omitempty"` + + // Start of the month to be followed during the cadence period. + CadenceStartMonth *Month `mandatory:"false" json:"cadenceStartMonth"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateSchedulingPolicyDetails) 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 UpdateSchedulingPolicyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingUpdateSchedulingPolicyDetailsCadenceEnum(string(m.Cadence)); !ok && m.Cadence != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Cadence: %s. Supported values are: %s.", m.Cadence, strings.Join(GetUpdateSchedulingPolicyDetailsCadenceEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateSchedulingPolicyDetailsCadenceEnum Enum with underlying type: string +type UpdateSchedulingPolicyDetailsCadenceEnum string + +// Set of constants representing the allowable values for UpdateSchedulingPolicyDetailsCadenceEnum +const ( + UpdateSchedulingPolicyDetailsCadenceHalfyearly UpdateSchedulingPolicyDetailsCadenceEnum = "HALFYEARLY" + UpdateSchedulingPolicyDetailsCadenceQuarterly UpdateSchedulingPolicyDetailsCadenceEnum = "QUARTERLY" + UpdateSchedulingPolicyDetailsCadenceMonthly UpdateSchedulingPolicyDetailsCadenceEnum = "MONTHLY" +) + +var mappingUpdateSchedulingPolicyDetailsCadenceEnum = map[string]UpdateSchedulingPolicyDetailsCadenceEnum{ + "HALFYEARLY": UpdateSchedulingPolicyDetailsCadenceHalfyearly, + "QUARTERLY": UpdateSchedulingPolicyDetailsCadenceQuarterly, + "MONTHLY": UpdateSchedulingPolicyDetailsCadenceMonthly, +} + +var mappingUpdateSchedulingPolicyDetailsCadenceEnumLowerCase = map[string]UpdateSchedulingPolicyDetailsCadenceEnum{ + "halfyearly": UpdateSchedulingPolicyDetailsCadenceHalfyearly, + "quarterly": UpdateSchedulingPolicyDetailsCadenceQuarterly, + "monthly": UpdateSchedulingPolicyDetailsCadenceMonthly, +} + +// GetUpdateSchedulingPolicyDetailsCadenceEnumValues Enumerates the set of values for UpdateSchedulingPolicyDetailsCadenceEnum +func GetUpdateSchedulingPolicyDetailsCadenceEnumValues() []UpdateSchedulingPolicyDetailsCadenceEnum { + values := make([]UpdateSchedulingPolicyDetailsCadenceEnum, 0) + for _, v := range mappingUpdateSchedulingPolicyDetailsCadenceEnum { + values = append(values, v) + } + return values +} + +// GetUpdateSchedulingPolicyDetailsCadenceEnumStringValues Enumerates the set of values in String for UpdateSchedulingPolicyDetailsCadenceEnum +func GetUpdateSchedulingPolicyDetailsCadenceEnumStringValues() []string { + return []string{ + "HALFYEARLY", + "QUARTERLY", + "MONTHLY", + } +} + +// GetMappingUpdateSchedulingPolicyDetailsCadenceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUpdateSchedulingPolicyDetailsCadenceEnum(val string) (UpdateSchedulingPolicyDetailsCadenceEnum, bool) { + enum, ok := mappingUpdateSchedulingPolicyDetailsCadenceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/database/update_scheduling_policy_request_response.go b/database/update_scheduling_policy_request_response.go new file mode 100644 index 0000000000..fc4f677c22 --- /dev/null +++ b/database/update_scheduling_policy_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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateSchedulingPolicyRequest wrapper for the UpdateSchedulingPolicy operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateSchedulingPolicy.go.html to see an example of how to use UpdateSchedulingPolicyRequest. +type UpdateSchedulingPolicyRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // Request to update the properties of a Scheduling Policy. + UpdateSchedulingPolicyDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateSchedulingPolicyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSchedulingPolicyRequest) 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 UpdateSchedulingPolicyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSchedulingPolicyRequest) 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 UpdateSchedulingPolicyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateSchedulingPolicyResponse wrapper for the UpdateSchedulingPolicy operation +type UpdateSchedulingPolicyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingPolicy instance + SchedulingPolicy `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 UpdateSchedulingPolicyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSchedulingPolicyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/update_scheduling_window_details.go b/database/update_scheduling_window_details.go new file mode 100644 index 0000000000..ca467247a7 --- /dev/null +++ b/database/update_scheduling_window_details.go @@ -0,0 +1,46 @@ +// 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 Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateSchedulingWindowDetails Describes the modification parameters for the Scheduling Window. +type UpdateSchedulingWindowDetails struct { + WindowPreference *WindowPreferenceDetail `mandatory:"false" json:"windowPreference"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateSchedulingWindowDetails) 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 UpdateSchedulingWindowDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/database/update_scheduling_window_request_response.go b/database/update_scheduling_window_request_response.go new file mode 100644 index 0000000000..5eaa2fd4b2 --- /dev/null +++ b/database/update_scheduling_window_request_response.go @@ -0,0 +1,107 @@ +// 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 database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateSchedulingWindowRequest wrapper for the UpdateSchedulingWindow operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/UpdateSchedulingWindow.go.html to see an example of how to use UpdateSchedulingWindowRequest. +type UpdateSchedulingWindowRequest struct { + + // The Scheduling Policy OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingPolicyId *string `mandatory:"true" contributesTo:"path" name:"schedulingPolicyId"` + + // The Scheduling Window OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + SchedulingWindowId *string `mandatory:"true" contributesTo:"path" name:"schedulingWindowId"` + + // Request to update the properties of a Scheduling Window. + UpdateSchedulingWindowDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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 UpdateSchedulingWindowRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateSchedulingWindowRequest) 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 UpdateSchedulingWindowRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateSchedulingWindowRequest) 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 UpdateSchedulingWindowRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateSchedulingWindowResponse wrapper for the UpdateSchedulingWindow operation +type UpdateSchedulingWindowResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The SchedulingWindow instance + SchedulingWindow `presentIn:"body"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the work request. Multiple OCID values are returned in a comma-separated list. Use GetWorkRequest with a work request OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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 UpdateSchedulingWindowResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateSchedulingWindowResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/database/window_preference_detail.go b/database/window_preference_detail.go new file mode 100644 index 0000000000..bb9d657855 --- /dev/null +++ b/database/window_preference_detail.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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WindowPreferenceDetail The Single Scheduling Window details. +type WindowPreferenceDetail struct { + + // Weeks during the month when scheduled window should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. + // For example, to allow scheduling window during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Scheduling window cannot be scheduled for the fifth week of months that contain more than 28 days. + // Note that this parameter works in conjunction with the daysOfWeek and startTime parameters to allow you to specify specific days of the week and hours that scheduled window will be performed. + WeeksOfMonth []int `mandatory:"true" json:"weeksOfMonth"` + + // Days during the week when scheduling window should be performed. + DaysOfWeek []DayOfWeek `mandatory:"true" json:"daysOfWeek"` + + // The scheduling window start time. The value must use the ISO-8601 format "hh:mm". + StartTime *string `mandatory:"true" json:"startTime"` + + // Duration window allows user to set a duration they plan to allocate for Scheduling window. The duration is in minutes. + Duration *int `mandatory:"true" json:"duration"` + + // Indicates if duration the user plans to allocate for scheduling window is strictly enforced. The default value is `FALSE`. + IsEnforcedDuration *bool `mandatory:"true" json:"isEnforcedDuration"` + + // Months during the year when scheduled window should be performed. + Months []Month `mandatory:"false" json:"months"` +} + +func (m WindowPreferenceDetail) 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 WindowPreferenceDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/autonomous_database_diagnostics_and_management_feature_details.go b/databasemanagement/autonomous_database_diagnostics_and_management_feature_details.go new file mode 100644 index 0000000000..0360248f9a --- /dev/null +++ b/databasemanagement/autonomous_database_diagnostics_and_management_feature_details.go @@ -0,0 +1,93 @@ +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutonomousDatabaseDiagnosticsAndManagementFeatureDetails The details required to enable the Diagnostics and Management feature. +type AutonomousDatabaseDiagnosticsAndManagementFeatureDetails struct { + DatabaseConnectionDetails *DatabaseConnectionDetails `mandatory:"true" json:"databaseConnectionDetails"` + + ConnectorDetails ConnectorDetails `mandatory:"false" json:"connectorDetails"` +} + +// GetDatabaseConnectionDetails returns DatabaseConnectionDetails +func (m AutonomousDatabaseDiagnosticsAndManagementFeatureDetails) GetDatabaseConnectionDetails() *DatabaseConnectionDetails { + return m.DatabaseConnectionDetails +} + +// GetConnectorDetails returns ConnectorDetails +func (m AutonomousDatabaseDiagnosticsAndManagementFeatureDetails) GetConnectorDetails() ConnectorDetails { + return m.ConnectorDetails +} + +func (m AutonomousDatabaseDiagnosticsAndManagementFeatureDetails) 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 AutonomousDatabaseDiagnosticsAndManagementFeatureDetails) 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 AutonomousDatabaseDiagnosticsAndManagementFeatureDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAutonomousDatabaseDiagnosticsAndManagementFeatureDetails AutonomousDatabaseDiagnosticsAndManagementFeatureDetails + s := struct { + DiscriminatorParam string `json:"feature"` + MarshalTypeAutonomousDatabaseDiagnosticsAndManagementFeatureDetails + }{ + "DIAGNOSTICS_AND_MANAGEMENT", + (MarshalTypeAutonomousDatabaseDiagnosticsAndManagementFeatureDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *AutonomousDatabaseDiagnosticsAndManagementFeatureDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + ConnectorDetails connectordetails `json:"connectorDetails"` + DatabaseConnectionDetails *DatabaseConnectionDetails `json:"databaseConnectionDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.ConnectorDetails.UnmarshalPolymorphicJSON(model.ConnectorDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ConnectorDetails = nn.(ConnectorDetails) + } else { + m.ConnectorDetails = nil + } + + m.DatabaseConnectionDetails = model.DatabaseConnectionDetails + + return +} diff --git a/databasemanagement/autonomous_database_feature_details.go b/databasemanagement/autonomous_database_feature_details.go new file mode 100644 index 0000000000..727edc2acb --- /dev/null +++ b/databasemanagement/autonomous_database_feature_details.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. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutonomousDatabaseFeatureDetails The details required to enable the specified Database Management feature for an Autonomous Database. +type AutonomousDatabaseFeatureDetails interface { + GetDatabaseConnectionDetails() *DatabaseConnectionDetails + + GetConnectorDetails() ConnectorDetails +} + +type autonomousdatabasefeaturedetails struct { + JsonData []byte + ConnectorDetails connectordetails `mandatory:"false" json:"connectorDetails"` + DatabaseConnectionDetails *DatabaseConnectionDetails `mandatory:"true" json:"databaseConnectionDetails"` + Feature string `json:"feature"` +} + +// UnmarshalJSON unmarshals json +func (m *autonomousdatabasefeaturedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerautonomousdatabasefeaturedetails autonomousdatabasefeaturedetails + s := struct { + Model Unmarshalerautonomousdatabasefeaturedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DatabaseConnectionDetails = s.Model.DatabaseConnectionDetails + m.ConnectorDetails = s.Model.ConnectorDetails + m.Feature = s.Model.Feature + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *autonomousdatabasefeaturedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Feature { + case "SQLWATCH": + mm := AutonomousDatabaseSqlWatchFeatureDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "DIAGNOSTICS_AND_MANAGEMENT": + mm := AutonomousDatabaseDiagnosticsAndManagementFeatureDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for AutonomousDatabaseFeatureDetails: %s.", m.Feature) + return *m, nil + } +} + +// GetConnectorDetails returns ConnectorDetails +func (m autonomousdatabasefeaturedetails) GetConnectorDetails() connectordetails { + return m.ConnectorDetails +} + +// GetDatabaseConnectionDetails returns DatabaseConnectionDetails +func (m autonomousdatabasefeaturedetails) GetDatabaseConnectionDetails() *DatabaseConnectionDetails { + return m.DatabaseConnectionDetails +} + +func (m autonomousdatabasefeaturedetails) 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 autonomousdatabasefeaturedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/autonomous_database_sql_watch_feature_details.go b/databasemanagement/autonomous_database_sql_watch_feature_details.go new file mode 100644 index 0000000000..74ce74eddb --- /dev/null +++ b/databasemanagement/autonomous_database_sql_watch_feature_details.go @@ -0,0 +1,93 @@ +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AutonomousDatabaseSqlWatchFeatureDetails The details required to enable the SQL Watch feature. +type AutonomousDatabaseSqlWatchFeatureDetails struct { + DatabaseConnectionDetails *DatabaseConnectionDetails `mandatory:"true" json:"databaseConnectionDetails"` + + ConnectorDetails ConnectorDetails `mandatory:"false" json:"connectorDetails"` +} + +// GetDatabaseConnectionDetails returns DatabaseConnectionDetails +func (m AutonomousDatabaseSqlWatchFeatureDetails) GetDatabaseConnectionDetails() *DatabaseConnectionDetails { + return m.DatabaseConnectionDetails +} + +// GetConnectorDetails returns ConnectorDetails +func (m AutonomousDatabaseSqlWatchFeatureDetails) GetConnectorDetails() ConnectorDetails { + return m.ConnectorDetails +} + +func (m AutonomousDatabaseSqlWatchFeatureDetails) 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 AutonomousDatabaseSqlWatchFeatureDetails) 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 AutonomousDatabaseSqlWatchFeatureDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAutonomousDatabaseSqlWatchFeatureDetails AutonomousDatabaseSqlWatchFeatureDetails + s := struct { + DiscriminatorParam string `json:"feature"` + MarshalTypeAutonomousDatabaseSqlWatchFeatureDetails + }{ + "SQLWATCH", + (MarshalTypeAutonomousDatabaseSqlWatchFeatureDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *AutonomousDatabaseSqlWatchFeatureDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + ConnectorDetails connectordetails `json:"connectorDetails"` + DatabaseConnectionDetails *DatabaseConnectionDetails `json:"databaseConnectionDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.ConnectorDetails.UnmarshalPolymorphicJSON(model.ConnectorDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ConnectorDetails = nn.(ConnectorDetails) + } else { + m.ConnectorDetails = nil + } + + m.DatabaseConnectionDetails = model.DatabaseConnectionDetails + + return +} diff --git a/databasemanagement/connector_details.go b/databasemanagement/connector_details.go index 40fa0d7bac..b970cf1405 100644 --- a/databasemanagement/connector_details.go +++ b/databasemanagement/connector_details.go @@ -56,6 +56,10 @@ func (m *connectordetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, e mm := ExternalConnectorDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "DIRECT": + mm := DirectConnectorDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "MACS": mm := MacsConnectorDetails{} err = json.Unmarshal(data, &mm) @@ -94,18 +98,21 @@ const ( ConnectorDetailsConnectorTypePe ConnectorDetailsConnectorTypeEnum = "PE" ConnectorDetailsConnectorTypeMacs ConnectorDetailsConnectorTypeEnum = "MACS" ConnectorDetailsConnectorTypeExternal ConnectorDetailsConnectorTypeEnum = "EXTERNAL" + ConnectorDetailsConnectorTypeDirect ConnectorDetailsConnectorTypeEnum = "DIRECT" ) var mappingConnectorDetailsConnectorTypeEnum = map[string]ConnectorDetailsConnectorTypeEnum{ "PE": ConnectorDetailsConnectorTypePe, "MACS": ConnectorDetailsConnectorTypeMacs, "EXTERNAL": ConnectorDetailsConnectorTypeExternal, + "DIRECT": ConnectorDetailsConnectorTypeDirect, } var mappingConnectorDetailsConnectorTypeEnumLowerCase = map[string]ConnectorDetailsConnectorTypeEnum{ "pe": ConnectorDetailsConnectorTypePe, "macs": ConnectorDetailsConnectorTypeMacs, "external": ConnectorDetailsConnectorTypeExternal, + "direct": ConnectorDetailsConnectorTypeDirect, } // GetConnectorDetailsConnectorTypeEnumValues Enumerates the set of values for ConnectorDetailsConnectorTypeEnum @@ -123,6 +130,7 @@ func GetConnectorDetailsConnectorTypeEnumStringValues() []string { "PE", "MACS", "EXTERNAL", + "DIRECT", } } diff --git a/databasemanagement/create_db_management_private_endpoint_details.go b/databasemanagement/create_db_management_private_endpoint_details.go index 2f67aa7ebd..65156ff7e1 100644 --- a/databasemanagement/create_db_management_private_endpoint_details.go +++ b/databasemanagement/create_db_management_private_endpoint_details.go @@ -32,6 +32,9 @@ type CreateDbManagementPrivateEndpointDetails struct { // Specifies whether the Database Management private endpoint will be used for Oracle Databases in a cluster. IsCluster *bool `mandatory:"false" json:"isCluster"` + // Specifies whether the Database Management private endpoint has DNS proxy server enabled to resolve private host name. + IsDnsResolutionEnabled *bool `mandatory:"false" json:"isDnsResolutionEnabled"` + // The description of the private endpoint. Description *string `mandatory:"false" json:"description"` diff --git a/databasemanagement/databasemanagement_dbmanagement_client.go b/databasemanagement/databasemanagement_dbmanagement_client.go index 086c46f077..005df96019 100644 --- a/databasemanagement/databasemanagement_dbmanagement_client.go +++ b/databasemanagement/databasemanagement_dbmanagement_client.go @@ -2467,6 +2467,69 @@ func (client DbManagementClient) disableAutomaticSpmEvolveAdvisorTask(ctx contex return response, err } +// DisableAutonomousDatabaseManagementFeature Disables a Database Management feature for the specified Autonomous Database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableAutonomousDatabaseManagementFeature.go.html to see an example of how to use DisableAutonomousDatabaseManagementFeature API. +// A default retry strategy applies to this operation DisableAutonomousDatabaseManagementFeature() +func (client DbManagementClient) DisableAutonomousDatabaseManagementFeature(ctx context.Context, request DisableAutonomousDatabaseManagementFeatureRequest) (response DisableAutonomousDatabaseManagementFeatureResponse, 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.disableAutonomousDatabaseManagementFeature, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DisableAutonomousDatabaseManagementFeatureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DisableAutonomousDatabaseManagementFeatureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DisableAutonomousDatabaseManagementFeatureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DisableAutonomousDatabaseManagementFeatureResponse") + } + return +} + +// disableAutonomousDatabaseManagementFeature implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) disableAutonomousDatabaseManagementFeature(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/disableDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DisableAutonomousDatabaseManagementFeatureResponse + 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/ManagedDatabase/DisableAutonomousDatabaseManagementFeature" + err = common.PostProcessServiceError(err, "DbManagement", "DisableAutonomousDatabaseManagementFeature", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DisableDatabaseManagementFeature Disables a Database Management feature for the specified Oracle cloud database. // // # See also @@ -3423,6 +3486,69 @@ func (client DbManagementClient) enableAutomaticSpmEvolveAdvisorTask(ctx context return response, err } +// EnableAutonomousDatabaseManagementFeature Enables a Database Management feature for the specified Autonomous Database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableAutonomousDatabaseManagementFeature.go.html to see an example of how to use EnableAutonomousDatabaseManagementFeature API. +// A default retry strategy applies to this operation EnableAutonomousDatabaseManagementFeature() +func (client DbManagementClient) EnableAutonomousDatabaseManagementFeature(ctx context.Context, request EnableAutonomousDatabaseManagementFeatureRequest) (response EnableAutonomousDatabaseManagementFeatureResponse, 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.enableAutonomousDatabaseManagementFeature, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = EnableAutonomousDatabaseManagementFeatureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = EnableAutonomousDatabaseManagementFeatureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(EnableAutonomousDatabaseManagementFeatureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into EnableAutonomousDatabaseManagementFeatureResponse") + } + return +} + +// enableAutonomousDatabaseManagementFeature implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) enableAutonomousDatabaseManagementFeature(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/enableDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response EnableAutonomousDatabaseManagementFeatureResponse + 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/ManagedDatabase/EnableAutonomousDatabaseManagementFeature" + err = common.PostProcessServiceError(err, "DbManagement", "EnableAutonomousDatabaseManagementFeature", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // EnableDatabaseManagementFeature Enables a Database Management feature for the specified cloud database. // // # See also @@ -9587,6 +9713,69 @@ func (client DbManagementClient) loadSqlPlanBaselinesFromCursorCache(ctx context return response, err } +// ModifyAutonomousDatabaseManagementFeature Modifies the Database Management feature for the specified Autonomous Database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ModifyAutonomousDatabaseManagementFeature.go.html to see an example of how to use ModifyAutonomousDatabaseManagementFeature API. +// A default retry strategy applies to this operation ModifyAutonomousDatabaseManagementFeature() +func (client DbManagementClient) ModifyAutonomousDatabaseManagementFeature(ctx context.Context, request ModifyAutonomousDatabaseManagementFeatureRequest) (response ModifyAutonomousDatabaseManagementFeatureResponse, 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.modifyAutonomousDatabaseManagementFeature, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ModifyAutonomousDatabaseManagementFeatureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ModifyAutonomousDatabaseManagementFeatureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ModifyAutonomousDatabaseManagementFeatureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ModifyAutonomousDatabaseManagementFeatureResponse") + } + return +} + +// modifyAutonomousDatabaseManagementFeature implements the OCIOperation interface (enables retrying operations) +func (client DbManagementClient) modifyAutonomousDatabaseManagementFeature(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/{autonomousDatabaseId}/actions/modifyDatabaseManagement", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ModifyAutonomousDatabaseManagementFeatureResponse + 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/ManagedDatabase/ModifyAutonomousDatabaseManagementFeature" + err = common.PostProcessServiceError(err, "DbManagement", "ModifyAutonomousDatabaseManagementFeature", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ModifyDatabaseManagementFeature Modifies a Database Management feature for the specified Oracle cloud database. // // # See also diff --git a/databasemanagement/db_management_private_endpoint.go b/databasemanagement/db_management_private_endpoint.go index 79afb74679..af97380f69 100644 --- a/databasemanagement/db_management_private_endpoint.go +++ b/databasemanagement/db_management_private_endpoint.go @@ -38,6 +38,9 @@ type DbManagementPrivateEndpoint struct { // Specifies whether the Database Management private endpoint can be used for Oracle Databases in a cluster. IsCluster *bool `mandatory:"false" json:"isCluster"` + // Specifies whether the Database Management private endpoint has DNS proxy server enabled to resolve private host name. + IsDnsResolutionEnabled *bool `mandatory:"false" json:"isDnsResolutionEnabled"` + // The IP addresses assigned to the Database Management private endpoint. PrivateIp *string `mandatory:"false" json:"privateIp"` diff --git a/databasemanagement/direct_connector_details.go b/databasemanagement/direct_connector_details.go new file mode 100644 index 0000000000..5830405d2c --- /dev/null +++ b/databasemanagement/direct_connector_details.go @@ -0,0 +1,53 @@ +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DirectConnectorDetails The connector details required to connect to an Autonomous Database. +type DirectConnectorDetails struct { +} + +func (m DirectConnectorDetails) 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 DirectConnectorDetails) 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 DirectConnectorDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDirectConnectorDetails DirectConnectorDetails + s := struct { + DiscriminatorParam string `json:"connectorType"` + MarshalTypeDirectConnectorDetails + }{ + "DIRECT", + (MarshalTypeDirectConnectorDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/databasemanagement/disable_autonomous_database_management_feature_details.go b/databasemanagement/disable_autonomous_database_management_feature_details.go new file mode 100644 index 0000000000..30021fb18e --- /dev/null +++ b/databasemanagement/disable_autonomous_database_management_feature_details.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" +) + +// DisableAutonomousDatabaseManagementFeatureDetails The details required to disable a Database Management feature for an Autonomous Database. +type DisableAutonomousDatabaseManagementFeatureDetails struct { + + // The name of the Database Management feature. + Feature DbManagementFeatureEnum `mandatory:"true" json:"feature"` +} + +func (m DisableAutonomousDatabaseManagementFeatureDetails) 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 DisableAutonomousDatabaseManagementFeatureDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDbManagementFeatureEnum(string(m.Feature)); !ok && m.Feature != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Feature: %s. Supported values are: %s.", m.Feature, strings.Join(GetDbManagementFeatureEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/databasemanagement/disable_autonomous_database_management_feature_request_response.go b/databasemanagement/disable_autonomous_database_management_feature_request_response.go new file mode 100644 index 0000000000..9dd0f96951 --- /dev/null +++ b/databasemanagement/disable_autonomous_database_management_feature_request_response.go @@ -0,0 +1,107 @@ +// 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" +) + +// DisableAutonomousDatabaseManagementFeatureRequest wrapper for the DisableAutonomousDatabaseManagementFeature operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/DisableAutonomousDatabaseManagementFeature.go.html to see an example of how to use DisableAutonomousDatabaseManagementFeatureRequest. +type DisableAutonomousDatabaseManagementFeatureRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database. + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // The details required to disable a Database Management feature for an Autonomous Database. + DisableAutonomousDatabaseManagementFeatureDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // 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 DisableAutonomousDatabaseManagementFeatureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DisableAutonomousDatabaseManagementFeatureRequest) 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 DisableAutonomousDatabaseManagementFeatureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DisableAutonomousDatabaseManagementFeatureRequest) 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 DisableAutonomousDatabaseManagementFeatureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DisableAutonomousDatabaseManagementFeatureResponse wrapper for the DisableAutonomousDatabaseManagementFeature operation +type DisableAutonomousDatabaseManagementFeatureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DisableAutonomousDatabaseManagementFeatureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DisableAutonomousDatabaseManagementFeatureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/enable_autonomous_database_management_feature_details.go b/databasemanagement/enable_autonomous_database_management_feature_details.go new file mode 100644 index 0000000000..770016108e --- /dev/null +++ b/databasemanagement/enable_autonomous_database_management_feature_details.go @@ -0,0 +1,64 @@ +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EnableAutonomousDatabaseManagementFeatureDetails The details required to enable a Database Management feature for an Autonomous Database. +type EnableAutonomousDatabaseManagementFeatureDetails struct { + FeatureDetails AutonomousDatabaseFeatureDetails `mandatory:"true" json:"featureDetails"` +} + +func (m EnableAutonomousDatabaseManagementFeatureDetails) 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 EnableAutonomousDatabaseManagementFeatureDetails) 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 *EnableAutonomousDatabaseManagementFeatureDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + FeatureDetails autonomousdatabasefeaturedetails `json:"featureDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.FeatureDetails.UnmarshalPolymorphicJSON(model.FeatureDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.FeatureDetails = nn.(AutonomousDatabaseFeatureDetails) + } else { + m.FeatureDetails = nil + } + + return +} diff --git a/databasemanagement/enable_autonomous_database_management_feature_request_response.go b/databasemanagement/enable_autonomous_database_management_feature_request_response.go new file mode 100644 index 0000000000..c884e75cba --- /dev/null +++ b/databasemanagement/enable_autonomous_database_management_feature_request_response.go @@ -0,0 +1,107 @@ +// 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" +) + +// EnableAutonomousDatabaseManagementFeatureRequest wrapper for the EnableAutonomousDatabaseManagementFeature operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/EnableAutonomousDatabaseManagementFeature.go.html to see an example of how to use EnableAutonomousDatabaseManagementFeatureRequest. +type EnableAutonomousDatabaseManagementFeatureRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database. + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // The details required to enable a Database Management feature for an Autonomous Database. + EnableAutonomousDatabaseManagementFeatureDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // 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 EnableAutonomousDatabaseManagementFeatureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request EnableAutonomousDatabaseManagementFeatureRequest) 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 EnableAutonomousDatabaseManagementFeatureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request EnableAutonomousDatabaseManagementFeatureRequest) 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 EnableAutonomousDatabaseManagementFeatureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EnableAutonomousDatabaseManagementFeatureResponse wrapper for the EnableAutonomousDatabaseManagementFeature operation +type EnableAutonomousDatabaseManagementFeatureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response EnableAutonomousDatabaseManagementFeatureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response EnableAutonomousDatabaseManagementFeatureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/list_db_management_private_endpoints_request_response.go b/databasemanagement/list_db_management_private_endpoints_request_response.go index d22b369cd0..1f5a01edf2 100644 --- a/databasemanagement/list_db_management_private_endpoints_request_response.go +++ b/databasemanagement/list_db_management_private_endpoints_request_response.go @@ -30,6 +30,10 @@ type ListDbManagementPrivateEndpointsRequest struct { // The option to filter Database Management private endpoints that can used for Oracle Databases in a cluster. This should be used along with the vcnId query parameter. IsCluster *bool `mandatory:"false" contributesTo:"query" name:"isCluster"` + // The option to filter Database Management private endpoints which are endbled with DNS proxy server. This should be used along with the vcnId query parameter. + // Only one of this parameter and IsClusterDbManagementPrivateEndpointQueryParam should be set to true at one time. + IsDnsResolutionEnabled *bool `mandatory:"false" contributesTo:"query" name:"isDnsResolutionEnabled"` + // The lifecycle state of a resource. LifecycleState ListDbManagementPrivateEndpointsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` diff --git a/databasemanagement/modify_autonomous_database_management_feature_details.go b/databasemanagement/modify_autonomous_database_management_feature_details.go new file mode 100644 index 0000000000..bba9072294 --- /dev/null +++ b/databasemanagement/modify_autonomous_database_management_feature_details.go @@ -0,0 +1,64 @@ +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModifyAutonomousDatabaseManagementFeatureDetails The details required to modify a Database Management feature for an Autonomous Database. +type ModifyAutonomousDatabaseManagementFeatureDetails struct { + FeatureDetails AutonomousDatabaseFeatureDetails `mandatory:"true" json:"featureDetails"` +} + +func (m ModifyAutonomousDatabaseManagementFeatureDetails) 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 ModifyAutonomousDatabaseManagementFeatureDetails) 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 *ModifyAutonomousDatabaseManagementFeatureDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + FeatureDetails autonomousdatabasefeaturedetails `json:"featureDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.FeatureDetails.UnmarshalPolymorphicJSON(model.FeatureDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.FeatureDetails = nn.(AutonomousDatabaseFeatureDetails) + } else { + m.FeatureDetails = nil + } + + return +} diff --git a/databasemanagement/modify_autonomous_database_management_feature_request_response.go b/databasemanagement/modify_autonomous_database_management_feature_request_response.go new file mode 100644 index 0000000000..4dc7838262 --- /dev/null +++ b/databasemanagement/modify_autonomous_database_management_feature_request_response.go @@ -0,0 +1,107 @@ +// 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" +) + +// ModifyAutonomousDatabaseManagementFeatureRequest wrapper for the ModifyAutonomousDatabaseManagementFeature operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/databasemanagement/ModifyAutonomousDatabaseManagementFeature.go.html to see an example of how to use ModifyAutonomousDatabaseManagementFeatureRequest. +type ModifyAutonomousDatabaseManagementFeatureRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Autonomous Database. + AutonomousDatabaseId *string `mandatory:"true" contributesTo:"path" name:"autonomousDatabaseId"` + + // The details required to modify a Database Management feature for an Autonomous Database. + ModifyAutonomousDatabaseManagementFeatureDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // 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 ModifyAutonomousDatabaseManagementFeatureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ModifyAutonomousDatabaseManagementFeatureRequest) 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 ModifyAutonomousDatabaseManagementFeatureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ModifyAutonomousDatabaseManagementFeatureRequest) 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 ModifyAutonomousDatabaseManagementFeatureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ModifyAutonomousDatabaseManagementFeatureResponse wrapper for the ModifyAutonomousDatabaseManagementFeature operation +type ModifyAutonomousDatabaseManagementFeatureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response ModifyAutonomousDatabaseManagementFeatureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ModifyAutonomousDatabaseManagementFeatureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/databasemanagement/optimizer_statistics_collection_operation.go b/databasemanagement/optimizer_statistics_collection_operation.go index 52e58222fe..0352137b65 100644 --- a/databasemanagement/optimizer_statistics_collection_operation.go +++ b/databasemanagement/optimizer_statistics_collection_operation.go @@ -94,6 +94,7 @@ const ( OptimizerStatisticsCollectionOperationStatusCompleted OptimizerStatisticsCollectionOperationStatusEnum = "COMPLETED" OptimizerStatisticsCollectionOperationStatusFailed OptimizerStatisticsCollectionOperationStatusEnum = "FAILED" OptimizerStatisticsCollectionOperationStatusTimedOut OptimizerStatisticsCollectionOperationStatusEnum = "TIMED_OUT" + OptimizerStatisticsCollectionOperationStatusUnknown OptimizerStatisticsCollectionOperationStatusEnum = "UNKNOWN" ) var mappingOptimizerStatisticsCollectionOperationStatusEnum = map[string]OptimizerStatisticsCollectionOperationStatusEnum{ @@ -101,6 +102,7 @@ var mappingOptimizerStatisticsCollectionOperationStatusEnum = map[string]Optimiz "COMPLETED": OptimizerStatisticsCollectionOperationStatusCompleted, "FAILED": OptimizerStatisticsCollectionOperationStatusFailed, "TIMED_OUT": OptimizerStatisticsCollectionOperationStatusTimedOut, + "UNKNOWN": OptimizerStatisticsCollectionOperationStatusUnknown, } var mappingOptimizerStatisticsCollectionOperationStatusEnumLowerCase = map[string]OptimizerStatisticsCollectionOperationStatusEnum{ @@ -108,6 +110,7 @@ var mappingOptimizerStatisticsCollectionOperationStatusEnumLowerCase = map[strin "completed": OptimizerStatisticsCollectionOperationStatusCompleted, "failed": OptimizerStatisticsCollectionOperationStatusFailed, "timed_out": OptimizerStatisticsCollectionOperationStatusTimedOut, + "unknown": OptimizerStatisticsCollectionOperationStatusUnknown, } // GetOptimizerStatisticsCollectionOperationStatusEnumValues Enumerates the set of values for OptimizerStatisticsCollectionOperationStatusEnum @@ -126,6 +129,7 @@ func GetOptimizerStatisticsCollectionOperationStatusEnumStringValues() []string "COMPLETED", "FAILED", "TIMED_OUT", + "UNKNOWN", } } diff --git a/databasemanagement/optimizer_statistics_collection_operation_summary.go b/databasemanagement/optimizer_statistics_collection_operation_summary.go index 4a6d5f3391..2cc1b7879d 100644 --- a/databasemanagement/optimizer_statistics_collection_operation_summary.go +++ b/databasemanagement/optimizer_statistics_collection_operation_summary.go @@ -89,6 +89,7 @@ const ( OptimizerStatisticsCollectionOperationSummaryStatusCompleted OptimizerStatisticsCollectionOperationSummaryStatusEnum = "COMPLETED" OptimizerStatisticsCollectionOperationSummaryStatusFailed OptimizerStatisticsCollectionOperationSummaryStatusEnum = "FAILED" OptimizerStatisticsCollectionOperationSummaryStatusTimedOut OptimizerStatisticsCollectionOperationSummaryStatusEnum = "TIMED_OUT" + OptimizerStatisticsCollectionOperationSummaryStatusUnknown OptimizerStatisticsCollectionOperationSummaryStatusEnum = "UNKNOWN" ) var mappingOptimizerStatisticsCollectionOperationSummaryStatusEnum = map[string]OptimizerStatisticsCollectionOperationSummaryStatusEnum{ @@ -96,6 +97,7 @@ var mappingOptimizerStatisticsCollectionOperationSummaryStatusEnum = map[string] "COMPLETED": OptimizerStatisticsCollectionOperationSummaryStatusCompleted, "FAILED": OptimizerStatisticsCollectionOperationSummaryStatusFailed, "TIMED_OUT": OptimizerStatisticsCollectionOperationSummaryStatusTimedOut, + "UNKNOWN": OptimizerStatisticsCollectionOperationSummaryStatusUnknown, } var mappingOptimizerStatisticsCollectionOperationSummaryStatusEnumLowerCase = map[string]OptimizerStatisticsCollectionOperationSummaryStatusEnum{ @@ -103,6 +105,7 @@ var mappingOptimizerStatisticsCollectionOperationSummaryStatusEnumLowerCase = ma "completed": OptimizerStatisticsCollectionOperationSummaryStatusCompleted, "failed": OptimizerStatisticsCollectionOperationSummaryStatusFailed, "timed_out": OptimizerStatisticsCollectionOperationSummaryStatusTimedOut, + "unknown": OptimizerStatisticsCollectionOperationSummaryStatusUnknown, } // GetOptimizerStatisticsCollectionOperationSummaryStatusEnumValues Enumerates the set of values for OptimizerStatisticsCollectionOperationSummaryStatusEnum @@ -121,6 +124,7 @@ func GetOptimizerStatisticsCollectionOperationSummaryStatusEnumStringValues() [] "COMPLETED", "FAILED", "TIMED_OUT", + "UNKNOWN", } } diff --git a/delegateaccesscontrol/action_type.go b/delegateaccesscontrol/action_type.go new file mode 100644 index 0000000000..b00712cd76 --- /dev/null +++ b/delegateaccesscontrol/action_type.go @@ -0,0 +1,76 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeCreated ActionTypeEnum = "CREATED" + ActionTypeUpdated ActionTypeEnum = "UPDATED" + ActionTypeDeleted ActionTypeEnum = "DELETED" + ActionTypeInProgress ActionTypeEnum = "IN_PROGRESS" + ActionTypeRelated ActionTypeEnum = "RELATED" + ActionTypeFailed ActionTypeEnum = "FAILED" +) + +var mappingActionTypeEnum = map[string]ActionTypeEnum{ + "CREATED": ActionTypeCreated, + "UPDATED": ActionTypeUpdated, + "DELETED": ActionTypeDeleted, + "IN_PROGRESS": ActionTypeInProgress, + "RELATED": ActionTypeRelated, + "FAILED": ActionTypeFailed, +} + +var mappingActionTypeEnumLowerCase = map[string]ActionTypeEnum{ + "created": ActionTypeCreated, + "updated": ActionTypeUpdated, + "deleted": ActionTypeDeleted, + "in_progress": ActionTypeInProgress, + "related": ActionTypeRelated, + "failed": ActionTypeFailed, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionTypeEnumStringValues Enumerates the set of values in String for ActionTypeEnum +func GetActionTypeEnumStringValues() []string { + return []string{ + "CREATED", + "UPDATED", + "DELETED", + "IN_PROGRESS", + "RELATED", + "FAILED", + } +} + +// GetMappingActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionTypeEnum(val string) (ActionTypeEnum, bool) { + enum, ok := mappingActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/approve_delegated_resource_access_request_details.go b/delegateaccesscontrol/approve_delegated_resource_access_request_details.go new file mode 100644 index 0000000000..69871299a1 --- /dev/null +++ b/delegateaccesscontrol/approve_delegated_resource_access_request_details.go @@ -0,0 +1,49 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApproveDelegatedResourceAccessRequestDetails Details of the Delegated Resource Access Request approval. +type ApproveDelegatedResourceAccessRequestDetails struct { + + // Comment by the approver during approval. + ApproverComment *string `mandatory:"false" json:"approverComment"` + + // Message that needs to be displayed to the operator. + AdditionalMessage *string `mandatory:"false" json:"additionalMessage"` + + // Access start time that is actually approved by the customer in RFC 3339 (https://tools.ietf.org/html/rfc3339)timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeApprovedForAccess *common.SDKTime `mandatory:"false" json:"timeApprovedForAccess"` +} + +func (m ApproveDelegatedResourceAccessRequestDetails) 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 ApproveDelegatedResourceAccessRequestDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/approve_delegated_resource_access_request_request_response.go b/delegateaccesscontrol/approve_delegated_resource_access_request_request_response.go new file mode 100644 index 0000000000..6154d6818a --- /dev/null +++ b/delegateaccesscontrol/approve_delegated_resource_access_request_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ApproveDelegatedResourceAccessRequestRequest wrapper for the ApproveDelegatedResourceAccessRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ApproveDelegatedResourceAccessRequest.go.html to see an example of how to use ApproveDelegatedResourceAccessRequestRequest. +type ApproveDelegatedResourceAccessRequestRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // Details regarding the approval of a Delegated Resource Access Request created by the support operator. + ApproveDelegatedResourceAccessRequestDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ApproveDelegatedResourceAccessRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ApproveDelegatedResourceAccessRequestRequest) 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 ApproveDelegatedResourceAccessRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ApproveDelegatedResourceAccessRequestRequest) 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 ApproveDelegatedResourceAccessRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ApproveDelegatedResourceAccessRequestResponse wrapper for the ApproveDelegatedResourceAccessRequest operation +type ApproveDelegatedResourceAccessRequestResponse 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 ApproveDelegatedResourceAccessRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ApproveDelegatedResourceAccessRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/audit_report_status.go b/delegateaccesscontrol/audit_report_status.go new file mode 100644 index 0000000000..6d409ac18d --- /dev/null +++ b/delegateaccesscontrol/audit_report_status.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// AuditReportStatusEnum Enum with underlying type: string +type AuditReportStatusEnum string + +// Set of constants representing the allowable values for AuditReportStatusEnum +const ( + AuditReportStatusNotavailable AuditReportStatusEnum = "NOTAVAILABLE" + AuditReportStatusAvailable AuditReportStatusEnum = "AVAILABLE" + AuditReportStatusExpired AuditReportStatusEnum = "EXPIRED" + AuditReportStatusFailed AuditReportStatusEnum = "FAILED" +) + +var mappingAuditReportStatusEnum = map[string]AuditReportStatusEnum{ + "NOTAVAILABLE": AuditReportStatusNotavailable, + "AVAILABLE": AuditReportStatusAvailable, + "EXPIRED": AuditReportStatusExpired, + "FAILED": AuditReportStatusFailed, +} + +var mappingAuditReportStatusEnumLowerCase = map[string]AuditReportStatusEnum{ + "notavailable": AuditReportStatusNotavailable, + "available": AuditReportStatusAvailable, + "expired": AuditReportStatusExpired, + "failed": AuditReportStatusFailed, +} + +// GetAuditReportStatusEnumValues Enumerates the set of values for AuditReportStatusEnum +func GetAuditReportStatusEnumValues() []AuditReportStatusEnum { + values := make([]AuditReportStatusEnum, 0) + for _, v := range mappingAuditReportStatusEnum { + values = append(values, v) + } + return values +} + +// GetAuditReportStatusEnumStringValues Enumerates the set of values in String for AuditReportStatusEnum +func GetAuditReportStatusEnumStringValues() []string { + return []string{ + "NOTAVAILABLE", + "AVAILABLE", + "EXPIRED", + "FAILED", + } +} + +// GetMappingAuditReportStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAuditReportStatusEnum(val string) (AuditReportStatusEnum, bool) { + enum, ok := mappingAuditReportStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/change_delegation_control_compartment_details.go b/delegateaccesscontrol/change_delegation_control_compartment_details.go new file mode 100644 index 0000000000..c8e13bb166 --- /dev/null +++ b/delegateaccesscontrol/change_delegation_control_compartment_details.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeDelegationControlCompartmentDetails Details of the new compartment to contain the Delegation Control. +type ChangeDelegationControlCompartmentDetails struct { + + // The OCID of the new compartment to contain the Delegation Control. + CompartmentId *string `mandatory:"false" json:"compartmentId"` +} + +func (m ChangeDelegationControlCompartmentDetails) 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 ChangeDelegationControlCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/change_delegation_control_compartment_request_response.go b/delegateaccesscontrol/change_delegation_control_compartment_request_response.go new file mode 100644 index 0000000000..2ca5db4883 --- /dev/null +++ b/delegateaccesscontrol/change_delegation_control_compartment_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeDelegationControlCompartmentRequest wrapper for the ChangeDelegationControlCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ChangeDelegationControlCompartment.go.html to see an example of how to use ChangeDelegationControlCompartmentRequest. +type ChangeDelegationControlCompartmentRequest struct { + + // unique Delegation Control identifier + DelegationControlId *string `mandatory:"true" contributesTo:"path" name:"delegationControlId"` + + // Moves the Delegation Control resource into a different compartment. + ChangeDelegationControlCompartmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeDelegationControlCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeDelegationControlCompartmentRequest) 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 ChangeDelegationControlCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeDelegationControlCompartmentRequest) 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 ChangeDelegationControlCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeDelegationControlCompartmentResponse wrapper for the ChangeDelegationControlCompartment operation +type ChangeDelegationControlCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // 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"` +} + +func (response ChangeDelegationControlCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeDelegationControlCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/change_delegation_subscription_compartment_details.go b/delegateaccesscontrol/change_delegation_subscription_compartment_details.go new file mode 100644 index 0000000000..37c1273925 --- /dev/null +++ b/delegateaccesscontrol/change_delegation_subscription_compartment_details.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeDelegationSubscriptionCompartmentDetails Details of the new compartment to contain the Delegation Subscription. +type ChangeDelegationSubscriptionCompartmentDetails struct { + + // The OCID of the new compartment to contain the Delegation Subscription. + CompartmentId *string `mandatory:"false" json:"compartmentId"` +} + +func (m ChangeDelegationSubscriptionCompartmentDetails) 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 ChangeDelegationSubscriptionCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/change_delegation_subscription_compartment_request_response.go b/delegateaccesscontrol/change_delegation_subscription_compartment_request_response.go new file mode 100644 index 0000000000..64e5d313f7 --- /dev/null +++ b/delegateaccesscontrol/change_delegation_subscription_compartment_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeDelegationSubscriptionCompartmentRequest wrapper for the ChangeDelegationSubscriptionCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ChangeDelegationSubscriptionCompartment.go.html to see an example of how to use ChangeDelegationSubscriptionCompartmentRequest. +type ChangeDelegationSubscriptionCompartmentRequest struct { + + // unique Delegation Subscription identifier + DelegationSubscriptionId *string `mandatory:"true" contributesTo:"path" name:"delegationSubscriptionId"` + + // Moves the Delegation Subscription resource into a different compartment. + ChangeDelegationSubscriptionCompartmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeDelegationSubscriptionCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeDelegationSubscriptionCompartmentRequest) 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 ChangeDelegationSubscriptionCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeDelegationSubscriptionCompartmentRequest) 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 ChangeDelegationSubscriptionCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeDelegationSubscriptionCompartmentResponse wrapper for the ChangeDelegationSubscriptionCompartment operation +type ChangeDelegationSubscriptionCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // 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"` +} + +func (response ChangeDelegationSubscriptionCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeDelegationSubscriptionCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/create_delegation_control_details.go b/delegateaccesscontrol/create_delegation_control_details.go new file mode 100644 index 0000000000..aedfe0b5da --- /dev/null +++ b/delegateaccesscontrol/create_delegation_control_details.go @@ -0,0 +1,98 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDelegationControlDetails While creating the Delegation Control, specify how Service Provider Actions are approved and the users who have the privilege of approving the Service Provider Actions associated with the Delegation Control. +// You must specify which Service Provider Actions must be pre-approved. The rest of the Service Provider Actions associated with the Delegation Control will require an explicit approval from the users selected either through the approver groups or individually. +// You must name your Delegation Control appropriately so it reflects the resources that will be governed by the Delegation Control. Neither the Delegation Controls nor their assignments to resources are visible to the support operators. +type CreateDelegationControlDetails struct { + + // The OCID of the compartment that contains this Delegation Control. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Name of the Delegation Control. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // List of Delegation Subscription OCID that are allowed for this Delegation Control. The allowed subscriptions will determine the available Service Provider Actions. Only support operators for the allowed subscriptions are allowed to create Delegated Resource Access Request. + DelegationSubscriptionIds []string `mandatory:"true" json:"delegationSubscriptionIds"` + + // The OCID of the selected resources that this Delegation Control is applicable to. + ResourceIds []string `mandatory:"true" json:"resourceIds"` + + // Resource type for which the Delegation Control is applicable to. + ResourceType DelegationControlResourceTypeEnum `mandatory:"true" json:"resourceType"` + + // The OCID of the OCI Notification topic to publish messages related to this Delegation Control. + NotificationTopicId *string `mandatory:"true" json:"notificationTopicId"` + + // The format of the OCI Notification messages for this Delegation Control. + NotificationMessageFormat DelegationControlNotificationMessageFormatEnum `mandatory:"true" json:"notificationMessageFormat"` + + // Description of the Delegation Control. + Description *string `mandatory:"false" json:"description"` + + // number of approvals required. + NumApprovalsRequired *int `mandatory:"false" json:"numApprovalsRequired"` + + // List of pre-approved Service Provider Action names. The list of pre-defined Service Provider Actions can be obtained from the ListServiceProviderActions API. Delegated Resource Access Requests associated with a resource governed by this Delegation Control will be + // automatically approved if the Delegated Resource Access Request only contain Service Provider Actions in the pre-approved list. + PreApprovedServiceProviderActionNames []string `mandatory:"false" json:"preApprovedServiceProviderActionNames"` + + // Set to true to allow all Delegated Resource Access Request to be approved automatically during maintenance. + IsAutoApproveDuringMaintenance *bool `mandatory:"false" json:"isAutoApproveDuringMaintenance"` + + // The OCID of the OCI Vault that will store the secrets containing the SSH keys to access the resource governed by this Delegation Control by Delegate Access Control Service. This property is required when resourceType is CLOUDVMCLUSTER. Delegate Access Control Service will generate the SSH keys and store them as secrets in the OCI Vault. + VaultId *string `mandatory:"false" json:"vaultId"` + + // The OCID of the Master Encryption Key in the OCI Vault specified by vaultId. This key will be used to encrypt the SSH keys to access the resource governed by this Delegation Control by Delegate Access Control Service. This property is required when resourceType is CLOUDVMCLUSTER. + VaultKeyId *string `mandatory:"false" json:"vaultKeyId"` + + // 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 CreateDelegationControlDetails) 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 CreateDelegationControlDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDelegationControlResourceTypeEnum(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(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegationControlNotificationMessageFormatEnum(string(m.NotificationMessageFormat)); !ok && m.NotificationMessageFormat != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NotificationMessageFormat: %s. Supported values are: %s.", m.NotificationMessageFormat, strings.Join(GetDelegationControlNotificationMessageFormatEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/create_delegation_control_request_response.go b/delegateaccesscontrol/create_delegation_control_request_response.go new file mode 100644 index 0000000000..ae747bb344 --- /dev/null +++ b/delegateaccesscontrol/create_delegation_control_request_response.go @@ -0,0 +1,110 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDelegationControlRequest wrapper for the CreateDelegationControl operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/CreateDelegationControl.go.html to see an example of how to use CreateDelegationControlRequest. +type CreateDelegationControlRequest struct { + + // Details for the new Delegation Control. + CreateDelegationControlDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateDelegationControlRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDelegationControlRequest) 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 CreateDelegationControlRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDelegationControlRequest) 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 CreateDelegationControlRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDelegationControlResponse wrapper for the CreateDelegationControl operation +type CreateDelegationControlResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegationControl instance + DelegationControl `presentIn:"body"` + + // 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"` + + // URI of the resource + Location *string `presentIn:"header" name:"location"` + + // URI of the resource + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateDelegationControlResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDelegationControlResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/create_delegation_subscription_details.go b/delegateaccesscontrol/create_delegation_subscription_details.go new file mode 100644 index 0000000000..79b48d3e06 --- /dev/null +++ b/delegateaccesscontrol/create_delegation_subscription_details.go @@ -0,0 +1,65 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDelegationSubscriptionDetails Details for creating the Delegation Subscription. +type CreateDelegationSubscriptionDetails struct { + + // The OCID of the compartment that contains the Delegation Control. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Unique identifier of the Service Provider. + ServiceProviderId *string `mandatory:"true" json:"serviceProviderId"` + + // Subscribed Service Provider Service Type. + SubscribedServiceType ServiceProviderServiceTypeEnum `mandatory:"true" json:"subscribedServiceType"` + + // Description of the Delegation Subscription. + Description *string `mandatory:"false" json:"description"` + + // 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 CreateDelegationSubscriptionDetails) 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 CreateDelegationSubscriptionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(m.SubscribedServiceType)); !ok && m.SubscribedServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscribedServiceType: %s. Supported values are: %s.", m.SubscribedServiceType, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/create_delegation_subscription_request_response.go b/delegateaccesscontrol/create_delegation_subscription_request_response.go new file mode 100644 index 0000000000..22f761684f --- /dev/null +++ b/delegateaccesscontrol/create_delegation_subscription_request_response.go @@ -0,0 +1,110 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDelegationSubscriptionRequest wrapper for the CreateDelegationSubscription operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/CreateDelegationSubscription.go.html to see an example of how to use CreateDelegationSubscriptionRequest. +type CreateDelegationSubscriptionRequest struct { + + // Details for creating Delegation Subscription in Delegation Control. + CreateDelegationSubscriptionDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateDelegationSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDelegationSubscriptionRequest) 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 CreateDelegationSubscriptionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDelegationSubscriptionRequest) 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 CreateDelegationSubscriptionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDelegationSubscriptionResponse wrapper for the CreateDelegationSubscription operation +type CreateDelegationSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegationSubscription instance + DelegationSubscription `presentIn:"body"` + + // 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"` + + // URI of the resource + Location *string `presentIn:"header" name:"location"` + + // URI of the resource + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateDelegationSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDelegationSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/delegateaccesscontrol_client.go b/delegateaccesscontrol/delegateaccesscontrol_client.go new file mode 100644 index 0000000000..440b03e0e1 --- /dev/null +++ b/delegateaccesscontrol/delegateaccesscontrol_client.go @@ -0,0 +1,1648 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// DelegateAccessControlClient a client for DelegateAccessControl +type DelegateAccessControlClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewDelegateAccessControlClientWithConfigurationProvider Creates a new default DelegateAccessControl client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewDelegateAccessControlClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client DelegateAccessControlClient, err error) { + if enabled := common.CheckForEnabledServices("delegateaccesscontrol"); !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 newDelegateAccessControlClientFromBaseClient(baseClient, provider) +} + +// NewDelegateAccessControlClientWithOboToken Creates a new default DelegateAccessControl 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 NewDelegateAccessControlClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client DelegateAccessControlClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newDelegateAccessControlClientFromBaseClient(baseClient, configProvider) +} + +func newDelegateAccessControlClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client DelegateAccessControlClient, err error) { + // DelegateAccessControl service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("DelegateAccessControl")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = DelegateAccessControlClient{BaseClient: baseClient} + client.BasePath = "20230801" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *DelegateAccessControlClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("delegateaccesscontrol", "https://delegate-access-control.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *DelegateAccessControlClient) 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 *DelegateAccessControlClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ApproveDelegatedResourceAccessRequest Approves a Delegated Resource Access Request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ApproveDelegatedResourceAccessRequest.go.html to see an example of how to use ApproveDelegatedResourceAccessRequest API. +// A default retry strategy applies to this operation ApproveDelegatedResourceAccessRequest() +func (client DelegateAccessControlClient) ApproveDelegatedResourceAccessRequest(ctx context.Context, request ApproveDelegatedResourceAccessRequestRequest) (response ApproveDelegatedResourceAccessRequestResponse, 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.approveDelegatedResourceAccessRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ApproveDelegatedResourceAccessRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ApproveDelegatedResourceAccessRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ApproveDelegatedResourceAccessRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ApproveDelegatedResourceAccessRequestResponse") + } + return +} + +// approveDelegatedResourceAccessRequest implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) approveDelegatedResourceAccessRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}/actions/approve", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ApproveDelegatedResourceAccessRequestResponse + 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, "DelegateAccessControl", "ApproveDelegatedResourceAccessRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeDelegationControlCompartment Moves the Delegation Control resource into a different compartment. When provided, 'If-Match' is checked against 'ETag' values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ChangeDelegationControlCompartment.go.html to see an example of how to use ChangeDelegationControlCompartment API. +// A default retry strategy applies to this operation ChangeDelegationControlCompartment() +func (client DelegateAccessControlClient) ChangeDelegationControlCompartment(ctx context.Context, request ChangeDelegationControlCompartmentRequest) (response ChangeDelegationControlCompartmentResponse, 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.changeDelegationControlCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeDelegationControlCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeDelegationControlCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeDelegationControlCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeDelegationControlCompartmentResponse") + } + return +} + +// changeDelegationControlCompartment implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) changeDelegationControlCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegationControls/{delegationControlId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeDelegationControlCompartmentResponse + 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, "DelegateAccessControl", "ChangeDelegationControlCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeDelegationSubscriptionCompartment Moves the Delegation Subscription resource into a different compartment. When provided, 'If-Match' is checked against 'ETag' values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ChangeDelegationSubscriptionCompartment.go.html to see an example of how to use ChangeDelegationSubscriptionCompartment API. +// A default retry strategy applies to this operation ChangeDelegationSubscriptionCompartment() +func (client DelegateAccessControlClient) ChangeDelegationSubscriptionCompartment(ctx context.Context, request ChangeDelegationSubscriptionCompartmentRequest) (response ChangeDelegationSubscriptionCompartmentResponse, 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.changeDelegationSubscriptionCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeDelegationSubscriptionCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeDelegationSubscriptionCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeDelegationSubscriptionCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeDelegationSubscriptionCompartmentResponse") + } + return +} + +// changeDelegationSubscriptionCompartment implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) changeDelegationSubscriptionCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegationSubscriptions/{delegationSubscriptionId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeDelegationSubscriptionCompartmentResponse + 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, "DelegateAccessControl", "ChangeDelegationSubscriptionCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateDelegationControl Creates a Delegation Control. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/CreateDelegationControl.go.html to see an example of how to use CreateDelegationControl API. +// A default retry strategy applies to this operation CreateDelegationControl() +func (client DelegateAccessControlClient) CreateDelegationControl(ctx context.Context, request CreateDelegationControlRequest) (response CreateDelegationControlResponse, 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.createDelegationControl, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDelegationControlResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDelegationControlResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDelegationControlResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDelegationControlResponse") + } + return +} + +// createDelegationControl implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) createDelegationControl(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegationControls", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDelegationControlResponse + 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, "DelegateAccessControl", "CreateDelegationControl", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateDelegationSubscription Creates Delegation Subscription in Delegation Control. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/CreateDelegationSubscription.go.html to see an example of how to use CreateDelegationSubscription API. +// A default retry strategy applies to this operation CreateDelegationSubscription() +func (client DelegateAccessControlClient) CreateDelegationSubscription(ctx context.Context, request CreateDelegationSubscriptionRequest) (response CreateDelegationSubscriptionResponse, 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.createDelegationSubscription, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDelegationSubscriptionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDelegationSubscriptionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDelegationSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDelegationSubscriptionResponse") + } + return +} + +// createDelegationSubscription implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) createDelegationSubscription(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegationSubscriptions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDelegationSubscriptionResponse + 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, "DelegateAccessControl", "CreateDelegationSubscription", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteDelegationControl Deletes a Delegation Control. You cannot delete a Delegation Control if it is assigned to govern any target resource currently or in the future. +// In that case, first, delete all of the current and future assignments before deleting the Delegation Control. A Delegation Control that was previously assigned to a target +// resource is marked as DELETED following a successful deletion. However, it is not completely deleted from the system. This is to ensure auditing information for the accesses +// done under the Delegation Control is preserved for future needs. The system purges the deleted Delegation Control only when all of the audit data associated with the +// Delegation Control are also deleted. Therefore, you cannot reuse the name of the deleted Delegation Control until the system purges the Delegation Control. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/DeleteDelegationControl.go.html to see an example of how to use DeleteDelegationControl API. +// A default retry strategy applies to this operation DeleteDelegationControl() +func (client DelegateAccessControlClient) DeleteDelegationControl(ctx context.Context, request DeleteDelegationControlRequest) (response DeleteDelegationControlResponse, 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.deleteDelegationControl, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDelegationControlResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDelegationControlResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDelegationControlResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDelegationControlResponse") + } + return +} + +// deleteDelegationControl implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) deleteDelegationControl(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/delegationControls/{delegationControlId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDelegationControlResponse + 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, "DelegateAccessControl", "DeleteDelegationControl", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteDelegationSubscription eletes an Delegation Subscription in Delegation Control. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/DeleteDelegationSubscription.go.html to see an example of how to use DeleteDelegationSubscription API. +// A default retry strategy applies to this operation DeleteDelegationSubscription() +func (client DelegateAccessControlClient) DeleteDelegationSubscription(ctx context.Context, request DeleteDelegationSubscriptionRequest) (response DeleteDelegationSubscriptionResponse, 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.deleteDelegationSubscription, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDelegationSubscriptionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDelegationSubscriptionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDelegationSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDelegationSubscriptionResponse") + } + return +} + +// deleteDelegationSubscription implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) deleteDelegationSubscription(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/delegationSubscriptions/{delegationSubscriptionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDelegationSubscriptionResponse + 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, "DelegateAccessControl", "DeleteDelegationSubscription", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDelegatedResourceAccessRequest Gets details of a Delegated Resource Access Request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegatedResourceAccessRequest.go.html to see an example of how to use GetDelegatedResourceAccessRequest API. +// A default retry strategy applies to this operation GetDelegatedResourceAccessRequest() +func (client DelegateAccessControlClient) GetDelegatedResourceAccessRequest(ctx context.Context, request GetDelegatedResourceAccessRequestRequest) (response GetDelegatedResourceAccessRequestResponse, 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.getDelegatedResourceAccessRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDelegatedResourceAccessRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDelegatedResourceAccessRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDelegatedResourceAccessRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDelegatedResourceAccessRequestResponse") + } + return +} + +// getDelegatedResourceAccessRequest implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) getDelegatedResourceAccessRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDelegatedResourceAccessRequestResponse + 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, "DelegateAccessControl", "GetDelegatedResourceAccessRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDelegatedResourceAccessRequestAuditLogReport Gets the audit log report for the given Delegated Resource Access Request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegatedResourceAccessRequestAuditLogReport.go.html to see an example of how to use GetDelegatedResourceAccessRequestAuditLogReport API. +// A default retry strategy applies to this operation GetDelegatedResourceAccessRequestAuditLogReport() +func (client DelegateAccessControlClient) GetDelegatedResourceAccessRequestAuditLogReport(ctx context.Context, request GetDelegatedResourceAccessRequestAuditLogReportRequest) (response GetDelegatedResourceAccessRequestAuditLogReportResponse, 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.getDelegatedResourceAccessRequestAuditLogReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDelegatedResourceAccessRequestAuditLogReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDelegatedResourceAccessRequestAuditLogReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDelegatedResourceAccessRequestAuditLogReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDelegatedResourceAccessRequestAuditLogReportResponse") + } + return +} + +// getDelegatedResourceAccessRequestAuditLogReport implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) getDelegatedResourceAccessRequestAuditLogReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}/delegatedResourceAccessRequestAuditLogReport", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDelegatedResourceAccessRequestAuditLogReportResponse + 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, "DelegateAccessControl", "GetDelegatedResourceAccessRequestAuditLogReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDelegationControl Gets the Delegation Control associated with the specified Delegation Control ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegationControl.go.html to see an example of how to use GetDelegationControl API. +// A default retry strategy applies to this operation GetDelegationControl() +func (client DelegateAccessControlClient) GetDelegationControl(ctx context.Context, request GetDelegationControlRequest) (response GetDelegationControlResponse, 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.getDelegationControl, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDelegationControlResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDelegationControlResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDelegationControlResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDelegationControlResponse") + } + return +} + +// getDelegationControl implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) getDelegationControl(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegationControls/{delegationControlId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDelegationControlResponse + 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, "DelegateAccessControl", "GetDelegationControl", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDelegationSubscription Gets a DelegationSubscription by identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegationSubscription.go.html to see an example of how to use GetDelegationSubscription API. +// A default retry strategy applies to this operation GetDelegationSubscription() +func (client DelegateAccessControlClient) GetDelegationSubscription(ctx context.Context, request GetDelegationSubscriptionRequest) (response GetDelegationSubscriptionResponse, 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.getDelegationSubscription, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDelegationSubscriptionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDelegationSubscriptionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDelegationSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDelegationSubscriptionResponse") + } + return +} + +// getDelegationSubscription implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) getDelegationSubscription(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegationSubscriptions/{delegationSubscriptionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDelegationSubscriptionResponse + 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, "DelegateAccessControl", "GetDelegationSubscription", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetServiceProvider Gets a ServiceProvider by identifier +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetServiceProvider.go.html to see an example of how to use GetServiceProvider API. +// A default retry strategy applies to this operation GetServiceProvider() +func (client DelegateAccessControlClient) GetServiceProvider(ctx context.Context, request GetServiceProviderRequest) (response GetServiceProviderResponse, 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.getServiceProvider, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetServiceProviderResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetServiceProviderResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetServiceProviderResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetServiceProviderResponse") + } + return +} + +// getServiceProvider implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) getServiceProvider(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceProviders/{serviceProviderId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetServiceProviderResponse + 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, "DelegateAccessControl", "GetServiceProvider", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetServiceProviderAction Gets the Service Provider Action associated with the specified Service Provider Action ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetServiceProviderAction.go.html to see an example of how to use GetServiceProviderAction API. +// A default retry strategy applies to this operation GetServiceProviderAction() +func (client DelegateAccessControlClient) GetServiceProviderAction(ctx context.Context, request GetServiceProviderActionRequest) (response GetServiceProviderActionResponse, 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.getServiceProviderAction, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetServiceProviderActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetServiceProviderActionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetServiceProviderActionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetServiceProviderActionResponse") + } + return +} + +// getServiceProviderAction implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) getServiceProviderAction(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceProviderActions/{serviceProviderActionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetServiceProviderActionResponse + 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, "DelegateAccessControl", "GetServiceProviderAction", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDelegatedResourceAccessRequestHistories Returns a history of all status associated with the Delegated Resource Access RequestId. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegatedResourceAccessRequestHistories.go.html to see an example of how to use ListDelegatedResourceAccessRequestHistories API. +// A default retry strategy applies to this operation ListDelegatedResourceAccessRequestHistories() +func (client DelegateAccessControlClient) ListDelegatedResourceAccessRequestHistories(ctx context.Context, request ListDelegatedResourceAccessRequestHistoriesRequest) (response ListDelegatedResourceAccessRequestHistoriesResponse, 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.listDelegatedResourceAccessRequestHistories, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDelegatedResourceAccessRequestHistoriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDelegatedResourceAccessRequestHistoriesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDelegatedResourceAccessRequestHistoriesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDelegatedResourceAccessRequestHistoriesResponse") + } + return +} + +// listDelegatedResourceAccessRequestHistories implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listDelegatedResourceAccessRequestHistories(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}/history", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDelegatedResourceAccessRequestHistoriesResponse + 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, "DelegateAccessControl", "ListDelegatedResourceAccessRequestHistories", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDelegatedResourceAccessRequests Lists all Delegated Resource Access Requests in the compartment. Note that only one of lifecycleState or requestStatus query parameter can be used. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegatedResourceAccessRequests.go.html to see an example of how to use ListDelegatedResourceAccessRequests API. +// A default retry strategy applies to this operation ListDelegatedResourceAccessRequests() +func (client DelegateAccessControlClient) ListDelegatedResourceAccessRequests(ctx context.Context, request ListDelegatedResourceAccessRequestsRequest) (response ListDelegatedResourceAccessRequestsResponse, 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.listDelegatedResourceAccessRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDelegatedResourceAccessRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDelegatedResourceAccessRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDelegatedResourceAccessRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDelegatedResourceAccessRequestsResponse") + } + return +} + +// listDelegatedResourceAccessRequests implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listDelegatedResourceAccessRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegatedResourceAccessRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDelegatedResourceAccessRequestsResponse + 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, "DelegateAccessControl", "ListDelegatedResourceAccessRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDelegationControlResources Returns a list of resources associated with the Delegation Control. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegationControlResources.go.html to see an example of how to use ListDelegationControlResources API. +// A default retry strategy applies to this operation ListDelegationControlResources() +func (client DelegateAccessControlClient) ListDelegationControlResources(ctx context.Context, request ListDelegationControlResourcesRequest) (response ListDelegationControlResourcesResponse, 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.listDelegationControlResources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDelegationControlResourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDelegationControlResourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDelegationControlResourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDelegationControlResourcesResponse") + } + return +} + +// listDelegationControlResources implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listDelegationControlResources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegationControls/{delegationControlId}/resources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDelegationControlResourcesResponse + 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, "DelegateAccessControl", "ListDelegationControlResources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDelegationControls Lists the Delegation Controls in the compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegationControls.go.html to see an example of how to use ListDelegationControls API. +// A default retry strategy applies to this operation ListDelegationControls() +func (client DelegateAccessControlClient) ListDelegationControls(ctx context.Context, request ListDelegationControlsRequest) (response ListDelegationControlsResponse, 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.listDelegationControls, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDelegationControlsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDelegationControlsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDelegationControlsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDelegationControlsResponse") + } + return +} + +// listDelegationControls implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listDelegationControls(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegationControls", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDelegationControlsResponse + 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, "DelegateAccessControl", "ListDelegationControls", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDelegationSubscriptions Lists the Delegation Subscriptions in Delegation Control. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegationSubscriptions.go.html to see an example of how to use ListDelegationSubscriptions API. +// A default retry strategy applies to this operation ListDelegationSubscriptions() +func (client DelegateAccessControlClient) ListDelegationSubscriptions(ctx context.Context, request ListDelegationSubscriptionsRequest) (response ListDelegationSubscriptionsResponse, 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.listDelegationSubscriptions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDelegationSubscriptionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDelegationSubscriptionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDelegationSubscriptionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDelegationSubscriptionsResponse") + } + return +} + +// listDelegationSubscriptions implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listDelegationSubscriptions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegationSubscriptions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDelegationSubscriptionsResponse + 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, "DelegateAccessControl", "ListDelegationSubscriptions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListServiceProviderActions Lists all the ServiceProviderActions available in the system. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListServiceProviderActions.go.html to see an example of how to use ListServiceProviderActions API. +// A default retry strategy applies to this operation ListServiceProviderActions() +func (client DelegateAccessControlClient) ListServiceProviderActions(ctx context.Context, request ListServiceProviderActionsRequest) (response ListServiceProviderActionsResponse, 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.listServiceProviderActions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListServiceProviderActionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListServiceProviderActionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListServiceProviderActionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServiceProviderActionsResponse") + } + return +} + +// listServiceProviderActions implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listServiceProviderActions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceProviderActions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListServiceProviderActionsResponse + 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, "DelegateAccessControl", "ListServiceProviderActions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListServiceProviderInteractions Lists the MoreInformation interaction between customer and support operators. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListServiceProviderInteractions.go.html to see an example of how to use ListServiceProviderInteractions API. +// A default retry strategy applies to this operation ListServiceProviderInteractions() +func (client DelegateAccessControlClient) ListServiceProviderInteractions(ctx context.Context, request ListServiceProviderInteractionsRequest) (response ListServiceProviderInteractionsResponse, 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.listServiceProviderInteractions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListServiceProviderInteractionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListServiceProviderInteractionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListServiceProviderInteractionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServiceProviderInteractionsResponse") + } + return +} + +// listServiceProviderInteractions implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listServiceProviderInteractions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}/serviceProviderInteractions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListServiceProviderInteractionsResponse + 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, "DelegateAccessControl", "ListServiceProviderInteractions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListServiceProviders Lists the Service Providers. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListServiceProviders.go.html to see an example of how to use ListServiceProviders API. +// A default retry strategy applies to this operation ListServiceProviders() +func (client DelegateAccessControlClient) ListServiceProviders(ctx context.Context, request ListServiceProvidersRequest) (response ListServiceProvidersResponse, 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.listServiceProviders, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListServiceProvidersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListServiceProvidersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListServiceProvidersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListServiceProvidersResponse") + } + return +} + +// listServiceProviders implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) listServiceProviders(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceProviders", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListServiceProvidersResponse + 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, "DelegateAccessControl", "ListServiceProviders", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RejectDelegatedResourceAccessRequest Rejects a Delegated Resource Access Request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/RejectDelegatedResourceAccessRequest.go.html to see an example of how to use RejectDelegatedResourceAccessRequest API. +// A default retry strategy applies to this operation RejectDelegatedResourceAccessRequest() +func (client DelegateAccessControlClient) RejectDelegatedResourceAccessRequest(ctx context.Context, request RejectDelegatedResourceAccessRequestRequest) (response RejectDelegatedResourceAccessRequestResponse, 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.rejectDelegatedResourceAccessRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RejectDelegatedResourceAccessRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RejectDelegatedResourceAccessRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RejectDelegatedResourceAccessRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RejectDelegatedResourceAccessRequestResponse") + } + return +} + +// rejectDelegatedResourceAccessRequest implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) rejectDelegatedResourceAccessRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}/actions/reject", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RejectDelegatedResourceAccessRequestResponse + 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, "DelegateAccessControl", "RejectDelegatedResourceAccessRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RevokeDelegatedResourceAccessRequest Revokes an already approved Delegated Resource Access Request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/RevokeDelegatedResourceAccessRequest.go.html to see an example of how to use RevokeDelegatedResourceAccessRequest API. +// A default retry strategy applies to this operation RevokeDelegatedResourceAccessRequest() +func (client DelegateAccessControlClient) RevokeDelegatedResourceAccessRequest(ctx context.Context, request RevokeDelegatedResourceAccessRequestRequest) (response RevokeDelegatedResourceAccessRequestResponse, 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.revokeDelegatedResourceAccessRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RevokeDelegatedResourceAccessRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RevokeDelegatedResourceAccessRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RevokeDelegatedResourceAccessRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RevokeDelegatedResourceAccessRequestResponse") + } + return +} + +// revokeDelegatedResourceAccessRequest implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) revokeDelegatedResourceAccessRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}/actions/revoke", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RevokeDelegatedResourceAccessRequestResponse + 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, "DelegateAccessControl", "RevokeDelegatedResourceAccessRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ServiceProviderInteractionRequest Posts query for additional information for the given Delegated Resource Access Request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ServiceProviderInteractionRequest.go.html to see an example of how to use ServiceProviderInteractionRequest API. +// A default retry strategy applies to this operation ServiceProviderInteractionRequest() +func (client DelegateAccessControlClient) ServiceProviderInteractionRequest(ctx context.Context, request ServiceProviderInteractionRequestRequest) (response ServiceProviderInteractionRequestResponse, 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.serviceProviderInteractionRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ServiceProviderInteractionRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ServiceProviderInteractionRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ServiceProviderInteractionRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ServiceProviderInteractionRequestResponse") + } + return +} + +// serviceProviderInteractionRequest implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) serviceProviderInteractionRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/delegatedResourceAccessRequests/{delegatedResourceAccessRequestId}/actions/serviceProviderInteractionRequest", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ServiceProviderInteractionRequestResponse + 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, "DelegateAccessControl", "ServiceProviderInteractionRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateDelegationControl Updates the existing DelegationControl for a given Delegation Control ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/UpdateDelegationControl.go.html to see an example of how to use UpdateDelegationControl API. +// A default retry strategy applies to this operation UpdateDelegationControl() +func (client DelegateAccessControlClient) UpdateDelegationControl(ctx context.Context, request UpdateDelegationControlRequest) (response UpdateDelegationControlResponse, 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.updateDelegationControl, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateDelegationControlResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateDelegationControlResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDelegationControlResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDelegationControlResponse") + } + return +} + +// updateDelegationControl implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) updateDelegationControl(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/delegationControls/{delegationControlId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateDelegationControlResponse + 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, "DelegateAccessControl", "UpdateDelegationControl", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateDelegationSubscription Updates the existing DelegationSubscription for a given Delegation Subscription ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/UpdateDelegationSubscription.go.html to see an example of how to use UpdateDelegationSubscription API. +// A default retry strategy applies to this operation UpdateDelegationSubscription() +func (client DelegateAccessControlClient) UpdateDelegationSubscription(ctx context.Context, request UpdateDelegationSubscriptionRequest) (response UpdateDelegationSubscriptionResponse, 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.updateDelegationSubscription, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateDelegationSubscriptionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateDelegationSubscriptionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDelegationSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDelegationSubscriptionResponse") + } + return +} + +// updateDelegationSubscription implements the OCIOperation interface (enables retrying operations) +func (client DelegateAccessControlClient) updateDelegationSubscription(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/delegationSubscriptions/{delegationSubscriptionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateDelegationSubscriptionResponse + 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, "DelegateAccessControl", "UpdateDelegationSubscription", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/delegateaccesscontrol/delegateaccesscontrol_workrequest_client.go b/delegateaccesscontrol/delegateaccesscontrol_workrequest_client.go new file mode 100644 index 0000000000..538caa06d3 --- /dev/null +++ b/delegateaccesscontrol/delegateaccesscontrol_workrequest_client.go @@ -0,0 +1,328 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// WorkRequestClient a client for WorkRequest +type WorkRequestClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewWorkRequestClientWithConfigurationProvider Creates a new default WorkRequest client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewWorkRequestClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client WorkRequestClient, err error) { + if enabled := common.CheckForEnabledServices("delegateaccesscontrol"); !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 newWorkRequestClientFromBaseClient(baseClient, provider) +} + +// NewWorkRequestClientWithOboToken Creates a new default WorkRequest 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 NewWorkRequestClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client WorkRequestClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newWorkRequestClientFromBaseClient(baseClient, configProvider) +} + +func newWorkRequestClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client WorkRequestClient, err error) { + // WorkRequest service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("WorkRequest")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = WorkRequestClient{BaseClient: baseClient} + client.BasePath = "20230801" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *WorkRequestClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("delegateaccesscontrol", "https://delegate-access-control.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *WorkRequestClient) 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 *WorkRequestClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetWorkRequest Gets details of the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client WorkRequestClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Returns a (paginated) list of errors for the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client WorkRequestClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Returns a (paginated) list of logs for the work request with the given ID. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client WorkRequestClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in a compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client WorkRequestClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client WorkRequestClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "WorkRequest", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/delegateaccesscontrol/delegated_resource_access_request.go b/delegateaccesscontrol/delegated_resource_access_request.go new file mode 100644 index 0000000000..ffa74729e3 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegatedResourceAccessRequest A support operator raises Delegated Resource Access Request when they need access to any infrastructure resource governed by Delegation Control. +// The Delegated Resource Access Request identifies the target resource and the set of Service Provider Actions. Delegated Resource Access Request handling depends upon the Delegation Control +// that governs the target resource, and the set of Service Provider Actions listed for approval in the Delegated Resource Access Request. If all of the Service Provider Actions +// listed in the Delegated Resource Access Request are in the pre-approved list in the Delegation Control that governs the target resource, then the Delegated Resource Access Request is +// automatically approved. If not, then the Delegated Resource Access Request requires explicit approval from the approver group specified by the Delegation Control governing the target resource. +// You can approve or reject a Delegated Resource Access Request. You can also revoke the approval of an already approved Delegated Resource Access Request. While creating a Delegated Resource Access Request, +// the support operator specifies the duration of access. You have the option to approve the entire duration or reduce or even increase the time duration. +// A support operator can also request for an extension. The approval for such an extension is processed the same way the original Delegated Resource Access Request was processed. +type DelegatedResourceAccessRequest struct { + + // The OCID of the Delegated Resource Access Request. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains the Delegated Resource Access Request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A short description explaining why this Delegated Resource Access Request is needed by the support operator. + ReasonForRequest *string `mandatory:"true" json:"reasonForRequest"` + + // Detailed description of this Delegated Resource Access Request. + Description *string `mandatory:"true" json:"description"` + + // The OCID of the target resource associated with the Delegated Resource Access Request. The support operator raises a Delegated Resource Access Request to get approval to + // access the target resource. + ResourceId *string `mandatory:"true" json:"resourceId"` + + // Display name. This is generated by the system automatically. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A list of ticket numbers related to this Delegated Resource Access Request, e.g. Service Request (SR) number and JIRA ticket number. + TicketNumbers []string `mandatory:"false" json:"ticketNumbers"` + + // Requested access start time in UTC. + TimeAccessRequested *common.SDKTime `mandatory:"false" json:"timeAccessRequested"` + + // The name of the target resource associated with the Delegated Resource Access Request. The support operator raises a Delegated Resource Access Request to get approval to + // access the target resource. + ResourceName *string `mandatory:"false" json:"resourceName"` + + // Resource type for which the associated Delegation Control is applicable to. + ResourceType DelegationControlResourceTypeEnum `mandatory:"false" json:"resourceType,omitempty"` + + // Requester type + RequesterType DelegatedResourceAccessRequesterTypeEnum `mandatory:"false" json:"requesterType,omitempty"` + + // List of Service Provider Action names for which approval is sought by the support operator user. The list of pre-defined Service Provider Actions can be obtained from the ListServiceProviderActions API. + RequestedActionNames []string `mandatory:"false" json:"requestedActionNames"` + + // List of Database unique names for which access is requested. This parameter is required for DLGT_MGMT_SYS_MAINT_ACCESS cage when database access in needed. + DatabaseNameList []string `mandatory:"false" json:"databaseNameList"` + + // List of Service Provider Service Types being provided by the support operator user. + ProvidedServiceTypes []ServiceProviderServiceTypeEnum `mandatory:"false" json:"providedServiceTypes,omitempty"` + + // List of Delegation Subscription OCID that are associated with this Delegated Resource Access Request based on the service types being requested. + DelegationSubscriptionIds []string `mandatory:"false" json:"delegationSubscriptionIds"` + + // Priority assigned to the Delegated Resource Access Request by the support operator + Severity DelegatedResourceAccessRequestSeverityEnum `mandatory:"false" json:"severity,omitempty"` + + // Duration in hours for which access is sought on the target resource. + DurationInHours *int `mandatory:"false" json:"durationInHours"` + + // Duration in hours for which extension access is sought on the target resource. + ExtendDurationInHours *int `mandatory:"false" json:"extendDurationInHours"` + + // Set to true if the request is approved automatically based on preApprovedServiceProviderActionNames or isAutoApproveDuringMaintenance in the associated Delegation Control. + IsAutoApproved *bool `mandatory:"false" json:"isAutoApproved"` + + // The current lifecycle state of the Delegated Resource Access Request. + LifecycleState DelegatedResourceAccessRequestLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // The current status of the Delegated Resource Access Request. + RequestStatus DelegatedResourceAccessRequestStatusEnum `mandatory:"false" json:"requestStatus,omitempty"` + + // Time when the Delegated Resource Access Request was created in RFC 3339 (https://tools.ietf.org/html/rfc3339)timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Delegated Resource Access Request was last modified in RFC 3339 (https://tools.ietf.org/html/rfc3339)timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Number of initial approvals that have been obtained so far. + NumInitialApprovals *int `mandatory:"false" json:"numInitialApprovals"` + + // Number of extension approvals that have been obtained so far. + NumExtensionApprovals *int `mandatory:"false" json:"numExtensionApprovals"` + + // In case of single approval, this will have only one item. Else, a list of approvals. + ApprovalInfo []DelegatedResourceAccessRequestApprovalDetails `mandatory:"false" json:"approvalInfo"` + + // The comment entered by the support operator while closing the request. + ClosureComment *string `mandatory:"false" json:"closureComment"` + + // The OCID of the Delegation Control governing the target resource. + DelegationControlId *string `mandatory:"false" json:"delegationControlId"` + + // Specifies the type of auditing to be enabled. There are two levels of auditing: command-level and keystroke-level. + // By default, both command-level and keystroke-level auditing are enabled, i.e. commands and key strokes issued by the support operator are logged. + AuditTypes []DelegatedResourceAccessRequestAuditTypeEnum `mandatory:"false" json:"auditTypes,omitempty"` + + // Indicates if the delegated resource access request is waiting on more information from the operator + IsPendingMoreInfo *bool `mandatory:"false" json:"isPendingMoreInfo"` + + // 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"` + + // 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 DelegatedResourceAccessRequest) 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 DelegatedResourceAccessRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegationControlResourceTypeEnum(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(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequesterTypeEnum(string(m.RequesterType)); !ok && m.RequesterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequesterType: %s. Supported values are: %s.", m.RequesterType, strings.Join(GetDelegatedResourceAccessRequesterTypeEnumStringValues(), ","))) + } + for _, val := range m.ProvidedServiceTypes { + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ProvidedServiceTypes: %s. Supported values are: %s.", val, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingDelegatedResourceAccessRequestSeverityEnum(string(m.Severity)); !ok && m.Severity != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Severity: %s. Supported values are: %s.", m.Severity, strings.Join(GetDelegatedResourceAccessRequestSeverityEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequestLifecycleStateEnum(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(GetDelegatedResourceAccessRequestLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequestStatusEnum(string(m.RequestStatus)); !ok && m.RequestStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestStatus: %s. Supported values are: %s.", m.RequestStatus, strings.Join(GetDelegatedResourceAccessRequestStatusEnumStringValues(), ","))) + } + for _, val := range m.AuditTypes { + if _, ok := GetMappingDelegatedResourceAccessRequestAuditTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AuditTypes: %s. Supported values are: %s.", val, strings.Join(GetDelegatedResourceAccessRequestAuditTypeEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DelegatedResourceAccessRequestLifecycleStateEnum Enum with underlying type: string +type DelegatedResourceAccessRequestLifecycleStateEnum string + +// Set of constants representing the allowable values for DelegatedResourceAccessRequestLifecycleStateEnum +const ( + DelegatedResourceAccessRequestLifecycleStateAccepted DelegatedResourceAccessRequestLifecycleStateEnum = "ACCEPTED" + DelegatedResourceAccessRequestLifecycleStateInProgress DelegatedResourceAccessRequestLifecycleStateEnum = "IN_PROGRESS" + DelegatedResourceAccessRequestLifecycleStateWaiting DelegatedResourceAccessRequestLifecycleStateEnum = "WAITING" + DelegatedResourceAccessRequestLifecycleStateFailed DelegatedResourceAccessRequestLifecycleStateEnum = "FAILED" + DelegatedResourceAccessRequestLifecycleStateSucceeded DelegatedResourceAccessRequestLifecycleStateEnum = "SUCCEEDED" + DelegatedResourceAccessRequestLifecycleStateCanceling DelegatedResourceAccessRequestLifecycleStateEnum = "CANCELING" + DelegatedResourceAccessRequestLifecycleStateCanceled DelegatedResourceAccessRequestLifecycleStateEnum = "CANCELED" + DelegatedResourceAccessRequestLifecycleStateNeedsAttention DelegatedResourceAccessRequestLifecycleStateEnum = "NEEDS_ATTENTION" +) + +var mappingDelegatedResourceAccessRequestLifecycleStateEnum = map[string]DelegatedResourceAccessRequestLifecycleStateEnum{ + "ACCEPTED": DelegatedResourceAccessRequestLifecycleStateAccepted, + "IN_PROGRESS": DelegatedResourceAccessRequestLifecycleStateInProgress, + "WAITING": DelegatedResourceAccessRequestLifecycleStateWaiting, + "FAILED": DelegatedResourceAccessRequestLifecycleStateFailed, + "SUCCEEDED": DelegatedResourceAccessRequestLifecycleStateSucceeded, + "CANCELING": DelegatedResourceAccessRequestLifecycleStateCanceling, + "CANCELED": DelegatedResourceAccessRequestLifecycleStateCanceled, + "NEEDS_ATTENTION": DelegatedResourceAccessRequestLifecycleStateNeedsAttention, +} + +var mappingDelegatedResourceAccessRequestLifecycleStateEnumLowerCase = map[string]DelegatedResourceAccessRequestLifecycleStateEnum{ + "accepted": DelegatedResourceAccessRequestLifecycleStateAccepted, + "in_progress": DelegatedResourceAccessRequestLifecycleStateInProgress, + "waiting": DelegatedResourceAccessRequestLifecycleStateWaiting, + "failed": DelegatedResourceAccessRequestLifecycleStateFailed, + "succeeded": DelegatedResourceAccessRequestLifecycleStateSucceeded, + "canceling": DelegatedResourceAccessRequestLifecycleStateCanceling, + "canceled": DelegatedResourceAccessRequestLifecycleStateCanceled, + "needs_attention": DelegatedResourceAccessRequestLifecycleStateNeedsAttention, +} + +// GetDelegatedResourceAccessRequestLifecycleStateEnumValues Enumerates the set of values for DelegatedResourceAccessRequestLifecycleStateEnum +func GetDelegatedResourceAccessRequestLifecycleStateEnumValues() []DelegatedResourceAccessRequestLifecycleStateEnum { + values := make([]DelegatedResourceAccessRequestLifecycleStateEnum, 0) + for _, v := range mappingDelegatedResourceAccessRequestLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetDelegatedResourceAccessRequestLifecycleStateEnumStringValues Enumerates the set of values in String for DelegatedResourceAccessRequestLifecycleStateEnum +func GetDelegatedResourceAccessRequestLifecycleStateEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + "NEEDS_ATTENTION", + } +} + +// GetMappingDelegatedResourceAccessRequestLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegatedResourceAccessRequestLifecycleStateEnum(val string) (DelegatedResourceAccessRequestLifecycleStateEnum, bool) { + enum, ok := mappingDelegatedResourceAccessRequestLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_approval_details.go b/delegateaccesscontrol/delegated_resource_access_request_approval_details.go new file mode 100644 index 0000000000..9eed84f832 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_approval_details.go @@ -0,0 +1,148 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegatedResourceAccessRequestApprovalDetails Approval info for initial access or extension of a Delegated Resource Access Request +type DelegatedResourceAccessRequestApprovalDetails struct { + + // Comment specified by the approver of the request. + ApproverComment *string `mandatory:"true" json:"approverComment"` + + // Indicated whether the request is approved or rejected. + ApprovalAction DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum `mandatory:"false" json:"approvalAction,omitempty"` + + // Access start time that is actually approved by the customer in RFC 3339 (https://tools.ietf.org/html/rfc3339)timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeApprovedForAccess *common.SDKTime `mandatory:"false" json:"timeApprovedForAccess"` + + // approval type, initial or extension + ApprovalType DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum `mandatory:"false" json:"approvalType,omitempty"` + + // User ID of the approver. + ApproverId *string `mandatory:"false" json:"approverId"` + + // Additional message specified by the approver of the request. + ApproverAdditionalMessage *string `mandatory:"false" json:"approverAdditionalMessage"` +} + +func (m DelegatedResourceAccessRequestApprovalDetails) 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 DelegatedResourceAccessRequestApprovalDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum(string(m.ApprovalAction)); !ok && m.ApprovalAction != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ApprovalAction: %s. Supported values are: %s.", m.ApprovalAction, strings.Join(GetDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum(string(m.ApprovalType)); !ok && m.ApprovalType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ApprovalType: %s. Supported values are: %s.", m.ApprovalType, strings.Join(GetDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum Enum with underlying type: string +type DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum string + +// Set of constants representing the allowable values for DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum +const ( + DelegatedResourceAccessRequestApprovalDetailsApprovalActionApprove DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum = "APPROVE" + DelegatedResourceAccessRequestApprovalDetailsApprovalActionReject DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum = "REJECT" +) + +var mappingDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum = map[string]DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum{ + "APPROVE": DelegatedResourceAccessRequestApprovalDetailsApprovalActionApprove, + "REJECT": DelegatedResourceAccessRequestApprovalDetailsApprovalActionReject, +} + +var mappingDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnumLowerCase = map[string]DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum{ + "approve": DelegatedResourceAccessRequestApprovalDetailsApprovalActionApprove, + "reject": DelegatedResourceAccessRequestApprovalDetailsApprovalActionReject, +} + +// GetDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnumValues Enumerates the set of values for DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum +func GetDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnumValues() []DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum { + values := make([]DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum, 0) + for _, v := range mappingDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum { + values = append(values, v) + } + return values +} + +// GetDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnumStringValues Enumerates the set of values in String for DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum +func GetDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnumStringValues() []string { + return []string{ + "APPROVE", + "REJECT", + } +} + +// GetMappingDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum(val string) (DelegatedResourceAccessRequestApprovalDetailsApprovalActionEnum, bool) { + enum, ok := mappingDelegatedResourceAccessRequestApprovalDetailsApprovalActionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum Enum with underlying type: string +type DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum string + +// Set of constants representing the allowable values for DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum +const ( + DelegatedResourceAccessRequestApprovalDetailsApprovalTypeInitial DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum = "INITIAL" + DelegatedResourceAccessRequestApprovalDetailsApprovalTypeExtension DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum = "EXTENSION" +) + +var mappingDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum = map[string]DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum{ + "INITIAL": DelegatedResourceAccessRequestApprovalDetailsApprovalTypeInitial, + "EXTENSION": DelegatedResourceAccessRequestApprovalDetailsApprovalTypeExtension, +} + +var mappingDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnumLowerCase = map[string]DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum{ + "initial": DelegatedResourceAccessRequestApprovalDetailsApprovalTypeInitial, + "extension": DelegatedResourceAccessRequestApprovalDetailsApprovalTypeExtension, +} + +// GetDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnumValues Enumerates the set of values for DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum +func GetDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnumValues() []DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum { + values := make([]DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum, 0) + for _, v := range mappingDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum { + values = append(values, v) + } + return values +} + +// GetDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnumStringValues Enumerates the set of values in String for DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum +func GetDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnumStringValues() []string { + return []string{ + "INITIAL", + "EXTENSION", + } +} + +// GetMappingDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum(val string) (DelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnum, bool) { + enum, ok := mappingDelegatedResourceAccessRequestApprovalDetailsApprovalTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_audit_log_report.go b/delegateaccesscontrol/delegated_resource_access_request_audit_log_report.go new file mode 100644 index 0000000000..c7d0f061a1 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_audit_log_report.go @@ -0,0 +1,55 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegatedResourceAccessRequestAuditLogReport The audit log report details. +type DelegatedResourceAccessRequestAuditLogReport struct { + + // Status of the audit report + AuditReportStatus AuditReportStatusEnum `mandatory:"true" json:"auditReportStatus"` + + // Audit log report. + Report *string `mandatory:"false" json:"report"` + + // The process tree data + ProcessTree *string `mandatory:"false" json:"processTree"` + + // Time when the audit report was generated RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeReportGenerated *common.SDKTime `mandatory:"false" json:"timeReportGenerated"` +} + +func (m DelegatedResourceAccessRequestAuditLogReport) 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 DelegatedResourceAccessRequestAuditLogReport) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAuditReportStatusEnum(string(m.AuditReportStatus)); !ok && m.AuditReportStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AuditReportStatus: %s. Supported values are: %s.", m.AuditReportStatus, strings.Join(GetAuditReportStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_audit_type.go b/delegateaccesscontrol/delegated_resource_access_request_audit_type.go new file mode 100644 index 0000000000..25d4d261ba --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_audit_type.go @@ -0,0 +1,60 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// DelegatedResourceAccessRequestAuditTypeEnum Enum with underlying type: string +type DelegatedResourceAccessRequestAuditTypeEnum string + +// Set of constants representing the allowable values for DelegatedResourceAccessRequestAuditTypeEnum +const ( + DelegatedResourceAccessRequestAuditTypeCommandAudit DelegatedResourceAccessRequestAuditTypeEnum = "COMMAND_AUDIT" + DelegatedResourceAccessRequestAuditTypeCommandKeystrokeAudit DelegatedResourceAccessRequestAuditTypeEnum = "COMMAND_KEYSTROKE_AUDIT" +) + +var mappingDelegatedResourceAccessRequestAuditTypeEnum = map[string]DelegatedResourceAccessRequestAuditTypeEnum{ + "COMMAND_AUDIT": DelegatedResourceAccessRequestAuditTypeCommandAudit, + "COMMAND_KEYSTROKE_AUDIT": DelegatedResourceAccessRequestAuditTypeCommandKeystrokeAudit, +} + +var mappingDelegatedResourceAccessRequestAuditTypeEnumLowerCase = map[string]DelegatedResourceAccessRequestAuditTypeEnum{ + "command_audit": DelegatedResourceAccessRequestAuditTypeCommandAudit, + "command_keystroke_audit": DelegatedResourceAccessRequestAuditTypeCommandKeystrokeAudit, +} + +// GetDelegatedResourceAccessRequestAuditTypeEnumValues Enumerates the set of values for DelegatedResourceAccessRequestAuditTypeEnum +func GetDelegatedResourceAccessRequestAuditTypeEnumValues() []DelegatedResourceAccessRequestAuditTypeEnum { + values := make([]DelegatedResourceAccessRequestAuditTypeEnum, 0) + for _, v := range mappingDelegatedResourceAccessRequestAuditTypeEnum { + values = append(values, v) + } + return values +} + +// GetDelegatedResourceAccessRequestAuditTypeEnumStringValues Enumerates the set of values in String for DelegatedResourceAccessRequestAuditTypeEnum +func GetDelegatedResourceAccessRequestAuditTypeEnumStringValues() []string { + return []string{ + "COMMAND_AUDIT", + "COMMAND_KEYSTROKE_AUDIT", + } +} + +// GetMappingDelegatedResourceAccessRequestAuditTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegatedResourceAccessRequestAuditTypeEnum(val string) (DelegatedResourceAccessRequestAuditTypeEnum, bool) { + enum, ok := mappingDelegatedResourceAccessRequestAuditTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_history_collection.go b/delegateaccesscontrol/delegated_resource_access_request_history_collection.go new file mode 100644 index 0000000000..56ab9cb818 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_history_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegatedResourceAccessRequestHistoryCollection List of Delegated Resource Access Request status transitions. +type DelegatedResourceAccessRequestHistoryCollection struct { + + // List of DelegatedResourceAccessRequestHistorySummary objects. + Items []DelegatedResourceAccessRequestHistorySummary `mandatory:"true" json:"items"` +} + +func (m DelegatedResourceAccessRequestHistoryCollection) 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 DelegatedResourceAccessRequestHistoryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_history_summary.go b/delegateaccesscontrol/delegated_resource_access_request_history_summary.go new file mode 100644 index 0000000000..13d039cd20 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_history_summary.go @@ -0,0 +1,61 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegatedResourceAccessRequestHistorySummary Summary of Delegated Resource Access Request status changes. +type DelegatedResourceAccessRequestHistorySummary struct { + + // The current lifecycle state of the Delegated Resource Access Request. + LifecycleState DelegatedResourceAccessRequestLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // The current status of the Delegated Resource Access Request. + RequestStatus DelegatedResourceAccessRequestStatusEnum `mandatory:"false" json:"requestStatus,omitempty"` + + // ID of user who modified the Delegated Resource Access Request. For operator, this field is "Operator". + UserId *string `mandatory:"false" json:"userId"` + + // Comment about the status change. + Comment *string `mandatory:"false" json:"comment"` + + // Time when the respective action happened in RFC 3339 (https://tools.ietf.org/html/rfc3339)timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m DelegatedResourceAccessRequestHistorySummary) 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 DelegatedResourceAccessRequestHistorySummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegatedResourceAccessRequestLifecycleStateEnum(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(GetDelegatedResourceAccessRequestLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequestStatusEnum(string(m.RequestStatus)); !ok && m.RequestStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestStatus: %s. Supported values are: %s.", m.RequestStatus, strings.Join(GetDelegatedResourceAccessRequestStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_severity.go b/delegateaccesscontrol/delegated_resource_access_request_severity.go new file mode 100644 index 0000000000..9364557558 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_severity.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// DelegatedResourceAccessRequestSeverityEnum Enum with underlying type: string +type DelegatedResourceAccessRequestSeverityEnum string + +// Set of constants representing the allowable values for DelegatedResourceAccessRequestSeverityEnum +const ( + DelegatedResourceAccessRequestSeverityS1 DelegatedResourceAccessRequestSeverityEnum = "S1" + DelegatedResourceAccessRequestSeverityS2 DelegatedResourceAccessRequestSeverityEnum = "S2" + DelegatedResourceAccessRequestSeverityS3 DelegatedResourceAccessRequestSeverityEnum = "S3" + DelegatedResourceAccessRequestSeverityS4 DelegatedResourceAccessRequestSeverityEnum = "S4" +) + +var mappingDelegatedResourceAccessRequestSeverityEnum = map[string]DelegatedResourceAccessRequestSeverityEnum{ + "S1": DelegatedResourceAccessRequestSeverityS1, + "S2": DelegatedResourceAccessRequestSeverityS2, + "S3": DelegatedResourceAccessRequestSeverityS3, + "S4": DelegatedResourceAccessRequestSeverityS4, +} + +var mappingDelegatedResourceAccessRequestSeverityEnumLowerCase = map[string]DelegatedResourceAccessRequestSeverityEnum{ + "s1": DelegatedResourceAccessRequestSeverityS1, + "s2": DelegatedResourceAccessRequestSeverityS2, + "s3": DelegatedResourceAccessRequestSeverityS3, + "s4": DelegatedResourceAccessRequestSeverityS4, +} + +// GetDelegatedResourceAccessRequestSeverityEnumValues Enumerates the set of values for DelegatedResourceAccessRequestSeverityEnum +func GetDelegatedResourceAccessRequestSeverityEnumValues() []DelegatedResourceAccessRequestSeverityEnum { + values := make([]DelegatedResourceAccessRequestSeverityEnum, 0) + for _, v := range mappingDelegatedResourceAccessRequestSeverityEnum { + values = append(values, v) + } + return values +} + +// GetDelegatedResourceAccessRequestSeverityEnumStringValues Enumerates the set of values in String for DelegatedResourceAccessRequestSeverityEnum +func GetDelegatedResourceAccessRequestSeverityEnumStringValues() []string { + return []string{ + "S1", + "S2", + "S3", + "S4", + } +} + +// GetMappingDelegatedResourceAccessRequestSeverityEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegatedResourceAccessRequestSeverityEnum(val string) (DelegatedResourceAccessRequestSeverityEnum, bool) { + enum, ok := mappingDelegatedResourceAccessRequestSeverityEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_status.go b/delegateaccesscontrol/delegated_resource_access_request_status.go new file mode 100644 index 0000000000..e9779223a4 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_status.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// DelegatedResourceAccessRequestStatusEnum Enum with underlying type: string +type DelegatedResourceAccessRequestStatusEnum string + +// Set of constants representing the allowable values for DelegatedResourceAccessRequestStatusEnum +const ( + DelegatedResourceAccessRequestStatusCreated DelegatedResourceAccessRequestStatusEnum = "CREATED" + DelegatedResourceAccessRequestStatusApprovalWaiting DelegatedResourceAccessRequestStatusEnum = "APPROVAL_WAITING" + DelegatedResourceAccessRequestStatusOperatorAssignmentWaiting DelegatedResourceAccessRequestStatusEnum = "OPERATOR_ASSIGNMENT_WAITING" + DelegatedResourceAccessRequestStatusPreapproved DelegatedResourceAccessRequestStatusEnum = "PREAPPROVED" + DelegatedResourceAccessRequestStatusApproved DelegatedResourceAccessRequestStatusEnum = "APPROVED" + DelegatedResourceAccessRequestStatusApprovedForFuture DelegatedResourceAccessRequestStatusEnum = "APPROVED_FOR_FUTURE" + DelegatedResourceAccessRequestStatusRejected DelegatedResourceAccessRequestStatusEnum = "REJECTED" + DelegatedResourceAccessRequestStatusDeployed DelegatedResourceAccessRequestStatusEnum = "DEPLOYED" + DelegatedResourceAccessRequestStatusDeployFailed DelegatedResourceAccessRequestStatusEnum = "DEPLOY_FAILED" + DelegatedResourceAccessRequestStatusUndeployed DelegatedResourceAccessRequestStatusEnum = "UNDEPLOYED" + DelegatedResourceAccessRequestStatusUndeployFailed DelegatedResourceAccessRequestStatusEnum = "UNDEPLOY_FAILED" + DelegatedResourceAccessRequestStatusCloseFailed DelegatedResourceAccessRequestStatusEnum = "CLOSE_FAILED" + DelegatedResourceAccessRequestStatusRevokeFailed DelegatedResourceAccessRequestStatusEnum = "REVOKE_FAILED" + DelegatedResourceAccessRequestStatusExpiryFailed DelegatedResourceAccessRequestStatusEnum = "EXPIRY_FAILED" + DelegatedResourceAccessRequestStatusRevoking DelegatedResourceAccessRequestStatusEnum = "REVOKING" + DelegatedResourceAccessRequestStatusRevoked DelegatedResourceAccessRequestStatusEnum = "REVOKED" + DelegatedResourceAccessRequestStatusExtending DelegatedResourceAccessRequestStatusEnum = "EXTENDING" + DelegatedResourceAccessRequestStatusExtended DelegatedResourceAccessRequestStatusEnum = "EXTENDED" + DelegatedResourceAccessRequestStatusExtensionRejected DelegatedResourceAccessRequestStatusEnum = "EXTENSION_REJECTED" + DelegatedResourceAccessRequestStatusExtensionFailed DelegatedResourceAccessRequestStatusEnum = "EXTENSION_FAILED" + DelegatedResourceAccessRequestStatusCompleting DelegatedResourceAccessRequestStatusEnum = "COMPLETING" + DelegatedResourceAccessRequestStatusCompleted DelegatedResourceAccessRequestStatusEnum = "COMPLETED" + DelegatedResourceAccessRequestStatusExpired DelegatedResourceAccessRequestStatusEnum = "EXPIRED" +) + +var mappingDelegatedResourceAccessRequestStatusEnum = map[string]DelegatedResourceAccessRequestStatusEnum{ + "CREATED": DelegatedResourceAccessRequestStatusCreated, + "APPROVAL_WAITING": DelegatedResourceAccessRequestStatusApprovalWaiting, + "OPERATOR_ASSIGNMENT_WAITING": DelegatedResourceAccessRequestStatusOperatorAssignmentWaiting, + "PREAPPROVED": DelegatedResourceAccessRequestStatusPreapproved, + "APPROVED": DelegatedResourceAccessRequestStatusApproved, + "APPROVED_FOR_FUTURE": DelegatedResourceAccessRequestStatusApprovedForFuture, + "REJECTED": DelegatedResourceAccessRequestStatusRejected, + "DEPLOYED": DelegatedResourceAccessRequestStatusDeployed, + "DEPLOY_FAILED": DelegatedResourceAccessRequestStatusDeployFailed, + "UNDEPLOYED": DelegatedResourceAccessRequestStatusUndeployed, + "UNDEPLOY_FAILED": DelegatedResourceAccessRequestStatusUndeployFailed, + "CLOSE_FAILED": DelegatedResourceAccessRequestStatusCloseFailed, + "REVOKE_FAILED": DelegatedResourceAccessRequestStatusRevokeFailed, + "EXPIRY_FAILED": DelegatedResourceAccessRequestStatusExpiryFailed, + "REVOKING": DelegatedResourceAccessRequestStatusRevoking, + "REVOKED": DelegatedResourceAccessRequestStatusRevoked, + "EXTENDING": DelegatedResourceAccessRequestStatusExtending, + "EXTENDED": DelegatedResourceAccessRequestStatusExtended, + "EXTENSION_REJECTED": DelegatedResourceAccessRequestStatusExtensionRejected, + "EXTENSION_FAILED": DelegatedResourceAccessRequestStatusExtensionFailed, + "COMPLETING": DelegatedResourceAccessRequestStatusCompleting, + "COMPLETED": DelegatedResourceAccessRequestStatusCompleted, + "EXPIRED": DelegatedResourceAccessRequestStatusExpired, +} + +var mappingDelegatedResourceAccessRequestStatusEnumLowerCase = map[string]DelegatedResourceAccessRequestStatusEnum{ + "created": DelegatedResourceAccessRequestStatusCreated, + "approval_waiting": DelegatedResourceAccessRequestStatusApprovalWaiting, + "operator_assignment_waiting": DelegatedResourceAccessRequestStatusOperatorAssignmentWaiting, + "preapproved": DelegatedResourceAccessRequestStatusPreapproved, + "approved": DelegatedResourceAccessRequestStatusApproved, + "approved_for_future": DelegatedResourceAccessRequestStatusApprovedForFuture, + "rejected": DelegatedResourceAccessRequestStatusRejected, + "deployed": DelegatedResourceAccessRequestStatusDeployed, + "deploy_failed": DelegatedResourceAccessRequestStatusDeployFailed, + "undeployed": DelegatedResourceAccessRequestStatusUndeployed, + "undeploy_failed": DelegatedResourceAccessRequestStatusUndeployFailed, + "close_failed": DelegatedResourceAccessRequestStatusCloseFailed, + "revoke_failed": DelegatedResourceAccessRequestStatusRevokeFailed, + "expiry_failed": DelegatedResourceAccessRequestStatusExpiryFailed, + "revoking": DelegatedResourceAccessRequestStatusRevoking, + "revoked": DelegatedResourceAccessRequestStatusRevoked, + "extending": DelegatedResourceAccessRequestStatusExtending, + "extended": DelegatedResourceAccessRequestStatusExtended, + "extension_rejected": DelegatedResourceAccessRequestStatusExtensionRejected, + "extension_failed": DelegatedResourceAccessRequestStatusExtensionFailed, + "completing": DelegatedResourceAccessRequestStatusCompleting, + "completed": DelegatedResourceAccessRequestStatusCompleted, + "expired": DelegatedResourceAccessRequestStatusExpired, +} + +// GetDelegatedResourceAccessRequestStatusEnumValues Enumerates the set of values for DelegatedResourceAccessRequestStatusEnum +func GetDelegatedResourceAccessRequestStatusEnumValues() []DelegatedResourceAccessRequestStatusEnum { + values := make([]DelegatedResourceAccessRequestStatusEnum, 0) + for _, v := range mappingDelegatedResourceAccessRequestStatusEnum { + values = append(values, v) + } + return values +} + +// GetDelegatedResourceAccessRequestStatusEnumStringValues Enumerates the set of values in String for DelegatedResourceAccessRequestStatusEnum +func GetDelegatedResourceAccessRequestStatusEnumStringValues() []string { + return []string{ + "CREATED", + "APPROVAL_WAITING", + "OPERATOR_ASSIGNMENT_WAITING", + "PREAPPROVED", + "APPROVED", + "APPROVED_FOR_FUTURE", + "REJECTED", + "DEPLOYED", + "DEPLOY_FAILED", + "UNDEPLOYED", + "UNDEPLOY_FAILED", + "CLOSE_FAILED", + "REVOKE_FAILED", + "EXPIRY_FAILED", + "REVOKING", + "REVOKED", + "EXTENDING", + "EXTENDED", + "EXTENSION_REJECTED", + "EXTENSION_FAILED", + "COMPLETING", + "COMPLETED", + "EXPIRED", + } +} + +// GetMappingDelegatedResourceAccessRequestStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegatedResourceAccessRequestStatusEnum(val string) (DelegatedResourceAccessRequestStatusEnum, bool) { + enum, ok := mappingDelegatedResourceAccessRequestStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_summary.go b/delegateaccesscontrol/delegated_resource_access_request_summary.go new file mode 100644 index 0000000000..b5d0841604 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_summary.go @@ -0,0 +1,134 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegatedResourceAccessRequestSummary Summary of Delegated Resource Access Request. +type DelegatedResourceAccessRequestSummary struct { + + // The OCID of the Delegated Resource Access Request. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains the Delegated Resource Access Request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A short description explaining why this Delegated Resource Access Request is needed by the support operator. + ReasonForRequest *string `mandatory:"true" json:"reasonForRequest"` + + // The OCID of the target resource associated with the Delegated Resource Access Request. The support operator raises a Delegated Resource Access Request to get approval to + // access the target resource. + ResourceId *string `mandatory:"true" json:"resourceId"` + + // The OCID of the Delegation Control governing the target resource. + DelegationControlId *string `mandatory:"true" json:"delegationControlId"` + + // Display name. This is generated by the system automatically. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A list of ticket numbers related to this Delegated Resource Access Request, e.g. Service Request (SR) number and JIRA ticket number. + TicketNumbers []string `mandatory:"false" json:"ticketNumbers"` + + // Requested access start time in UTC. + TimeAccessRequested *common.SDKTime `mandatory:"false" json:"timeAccessRequested"` + + // The name of the target resource associated with the Delegated Resource Access Request. The support operator raises a Delegated Resource Access Request to get approval to + // access the target resource. + ResourceName *string `mandatory:"false" json:"resourceName"` + + // Resource type for which the associated Delegation Control is applicable to. + ResourceType DelegationControlResourceTypeEnum `mandatory:"false" json:"resourceType,omitempty"` + + // List of Service Provider Action names for which approval is sought by the support operator user. The list of pre-defined Service Provider Actions can be obtained from the ListServiceProviderActions API. + RequestedActionNames []string `mandatory:"false" json:"requestedActionNames"` + + // Requester type + RequesterType DelegatedResourceAccessRequesterTypeEnum `mandatory:"false" json:"requesterType,omitempty"` + + // Priority assigned to the Delegated Resource Access Request by the support operator + Severity DelegatedResourceAccessRequestSeverityEnum `mandatory:"false" json:"severity,omitempty"` + + // Duration in hours for which access is sought on the target resource. + DurationInHours *int `mandatory:"false" json:"durationInHours"` + + // Duration in hours for which extension access is sought on the target resource. + ExtendDurationInHours *int `mandatory:"false" json:"extendDurationInHours"` + + // Set to true if the request is approved automatically based on preApprovedServiceProviderActionNames or isAutoApproveDuringMaintenance in the associated Delegation Control. + IsAutoApproved *bool `mandatory:"false" json:"isAutoApproved"` + + // The current lifecycle state of the Delegated Resource Access Request. + LifecycleState DelegatedResourceAccessRequestLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // The current status of the Delegated Resource Access Request. + RequestStatus DelegatedResourceAccessRequestStatusEnum `mandatory:"false" json:"requestStatus,omitempty"` + + // Time when the Delegated Resource Access Request was created by the support operator user in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Delegated Resource Access Request was last modified in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // 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 DelegatedResourceAccessRequestSummary) 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 DelegatedResourceAccessRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegationControlResourceTypeEnum(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(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequesterTypeEnum(string(m.RequesterType)); !ok && m.RequesterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequesterType: %s. Supported values are: %s.", m.RequesterType, strings.Join(GetDelegatedResourceAccessRequesterTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequestSeverityEnum(string(m.Severity)); !ok && m.Severity != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Severity: %s. Supported values are: %s.", m.Severity, strings.Join(GetDelegatedResourceAccessRequestSeverityEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequestLifecycleStateEnum(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(GetDelegatedResourceAccessRequestLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegatedResourceAccessRequestStatusEnum(string(m.RequestStatus)); !ok && m.RequestStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestStatus: %s. Supported values are: %s.", m.RequestStatus, strings.Join(GetDelegatedResourceAccessRequestStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegated_resource_access_request_summary_collection.go b/delegateaccesscontrol/delegated_resource_access_request_summary_collection.go new file mode 100644 index 0000000000..7e81b97a37 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_request_summary_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegatedResourceAccessRequestSummaryCollection Results of Delegated Resource Access Request search, which contains summary of Delegated Resource Access Request. +type DelegatedResourceAccessRequestSummaryCollection struct { + + // contains DelegatedResourceAccessRequestSummary + Items []DelegatedResourceAccessRequestSummary `mandatory:"true" json:"items"` +} + +func (m DelegatedResourceAccessRequestSummaryCollection) 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 DelegatedResourceAccessRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegated_resource_access_requester_type.go b/delegateaccesscontrol/delegated_resource_access_requester_type.go new file mode 100644 index 0000000000..44947728a8 --- /dev/null +++ b/delegateaccesscontrol/delegated_resource_access_requester_type.go @@ -0,0 +1,64 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// DelegatedResourceAccessRequesterTypeEnum Enum with underlying type: string +type DelegatedResourceAccessRequesterTypeEnum string + +// Set of constants representing the allowable values for DelegatedResourceAccessRequesterTypeEnum +const ( + DelegatedResourceAccessRequesterTypeOperator DelegatedResourceAccessRequesterTypeEnum = "OPERATOR" + DelegatedResourceAccessRequesterTypeCustomer DelegatedResourceAccessRequesterTypeEnum = "CUSTOMER" + DelegatedResourceAccessRequesterTypeSystem DelegatedResourceAccessRequesterTypeEnum = "SYSTEM" +) + +var mappingDelegatedResourceAccessRequesterTypeEnum = map[string]DelegatedResourceAccessRequesterTypeEnum{ + "OPERATOR": DelegatedResourceAccessRequesterTypeOperator, + "CUSTOMER": DelegatedResourceAccessRequesterTypeCustomer, + "SYSTEM": DelegatedResourceAccessRequesterTypeSystem, +} + +var mappingDelegatedResourceAccessRequesterTypeEnumLowerCase = map[string]DelegatedResourceAccessRequesterTypeEnum{ + "operator": DelegatedResourceAccessRequesterTypeOperator, + "customer": DelegatedResourceAccessRequesterTypeCustomer, + "system": DelegatedResourceAccessRequesterTypeSystem, +} + +// GetDelegatedResourceAccessRequesterTypeEnumValues Enumerates the set of values for DelegatedResourceAccessRequesterTypeEnum +func GetDelegatedResourceAccessRequesterTypeEnumValues() []DelegatedResourceAccessRequesterTypeEnum { + values := make([]DelegatedResourceAccessRequesterTypeEnum, 0) + for _, v := range mappingDelegatedResourceAccessRequesterTypeEnum { + values = append(values, v) + } + return values +} + +// GetDelegatedResourceAccessRequesterTypeEnumStringValues Enumerates the set of values in String for DelegatedResourceAccessRequesterTypeEnum +func GetDelegatedResourceAccessRequesterTypeEnumStringValues() []string { + return []string{ + "OPERATOR", + "CUSTOMER", + "SYSTEM", + } +} + +// GetMappingDelegatedResourceAccessRequesterTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegatedResourceAccessRequesterTypeEnum(val string) (DelegatedResourceAccessRequesterTypeEnum, bool) { + enum, ok := mappingDelegatedResourceAccessRequesterTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegation_control.go b/delegateaccesscontrol/delegation_control.go new file mode 100644 index 0000000000..d791d58cec --- /dev/null +++ b/delegateaccesscontrol/delegation_control.go @@ -0,0 +1,227 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationControl Delegation Control enables you to grant, audit, or revoke the access Oracle has to your Exadata Cloud infrastructure, and obtain audit reports of all actions taken by a human operator, in a near real-time manner. +type DelegationControl struct { + + // The OCID of the Delegation Control. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains the Delegation Control. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Name of the Delegation Control. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Resource type for which the Delegation Control is applicable to. + ResourceType DelegationControlResourceTypeEnum `mandatory:"true" json:"resourceType"` + + // Description of the Delegation Control. + Description *string `mandatory:"false" json:"description"` + + // number of approvals required. + NumApprovalsRequired *int `mandatory:"false" json:"numApprovalsRequired"` + + // List of pre-approved Service Provider Action names. The list of pre-defined Service Provider Actions can be obtained from the ListServiceProviderActions API. Delegated Resource Access Requests associated with a resource governed by this Delegation Control will be + // automatically approved if the Delegated Resource Access Request only contain Service Provider Actions in the pre-approved list. + PreApprovedServiceProviderActionNames []string `mandatory:"false" json:"preApprovedServiceProviderActionNames"` + + // List of Delegation Subscription OCID that are allowed for this Delegation Control. The allowed subscriptions will determine the available Service Provider Actions. Only support operators for the allowed subscriptions are allowed to create Delegated Resource Access Request. + DelegationSubscriptionIds []string `mandatory:"false" json:"delegationSubscriptionIds"` + + // Set to true to allow all Delegated Resource Access Request to be approved automatically during maintenance. + IsAutoApproveDuringMaintenance *bool `mandatory:"false" json:"isAutoApproveDuringMaintenance"` + + // The OCID of the selected resources that this Delegation Control is applicable to. + ResourceIds []string `mandatory:"false" json:"resourceIds"` + + // The OCID of the OCI Notification topic to publish messages related to this Delegation Control. + NotificationTopicId *string `mandatory:"false" json:"notificationTopicId"` + + // The format of the OCI Notification messages for this Delegation Control. + NotificationMessageFormat DelegationControlNotificationMessageFormatEnum `mandatory:"false" json:"notificationMessageFormat,omitempty"` + + // The OCID of the OCI Vault that will store the secrets containing the SSH keys to access the resource governed by this Delegation Control by Delegate Access Control Service. This property is required when resourceType is CLOUDVMCLUSTER. Delegate Access Control Service will generate the SSH keys and store them as secrets in the OCI Vault. + VaultId *string `mandatory:"false" json:"vaultId"` + + // The OCID of the Master Encryption Key in the OCI Vault specified by vaultId. This key will be used to encrypt the SSH keys to access the resource governed by this Delegation Control by Delegate Access Control Service. This property is required when resourceType is CLOUDVMCLUSTER. + VaultKeyId *string `mandatory:"false" json:"vaultKeyId"` + + // The current lifecycle state of the Delegation Control. + LifecycleState DelegationControlLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Time when the Delegation Control was created expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Delegation Control was last modified expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Time when the Delegation Control was deleted expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339)timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + // Note a deleted Delegation Control still stays in the system, so that you can still audit Service Provider Actions associated with Delegated Resource Access Requests + // raised on target resources governed by the deleted Delegation Control. + TimeDeleted *common.SDKTime `mandatory:"false" json:"timeDeleted"` + + // 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"` + + // 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 DelegationControl) 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 DelegationControl) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDelegationControlResourceTypeEnum(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(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingDelegationControlNotificationMessageFormatEnum(string(m.NotificationMessageFormat)); !ok && m.NotificationMessageFormat != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NotificationMessageFormat: %s. Supported values are: %s.", m.NotificationMessageFormat, strings.Join(GetDelegationControlNotificationMessageFormatEnumStringValues(), ","))) + } + if _, ok := GetMappingDelegationControlLifecycleStateEnum(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(GetDelegationControlLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DelegationControlNotificationMessageFormatEnum Enum with underlying type: string +type DelegationControlNotificationMessageFormatEnum string + +// Set of constants representing the allowable values for DelegationControlNotificationMessageFormatEnum +const ( + DelegationControlNotificationMessageFormatJson DelegationControlNotificationMessageFormatEnum = "JSON" + DelegationControlNotificationMessageFormatHtml DelegationControlNotificationMessageFormatEnum = "HTML" +) + +var mappingDelegationControlNotificationMessageFormatEnum = map[string]DelegationControlNotificationMessageFormatEnum{ + "JSON": DelegationControlNotificationMessageFormatJson, + "HTML": DelegationControlNotificationMessageFormatHtml, +} + +var mappingDelegationControlNotificationMessageFormatEnumLowerCase = map[string]DelegationControlNotificationMessageFormatEnum{ + "json": DelegationControlNotificationMessageFormatJson, + "html": DelegationControlNotificationMessageFormatHtml, +} + +// GetDelegationControlNotificationMessageFormatEnumValues Enumerates the set of values for DelegationControlNotificationMessageFormatEnum +func GetDelegationControlNotificationMessageFormatEnumValues() []DelegationControlNotificationMessageFormatEnum { + values := make([]DelegationControlNotificationMessageFormatEnum, 0) + for _, v := range mappingDelegationControlNotificationMessageFormatEnum { + values = append(values, v) + } + return values +} + +// GetDelegationControlNotificationMessageFormatEnumStringValues Enumerates the set of values in String for DelegationControlNotificationMessageFormatEnum +func GetDelegationControlNotificationMessageFormatEnumStringValues() []string { + return []string{ + "JSON", + "HTML", + } +} + +// GetMappingDelegationControlNotificationMessageFormatEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegationControlNotificationMessageFormatEnum(val string) (DelegationControlNotificationMessageFormatEnum, bool) { + enum, ok := mappingDelegationControlNotificationMessageFormatEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// DelegationControlLifecycleStateEnum Enum with underlying type: string +type DelegationControlLifecycleStateEnum string + +// Set of constants representing the allowable values for DelegationControlLifecycleStateEnum +const ( + DelegationControlLifecycleStateCreating DelegationControlLifecycleStateEnum = "CREATING" + DelegationControlLifecycleStateActive DelegationControlLifecycleStateEnum = "ACTIVE" + DelegationControlLifecycleStateUpdating DelegationControlLifecycleStateEnum = "UPDATING" + DelegationControlLifecycleStateDeleting DelegationControlLifecycleStateEnum = "DELETING" + DelegationControlLifecycleStateDeleted DelegationControlLifecycleStateEnum = "DELETED" + DelegationControlLifecycleStateFailed DelegationControlLifecycleStateEnum = "FAILED" + DelegationControlLifecycleStateNeedsAttention DelegationControlLifecycleStateEnum = "NEEDS_ATTENTION" +) + +var mappingDelegationControlLifecycleStateEnum = map[string]DelegationControlLifecycleStateEnum{ + "CREATING": DelegationControlLifecycleStateCreating, + "ACTIVE": DelegationControlLifecycleStateActive, + "UPDATING": DelegationControlLifecycleStateUpdating, + "DELETING": DelegationControlLifecycleStateDeleting, + "DELETED": DelegationControlLifecycleStateDeleted, + "FAILED": DelegationControlLifecycleStateFailed, + "NEEDS_ATTENTION": DelegationControlLifecycleStateNeedsAttention, +} + +var mappingDelegationControlLifecycleStateEnumLowerCase = map[string]DelegationControlLifecycleStateEnum{ + "creating": DelegationControlLifecycleStateCreating, + "active": DelegationControlLifecycleStateActive, + "updating": DelegationControlLifecycleStateUpdating, + "deleting": DelegationControlLifecycleStateDeleting, + "deleted": DelegationControlLifecycleStateDeleted, + "failed": DelegationControlLifecycleStateFailed, + "needs_attention": DelegationControlLifecycleStateNeedsAttention, +} + +// GetDelegationControlLifecycleStateEnumValues Enumerates the set of values for DelegationControlLifecycleStateEnum +func GetDelegationControlLifecycleStateEnumValues() []DelegationControlLifecycleStateEnum { + values := make([]DelegationControlLifecycleStateEnum, 0) + for _, v := range mappingDelegationControlLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetDelegationControlLifecycleStateEnumStringValues Enumerates the set of values in String for DelegationControlLifecycleStateEnum +func GetDelegationControlLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + "NEEDS_ATTENTION", + } +} + +// GetMappingDelegationControlLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegationControlLifecycleStateEnum(val string) (DelegationControlLifecycleStateEnum, bool) { + enum, ok := mappingDelegationControlLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegation_control_resource_collection.go b/delegateaccesscontrol/delegation_control_resource_collection.go new file mode 100644 index 0000000000..692052df85 --- /dev/null +++ b/delegateaccesscontrol/delegation_control_resource_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationControlResourceCollection List of DelegationControlResourceSummary objects. +type DelegationControlResourceCollection struct { + + // List of DelegationControlResourceSummary objects. + Items []DelegationControlResourceSummary `mandatory:"true" json:"items"` +} + +func (m DelegationControlResourceCollection) 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 DelegationControlResourceCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegation_control_resource_summary.go b/delegateaccesscontrol/delegation_control_resource_summary.go new file mode 100644 index 0000000000..fc75bca014 --- /dev/null +++ b/delegateaccesscontrol/delegation_control_resource_summary.go @@ -0,0 +1,119 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationControlResourceSummary Details of the resources that this Delegation Control is applicable to. +type DelegationControlResourceSummary struct { + + // OCID of the resource. + Id *string `mandatory:"false" json:"id"` + + // The current status of the resource in Delegation Control. + ResourceStatus DelegationControlResourceSummaryResourceStatusEnum `mandatory:"false" json:"resourceStatus,omitempty"` +} + +func (m DelegationControlResourceSummary) 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 DelegationControlResourceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegationControlResourceSummaryResourceStatusEnum(string(m.ResourceStatus)); !ok && m.ResourceStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ResourceStatus: %s. Supported values are: %s.", m.ResourceStatus, strings.Join(GetDelegationControlResourceSummaryResourceStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DelegationControlResourceSummaryResourceStatusEnum Enum with underlying type: string +type DelegationControlResourceSummaryResourceStatusEnum string + +// Set of constants representing the allowable values for DelegationControlResourceSummaryResourceStatusEnum +const ( + DelegationControlResourceSummaryResourceStatusCreated DelegationControlResourceSummaryResourceStatusEnum = "CREATED" + DelegationControlResourceSummaryResourceStatusApplying DelegationControlResourceSummaryResourceStatusEnum = "APPLYING" + DelegationControlResourceSummaryResourceStatusApplied DelegationControlResourceSummaryResourceStatusEnum = "APPLIED" + DelegationControlResourceSummaryResourceStatusApplyFailed DelegationControlResourceSummaryResourceStatusEnum = "APPLY_FAILED" + DelegationControlResourceSummaryResourceStatusUpdating DelegationControlResourceSummaryResourceStatusEnum = "UPDATING" + DelegationControlResourceSummaryResourceStatusUpdateFailed DelegationControlResourceSummaryResourceStatusEnum = "UPDATE_FAILED" + DelegationControlResourceSummaryResourceStatusDeleting DelegationControlResourceSummaryResourceStatusEnum = "DELETING" + DelegationControlResourceSummaryResourceStatusDeleted DelegationControlResourceSummaryResourceStatusEnum = "DELETED" + DelegationControlResourceSummaryResourceStatusDeletionFailed DelegationControlResourceSummaryResourceStatusEnum = "DELETION_FAILED" +) + +var mappingDelegationControlResourceSummaryResourceStatusEnum = map[string]DelegationControlResourceSummaryResourceStatusEnum{ + "CREATED": DelegationControlResourceSummaryResourceStatusCreated, + "APPLYING": DelegationControlResourceSummaryResourceStatusApplying, + "APPLIED": DelegationControlResourceSummaryResourceStatusApplied, + "APPLY_FAILED": DelegationControlResourceSummaryResourceStatusApplyFailed, + "UPDATING": DelegationControlResourceSummaryResourceStatusUpdating, + "UPDATE_FAILED": DelegationControlResourceSummaryResourceStatusUpdateFailed, + "DELETING": DelegationControlResourceSummaryResourceStatusDeleting, + "DELETED": DelegationControlResourceSummaryResourceStatusDeleted, + "DELETION_FAILED": DelegationControlResourceSummaryResourceStatusDeletionFailed, +} + +var mappingDelegationControlResourceSummaryResourceStatusEnumLowerCase = map[string]DelegationControlResourceSummaryResourceStatusEnum{ + "created": DelegationControlResourceSummaryResourceStatusCreated, + "applying": DelegationControlResourceSummaryResourceStatusApplying, + "applied": DelegationControlResourceSummaryResourceStatusApplied, + "apply_failed": DelegationControlResourceSummaryResourceStatusApplyFailed, + "updating": DelegationControlResourceSummaryResourceStatusUpdating, + "update_failed": DelegationControlResourceSummaryResourceStatusUpdateFailed, + "deleting": DelegationControlResourceSummaryResourceStatusDeleting, + "deleted": DelegationControlResourceSummaryResourceStatusDeleted, + "deletion_failed": DelegationControlResourceSummaryResourceStatusDeletionFailed, +} + +// GetDelegationControlResourceSummaryResourceStatusEnumValues Enumerates the set of values for DelegationControlResourceSummaryResourceStatusEnum +func GetDelegationControlResourceSummaryResourceStatusEnumValues() []DelegationControlResourceSummaryResourceStatusEnum { + values := make([]DelegationControlResourceSummaryResourceStatusEnum, 0) + for _, v := range mappingDelegationControlResourceSummaryResourceStatusEnum { + values = append(values, v) + } + return values +} + +// GetDelegationControlResourceSummaryResourceStatusEnumStringValues Enumerates the set of values in String for DelegationControlResourceSummaryResourceStatusEnum +func GetDelegationControlResourceSummaryResourceStatusEnumStringValues() []string { + return []string{ + "CREATED", + "APPLYING", + "APPLIED", + "APPLY_FAILED", + "UPDATING", + "UPDATE_FAILED", + "DELETING", + "DELETED", + "DELETION_FAILED", + } +} + +// GetMappingDelegationControlResourceSummaryResourceStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegationControlResourceSummaryResourceStatusEnum(val string) (DelegationControlResourceSummaryResourceStatusEnum, bool) { + enum, ok := mappingDelegationControlResourceSummaryResourceStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegation_control_resource_type.go b/delegateaccesscontrol/delegation_control_resource_type.go new file mode 100644 index 0000000000..956e20a0e1 --- /dev/null +++ b/delegateaccesscontrol/delegation_control_resource_type.go @@ -0,0 +1,60 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// DelegationControlResourceTypeEnum Enum with underlying type: string +type DelegationControlResourceTypeEnum string + +// Set of constants representing the allowable values for DelegationControlResourceTypeEnum +const ( + DelegationControlResourceTypeVmcluster DelegationControlResourceTypeEnum = "VMCLUSTER" + DelegationControlResourceTypeCloudvmcluster DelegationControlResourceTypeEnum = "CLOUDVMCLUSTER" +) + +var mappingDelegationControlResourceTypeEnum = map[string]DelegationControlResourceTypeEnum{ + "VMCLUSTER": DelegationControlResourceTypeVmcluster, + "CLOUDVMCLUSTER": DelegationControlResourceTypeCloudvmcluster, +} + +var mappingDelegationControlResourceTypeEnumLowerCase = map[string]DelegationControlResourceTypeEnum{ + "vmcluster": DelegationControlResourceTypeVmcluster, + "cloudvmcluster": DelegationControlResourceTypeCloudvmcluster, +} + +// GetDelegationControlResourceTypeEnumValues Enumerates the set of values for DelegationControlResourceTypeEnum +func GetDelegationControlResourceTypeEnumValues() []DelegationControlResourceTypeEnum { + values := make([]DelegationControlResourceTypeEnum, 0) + for _, v := range mappingDelegationControlResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetDelegationControlResourceTypeEnumStringValues Enumerates the set of values in String for DelegationControlResourceTypeEnum +func GetDelegationControlResourceTypeEnumStringValues() []string { + return []string{ + "VMCLUSTER", + "CLOUDVMCLUSTER", + } +} + +// GetMappingDelegationControlResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegationControlResourceTypeEnum(val string) (DelegationControlResourceTypeEnum, bool) { + enum, ok := mappingDelegationControlResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegation_control_summary.go b/delegateaccesscontrol/delegation_control_summary.go new file mode 100644 index 0000000000..08b8b4f377 --- /dev/null +++ b/delegateaccesscontrol/delegation_control_summary.go @@ -0,0 +1,87 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationControlSummary Summary of the Delegation Control. +type DelegationControlSummary struct { + + // The OCID of the Delegation Control. + Id *string `mandatory:"true" json:"id"` + + // Name of the Delegation Control. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the compartment that contains the Delegation Control. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // resourceType for which the Delegation Control is applicable + ResourceType DelegationControlResourceTypeEnum `mandatory:"true" json:"resourceType"` + + // Time when the Delegation Control was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Delegation Control was last modified, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // Time when the Delegation Control was deleted, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + TimeDeleted *common.SDKTime `mandatory:"false" json:"timeDeleted"` + + // The current lifecycle state of the Delegation Control. + LifecycleState DelegationControlLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // 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"` + + // 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 DelegationControlSummary) 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 DelegationControlSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDelegationControlResourceTypeEnum(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(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingDelegationControlLifecycleStateEnum(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(GetDelegationControlLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegation_control_summary_collection.go b/delegateaccesscontrol/delegation_control_summary_collection.go new file mode 100644 index 0000000000..ccda77ab67 --- /dev/null +++ b/delegateaccesscontrol/delegation_control_summary_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationControlSummaryCollection Results of Delegation Control search, which contains summary of the Delegation Control. +type DelegationControlSummaryCollection struct { + + // contains DelegationControlSummary + Items []DelegationControlSummary `mandatory:"true" json:"items"` +} + +func (m DelegationControlSummaryCollection) 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 DelegationControlSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegation_subscription.go b/delegateaccesscontrol/delegation_subscription.go new file mode 100644 index 0000000000..efdd27e235 --- /dev/null +++ b/delegateaccesscontrol/delegation_subscription.go @@ -0,0 +1,148 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationSubscription Details of the Delegation Subscription. +type DelegationSubscription struct { + + // Unique identifier for the Delegation Subscription. + Id *string `mandatory:"true" json:"id"` + + // Unique identifier of the Service Provider. + ServiceProviderId *string `mandatory:"true" json:"serviceProviderId"` + + // Subscribed Service Provider Service Type. + SubscribedServiceType ServiceProviderServiceTypeEnum `mandatory:"true" json:"subscribedServiceType"` + + // The OCID of the compartment that contains the Delegation Subscription. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Display name + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the Delegation Subscription. + Description *string `mandatory:"false" json:"description"` + + // The current lifecycle state of the Service Provider. + LifecycleState DelegationSubscriptionLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Time when the Service Provider was created expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Service Provider was last modified expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // 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 DelegationSubscription) 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 DelegationSubscription) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(m.SubscribedServiceType)); !ok && m.SubscribedServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscribedServiceType: %s. Supported values are: %s.", m.SubscribedServiceType, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingDelegationSubscriptionLifecycleStateEnum(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(GetDelegationSubscriptionLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DelegationSubscriptionLifecycleStateEnum Enum with underlying type: string +type DelegationSubscriptionLifecycleStateEnum string + +// Set of constants representing the allowable values for DelegationSubscriptionLifecycleStateEnum +const ( + DelegationSubscriptionLifecycleStateCreating DelegationSubscriptionLifecycleStateEnum = "CREATING" + DelegationSubscriptionLifecycleStateActive DelegationSubscriptionLifecycleStateEnum = "ACTIVE" + DelegationSubscriptionLifecycleStateUpdating DelegationSubscriptionLifecycleStateEnum = "UPDATING" + DelegationSubscriptionLifecycleStateDeleting DelegationSubscriptionLifecycleStateEnum = "DELETING" + DelegationSubscriptionLifecycleStateDeleted DelegationSubscriptionLifecycleStateEnum = "DELETED" + DelegationSubscriptionLifecycleStateFailed DelegationSubscriptionLifecycleStateEnum = "FAILED" +) + +var mappingDelegationSubscriptionLifecycleStateEnum = map[string]DelegationSubscriptionLifecycleStateEnum{ + "CREATING": DelegationSubscriptionLifecycleStateCreating, + "ACTIVE": DelegationSubscriptionLifecycleStateActive, + "UPDATING": DelegationSubscriptionLifecycleStateUpdating, + "DELETING": DelegationSubscriptionLifecycleStateDeleting, + "DELETED": DelegationSubscriptionLifecycleStateDeleted, + "FAILED": DelegationSubscriptionLifecycleStateFailed, +} + +var mappingDelegationSubscriptionLifecycleStateEnumLowerCase = map[string]DelegationSubscriptionLifecycleStateEnum{ + "creating": DelegationSubscriptionLifecycleStateCreating, + "active": DelegationSubscriptionLifecycleStateActive, + "updating": DelegationSubscriptionLifecycleStateUpdating, + "deleting": DelegationSubscriptionLifecycleStateDeleting, + "deleted": DelegationSubscriptionLifecycleStateDeleted, + "failed": DelegationSubscriptionLifecycleStateFailed, +} + +// GetDelegationSubscriptionLifecycleStateEnumValues Enumerates the set of values for DelegationSubscriptionLifecycleStateEnum +func GetDelegationSubscriptionLifecycleStateEnumValues() []DelegationSubscriptionLifecycleStateEnum { + values := make([]DelegationSubscriptionLifecycleStateEnum, 0) + for _, v := range mappingDelegationSubscriptionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetDelegationSubscriptionLifecycleStateEnumStringValues Enumerates the set of values in String for DelegationSubscriptionLifecycleStateEnum +func GetDelegationSubscriptionLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingDelegationSubscriptionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDelegationSubscriptionLifecycleStateEnum(val string) (DelegationSubscriptionLifecycleStateEnum, bool) { + enum, ok := mappingDelegationSubscriptionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/delegation_subscription_summary.go b/delegateaccesscontrol/delegation_subscription_summary.go new file mode 100644 index 0000000000..b15e44877f --- /dev/null +++ b/delegateaccesscontrol/delegation_subscription_summary.go @@ -0,0 +1,87 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationSubscriptionSummary Summary of the Delegation Subscription. +type DelegationSubscriptionSummary struct { + + // Unique identifier for the Delegation Subscription. + Id *string `mandatory:"true" json:"id"` + + // Unique identifier of the Service Provider. + ServiceProviderId *string `mandatory:"true" json:"serviceProviderId"` + + // Subscribed Service Provider Service Type. + SubscribedServiceType ServiceProviderServiceTypeEnum `mandatory:"true" json:"subscribedServiceType"` + + // The OCID of the compartment that contains the Delegation Subscription. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Display name + DisplayName *string `mandatory:"false" json:"displayName"` + + // The current lifecycle state of the Service Provider. + LifecycleState DelegationSubscriptionLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Time when the Service Provider was created expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Service Provider was last modified expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // 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 DelegationSubscriptionSummary) 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 DelegationSubscriptionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(m.SubscribedServiceType)); !ok && m.SubscribedServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscribedServiceType: %s. Supported values are: %s.", m.SubscribedServiceType, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingDelegationSubscriptionLifecycleStateEnum(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(GetDelegationSubscriptionLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delegation_subscription_summary_collection.go b/delegateaccesscontrol/delegation_subscription_summary_collection.go new file mode 100644 index 0000000000..80edf284b1 --- /dev/null +++ b/delegateaccesscontrol/delegation_subscription_summary_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DelegationSubscriptionSummaryCollection List of DelegationSubscriptionSummary objects. +type DelegationSubscriptionSummaryCollection struct { + + // List of DelegationSubscriptionSummary objects. + Items []DelegationSubscriptionSummary `mandatory:"true" json:"items"` +} + +func (m DelegationSubscriptionSummaryCollection) 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 DelegationSubscriptionSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/delete_delegation_control_request_response.go b/delegateaccesscontrol/delete_delegation_control_request_response.go new file mode 100644 index 0000000000..fb2ec39481 --- /dev/null +++ b/delegateaccesscontrol/delete_delegation_control_request_response.go @@ -0,0 +1,101 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDelegationControlRequest wrapper for the DeleteDelegationControl operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/DeleteDelegationControl.go.html to see an example of how to use DeleteDelegationControlRequest. +type DeleteDelegationControlRequest struct { + + // unique Delegation Control identifier + DelegationControlId *string `mandatory:"true" contributesTo:"path" name:"delegationControlId"` + + // Reason why this Delegation Control is deleted. + Description *string `mandatory:"false" contributesTo:"query" name:"description"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteDelegationControlRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDelegationControlRequest) 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 DeleteDelegationControlRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDelegationControlRequest) 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 DeleteDelegationControlRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDelegationControlResponse wrapper for the DeleteDelegationControl operation +type DeleteDelegationControlResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // 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"` +} + +func (response DeleteDelegationControlResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDelegationControlResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/delete_delegation_subscription_request_response.go b/delegateaccesscontrol/delete_delegation_subscription_request_response.go new file mode 100644 index 0000000000..53ed9314e0 --- /dev/null +++ b/delegateaccesscontrol/delete_delegation_subscription_request_response.go @@ -0,0 +1,98 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDelegationSubscriptionRequest wrapper for the DeleteDelegationSubscription operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/DeleteDelegationSubscription.go.html to see an example of how to use DeleteDelegationSubscriptionRequest. +type DeleteDelegationSubscriptionRequest struct { + + // unique Delegation Subscription identifier + DelegationSubscriptionId *string `mandatory:"true" contributesTo:"path" name:"delegationSubscriptionId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteDelegationSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDelegationSubscriptionRequest) 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 DeleteDelegationSubscriptionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDelegationSubscriptionRequest) 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 DeleteDelegationSubscriptionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDelegationSubscriptionResponse wrapper for the DeleteDelegationSubscription operation +type DeleteDelegationSubscriptionResponse 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 DeleteDelegationSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDelegationSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/get_delegated_resource_access_request_audit_log_report_request_response.go b/delegateaccesscontrol/get_delegated_resource_access_request_audit_log_report_request_response.go new file mode 100644 index 0000000000..9cbb26f099 --- /dev/null +++ b/delegateaccesscontrol/get_delegated_resource_access_request_audit_log_report_request_response.go @@ -0,0 +1,93 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDelegatedResourceAccessRequestAuditLogReportRequest wrapper for the GetDelegatedResourceAccessRequestAuditLogReport operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegatedResourceAccessRequestAuditLogReport.go.html to see an example of how to use GetDelegatedResourceAccessRequestAuditLogReportRequest. +type GetDelegatedResourceAccessRequestAuditLogReportRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // Set to true to enable process tree computation in audit report + IsProcessTreeEnabled *bool `mandatory:"false" contributesTo:"query" name:"isProcessTreeEnabled"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDelegatedResourceAccessRequestAuditLogReportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDelegatedResourceAccessRequestAuditLogReportRequest) 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 GetDelegatedResourceAccessRequestAuditLogReportRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDelegatedResourceAccessRequestAuditLogReportRequest) 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 GetDelegatedResourceAccessRequestAuditLogReportRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDelegatedResourceAccessRequestAuditLogReportResponse wrapper for the GetDelegatedResourceAccessRequestAuditLogReport operation +type GetDelegatedResourceAccessRequestAuditLogReportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegatedResourceAccessRequestAuditLogReport instance + DelegatedResourceAccessRequestAuditLogReport `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 GetDelegatedResourceAccessRequestAuditLogReportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDelegatedResourceAccessRequestAuditLogReportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/get_delegated_resource_access_request_request_response.go b/delegateaccesscontrol/get_delegated_resource_access_request_request_response.go new file mode 100644 index 0000000000..0680942b5b --- /dev/null +++ b/delegateaccesscontrol/get_delegated_resource_access_request_request_response.go @@ -0,0 +1,93 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDelegatedResourceAccessRequestRequest wrapper for the GetDelegatedResourceAccessRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegatedResourceAccessRequest.go.html to see an example of how to use GetDelegatedResourceAccessRequestRequest. +type GetDelegatedResourceAccessRequestRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDelegatedResourceAccessRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDelegatedResourceAccessRequestRequest) 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 GetDelegatedResourceAccessRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDelegatedResourceAccessRequestRequest) 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 GetDelegatedResourceAccessRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDelegatedResourceAccessRequestResponse wrapper for the GetDelegatedResourceAccessRequest operation +type GetDelegatedResourceAccessRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegatedResourceAccessRequest instance + DelegatedResourceAccessRequest `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 GetDelegatedResourceAccessRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDelegatedResourceAccessRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/get_delegation_control_request_response.go b/delegateaccesscontrol/get_delegation_control_request_response.go new file mode 100644 index 0000000000..99e7c1842c --- /dev/null +++ b/delegateaccesscontrol/get_delegation_control_request_response.go @@ -0,0 +1,93 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDelegationControlRequest wrapper for the GetDelegationControl operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegationControl.go.html to see an example of how to use GetDelegationControlRequest. +type GetDelegationControlRequest struct { + + // unique Delegation Control identifier + DelegationControlId *string `mandatory:"true" contributesTo:"path" name:"delegationControlId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDelegationControlRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDelegationControlRequest) 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 GetDelegationControlRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDelegationControlRequest) 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 GetDelegationControlRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDelegationControlResponse wrapper for the GetDelegationControl operation +type GetDelegationControlResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegationControl instance + DelegationControl `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 GetDelegationControlResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDelegationControlResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/get_delegation_subscription_request_response.go b/delegateaccesscontrol/get_delegation_subscription_request_response.go new file mode 100644 index 0000000000..e517882ce4 --- /dev/null +++ b/delegateaccesscontrol/get_delegation_subscription_request_response.go @@ -0,0 +1,93 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDelegationSubscriptionRequest wrapper for the GetDelegationSubscription operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetDelegationSubscription.go.html to see an example of how to use GetDelegationSubscriptionRequest. +type GetDelegationSubscriptionRequest struct { + + // unique Delegation Subscription identifier + DelegationSubscriptionId *string `mandatory:"true" contributesTo:"path" name:"delegationSubscriptionId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetDelegationSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDelegationSubscriptionRequest) 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 GetDelegationSubscriptionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDelegationSubscriptionRequest) 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 GetDelegationSubscriptionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDelegationSubscriptionResponse wrapper for the GetDelegationSubscription operation +type GetDelegationSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegationSubscription instance + DelegationSubscription `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 GetDelegationSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDelegationSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/get_service_provider_action_request_response.go b/delegateaccesscontrol/get_service_provider_action_request_response.go new file mode 100644 index 0000000000..804c60a72d --- /dev/null +++ b/delegateaccesscontrol/get_service_provider_action_request_response.go @@ -0,0 +1,93 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetServiceProviderActionRequest wrapper for the GetServiceProviderAction operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetServiceProviderAction.go.html to see an example of how to use GetServiceProviderActionRequest. +type GetServiceProviderActionRequest struct { + + // Unique Oracle supplied identifier associated with the Service Provider Action. + ServiceProviderActionId *string `mandatory:"true" contributesTo:"path" name:"serviceProviderActionId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetServiceProviderActionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetServiceProviderActionRequest) 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 GetServiceProviderActionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetServiceProviderActionRequest) 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 GetServiceProviderActionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetServiceProviderActionResponse wrapper for the GetServiceProviderAction operation +type GetServiceProviderActionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceProviderAction instance + ServiceProviderAction `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 GetServiceProviderActionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetServiceProviderActionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/get_service_provider_request_response.go b/delegateaccesscontrol/get_service_provider_request_response.go new file mode 100644 index 0000000000..71e0244591 --- /dev/null +++ b/delegateaccesscontrol/get_service_provider_request_response.go @@ -0,0 +1,93 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetServiceProviderRequest wrapper for the GetServiceProvider operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetServiceProvider.go.html to see an example of how to use GetServiceProviderRequest. +type GetServiceProviderRequest struct { + + // unique Service Provider identifier + ServiceProviderId *string `mandatory:"true" contributesTo:"path" name:"serviceProviderId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetServiceProviderRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetServiceProviderRequest) 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 GetServiceProviderRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetServiceProviderRequest) 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 GetServiceProviderRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetServiceProviderResponse wrapper for the GetServiceProvider operation +type GetServiceProviderResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ServiceProvider instance + ServiceProvider `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 GetServiceProviderResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetServiceProviderResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/get_work_request_request_response.go b/delegateaccesscontrol/get_work_request_request_response.go new file mode 100644 index 0000000000..77f43d2b5f --- /dev/null +++ b/delegateaccesscontrol/get_work_request_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // 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"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/list_delegated_resource_access_request_histories_request_response.go b/delegateaccesscontrol/list_delegated_resource_access_request_histories_request_response.go new file mode 100644 index 0000000000..013b6482ea --- /dev/null +++ b/delegateaccesscontrol/list_delegated_resource_access_request_histories_request_response.go @@ -0,0 +1,192 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDelegatedResourceAccessRequestHistoriesRequest wrapper for the ListDelegatedResourceAccessRequestHistories operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegatedResourceAccessRequestHistories.go.html to see an example of how to use ListDelegatedResourceAccessRequestHistoriesRequest. +type ListDelegatedResourceAccessRequestHistoriesRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListDelegatedResourceAccessRequestHistoriesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timestamp is descending. If no value is specified, timestamp is default. + SortBy ListDelegatedResourceAccessRequestHistoriesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListDelegatedResourceAccessRequestHistoriesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDelegatedResourceAccessRequestHistoriesRequest) 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 ListDelegatedResourceAccessRequestHistoriesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDelegatedResourceAccessRequestHistoriesRequest) 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 ListDelegatedResourceAccessRequestHistoriesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListDelegatedResourceAccessRequestHistoriesSortOrderEnum(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(GetListDelegatedResourceAccessRequestHistoriesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegatedResourceAccessRequestHistoriesSortByEnum(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(GetListDelegatedResourceAccessRequestHistoriesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDelegatedResourceAccessRequestHistoriesResponse wrapper for the ListDelegatedResourceAccessRequestHistories operation +type ListDelegatedResourceAccessRequestHistoriesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DelegatedResourceAccessRequestHistoryCollection instances + DelegatedResourceAccessRequestHistoryCollection `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 ListDelegatedResourceAccessRequestHistoriesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDelegatedResourceAccessRequestHistoriesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDelegatedResourceAccessRequestHistoriesSortOrderEnum Enum with underlying type: string +type ListDelegatedResourceAccessRequestHistoriesSortOrderEnum string + +// Set of constants representing the allowable values for ListDelegatedResourceAccessRequestHistoriesSortOrderEnum +const ( + ListDelegatedResourceAccessRequestHistoriesSortOrderAsc ListDelegatedResourceAccessRequestHistoriesSortOrderEnum = "ASC" + ListDelegatedResourceAccessRequestHistoriesSortOrderDesc ListDelegatedResourceAccessRequestHistoriesSortOrderEnum = "DESC" +) + +var mappingListDelegatedResourceAccessRequestHistoriesSortOrderEnum = map[string]ListDelegatedResourceAccessRequestHistoriesSortOrderEnum{ + "ASC": ListDelegatedResourceAccessRequestHistoriesSortOrderAsc, + "DESC": ListDelegatedResourceAccessRequestHistoriesSortOrderDesc, +} + +var mappingListDelegatedResourceAccessRequestHistoriesSortOrderEnumLowerCase = map[string]ListDelegatedResourceAccessRequestHistoriesSortOrderEnum{ + "asc": ListDelegatedResourceAccessRequestHistoriesSortOrderAsc, + "desc": ListDelegatedResourceAccessRequestHistoriesSortOrderDesc, +} + +// GetListDelegatedResourceAccessRequestHistoriesSortOrderEnumValues Enumerates the set of values for ListDelegatedResourceAccessRequestHistoriesSortOrderEnum +func GetListDelegatedResourceAccessRequestHistoriesSortOrderEnumValues() []ListDelegatedResourceAccessRequestHistoriesSortOrderEnum { + values := make([]ListDelegatedResourceAccessRequestHistoriesSortOrderEnum, 0) + for _, v := range mappingListDelegatedResourceAccessRequestHistoriesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDelegatedResourceAccessRequestHistoriesSortOrderEnumStringValues Enumerates the set of values in String for ListDelegatedResourceAccessRequestHistoriesSortOrderEnum +func GetListDelegatedResourceAccessRequestHistoriesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDelegatedResourceAccessRequestHistoriesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegatedResourceAccessRequestHistoriesSortOrderEnum(val string) (ListDelegatedResourceAccessRequestHistoriesSortOrderEnum, bool) { + enum, ok := mappingListDelegatedResourceAccessRequestHistoriesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDelegatedResourceAccessRequestHistoriesSortByEnum Enum with underlying type: string +type ListDelegatedResourceAccessRequestHistoriesSortByEnum string + +// Set of constants representing the allowable values for ListDelegatedResourceAccessRequestHistoriesSortByEnum +const ( + ListDelegatedResourceAccessRequestHistoriesSortByTimestamp ListDelegatedResourceAccessRequestHistoriesSortByEnum = "timestamp" +) + +var mappingListDelegatedResourceAccessRequestHistoriesSortByEnum = map[string]ListDelegatedResourceAccessRequestHistoriesSortByEnum{ + "timestamp": ListDelegatedResourceAccessRequestHistoriesSortByTimestamp, +} + +var mappingListDelegatedResourceAccessRequestHistoriesSortByEnumLowerCase = map[string]ListDelegatedResourceAccessRequestHistoriesSortByEnum{ + "timestamp": ListDelegatedResourceAccessRequestHistoriesSortByTimestamp, +} + +// GetListDelegatedResourceAccessRequestHistoriesSortByEnumValues Enumerates the set of values for ListDelegatedResourceAccessRequestHistoriesSortByEnum +func GetListDelegatedResourceAccessRequestHistoriesSortByEnumValues() []ListDelegatedResourceAccessRequestHistoriesSortByEnum { + values := make([]ListDelegatedResourceAccessRequestHistoriesSortByEnum, 0) + for _, v := range mappingListDelegatedResourceAccessRequestHistoriesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDelegatedResourceAccessRequestHistoriesSortByEnumStringValues Enumerates the set of values in String for ListDelegatedResourceAccessRequestHistoriesSortByEnum +func GetListDelegatedResourceAccessRequestHistoriesSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListDelegatedResourceAccessRequestHistoriesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegatedResourceAccessRequestHistoriesSortByEnum(val string) (ListDelegatedResourceAccessRequestHistoriesSortByEnum, bool) { + enum, ok := mappingListDelegatedResourceAccessRequestHistoriesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_delegated_resource_access_requests_request_response.go b/delegateaccesscontrol/list_delegated_resource_access_requests_request_response.go new file mode 100644 index 0000000000..b64de1c1d0 --- /dev/null +++ b/delegateaccesscontrol/list_delegated_resource_access_requests_request_response.go @@ -0,0 +1,350 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDelegatedResourceAccessRequestsRequest wrapper for the ListDelegatedResourceAccessRequests operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegatedResourceAccessRequests.go.html to see an example of how to use ListDelegatedResourceAccessRequestsRequest. +type ListDelegatedResourceAccessRequestsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // unique Delegation Control identifier + DelegationControlId *string `mandatory:"false" contributesTo:"query" name:"delegationControlId"` + + // A filter to return only Delegated Resource Access Requests for the given resource identifier. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // A filter to return only Delegated Resource Access Requests whose lifecycleState matches the given Delegated Resource Access Request lifecycleState. + LifecycleState DelegatedResourceAccessRequestLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only Delegated Resource Access Requests whose status matches the given Delegated Resource Access Request status. + RequestStatus ListDelegatedResourceAccessRequestsRequestStatusEnum `mandatory:"false" contributesTo:"query" name:"requestStatus" omitEmpty:"true"` + + // Query start time in UTC in ISO 8601 format(inclusive). + // Example 2019-10-30T00:00:00Z (yyyy-MM-ddThh:mm:ssZ). + // timeIntervalStart and timeIntervalEnd parameters cannot be used together. + TimeStart *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeStart"` + + // Query end time in UTC in ISO 8601 format(inclusive). + // Example 2019-10-30T00:00:00Z (yyyy-MM-ddThh:mm:ssZ). + // timeIntervalStart and timeIntervalEnd parameters cannot be used together. + TimeEnd *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeEnd"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListDelegatedResourceAccessRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified, default is timeCreated. + SortBy ListDelegatedResourceAccessRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListDelegatedResourceAccessRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDelegatedResourceAccessRequestsRequest) 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 ListDelegatedResourceAccessRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDelegatedResourceAccessRequestsRequest) 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 ListDelegatedResourceAccessRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDelegatedResourceAccessRequestLifecycleStateEnum(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(GetDelegatedResourceAccessRequestLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegatedResourceAccessRequestsRequestStatusEnum(string(request.RequestStatus)); !ok && request.RequestStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RequestStatus: %s. Supported values are: %s.", request.RequestStatus, strings.Join(GetListDelegatedResourceAccessRequestsRequestStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegatedResourceAccessRequestsSortOrderEnum(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(GetListDelegatedResourceAccessRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegatedResourceAccessRequestsSortByEnum(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(GetListDelegatedResourceAccessRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDelegatedResourceAccessRequestsResponse wrapper for the ListDelegatedResourceAccessRequests operation +type ListDelegatedResourceAccessRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DelegatedResourceAccessRequestSummaryCollection instances + DelegatedResourceAccessRequestSummaryCollection `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 ListDelegatedResourceAccessRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDelegatedResourceAccessRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDelegatedResourceAccessRequestsRequestStatusEnum Enum with underlying type: string +type ListDelegatedResourceAccessRequestsRequestStatusEnum string + +// Set of constants representing the allowable values for ListDelegatedResourceAccessRequestsRequestStatusEnum +const ( + ListDelegatedResourceAccessRequestsRequestStatusCreated ListDelegatedResourceAccessRequestsRequestStatusEnum = "CREATED" + ListDelegatedResourceAccessRequestsRequestStatusApprovalWaiting ListDelegatedResourceAccessRequestsRequestStatusEnum = "APPROVAL_WAITING" + ListDelegatedResourceAccessRequestsRequestStatusOperatorAssignmentWaiting ListDelegatedResourceAccessRequestsRequestStatusEnum = "OPERATOR_ASSIGNMENT_WAITING" + ListDelegatedResourceAccessRequestsRequestStatusPreapproved ListDelegatedResourceAccessRequestsRequestStatusEnum = "PREAPPROVED" + ListDelegatedResourceAccessRequestsRequestStatusApproved ListDelegatedResourceAccessRequestsRequestStatusEnum = "APPROVED" + ListDelegatedResourceAccessRequestsRequestStatusApprovedForFuture ListDelegatedResourceAccessRequestsRequestStatusEnum = "APPROVED_FOR_FUTURE" + ListDelegatedResourceAccessRequestsRequestStatusRejected ListDelegatedResourceAccessRequestsRequestStatusEnum = "REJECTED" + ListDelegatedResourceAccessRequestsRequestStatusDeployed ListDelegatedResourceAccessRequestsRequestStatusEnum = "DEPLOYED" + ListDelegatedResourceAccessRequestsRequestStatusDeployFailed ListDelegatedResourceAccessRequestsRequestStatusEnum = "DEPLOY_FAILED" + ListDelegatedResourceAccessRequestsRequestStatusUndeployed ListDelegatedResourceAccessRequestsRequestStatusEnum = "UNDEPLOYED" + ListDelegatedResourceAccessRequestsRequestStatusUndeployFailed ListDelegatedResourceAccessRequestsRequestStatusEnum = "UNDEPLOY_FAILED" + ListDelegatedResourceAccessRequestsRequestStatusCloseFailed ListDelegatedResourceAccessRequestsRequestStatusEnum = "CLOSE_FAILED" + ListDelegatedResourceAccessRequestsRequestStatusRevokeFailed ListDelegatedResourceAccessRequestsRequestStatusEnum = "REVOKE_FAILED" + ListDelegatedResourceAccessRequestsRequestStatusExpiryFailed ListDelegatedResourceAccessRequestsRequestStatusEnum = "EXPIRY_FAILED" + ListDelegatedResourceAccessRequestsRequestStatusRevoking ListDelegatedResourceAccessRequestsRequestStatusEnum = "REVOKING" + ListDelegatedResourceAccessRequestsRequestStatusRevoked ListDelegatedResourceAccessRequestsRequestStatusEnum = "REVOKED" + ListDelegatedResourceAccessRequestsRequestStatusExtending ListDelegatedResourceAccessRequestsRequestStatusEnum = "EXTENDING" + ListDelegatedResourceAccessRequestsRequestStatusExtended ListDelegatedResourceAccessRequestsRequestStatusEnum = "EXTENDED" + ListDelegatedResourceAccessRequestsRequestStatusExtensionRejected ListDelegatedResourceAccessRequestsRequestStatusEnum = "EXTENSION_REJECTED" + ListDelegatedResourceAccessRequestsRequestStatusExtensionFailed ListDelegatedResourceAccessRequestsRequestStatusEnum = "EXTENSION_FAILED" + ListDelegatedResourceAccessRequestsRequestStatusCompleting ListDelegatedResourceAccessRequestsRequestStatusEnum = "COMPLETING" + ListDelegatedResourceAccessRequestsRequestStatusCompleted ListDelegatedResourceAccessRequestsRequestStatusEnum = "COMPLETED" + ListDelegatedResourceAccessRequestsRequestStatusExpired ListDelegatedResourceAccessRequestsRequestStatusEnum = "EXPIRED" +) + +var mappingListDelegatedResourceAccessRequestsRequestStatusEnum = map[string]ListDelegatedResourceAccessRequestsRequestStatusEnum{ + "CREATED": ListDelegatedResourceAccessRequestsRequestStatusCreated, + "APPROVAL_WAITING": ListDelegatedResourceAccessRequestsRequestStatusApprovalWaiting, + "OPERATOR_ASSIGNMENT_WAITING": ListDelegatedResourceAccessRequestsRequestStatusOperatorAssignmentWaiting, + "PREAPPROVED": ListDelegatedResourceAccessRequestsRequestStatusPreapproved, + "APPROVED": ListDelegatedResourceAccessRequestsRequestStatusApproved, + "APPROVED_FOR_FUTURE": ListDelegatedResourceAccessRequestsRequestStatusApprovedForFuture, + "REJECTED": ListDelegatedResourceAccessRequestsRequestStatusRejected, + "DEPLOYED": ListDelegatedResourceAccessRequestsRequestStatusDeployed, + "DEPLOY_FAILED": ListDelegatedResourceAccessRequestsRequestStatusDeployFailed, + "UNDEPLOYED": ListDelegatedResourceAccessRequestsRequestStatusUndeployed, + "UNDEPLOY_FAILED": ListDelegatedResourceAccessRequestsRequestStatusUndeployFailed, + "CLOSE_FAILED": ListDelegatedResourceAccessRequestsRequestStatusCloseFailed, + "REVOKE_FAILED": ListDelegatedResourceAccessRequestsRequestStatusRevokeFailed, + "EXPIRY_FAILED": ListDelegatedResourceAccessRequestsRequestStatusExpiryFailed, + "REVOKING": ListDelegatedResourceAccessRequestsRequestStatusRevoking, + "REVOKED": ListDelegatedResourceAccessRequestsRequestStatusRevoked, + "EXTENDING": ListDelegatedResourceAccessRequestsRequestStatusExtending, + "EXTENDED": ListDelegatedResourceAccessRequestsRequestStatusExtended, + "EXTENSION_REJECTED": ListDelegatedResourceAccessRequestsRequestStatusExtensionRejected, + "EXTENSION_FAILED": ListDelegatedResourceAccessRequestsRequestStatusExtensionFailed, + "COMPLETING": ListDelegatedResourceAccessRequestsRequestStatusCompleting, + "COMPLETED": ListDelegatedResourceAccessRequestsRequestStatusCompleted, + "EXPIRED": ListDelegatedResourceAccessRequestsRequestStatusExpired, +} + +var mappingListDelegatedResourceAccessRequestsRequestStatusEnumLowerCase = map[string]ListDelegatedResourceAccessRequestsRequestStatusEnum{ + "created": ListDelegatedResourceAccessRequestsRequestStatusCreated, + "approval_waiting": ListDelegatedResourceAccessRequestsRequestStatusApprovalWaiting, + "operator_assignment_waiting": ListDelegatedResourceAccessRequestsRequestStatusOperatorAssignmentWaiting, + "preapproved": ListDelegatedResourceAccessRequestsRequestStatusPreapproved, + "approved": ListDelegatedResourceAccessRequestsRequestStatusApproved, + "approved_for_future": ListDelegatedResourceAccessRequestsRequestStatusApprovedForFuture, + "rejected": ListDelegatedResourceAccessRequestsRequestStatusRejected, + "deployed": ListDelegatedResourceAccessRequestsRequestStatusDeployed, + "deploy_failed": ListDelegatedResourceAccessRequestsRequestStatusDeployFailed, + "undeployed": ListDelegatedResourceAccessRequestsRequestStatusUndeployed, + "undeploy_failed": ListDelegatedResourceAccessRequestsRequestStatusUndeployFailed, + "close_failed": ListDelegatedResourceAccessRequestsRequestStatusCloseFailed, + "revoke_failed": ListDelegatedResourceAccessRequestsRequestStatusRevokeFailed, + "expiry_failed": ListDelegatedResourceAccessRequestsRequestStatusExpiryFailed, + "revoking": ListDelegatedResourceAccessRequestsRequestStatusRevoking, + "revoked": ListDelegatedResourceAccessRequestsRequestStatusRevoked, + "extending": ListDelegatedResourceAccessRequestsRequestStatusExtending, + "extended": ListDelegatedResourceAccessRequestsRequestStatusExtended, + "extension_rejected": ListDelegatedResourceAccessRequestsRequestStatusExtensionRejected, + "extension_failed": ListDelegatedResourceAccessRequestsRequestStatusExtensionFailed, + "completing": ListDelegatedResourceAccessRequestsRequestStatusCompleting, + "completed": ListDelegatedResourceAccessRequestsRequestStatusCompleted, + "expired": ListDelegatedResourceAccessRequestsRequestStatusExpired, +} + +// GetListDelegatedResourceAccessRequestsRequestStatusEnumValues Enumerates the set of values for ListDelegatedResourceAccessRequestsRequestStatusEnum +func GetListDelegatedResourceAccessRequestsRequestStatusEnumValues() []ListDelegatedResourceAccessRequestsRequestStatusEnum { + values := make([]ListDelegatedResourceAccessRequestsRequestStatusEnum, 0) + for _, v := range mappingListDelegatedResourceAccessRequestsRequestStatusEnum { + values = append(values, v) + } + return values +} + +// GetListDelegatedResourceAccessRequestsRequestStatusEnumStringValues Enumerates the set of values in String for ListDelegatedResourceAccessRequestsRequestStatusEnum +func GetListDelegatedResourceAccessRequestsRequestStatusEnumStringValues() []string { + return []string{ + "CREATED", + "APPROVAL_WAITING", + "OPERATOR_ASSIGNMENT_WAITING", + "PREAPPROVED", + "APPROVED", + "APPROVED_FOR_FUTURE", + "REJECTED", + "DEPLOYED", + "DEPLOY_FAILED", + "UNDEPLOYED", + "UNDEPLOY_FAILED", + "CLOSE_FAILED", + "REVOKE_FAILED", + "EXPIRY_FAILED", + "REVOKING", + "REVOKED", + "EXTENDING", + "EXTENDED", + "EXTENSION_REJECTED", + "EXTENSION_FAILED", + "COMPLETING", + "COMPLETED", + "EXPIRED", + } +} + +// GetMappingListDelegatedResourceAccessRequestsRequestStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegatedResourceAccessRequestsRequestStatusEnum(val string) (ListDelegatedResourceAccessRequestsRequestStatusEnum, bool) { + enum, ok := mappingListDelegatedResourceAccessRequestsRequestStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDelegatedResourceAccessRequestsSortOrderEnum Enum with underlying type: string +type ListDelegatedResourceAccessRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListDelegatedResourceAccessRequestsSortOrderEnum +const ( + ListDelegatedResourceAccessRequestsSortOrderAsc ListDelegatedResourceAccessRequestsSortOrderEnum = "ASC" + ListDelegatedResourceAccessRequestsSortOrderDesc ListDelegatedResourceAccessRequestsSortOrderEnum = "DESC" +) + +var mappingListDelegatedResourceAccessRequestsSortOrderEnum = map[string]ListDelegatedResourceAccessRequestsSortOrderEnum{ + "ASC": ListDelegatedResourceAccessRequestsSortOrderAsc, + "DESC": ListDelegatedResourceAccessRequestsSortOrderDesc, +} + +var mappingListDelegatedResourceAccessRequestsSortOrderEnumLowerCase = map[string]ListDelegatedResourceAccessRequestsSortOrderEnum{ + "asc": ListDelegatedResourceAccessRequestsSortOrderAsc, + "desc": ListDelegatedResourceAccessRequestsSortOrderDesc, +} + +// GetListDelegatedResourceAccessRequestsSortOrderEnumValues Enumerates the set of values for ListDelegatedResourceAccessRequestsSortOrderEnum +func GetListDelegatedResourceAccessRequestsSortOrderEnumValues() []ListDelegatedResourceAccessRequestsSortOrderEnum { + values := make([]ListDelegatedResourceAccessRequestsSortOrderEnum, 0) + for _, v := range mappingListDelegatedResourceAccessRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDelegatedResourceAccessRequestsSortOrderEnumStringValues Enumerates the set of values in String for ListDelegatedResourceAccessRequestsSortOrderEnum +func GetListDelegatedResourceAccessRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDelegatedResourceAccessRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegatedResourceAccessRequestsSortOrderEnum(val string) (ListDelegatedResourceAccessRequestsSortOrderEnum, bool) { + enum, ok := mappingListDelegatedResourceAccessRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDelegatedResourceAccessRequestsSortByEnum Enum with underlying type: string +type ListDelegatedResourceAccessRequestsSortByEnum string + +// Set of constants representing the allowable values for ListDelegatedResourceAccessRequestsSortByEnum +const ( + ListDelegatedResourceAccessRequestsSortByTimecreated ListDelegatedResourceAccessRequestsSortByEnum = "timeCreated" + ListDelegatedResourceAccessRequestsSortByDisplayname ListDelegatedResourceAccessRequestsSortByEnum = "displayName" +) + +var mappingListDelegatedResourceAccessRequestsSortByEnum = map[string]ListDelegatedResourceAccessRequestsSortByEnum{ + "timeCreated": ListDelegatedResourceAccessRequestsSortByTimecreated, + "displayName": ListDelegatedResourceAccessRequestsSortByDisplayname, +} + +var mappingListDelegatedResourceAccessRequestsSortByEnumLowerCase = map[string]ListDelegatedResourceAccessRequestsSortByEnum{ + "timecreated": ListDelegatedResourceAccessRequestsSortByTimecreated, + "displayname": ListDelegatedResourceAccessRequestsSortByDisplayname, +} + +// GetListDelegatedResourceAccessRequestsSortByEnumValues Enumerates the set of values for ListDelegatedResourceAccessRequestsSortByEnum +func GetListDelegatedResourceAccessRequestsSortByEnumValues() []ListDelegatedResourceAccessRequestsSortByEnum { + values := make([]ListDelegatedResourceAccessRequestsSortByEnum, 0) + for _, v := range mappingListDelegatedResourceAccessRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDelegatedResourceAccessRequestsSortByEnumStringValues Enumerates the set of values in String for ListDelegatedResourceAccessRequestsSortByEnum +func GetListDelegatedResourceAccessRequestsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListDelegatedResourceAccessRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegatedResourceAccessRequestsSortByEnum(val string) (ListDelegatedResourceAccessRequestsSortByEnum, bool) { + enum, ok := mappingListDelegatedResourceAccessRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_delegation_control_resources_request_response.go b/delegateaccesscontrol/list_delegation_control_resources_request_response.go new file mode 100644 index 0000000000..4848ffa2e1 --- /dev/null +++ b/delegateaccesscontrol/list_delegation_control_resources_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDelegationControlResourcesRequest wrapper for the ListDelegationControlResources operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegationControlResources.go.html to see an example of how to use ListDelegationControlResourcesRequest. +type ListDelegationControlResourcesRequest struct { + + // unique Delegation Control identifier + DelegationControlId *string `mandatory:"true" contributesTo:"path" name:"delegationControlId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListDelegationControlResourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDelegationControlResourcesRequest) 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 ListDelegationControlResourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDelegationControlResourcesRequest) 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 ListDelegationControlResourcesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDelegationControlResourcesResponse wrapper for the ListDelegationControlResources operation +type ListDelegationControlResourcesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DelegationControlResourceCollection instances + DelegationControlResourceCollection `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 ListDelegationControlResourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDelegationControlResourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/list_delegation_controls_request_response.go b/delegateaccesscontrol/list_delegation_controls_request_response.go new file mode 100644 index 0000000000..bd1b145b9d --- /dev/null +++ b/delegateaccesscontrol/list_delegation_controls_request_response.go @@ -0,0 +1,256 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDelegationControlsRequest wrapper for the ListDelegationControls operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegationControls.go.html to see an example of how to use ListDelegationControlsRequest. +type ListDelegationControlsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only Delegation Control resources whose lifecycleState matches the given Delegation Control lifecycle state. + LifecycleState DelegationControlLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return Delegation Control resources that match the given display name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only resources that match the given resource type. + ResourceType ListDelegationControlsResourceTypeEnum `mandatory:"false" contributesTo:"query" name:"resourceType" omitEmpty:"true"` + + // A filter to return Delegation Control resources that match the given resource ID. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListDelegationControlsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified, default is timeCreated. + SortBy ListDelegationControlsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListDelegationControlsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDelegationControlsRequest) 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 ListDelegationControlsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDelegationControlsRequest) 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 ListDelegationControlsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDelegationControlLifecycleStateEnum(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(GetDelegationControlLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegationControlsResourceTypeEnum(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(GetListDelegationControlsResourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegationControlsSortOrderEnum(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(GetListDelegationControlsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegationControlsSortByEnum(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(GetListDelegationControlsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDelegationControlsResponse wrapper for the ListDelegationControls operation +type ListDelegationControlsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DelegationControlSummaryCollection instances + DelegationControlSummaryCollection `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 ListDelegationControlsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDelegationControlsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDelegationControlsResourceTypeEnum Enum with underlying type: string +type ListDelegationControlsResourceTypeEnum string + +// Set of constants representing the allowable values for ListDelegationControlsResourceTypeEnum +const ( + ListDelegationControlsResourceTypeVmcluster ListDelegationControlsResourceTypeEnum = "VMCLUSTER" + ListDelegationControlsResourceTypeCloudvmcluster ListDelegationControlsResourceTypeEnum = "CLOUDVMCLUSTER" +) + +var mappingListDelegationControlsResourceTypeEnum = map[string]ListDelegationControlsResourceTypeEnum{ + "VMCLUSTER": ListDelegationControlsResourceTypeVmcluster, + "CLOUDVMCLUSTER": ListDelegationControlsResourceTypeCloudvmcluster, +} + +var mappingListDelegationControlsResourceTypeEnumLowerCase = map[string]ListDelegationControlsResourceTypeEnum{ + "vmcluster": ListDelegationControlsResourceTypeVmcluster, + "cloudvmcluster": ListDelegationControlsResourceTypeCloudvmcluster, +} + +// GetListDelegationControlsResourceTypeEnumValues Enumerates the set of values for ListDelegationControlsResourceTypeEnum +func GetListDelegationControlsResourceTypeEnumValues() []ListDelegationControlsResourceTypeEnum { + values := make([]ListDelegationControlsResourceTypeEnum, 0) + for _, v := range mappingListDelegationControlsResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetListDelegationControlsResourceTypeEnumStringValues Enumerates the set of values in String for ListDelegationControlsResourceTypeEnum +func GetListDelegationControlsResourceTypeEnumStringValues() []string { + return []string{ + "VMCLUSTER", + "CLOUDVMCLUSTER", + } +} + +// GetMappingListDelegationControlsResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegationControlsResourceTypeEnum(val string) (ListDelegationControlsResourceTypeEnum, bool) { + enum, ok := mappingListDelegationControlsResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDelegationControlsSortOrderEnum Enum with underlying type: string +type ListDelegationControlsSortOrderEnum string + +// Set of constants representing the allowable values for ListDelegationControlsSortOrderEnum +const ( + ListDelegationControlsSortOrderAsc ListDelegationControlsSortOrderEnum = "ASC" + ListDelegationControlsSortOrderDesc ListDelegationControlsSortOrderEnum = "DESC" +) + +var mappingListDelegationControlsSortOrderEnum = map[string]ListDelegationControlsSortOrderEnum{ + "ASC": ListDelegationControlsSortOrderAsc, + "DESC": ListDelegationControlsSortOrderDesc, +} + +var mappingListDelegationControlsSortOrderEnumLowerCase = map[string]ListDelegationControlsSortOrderEnum{ + "asc": ListDelegationControlsSortOrderAsc, + "desc": ListDelegationControlsSortOrderDesc, +} + +// GetListDelegationControlsSortOrderEnumValues Enumerates the set of values for ListDelegationControlsSortOrderEnum +func GetListDelegationControlsSortOrderEnumValues() []ListDelegationControlsSortOrderEnum { + values := make([]ListDelegationControlsSortOrderEnum, 0) + for _, v := range mappingListDelegationControlsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDelegationControlsSortOrderEnumStringValues Enumerates the set of values in String for ListDelegationControlsSortOrderEnum +func GetListDelegationControlsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDelegationControlsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegationControlsSortOrderEnum(val string) (ListDelegationControlsSortOrderEnum, bool) { + enum, ok := mappingListDelegationControlsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDelegationControlsSortByEnum Enum with underlying type: string +type ListDelegationControlsSortByEnum string + +// Set of constants representing the allowable values for ListDelegationControlsSortByEnum +const ( + ListDelegationControlsSortByTimecreated ListDelegationControlsSortByEnum = "timeCreated" + ListDelegationControlsSortByDisplayname ListDelegationControlsSortByEnum = "displayName" +) + +var mappingListDelegationControlsSortByEnum = map[string]ListDelegationControlsSortByEnum{ + "timeCreated": ListDelegationControlsSortByTimecreated, + "displayName": ListDelegationControlsSortByDisplayname, +} + +var mappingListDelegationControlsSortByEnumLowerCase = map[string]ListDelegationControlsSortByEnum{ + "timecreated": ListDelegationControlsSortByTimecreated, + "displayname": ListDelegationControlsSortByDisplayname, +} + +// GetListDelegationControlsSortByEnumValues Enumerates the set of values for ListDelegationControlsSortByEnum +func GetListDelegationControlsSortByEnumValues() []ListDelegationControlsSortByEnum { + values := make([]ListDelegationControlsSortByEnum, 0) + for _, v := range mappingListDelegationControlsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDelegationControlsSortByEnumStringValues Enumerates the set of values in String for ListDelegationControlsSortByEnum +func GetListDelegationControlsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListDelegationControlsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegationControlsSortByEnum(val string) (ListDelegationControlsSortByEnum, bool) { + enum, ok := mappingListDelegationControlsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_delegation_subscriptions_request_response.go b/delegateaccesscontrol/list_delegation_subscriptions_request_response.go new file mode 100644 index 0000000000..3dded43987 --- /dev/null +++ b/delegateaccesscontrol/list_delegation_subscriptions_request_response.go @@ -0,0 +1,205 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDelegationSubscriptionsRequest wrapper for the ListDelegationSubscriptions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListDelegationSubscriptions.go.html to see an example of how to use ListDelegationSubscriptionsRequest. +type ListDelegationSubscriptionsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only Delegation Subscription resources whose lifecycleState matches the given Delegation Subscription lifecycle state. + LifecycleState DelegationSubscriptionLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return Delegation Subscription resources that match the given display name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListDelegationSubscriptionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified, timeCreated is default. + SortBy ListDelegationSubscriptionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListDelegationSubscriptionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDelegationSubscriptionsRequest) 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 ListDelegationSubscriptionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDelegationSubscriptionsRequest) 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 ListDelegationSubscriptionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDelegationSubscriptionLifecycleStateEnum(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(GetDelegationSubscriptionLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegationSubscriptionsSortOrderEnum(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(GetListDelegationSubscriptionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDelegationSubscriptionsSortByEnum(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(GetListDelegationSubscriptionsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDelegationSubscriptionsResponse wrapper for the ListDelegationSubscriptions operation +type ListDelegationSubscriptionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DelegationSubscriptionSummaryCollection instances + DelegationSubscriptionSummaryCollection `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 ListDelegationSubscriptionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDelegationSubscriptionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDelegationSubscriptionsSortOrderEnum Enum with underlying type: string +type ListDelegationSubscriptionsSortOrderEnum string + +// Set of constants representing the allowable values for ListDelegationSubscriptionsSortOrderEnum +const ( + ListDelegationSubscriptionsSortOrderAsc ListDelegationSubscriptionsSortOrderEnum = "ASC" + ListDelegationSubscriptionsSortOrderDesc ListDelegationSubscriptionsSortOrderEnum = "DESC" +) + +var mappingListDelegationSubscriptionsSortOrderEnum = map[string]ListDelegationSubscriptionsSortOrderEnum{ + "ASC": ListDelegationSubscriptionsSortOrderAsc, + "DESC": ListDelegationSubscriptionsSortOrderDesc, +} + +var mappingListDelegationSubscriptionsSortOrderEnumLowerCase = map[string]ListDelegationSubscriptionsSortOrderEnum{ + "asc": ListDelegationSubscriptionsSortOrderAsc, + "desc": ListDelegationSubscriptionsSortOrderDesc, +} + +// GetListDelegationSubscriptionsSortOrderEnumValues Enumerates the set of values for ListDelegationSubscriptionsSortOrderEnum +func GetListDelegationSubscriptionsSortOrderEnumValues() []ListDelegationSubscriptionsSortOrderEnum { + values := make([]ListDelegationSubscriptionsSortOrderEnum, 0) + for _, v := range mappingListDelegationSubscriptionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDelegationSubscriptionsSortOrderEnumStringValues Enumerates the set of values in String for ListDelegationSubscriptionsSortOrderEnum +func GetListDelegationSubscriptionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDelegationSubscriptionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegationSubscriptionsSortOrderEnum(val string) (ListDelegationSubscriptionsSortOrderEnum, bool) { + enum, ok := mappingListDelegationSubscriptionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDelegationSubscriptionsSortByEnum Enum with underlying type: string +type ListDelegationSubscriptionsSortByEnum string + +// Set of constants representing the allowable values for ListDelegationSubscriptionsSortByEnum +const ( + ListDelegationSubscriptionsSortByTimecreated ListDelegationSubscriptionsSortByEnum = "timeCreated" + ListDelegationSubscriptionsSortByDisplayname ListDelegationSubscriptionsSortByEnum = "displayName" +) + +var mappingListDelegationSubscriptionsSortByEnum = map[string]ListDelegationSubscriptionsSortByEnum{ + "timeCreated": ListDelegationSubscriptionsSortByTimecreated, + "displayName": ListDelegationSubscriptionsSortByDisplayname, +} + +var mappingListDelegationSubscriptionsSortByEnumLowerCase = map[string]ListDelegationSubscriptionsSortByEnum{ + "timecreated": ListDelegationSubscriptionsSortByTimecreated, + "displayname": ListDelegationSubscriptionsSortByDisplayname, +} + +// GetListDelegationSubscriptionsSortByEnumValues Enumerates the set of values for ListDelegationSubscriptionsSortByEnum +func GetListDelegationSubscriptionsSortByEnumValues() []ListDelegationSubscriptionsSortByEnum { + values := make([]ListDelegationSubscriptionsSortByEnum, 0) + for _, v := range mappingListDelegationSubscriptionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDelegationSubscriptionsSortByEnumStringValues Enumerates the set of values in String for ListDelegationSubscriptionsSortByEnum +func GetListDelegationSubscriptionsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListDelegationSubscriptionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDelegationSubscriptionsSortByEnum(val string) (ListDelegationSubscriptionsSortByEnum, bool) { + enum, ok := mappingListDelegationSubscriptionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_service_provider_actions_request_response.go b/delegateaccesscontrol/list_service_provider_actions_request_response.go new file mode 100644 index 0000000000..23fdbe8f59 --- /dev/null +++ b/delegateaccesscontrol/list_service_provider_actions_request_response.go @@ -0,0 +1,262 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListServiceProviderActionsRequest wrapper for the ListServiceProviderActions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListServiceProviderActions.go.html to see an example of how to use ListServiceProviderActionsRequest. +type ListServiceProviderActionsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the entire name given. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return only resources that match the given resource type. + ResourceType ListServiceProviderActionsResourceTypeEnum `mandatory:"false" contributesTo:"query" name:"resourceType" omitEmpty:"true"` + + // A filter to return only resources that match the given Service Provider service type. + ServiceProviderServiceType []ServiceProviderServiceTypeEnum `contributesTo:"query" name:"serviceProviderServiceType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only resources whose lifecycleState matches the given Service Provider Action lifecycleState. + LifecycleState ServiceProviderActionLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListServiceProviderActionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for name is ascending. If no value is specified, default is timeCreated. + SortBy ListServiceProviderActionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListServiceProviderActionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServiceProviderActionsRequest) 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 ListServiceProviderActionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServiceProviderActionsRequest) 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 ListServiceProviderActionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListServiceProviderActionsResourceTypeEnum(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(GetListServiceProviderActionsResourceTypeEnumStringValues(), ","))) + } + for _, val := range request.ServiceProviderServiceType { + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceProviderServiceType: %s. Supported values are: %s.", val, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingServiceProviderActionLifecycleStateEnum(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(GetServiceProviderActionLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListServiceProviderActionsSortOrderEnum(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(GetListServiceProviderActionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListServiceProviderActionsSortByEnum(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(GetListServiceProviderActionsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListServiceProviderActionsResponse wrapper for the ListServiceProviderActions operation +type ListServiceProviderActionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ServiceProviderActionSummaryCollection instances + ServiceProviderActionSummaryCollection `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 ListServiceProviderActionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServiceProviderActionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListServiceProviderActionsResourceTypeEnum Enum with underlying type: string +type ListServiceProviderActionsResourceTypeEnum string + +// Set of constants representing the allowable values for ListServiceProviderActionsResourceTypeEnum +const ( + ListServiceProviderActionsResourceTypeVmcluster ListServiceProviderActionsResourceTypeEnum = "VMCLUSTER" + ListServiceProviderActionsResourceTypeCloudvmcluster ListServiceProviderActionsResourceTypeEnum = "CLOUDVMCLUSTER" +) + +var mappingListServiceProviderActionsResourceTypeEnum = map[string]ListServiceProviderActionsResourceTypeEnum{ + "VMCLUSTER": ListServiceProviderActionsResourceTypeVmcluster, + "CLOUDVMCLUSTER": ListServiceProviderActionsResourceTypeCloudvmcluster, +} + +var mappingListServiceProviderActionsResourceTypeEnumLowerCase = map[string]ListServiceProviderActionsResourceTypeEnum{ + "vmcluster": ListServiceProviderActionsResourceTypeVmcluster, + "cloudvmcluster": ListServiceProviderActionsResourceTypeCloudvmcluster, +} + +// GetListServiceProviderActionsResourceTypeEnumValues Enumerates the set of values for ListServiceProviderActionsResourceTypeEnum +func GetListServiceProviderActionsResourceTypeEnumValues() []ListServiceProviderActionsResourceTypeEnum { + values := make([]ListServiceProviderActionsResourceTypeEnum, 0) + for _, v := range mappingListServiceProviderActionsResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetListServiceProviderActionsResourceTypeEnumStringValues Enumerates the set of values in String for ListServiceProviderActionsResourceTypeEnum +func GetListServiceProviderActionsResourceTypeEnumStringValues() []string { + return []string{ + "VMCLUSTER", + "CLOUDVMCLUSTER", + } +} + +// GetMappingListServiceProviderActionsResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceProviderActionsResourceTypeEnum(val string) (ListServiceProviderActionsResourceTypeEnum, bool) { + enum, ok := mappingListServiceProviderActionsResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServiceProviderActionsSortOrderEnum Enum with underlying type: string +type ListServiceProviderActionsSortOrderEnum string + +// Set of constants representing the allowable values for ListServiceProviderActionsSortOrderEnum +const ( + ListServiceProviderActionsSortOrderAsc ListServiceProviderActionsSortOrderEnum = "ASC" + ListServiceProviderActionsSortOrderDesc ListServiceProviderActionsSortOrderEnum = "DESC" +) + +var mappingListServiceProviderActionsSortOrderEnum = map[string]ListServiceProviderActionsSortOrderEnum{ + "ASC": ListServiceProviderActionsSortOrderAsc, + "DESC": ListServiceProviderActionsSortOrderDesc, +} + +var mappingListServiceProviderActionsSortOrderEnumLowerCase = map[string]ListServiceProviderActionsSortOrderEnum{ + "asc": ListServiceProviderActionsSortOrderAsc, + "desc": ListServiceProviderActionsSortOrderDesc, +} + +// GetListServiceProviderActionsSortOrderEnumValues Enumerates the set of values for ListServiceProviderActionsSortOrderEnum +func GetListServiceProviderActionsSortOrderEnumValues() []ListServiceProviderActionsSortOrderEnum { + values := make([]ListServiceProviderActionsSortOrderEnum, 0) + for _, v := range mappingListServiceProviderActionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListServiceProviderActionsSortOrderEnumStringValues Enumerates the set of values in String for ListServiceProviderActionsSortOrderEnum +func GetListServiceProviderActionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListServiceProviderActionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceProviderActionsSortOrderEnum(val string) (ListServiceProviderActionsSortOrderEnum, bool) { + enum, ok := mappingListServiceProviderActionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServiceProviderActionsSortByEnum Enum with underlying type: string +type ListServiceProviderActionsSortByEnum string + +// Set of constants representing the allowable values for ListServiceProviderActionsSortByEnum +const ( + ListServiceProviderActionsSortByTimecreated ListServiceProviderActionsSortByEnum = "timeCreated" + ListServiceProviderActionsSortByName ListServiceProviderActionsSortByEnum = "name" +) + +var mappingListServiceProviderActionsSortByEnum = map[string]ListServiceProviderActionsSortByEnum{ + "timeCreated": ListServiceProviderActionsSortByTimecreated, + "name": ListServiceProviderActionsSortByName, +} + +var mappingListServiceProviderActionsSortByEnumLowerCase = map[string]ListServiceProviderActionsSortByEnum{ + "timecreated": ListServiceProviderActionsSortByTimecreated, + "name": ListServiceProviderActionsSortByName, +} + +// GetListServiceProviderActionsSortByEnumValues Enumerates the set of values for ListServiceProviderActionsSortByEnum +func GetListServiceProviderActionsSortByEnumValues() []ListServiceProviderActionsSortByEnum { + values := make([]ListServiceProviderActionsSortByEnum, 0) + for _, v := range mappingListServiceProviderActionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListServiceProviderActionsSortByEnumStringValues Enumerates the set of values in String for ListServiceProviderActionsSortByEnum +func GetListServiceProviderActionsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "name", + } +} + +// GetMappingListServiceProviderActionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceProviderActionsSortByEnum(val string) (ListServiceProviderActionsSortByEnum, bool) { + enum, ok := mappingListServiceProviderActionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_service_provider_interactions_request_response.go b/delegateaccesscontrol/list_service_provider_interactions_request_response.go new file mode 100644 index 0000000000..229a98da4d --- /dev/null +++ b/delegateaccesscontrol/list_service_provider_interactions_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListServiceProviderInteractionsRequest wrapper for the ListServiceProviderInteractions operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListServiceProviderInteractions.go.html to see an example of how to use ListServiceProviderInteractionsRequest. +type ListServiceProviderInteractionsRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListServiceProviderInteractionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServiceProviderInteractionsRequest) 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 ListServiceProviderInteractionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServiceProviderInteractionsRequest) 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 ListServiceProviderInteractionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListServiceProviderInteractionsResponse wrapper for the ListServiceProviderInteractions operation +type ListServiceProviderInteractionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ServiceProviderInteractionCollection instances + ServiceProviderInteractionCollection `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 ListServiceProviderInteractionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServiceProviderInteractionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/list_service_providers_request_response.go b/delegateaccesscontrol/list_service_providers_request_response.go new file mode 100644 index 0000000000..ac4f553f64 --- /dev/null +++ b/delegateaccesscontrol/list_service_providers_request_response.go @@ -0,0 +1,259 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListServiceProvidersRequest wrapper for the ListServiceProviders operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListServiceProviders.go.html to see an example of how to use ListServiceProvidersRequest. +type ListServiceProvidersRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only Service Provider resources whose lifecycleState matches the given Service Provider lifecycle state. + LifecycleState ServiceProviderLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return Service Provider resources that match the given name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return only Service Provider resources whose supported resource type matches the given resource type. + SupportedResourceType ListServiceProvidersSupportedResourceTypeEnum `mandatory:"false" contributesTo:"query" name:"supportedResourceType" omitEmpty:"true"` + + // A filter to return only Service Provider resources whose provider type matches the given provider type. + ServiceProviderType ServiceProviderServiceProviderTypeEnum `mandatory:"false" contributesTo:"query" name:"serviceProviderType" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListServiceProvidersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for name is ascending. If no value is specified, timeCreated is default. + SortBy ListServiceProvidersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListServiceProvidersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListServiceProvidersRequest) 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 ListServiceProvidersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListServiceProvidersRequest) 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 ListServiceProvidersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingServiceProviderLifecycleStateEnum(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(GetServiceProviderLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListServiceProvidersSupportedResourceTypeEnum(string(request.SupportedResourceType)); !ok && request.SupportedResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SupportedResourceType: %s. Supported values are: %s.", request.SupportedResourceType, strings.Join(GetListServiceProvidersSupportedResourceTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingServiceProviderServiceProviderTypeEnum(string(request.ServiceProviderType)); !ok && request.ServiceProviderType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceProviderType: %s. Supported values are: %s.", request.ServiceProviderType, strings.Join(GetServiceProviderServiceProviderTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListServiceProvidersSortOrderEnum(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(GetListServiceProvidersSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListServiceProvidersSortByEnum(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(GetListServiceProvidersSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListServiceProvidersResponse wrapper for the ListServiceProviders operation +type ListServiceProvidersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ServiceProviderSummaryCollection instances + ServiceProviderSummaryCollection `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 ListServiceProvidersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListServiceProvidersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListServiceProvidersSupportedResourceTypeEnum Enum with underlying type: string +type ListServiceProvidersSupportedResourceTypeEnum string + +// Set of constants representing the allowable values for ListServiceProvidersSupportedResourceTypeEnum +const ( + ListServiceProvidersSupportedResourceTypeVmcluster ListServiceProvidersSupportedResourceTypeEnum = "VMCLUSTER" + ListServiceProvidersSupportedResourceTypeCloudvmcluster ListServiceProvidersSupportedResourceTypeEnum = "CLOUDVMCLUSTER" +) + +var mappingListServiceProvidersSupportedResourceTypeEnum = map[string]ListServiceProvidersSupportedResourceTypeEnum{ + "VMCLUSTER": ListServiceProvidersSupportedResourceTypeVmcluster, + "CLOUDVMCLUSTER": ListServiceProvidersSupportedResourceTypeCloudvmcluster, +} + +var mappingListServiceProvidersSupportedResourceTypeEnumLowerCase = map[string]ListServiceProvidersSupportedResourceTypeEnum{ + "vmcluster": ListServiceProvidersSupportedResourceTypeVmcluster, + "cloudvmcluster": ListServiceProvidersSupportedResourceTypeCloudvmcluster, +} + +// GetListServiceProvidersSupportedResourceTypeEnumValues Enumerates the set of values for ListServiceProvidersSupportedResourceTypeEnum +func GetListServiceProvidersSupportedResourceTypeEnumValues() []ListServiceProvidersSupportedResourceTypeEnum { + values := make([]ListServiceProvidersSupportedResourceTypeEnum, 0) + for _, v := range mappingListServiceProvidersSupportedResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetListServiceProvidersSupportedResourceTypeEnumStringValues Enumerates the set of values in String for ListServiceProvidersSupportedResourceTypeEnum +func GetListServiceProvidersSupportedResourceTypeEnumStringValues() []string { + return []string{ + "VMCLUSTER", + "CLOUDVMCLUSTER", + } +} + +// GetMappingListServiceProvidersSupportedResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceProvidersSupportedResourceTypeEnum(val string) (ListServiceProvidersSupportedResourceTypeEnum, bool) { + enum, ok := mappingListServiceProvidersSupportedResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServiceProvidersSortOrderEnum Enum with underlying type: string +type ListServiceProvidersSortOrderEnum string + +// Set of constants representing the allowable values for ListServiceProvidersSortOrderEnum +const ( + ListServiceProvidersSortOrderAsc ListServiceProvidersSortOrderEnum = "ASC" + ListServiceProvidersSortOrderDesc ListServiceProvidersSortOrderEnum = "DESC" +) + +var mappingListServiceProvidersSortOrderEnum = map[string]ListServiceProvidersSortOrderEnum{ + "ASC": ListServiceProvidersSortOrderAsc, + "DESC": ListServiceProvidersSortOrderDesc, +} + +var mappingListServiceProvidersSortOrderEnumLowerCase = map[string]ListServiceProvidersSortOrderEnum{ + "asc": ListServiceProvidersSortOrderAsc, + "desc": ListServiceProvidersSortOrderDesc, +} + +// GetListServiceProvidersSortOrderEnumValues Enumerates the set of values for ListServiceProvidersSortOrderEnum +func GetListServiceProvidersSortOrderEnumValues() []ListServiceProvidersSortOrderEnum { + values := make([]ListServiceProvidersSortOrderEnum, 0) + for _, v := range mappingListServiceProvidersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListServiceProvidersSortOrderEnumStringValues Enumerates the set of values in String for ListServiceProvidersSortOrderEnum +func GetListServiceProvidersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListServiceProvidersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceProvidersSortOrderEnum(val string) (ListServiceProvidersSortOrderEnum, bool) { + enum, ok := mappingListServiceProvidersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListServiceProvidersSortByEnum Enum with underlying type: string +type ListServiceProvidersSortByEnum string + +// Set of constants representing the allowable values for ListServiceProvidersSortByEnum +const ( + ListServiceProvidersSortByTimecreated ListServiceProvidersSortByEnum = "timeCreated" + ListServiceProvidersSortByDisplayname ListServiceProvidersSortByEnum = "displayName" +) + +var mappingListServiceProvidersSortByEnum = map[string]ListServiceProvidersSortByEnum{ + "timeCreated": ListServiceProvidersSortByTimecreated, + "displayName": ListServiceProvidersSortByDisplayname, +} + +var mappingListServiceProvidersSortByEnumLowerCase = map[string]ListServiceProvidersSortByEnum{ + "timecreated": ListServiceProvidersSortByTimecreated, + "displayname": ListServiceProvidersSortByDisplayname, +} + +// GetListServiceProvidersSortByEnumValues Enumerates the set of values for ListServiceProvidersSortByEnum +func GetListServiceProvidersSortByEnumValues() []ListServiceProvidersSortByEnum { + values := make([]ListServiceProvidersSortByEnum, 0) + for _, v := range mappingListServiceProvidersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListServiceProvidersSortByEnumStringValues Enumerates the set of values in String for ListServiceProvidersSortByEnum +func GetListServiceProvidersSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListServiceProvidersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListServiceProvidersSortByEnum(val string) (ListServiceProvidersSortByEnum, bool) { + enum, ok := mappingListServiceProvidersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_work_request_errors_request_response.go b/delegateaccesscontrol/list_work_request_errors_request_response.go new file mode 100644 index 0000000000..677b74e152 --- /dev/null +++ b/delegateaccesscontrol/list_work_request_errors_request_response.go @@ -0,0 +1,192 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timestamp is descending. + SortBy ListWorkRequestErrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListWorkRequestErrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestErrorsSortByEnum(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(GetListWorkRequestErrorsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestErrorsSortOrderEnum(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(GetListWorkRequestErrorsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // For 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimestamp ListWorkRequestErrorsSortByEnum = "timestamp" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +// GetListWorkRequestErrorsSortByEnumValues Enumerates the set of values for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumValues() []ListWorkRequestErrorsSortByEnum { + values := make([]ListWorkRequestErrorsSortByEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestErrorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortByEnum(val string) (ListWorkRequestErrorsSortByEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestErrorsSortOrderEnum Enum with underlying type: string +type ListWorkRequestErrorsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortOrderEnum +const ( + ListWorkRequestErrorsSortOrderAsc ListWorkRequestErrorsSortOrderEnum = "ASC" + ListWorkRequestErrorsSortOrderDesc ListWorkRequestErrorsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestErrorsSortOrderEnum = map[string]ListWorkRequestErrorsSortOrderEnum{ + "ASC": ListWorkRequestErrorsSortOrderAsc, + "DESC": ListWorkRequestErrorsSortOrderDesc, +} + +var mappingListWorkRequestErrorsSortOrderEnumLowerCase = map[string]ListWorkRequestErrorsSortOrderEnum{ + "asc": ListWorkRequestErrorsSortOrderAsc, + "desc": ListWorkRequestErrorsSortOrderDesc, +} + +// GetListWorkRequestErrorsSortOrderEnumValues Enumerates the set of values for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumValues() []ListWorkRequestErrorsSortOrderEnum { + values := make([]ListWorkRequestErrorsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestErrorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortOrderEnum(val string) (ListWorkRequestErrorsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_work_request_logs_request_response.go b/delegateaccesscontrol/list_work_request_logs_request_response.go new file mode 100644 index 0000000000..8802014a3e --- /dev/null +++ b/delegateaccesscontrol/list_work_request_logs_request_response.go @@ -0,0 +1,192 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for timestamp is descending. + SortBy ListWorkRequestLogsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListWorkRequestLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestLogsSortByEnum(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(GetListWorkRequestLogsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestLogsSortOrderEnum(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(GetListWorkRequestLogsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // For 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"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimestamp ListWorkRequestLogsSortByEnum = "timestamp" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +// GetListWorkRequestLogsSortByEnumValues Enumerates the set of values for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumValues() []ListWorkRequestLogsSortByEnum { + values := make([]ListWorkRequestLogsSortByEnum, 0) + for _, v := range mappingListWorkRequestLogsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestLogsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortByEnum(val string) (ListWorkRequestLogsSortByEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestLogsSortOrderEnum Enum with underlying type: string +type ListWorkRequestLogsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortOrderEnum +const ( + ListWorkRequestLogsSortOrderAsc ListWorkRequestLogsSortOrderEnum = "ASC" + ListWorkRequestLogsSortOrderDesc ListWorkRequestLogsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestLogsSortOrderEnum = map[string]ListWorkRequestLogsSortOrderEnum{ + "ASC": ListWorkRequestLogsSortOrderAsc, + "DESC": ListWorkRequestLogsSortOrderDesc, +} + +var mappingListWorkRequestLogsSortOrderEnumLowerCase = map[string]ListWorkRequestLogsSortOrderEnum{ + "asc": ListWorkRequestLogsSortOrderAsc, + "desc": ListWorkRequestLogsSortOrderDesc, +} + +// GetListWorkRequestLogsSortOrderEnumValues Enumerates the set of values for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumValues() []ListWorkRequestLogsSortOrderEnum { + values := make([]ListWorkRequestLogsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestLogsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestLogsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortOrderEnum(val string) (ListWorkRequestLogsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/list_work_requests_request_response.go b/delegateaccesscontrol/list_work_requests_request_response.go new file mode 100644 index 0000000000..5765dac47a --- /dev/null +++ b/delegateaccesscontrol/list_work_requests_request_response.go @@ -0,0 +1,270 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The ID of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // A filter to return only work requests with the given OperationStatus. + Status ListWorkRequestsStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + + // The ID of the resource affected by the work request. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The sort order to use, either 'asc' or 'desc'. + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. + SortBy ListWorkRequestsSortByEnum `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 ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestsStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetListWorkRequestsStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortOrderEnum(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(GetListWorkRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortByEnum(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(GetListWorkRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For 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 ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsStatusEnum Enum with underlying type: string +type ListWorkRequestsStatusEnum string + +// Set of constants representing the allowable values for ListWorkRequestsStatusEnum +const ( + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "needs_attention": ListWorkRequestsStatusNeedsAttention, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, +} + +// GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumValues() []ListWorkRequestsStatusEnum { + values := make([]ListWorkRequestsStatusEnum, 0) + for _, v := range mappingListWorkRequestsStatusEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsStatusEnumStringValues Enumerates the set of values in String for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingListWorkRequestsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsStatusEnum(val string) (ListWorkRequestsStatusEnum, bool) { + enum, ok := mappingListWorkRequestsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrderEnum = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +var mappingListWorkRequestsSortOrderEnumLowerCase = map[string]ListWorkRequestsSortOrderEnum{ + "asc": ListWorkRequestsSortOrderAsc, + "desc": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortOrderEnum(val string) (ListWorkRequestsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortByTimeaccepted ListWorkRequestsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestsSortByEnum = map[string]ListWorkRequestsSortByEnum{ + "timeAccepted": ListWorkRequestsSortByTimeaccepted, +} + +var mappingListWorkRequestsSortByEnumLowerCase = map[string]ListWorkRequestsSortByEnum{ + "timeaccepted": ListWorkRequestsSortByTimeaccepted, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortByEnum(val string) (ListWorkRequestsSortByEnum, bool) { + enum, ok := mappingListWorkRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/operation_status.go b/delegateaccesscontrol/operation_status.go new file mode 100644 index 0000000000..cc83414c3f --- /dev/null +++ b/delegateaccesscontrol/operation_status.go @@ -0,0 +1,84 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "needs_attention": OperationStatusNeedsAttention, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/operation_type.go b/delegateaccesscontrol/operation_type.go new file mode 100644 index 0000000000..9acdfce409 --- /dev/null +++ b/delegateaccesscontrol/operation_type.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypeCreateDelegationControl OperationTypeEnum = "CREATE_DELEGATION_CONTROL" + OperationTypeUpdateDelegationControl OperationTypeEnum = "UPDATE_DELEGATION_CONTROL" + OperationTypeDeleteDelegationControl OperationTypeEnum = "DELETE_DELEGATION_CONTROL" + OperationTypeMoveDelegationControl OperationTypeEnum = "MOVE_DELEGATION_CONTROL" + OperationTypeCreateDelegatedResourceAccessRequest OperationTypeEnum = "CREATE_DELEGATED_RESOURCE_ACCESS_REQUEST" + OperationTypeApproveDelegatedResourceAccessRequest OperationTypeEnum = "APPROVE_DELEGATED_RESOURCE_ACCESS_REQUEST" + OperationTypeRejectDelegatedResourceAccessRequest OperationTypeEnum = "REJECT_DELEGATED_RESOURCE_ACCESS_REQUEST" + OperationTypeRevokeDelegatedResourceAccessRequest OperationTypeEnum = "REVOKE_DELEGATED_RESOURCE_ACCESS_REQUEST" + OperationTypeCreateDelegationSubscription OperationTypeEnum = "CREATE_DELEGATION_SUBSCRIPTION" + OperationTypeUpdateDelegationSubscription OperationTypeEnum = "UPDATE_DELEGATION_SUBSCRIPTION" + OperationTypeDeleteDelegationSubscription OperationTypeEnum = "DELETE_DELEGATION_SUBSCRIPTION" + OperationTypeMoveDelegationSubscription OperationTypeEnum = "MOVE_DELEGATION_SUBSCRIPTION" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "CREATE_DELEGATION_CONTROL": OperationTypeCreateDelegationControl, + "UPDATE_DELEGATION_CONTROL": OperationTypeUpdateDelegationControl, + "DELETE_DELEGATION_CONTROL": OperationTypeDeleteDelegationControl, + "MOVE_DELEGATION_CONTROL": OperationTypeMoveDelegationControl, + "CREATE_DELEGATED_RESOURCE_ACCESS_REQUEST": OperationTypeCreateDelegatedResourceAccessRequest, + "APPROVE_DELEGATED_RESOURCE_ACCESS_REQUEST": OperationTypeApproveDelegatedResourceAccessRequest, + "REJECT_DELEGATED_RESOURCE_ACCESS_REQUEST": OperationTypeRejectDelegatedResourceAccessRequest, + "REVOKE_DELEGATED_RESOURCE_ACCESS_REQUEST": OperationTypeRevokeDelegatedResourceAccessRequest, + "CREATE_DELEGATION_SUBSCRIPTION": OperationTypeCreateDelegationSubscription, + "UPDATE_DELEGATION_SUBSCRIPTION": OperationTypeUpdateDelegationSubscription, + "DELETE_DELEGATION_SUBSCRIPTION": OperationTypeDeleteDelegationSubscription, + "MOVE_DELEGATION_SUBSCRIPTION": OperationTypeMoveDelegationSubscription, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "create_delegation_control": OperationTypeCreateDelegationControl, + "update_delegation_control": OperationTypeUpdateDelegationControl, + "delete_delegation_control": OperationTypeDeleteDelegationControl, + "move_delegation_control": OperationTypeMoveDelegationControl, + "create_delegated_resource_access_request": OperationTypeCreateDelegatedResourceAccessRequest, + "approve_delegated_resource_access_request": OperationTypeApproveDelegatedResourceAccessRequest, + "reject_delegated_resource_access_request": OperationTypeRejectDelegatedResourceAccessRequest, + "revoke_delegated_resource_access_request": OperationTypeRevokeDelegatedResourceAccessRequest, + "create_delegation_subscription": OperationTypeCreateDelegationSubscription, + "update_delegation_subscription": OperationTypeUpdateDelegationSubscription, + "delete_delegation_subscription": OperationTypeDeleteDelegationSubscription, + "move_delegation_subscription": OperationTypeMoveDelegationSubscription, +} + +// GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum +func GetOperationTypeEnumValues() []OperationTypeEnum { + values := make([]OperationTypeEnum, 0) + for _, v := range mappingOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypeEnumStringValues Enumerates the set of values in String for OperationTypeEnum +func GetOperationTypeEnumStringValues() []string { + return []string{ + "CREATE_DELEGATION_CONTROL", + "UPDATE_DELEGATION_CONTROL", + "DELETE_DELEGATION_CONTROL", + "MOVE_DELEGATION_CONTROL", + "CREATE_DELEGATED_RESOURCE_ACCESS_REQUEST", + "APPROVE_DELEGATED_RESOURCE_ACCESS_REQUEST", + "REJECT_DELEGATED_RESOURCE_ACCESS_REQUEST", + "REVOKE_DELEGATED_RESOURCE_ACCESS_REQUEST", + "CREATE_DELEGATION_SUBSCRIPTION", + "UPDATE_DELEGATION_SUBSCRIPTION", + "DELETE_DELEGATION_SUBSCRIPTION", + "MOVE_DELEGATION_SUBSCRIPTION", + } +} + +// GetMappingOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypeEnum(val string) (OperationTypeEnum, bool) { + enum, ok := mappingOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/reject_delegated_resource_access_request_details.go b/delegateaccesscontrol/reject_delegated_resource_access_request_details.go new file mode 100644 index 0000000000..3e60df21f4 --- /dev/null +++ b/delegateaccesscontrol/reject_delegated_resource_access_request_details.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RejectDelegatedResourceAccessRequestDetails Summary of why the Delegated Resource Access Request was rejected. +type RejectDelegatedResourceAccessRequestDetails struct { + + // Comment by the approver explaining why the request is rejected. + ApproverComment *string `mandatory:"false" json:"approverComment"` +} + +func (m RejectDelegatedResourceAccessRequestDetails) 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 RejectDelegatedResourceAccessRequestDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/reject_delegated_resource_access_request_request_response.go b/delegateaccesscontrol/reject_delegated_resource_access_request_request_response.go new file mode 100644 index 0000000000..72e0e78916 --- /dev/null +++ b/delegateaccesscontrol/reject_delegated_resource_access_request_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RejectDelegatedResourceAccessRequestRequest wrapper for the RejectDelegatedResourceAccessRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/RejectDelegatedResourceAccessRequest.go.html to see an example of how to use RejectDelegatedResourceAccessRequestRequest. +type RejectDelegatedResourceAccessRequestRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // Details regarding the rejection of a Delegated Resource Access Request created by the support operator. + RejectDelegatedResourceAccessRequestDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RejectDelegatedResourceAccessRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RejectDelegatedResourceAccessRequestRequest) 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 RejectDelegatedResourceAccessRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RejectDelegatedResourceAccessRequestRequest) 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 RejectDelegatedResourceAccessRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RejectDelegatedResourceAccessRequestResponse wrapper for the RejectDelegatedResourceAccessRequest operation +type RejectDelegatedResourceAccessRequestResponse 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 RejectDelegatedResourceAccessRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RejectDelegatedResourceAccessRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/revoke_delegated_resource_access_request_details.go b/delegateaccesscontrol/revoke_delegated_resource_access_request_details.go new file mode 100644 index 0000000000..dbd593a705 --- /dev/null +++ b/delegateaccesscontrol/revoke_delegated_resource_access_request_details.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RevokeDelegatedResourceAccessRequestDetails Summary of why the already approved Delegated Resource Access Request was revoked. +type RevokeDelegatedResourceAccessRequestDetails struct { + + // Comment specified by the approver explaining why the approval is revoked. + ApproverComment *string `mandatory:"false" json:"approverComment"` +} + +func (m RevokeDelegatedResourceAccessRequestDetails) 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 RevokeDelegatedResourceAccessRequestDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/revoke_delegated_resource_access_request_request_response.go b/delegateaccesscontrol/revoke_delegated_resource_access_request_request_response.go new file mode 100644 index 0000000000..bf56404b96 --- /dev/null +++ b/delegateaccesscontrol/revoke_delegated_resource_access_request_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RevokeDelegatedResourceAccessRequestRequest wrapper for the RevokeDelegatedResourceAccessRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/RevokeDelegatedResourceAccessRequest.go.html to see an example of how to use RevokeDelegatedResourceAccessRequestRequest. +type RevokeDelegatedResourceAccessRequestRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // Details regarding the revocation of a Delegated Resource Access Request created by the support operator. + RevokeDelegatedResourceAccessRequestDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RevokeDelegatedResourceAccessRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RevokeDelegatedResourceAccessRequestRequest) 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 RevokeDelegatedResourceAccessRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RevokeDelegatedResourceAccessRequestRequest) 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 RevokeDelegatedResourceAccessRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RevokeDelegatedResourceAccessRequestResponse wrapper for the RevokeDelegatedResourceAccessRequest operation +type RevokeDelegatedResourceAccessRequestResponse 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 RevokeDelegatedResourceAccessRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RevokeDelegatedResourceAccessRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/service_provider.go b/delegateaccesscontrol/service_provider.go new file mode 100644 index 0000000000..1e1a222cf4 --- /dev/null +++ b/delegateaccesscontrol/service_provider.go @@ -0,0 +1,200 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProvider Details of the Service Provider. Service provider offers services to the customer to support the delegated resources. +type ServiceProvider struct { + + // Unique identifier for the Service Provider. + Id *string `mandatory:"true" json:"id"` + + // Unique name of the Service Provider. + Name *string `mandatory:"true" json:"name"` + + // Service Provider type. + ServiceProviderType ServiceProviderServiceProviderTypeEnum `mandatory:"true" json:"serviceProviderType"` + + // Types of services offered by this provider. + ServiceTypes []ServiceProviderServiceTypeEnum `mandatory:"true" json:"serviceTypes"` + + // Resource types for which this provider will provide service. Default to all if not specified. + SupportedResourceTypes []DelegationControlResourceTypeEnum `mandatory:"true" json:"supportedResourceTypes"` + + // The OCID of the compartment that contains the Delegation Control. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Description of the Service Provider. + Description *string `mandatory:"false" json:"description"` + + // The current lifecycle state of the Service Provider. + LifecycleState ServiceProviderLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Time when the Service Provider was created expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Service Provider was last modified expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // 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 ServiceProvider) 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 ServiceProvider) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingServiceProviderServiceProviderTypeEnum(string(m.ServiceProviderType)); !ok && m.ServiceProviderType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceProviderType: %s. Supported values are: %s.", m.ServiceProviderType, strings.Join(GetServiceProviderServiceProviderTypeEnumStringValues(), ","))) + } + for _, val := range m.ServiceTypes { + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceTypes: %s. Supported values are: %s.", val, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + } + + for _, val := range m.SupportedResourceTypes { + if _, ok := GetMappingDelegationControlResourceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SupportedResourceTypes: %s. Supported values are: %s.", val, strings.Join(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingServiceProviderLifecycleStateEnum(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(GetServiceProviderLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ServiceProviderServiceProviderTypeEnum Enum with underlying type: string +type ServiceProviderServiceProviderTypeEnum string + +// Set of constants representing the allowable values for ServiceProviderServiceProviderTypeEnum +const ( + ServiceProviderServiceProviderTypeOracleProvided ServiceProviderServiceProviderTypeEnum = "ORACLE_PROVIDED" +) + +var mappingServiceProviderServiceProviderTypeEnum = map[string]ServiceProviderServiceProviderTypeEnum{ + "ORACLE_PROVIDED": ServiceProviderServiceProviderTypeOracleProvided, +} + +var mappingServiceProviderServiceProviderTypeEnumLowerCase = map[string]ServiceProviderServiceProviderTypeEnum{ + "oracle_provided": ServiceProviderServiceProviderTypeOracleProvided, +} + +// GetServiceProviderServiceProviderTypeEnumValues Enumerates the set of values for ServiceProviderServiceProviderTypeEnum +func GetServiceProviderServiceProviderTypeEnumValues() []ServiceProviderServiceProviderTypeEnum { + values := make([]ServiceProviderServiceProviderTypeEnum, 0) + for _, v := range mappingServiceProviderServiceProviderTypeEnum { + values = append(values, v) + } + return values +} + +// GetServiceProviderServiceProviderTypeEnumStringValues Enumerates the set of values in String for ServiceProviderServiceProviderTypeEnum +func GetServiceProviderServiceProviderTypeEnumStringValues() []string { + return []string{ + "ORACLE_PROVIDED", + } +} + +// GetMappingServiceProviderServiceProviderTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingServiceProviderServiceProviderTypeEnum(val string) (ServiceProviderServiceProviderTypeEnum, bool) { + enum, ok := mappingServiceProviderServiceProviderTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ServiceProviderLifecycleStateEnum Enum with underlying type: string +type ServiceProviderLifecycleStateEnum string + +// Set of constants representing the allowable values for ServiceProviderLifecycleStateEnum +const ( + ServiceProviderLifecycleStateCreating ServiceProviderLifecycleStateEnum = "CREATING" + ServiceProviderLifecycleStateActive ServiceProviderLifecycleStateEnum = "ACTIVE" + ServiceProviderLifecycleStateUpdating ServiceProviderLifecycleStateEnum = "UPDATING" + ServiceProviderLifecycleStateDeleting ServiceProviderLifecycleStateEnum = "DELETING" + ServiceProviderLifecycleStateDeleted ServiceProviderLifecycleStateEnum = "DELETED" + ServiceProviderLifecycleStateFailed ServiceProviderLifecycleStateEnum = "FAILED" +) + +var mappingServiceProviderLifecycleStateEnum = map[string]ServiceProviderLifecycleStateEnum{ + "CREATING": ServiceProviderLifecycleStateCreating, + "ACTIVE": ServiceProviderLifecycleStateActive, + "UPDATING": ServiceProviderLifecycleStateUpdating, + "DELETING": ServiceProviderLifecycleStateDeleting, + "DELETED": ServiceProviderLifecycleStateDeleted, + "FAILED": ServiceProviderLifecycleStateFailed, +} + +var mappingServiceProviderLifecycleStateEnumLowerCase = map[string]ServiceProviderLifecycleStateEnum{ + "creating": ServiceProviderLifecycleStateCreating, + "active": ServiceProviderLifecycleStateActive, + "updating": ServiceProviderLifecycleStateUpdating, + "deleting": ServiceProviderLifecycleStateDeleting, + "deleted": ServiceProviderLifecycleStateDeleted, + "failed": ServiceProviderLifecycleStateFailed, +} + +// GetServiceProviderLifecycleStateEnumValues Enumerates the set of values for ServiceProviderLifecycleStateEnum +func GetServiceProviderLifecycleStateEnumValues() []ServiceProviderLifecycleStateEnum { + values := make([]ServiceProviderLifecycleStateEnum, 0) + for _, v := range mappingServiceProviderLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetServiceProviderLifecycleStateEnumStringValues Enumerates the set of values in String for ServiceProviderLifecycleStateEnum +func GetServiceProviderLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingServiceProviderLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingServiceProviderLifecycleStateEnum(val string) (ServiceProviderLifecycleStateEnum, bool) { + enum, ok := mappingServiceProviderLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/service_provider_action.go b/delegateaccesscontrol/service_provider_action.go new file mode 100644 index 0000000000..4334eacbb7 --- /dev/null +++ b/delegateaccesscontrol/service_provider_action.go @@ -0,0 +1,123 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderAction Details of the Service Provider Action. Service provider actions are a pre-defined set of commands available to the support operator on different layers of the infrastructure. Although the groupings may differ depending on the infrastructure layers, +// the groups are designed to enable the support operator access to commands to resolve a specific set of issues. +type ServiceProviderAction struct { + + // Unique Oracle assigned identifier for the Service Provider Action. + Id *string `mandatory:"true" json:"id"` + + // Unique name of the Service Provider Action. + Name *string `mandatory:"true" json:"name"` + + // Display Name of the Service Provider Action. + CustomerDisplayName *string `mandatory:"false" json:"customerDisplayName"` + + // Name of the infrastructure layer associated with the Service Provider Action. + Component *string `mandatory:"false" json:"component"` + + // resourceType for which the ServiceProviderAction is applicable + ResourceType DelegationControlResourceTypeEnum `mandatory:"false" json:"resourceType,omitempty"` + + // List of Service Provider Service Types that this Service Provider Action is applicable to. + ServiceProviderServiceTypes []ServiceProviderServiceTypeEnum `mandatory:"false" json:"serviceProviderServiceTypes,omitempty"` + + // The current lifecycle state of the Service Provider Action. + LifecycleState ServiceProviderActionLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the Service Provider Action in terms of associated risk profile, and characteristics of the operating system commands made + // available to the support operator under this Service Provider Action. + Description *string `mandatory:"false" json:"description"` + + // Fine grained properties associated with the Delegation Control. + Properties []ServiceProviderActionProperties `mandatory:"false" json:"properties"` +} + +func (m ServiceProviderAction) 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 ServiceProviderAction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegationControlResourceTypeEnum(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(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + for _, val := range m.ServiceProviderServiceTypes { + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceProviderServiceTypes: %s. Supported values are: %s.", val, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingServiceProviderActionLifecycleStateEnum(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(GetServiceProviderActionLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ServiceProviderActionLifecycleStateEnum Enum with underlying type: string +type ServiceProviderActionLifecycleStateEnum string + +// Set of constants representing the allowable values for ServiceProviderActionLifecycleStateEnum +const ( + ServiceProviderActionLifecycleStateActive ServiceProviderActionLifecycleStateEnum = "ACTIVE" + ServiceProviderActionLifecycleStateInactive ServiceProviderActionLifecycleStateEnum = "INACTIVE" +) + +var mappingServiceProviderActionLifecycleStateEnum = map[string]ServiceProviderActionLifecycleStateEnum{ + "ACTIVE": ServiceProviderActionLifecycleStateActive, + "INACTIVE": ServiceProviderActionLifecycleStateInactive, +} + +var mappingServiceProviderActionLifecycleStateEnumLowerCase = map[string]ServiceProviderActionLifecycleStateEnum{ + "active": ServiceProviderActionLifecycleStateActive, + "inactive": ServiceProviderActionLifecycleStateInactive, +} + +// GetServiceProviderActionLifecycleStateEnumValues Enumerates the set of values for ServiceProviderActionLifecycleStateEnum +func GetServiceProviderActionLifecycleStateEnumValues() []ServiceProviderActionLifecycleStateEnum { + values := make([]ServiceProviderActionLifecycleStateEnum, 0) + for _, v := range mappingServiceProviderActionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetServiceProviderActionLifecycleStateEnumStringValues Enumerates the set of values in String for ServiceProviderActionLifecycleStateEnum +func GetServiceProviderActionLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + } +} + +// GetMappingServiceProviderActionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingServiceProviderActionLifecycleStateEnum(val string) (ServiceProviderActionLifecycleStateEnum, bool) { + enum, ok := mappingServiceProviderActionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/service_provider_action_properties.go b/delegateaccesscontrol/service_provider_action_properties.go new file mode 100644 index 0000000000..e4a11783ee --- /dev/null +++ b/delegateaccesscontrol/service_provider_action_properties.go @@ -0,0 +1,46 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderActionProperties Details of the properties of Service Provider Action. +type ServiceProviderActionProperties struct { + + // Name of the property + Name *string `mandatory:"false" json:"name"` + + // value of the property + Value *string `mandatory:"false" json:"value"` +} + +func (m ServiceProviderActionProperties) 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 ServiceProviderActionProperties) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/service_provider_action_summary.go b/delegateaccesscontrol/service_provider_action_summary.go new file mode 100644 index 0000000000..c8f9fad3f5 --- /dev/null +++ b/delegateaccesscontrol/service_provider_action_summary.go @@ -0,0 +1,77 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderActionSummary Details of the Service Provider Action. Service provider actions are pre-defined set of commands available to the support operator on different layers of the infrastructure. +type ServiceProviderActionSummary struct { + + // Unique identifier assigned by Oracle to a Service Provider Action. + Id *string `mandatory:"true" json:"id"` + + // Name of the Service Provider Action. + Name *string `mandatory:"true" json:"name"` + + // Display Name of the Service Provider Action. + CustomerDisplayName *string `mandatory:"false" json:"customerDisplayName"` + + // Name of the component for which the Service Provider Action is applicable. + Component *string `mandatory:"false" json:"component"` + + // resourceType for which the ServiceProviderAction is applicable + ResourceType DelegationControlResourceTypeEnum `mandatory:"false" json:"resourceType,omitempty"` + + // List of Service Provider Service Types that this Service Provider Action is applicable to. + ServiceProviderServiceTypes []ServiceProviderServiceTypeEnum `mandatory:"false" json:"serviceProviderServiceTypes,omitempty"` + + // The current lifecycle state of the Service Provider Action. + LifecycleState ServiceProviderActionLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the Service Provider Action in terms of associated risk profile, and characteristics of the operating system commands made + // available to the support operator under this Service Provider Action. + Description *string `mandatory:"false" json:"description"` +} + +func (m ServiceProviderActionSummary) 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 ServiceProviderActionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegationControlResourceTypeEnum(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(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + for _, val := range m.ServiceProviderServiceTypes { + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceProviderServiceTypes: %s. Supported values are: %s.", val, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingServiceProviderActionLifecycleStateEnum(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(GetServiceProviderActionLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/service_provider_action_summary_collection.go b/delegateaccesscontrol/service_provider_action_summary_collection.go new file mode 100644 index 0000000000..3fc1e8e360 --- /dev/null +++ b/delegateaccesscontrol/service_provider_action_summary_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderActionSummaryCollection List of ServiceProviderActionSummary resources. +type ServiceProviderActionSummaryCollection struct { + + // contains ServiceProviderActionSummary + Items []ServiceProviderActionSummary `mandatory:"true" json:"items"` +} + +func (m ServiceProviderActionSummaryCollection) 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 ServiceProviderActionSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/service_provider_interaction_collection.go b/delegateaccesscontrol/service_provider_interaction_collection.go new file mode 100644 index 0000000000..ddb2c41c9c --- /dev/null +++ b/delegateaccesscontrol/service_provider_interaction_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderInteractionCollection Results of access request additionalInfo search, which contains details of the conversation between customer and operator. +type ServiceProviderInteractionCollection struct { + + // contains ServiceProviderInteractionSummary + Items []ServiceProviderInteractionSummary `mandatory:"true" json:"items"` +} + +func (m ServiceProviderInteractionCollection) 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 ServiceProviderInteractionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/service_provider_interaction_request_details.go b/delegateaccesscontrol/service_provider_interaction_request_details.go new file mode 100644 index 0000000000..769fd5fa6e --- /dev/null +++ b/delegateaccesscontrol/service_provider_interaction_request_details.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderInteractionRequestDetails Details for asking operator to provide more information. +type ServiceProviderInteractionRequestDetails struct { + + // Questions for operator to provide more information. + MoreInfoDetails *string `mandatory:"false" json:"moreInfoDetails"` +} + +func (m ServiceProviderInteractionRequestDetails) 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 ServiceProviderInteractionRequestDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/service_provider_interaction_request_request_response.go b/delegateaccesscontrol/service_provider_interaction_request_request_response.go new file mode 100644 index 0000000000..6f8c354854 --- /dev/null +++ b/delegateaccesscontrol/service_provider_interaction_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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ServiceProviderInteractionRequestRequest wrapper for the ServiceProviderInteractionRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/ServiceProviderInteractionRequest.go.html to see an example of how to use ServiceProviderInteractionRequestRequest. +type ServiceProviderInteractionRequestRequest struct { + + // Unique Delegated Resource Access Request identifier + DelegatedResourceAccessRequestId *string `mandatory:"true" contributesTo:"path" name:"delegatedResourceAccessRequestId"` + + // Details containing Query for additional information provided by Customer. + ServiceProviderInteractionRequestDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ServiceProviderInteractionRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ServiceProviderInteractionRequestRequest) 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 ServiceProviderInteractionRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ServiceProviderInteractionRequestRequest) 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 ServiceProviderInteractionRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ServiceProviderInteractionRequestResponse wrapper for the ServiceProviderInteractionRequest operation +type ServiceProviderInteractionRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ServiceProviderInteractionRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ServiceProviderInteractionRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/service_provider_interaction_summary.go b/delegateaccesscontrol/service_provider_interaction_summary.go new file mode 100644 index 0000000000..3a6d534f0c --- /dev/null +++ b/delegateaccesscontrol/service_provider_interaction_summary.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderInteractionSummary Summary of customer and operator conversation. +type ServiceProviderInteractionSummary struct { + + // The unique identifier of the message within the scope of the associated access request. + MessageIdentifier *string `mandatory:"false" json:"messageIdentifier"` + + // ID of the customer or operator who is part of this conversation. For operator, this field is null. + UserId *string `mandatory:"false" json:"userId"` + + // Name of the customer or operator who is part of this conversation. For operator, the name is "Operator". + UserName *string `mandatory:"false" json:"userName"` + + // The information exchanged between the customer and the operator. + Message *string `mandatory:"false" json:"message"` + + // Indicates whether the user is a customer or an operator. + UserType ServiceProviderInteractionSummaryUserTypeEnum `mandatory:"false" json:"userType,omitempty"` + + // Time when the conversation happened in RFC 3339 (https://tools.ietf.org/html/rfc3339)timestamp format, e.g. '2020-05-22T21:10:29.600Z'. + Timestamp *common.SDKTime `mandatory:"false" json:"timestamp"` +} + +func (m ServiceProviderInteractionSummary) 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 ServiceProviderInteractionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingServiceProviderInteractionSummaryUserTypeEnum(string(m.UserType)); !ok && m.UserType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UserType: %s. Supported values are: %s.", m.UserType, strings.Join(GetServiceProviderInteractionSummaryUserTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ServiceProviderInteractionSummaryUserTypeEnum Enum with underlying type: string +type ServiceProviderInteractionSummaryUserTypeEnum string + +// Set of constants representing the allowable values for ServiceProviderInteractionSummaryUserTypeEnum +const ( + ServiceProviderInteractionSummaryUserTypeCustomer ServiceProviderInteractionSummaryUserTypeEnum = "CUSTOMER" + ServiceProviderInteractionSummaryUserTypeOperator ServiceProviderInteractionSummaryUserTypeEnum = "OPERATOR" +) + +var mappingServiceProviderInteractionSummaryUserTypeEnum = map[string]ServiceProviderInteractionSummaryUserTypeEnum{ + "CUSTOMER": ServiceProviderInteractionSummaryUserTypeCustomer, + "OPERATOR": ServiceProviderInteractionSummaryUserTypeOperator, +} + +var mappingServiceProviderInteractionSummaryUserTypeEnumLowerCase = map[string]ServiceProviderInteractionSummaryUserTypeEnum{ + "customer": ServiceProviderInteractionSummaryUserTypeCustomer, + "operator": ServiceProviderInteractionSummaryUserTypeOperator, +} + +// GetServiceProviderInteractionSummaryUserTypeEnumValues Enumerates the set of values for ServiceProviderInteractionSummaryUserTypeEnum +func GetServiceProviderInteractionSummaryUserTypeEnumValues() []ServiceProviderInteractionSummaryUserTypeEnum { + values := make([]ServiceProviderInteractionSummaryUserTypeEnum, 0) + for _, v := range mappingServiceProviderInteractionSummaryUserTypeEnum { + values = append(values, v) + } + return values +} + +// GetServiceProviderInteractionSummaryUserTypeEnumStringValues Enumerates the set of values in String for ServiceProviderInteractionSummaryUserTypeEnum +func GetServiceProviderInteractionSummaryUserTypeEnumStringValues() []string { + return []string{ + "CUSTOMER", + "OPERATOR", + } +} + +// GetMappingServiceProviderInteractionSummaryUserTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingServiceProviderInteractionSummaryUserTypeEnum(val string) (ServiceProviderInteractionSummaryUserTypeEnum, bool) { + enum, ok := mappingServiceProviderInteractionSummaryUserTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/service_provider_service_type.go b/delegateaccesscontrol/service_provider_service_type.go new file mode 100644 index 0000000000..505c5e3f01 --- /dev/null +++ b/delegateaccesscontrol/service_provider_service_type.go @@ -0,0 +1,60 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// ServiceProviderServiceTypeEnum Enum with underlying type: string +type ServiceProviderServiceTypeEnum string + +// Set of constants representing the allowable values for ServiceProviderServiceTypeEnum +const ( + ServiceProviderServiceTypeTroubleshooting ServiceProviderServiceTypeEnum = "TROUBLESHOOTING" + ServiceProviderServiceTypeAssistedPatching ServiceProviderServiceTypeEnum = "ASSISTED_PATCHING" +) + +var mappingServiceProviderServiceTypeEnum = map[string]ServiceProviderServiceTypeEnum{ + "TROUBLESHOOTING": ServiceProviderServiceTypeTroubleshooting, + "ASSISTED_PATCHING": ServiceProviderServiceTypeAssistedPatching, +} + +var mappingServiceProviderServiceTypeEnumLowerCase = map[string]ServiceProviderServiceTypeEnum{ + "troubleshooting": ServiceProviderServiceTypeTroubleshooting, + "assisted_patching": ServiceProviderServiceTypeAssistedPatching, +} + +// GetServiceProviderServiceTypeEnumValues Enumerates the set of values for ServiceProviderServiceTypeEnum +func GetServiceProviderServiceTypeEnumValues() []ServiceProviderServiceTypeEnum { + values := make([]ServiceProviderServiceTypeEnum, 0) + for _, v := range mappingServiceProviderServiceTypeEnum { + values = append(values, v) + } + return values +} + +// GetServiceProviderServiceTypeEnumStringValues Enumerates the set of values in String for ServiceProviderServiceTypeEnum +func GetServiceProviderServiceTypeEnumStringValues() []string { + return []string{ + "TROUBLESHOOTING", + "ASSISTED_PATCHING", + } +} + +// GetMappingServiceProviderServiceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingServiceProviderServiceTypeEnum(val string) (ServiceProviderServiceTypeEnum, bool) { + enum, ok := mappingServiceProviderServiceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/service_provider_summary.go b/delegateaccesscontrol/service_provider_summary.go new file mode 100644 index 0000000000..bf4cd6bd9d --- /dev/null +++ b/delegateaccesscontrol/service_provider_summary.go @@ -0,0 +1,102 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderSummary Summary of the Service Provider. Service provider offers services to the customer to support the delegated resources. +type ServiceProviderSummary struct { + + // Unique identifier for the Service Provider. + Id *string `mandatory:"true" json:"id"` + + // Unique name of the Service Provider. + Name *string `mandatory:"true" json:"name"` + + // The OCID of the compartment that contains the Delegation Control. + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // Service Provider type. + ServiceProviderType ServiceProviderServiceProviderTypeEnum `mandatory:"false" json:"serviceProviderType,omitempty"` + + // Types of services offered by this provider. + ServiceTypes []ServiceProviderServiceTypeEnum `mandatory:"false" json:"serviceTypes,omitempty"` + + // Resource types for which this provider will provide service. Default to all if not specified. + SupportedResourceTypes []DelegationControlResourceTypeEnum `mandatory:"false" json:"supportedResourceTypes,omitempty"` + + // The current lifecycle state of the Service Provider. + LifecycleState ServiceProviderLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Description of the current lifecycle state in more detail. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Time when the Service Provider was created expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // Time when the Service Provider was last modified expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format, e.g. '2020-05-22T21:10:29.600Z' + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // 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 ServiceProviderSummary) 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 ServiceProviderSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingServiceProviderServiceProviderTypeEnum(string(m.ServiceProviderType)); !ok && m.ServiceProviderType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceProviderType: %s. Supported values are: %s.", m.ServiceProviderType, strings.Join(GetServiceProviderServiceProviderTypeEnumStringValues(), ","))) + } + for _, val := range m.ServiceTypes { + if _, ok := GetMappingServiceProviderServiceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceTypes: %s. Supported values are: %s.", val, strings.Join(GetServiceProviderServiceTypeEnumStringValues(), ","))) + } + } + + for _, val := range m.SupportedResourceTypes { + if _, ok := GetMappingDelegationControlResourceTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SupportedResourceTypes: %s. Supported values are: %s.", val, strings.Join(GetDelegationControlResourceTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingServiceProviderLifecycleStateEnum(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(GetServiceProviderLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/service_provider_summary_collection.go b/delegateaccesscontrol/service_provider_summary_collection.go new file mode 100644 index 0000000000..0dfd7d0b67 --- /dev/null +++ b/delegateaccesscontrol/service_provider_summary_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ServiceProviderSummaryCollection List of ServiceProviderSummary objects. +type ServiceProviderSummaryCollection struct { + + // List of ServiceProviderSummary objects. + Items []ServiceProviderSummary `mandatory:"true" json:"items"` +} + +func (m ServiceProviderSummaryCollection) 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 ServiceProviderSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/sort_orders.go b/delegateaccesscontrol/sort_orders.go new file mode 100644 index 0000000000..2e140060fb --- /dev/null +++ b/delegateaccesscontrol/sort_orders.go @@ -0,0 +1,60 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// SortOrdersEnum Enum with underlying type: string +type SortOrdersEnum string + +// Set of constants representing the allowable values for SortOrdersEnum +const ( + SortOrdersAsc SortOrdersEnum = "ASC" + SortOrdersDesc SortOrdersEnum = "DESC" +) + +var mappingSortOrdersEnum = map[string]SortOrdersEnum{ + "ASC": SortOrdersAsc, + "DESC": SortOrdersDesc, +} + +var mappingSortOrdersEnumLowerCase = map[string]SortOrdersEnum{ + "asc": SortOrdersAsc, + "desc": SortOrdersDesc, +} + +// GetSortOrdersEnumValues Enumerates the set of values for SortOrdersEnum +func GetSortOrdersEnumValues() []SortOrdersEnum { + values := make([]SortOrdersEnum, 0) + for _, v := range mappingSortOrdersEnum { + values = append(values, v) + } + return values +} + +// GetSortOrdersEnumStringValues Enumerates the set of values in String for SortOrdersEnum +func GetSortOrdersEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrdersEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrdersEnum(val string) (SortOrdersEnum, bool) { + enum, ok := mappingSortOrdersEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/update_delegation_control_details.go b/delegateaccesscontrol/update_delegation_control_details.go new file mode 100644 index 0000000000..963b89ca5d --- /dev/null +++ b/delegateaccesscontrol/update_delegation_control_details.go @@ -0,0 +1,81 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDelegationControlDetails Information about the new Delegation Control. +type UpdateDelegationControlDetails struct { + + // Name of the Delegation Control. The name does not need to be unique. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Description of the Delegation Control. + Description *string `mandatory:"false" json:"description"` + + // number of approvals required. + NumApprovalsRequired *int `mandatory:"false" json:"numApprovalsRequired"` + + // List of Delegation Subscription OCID that are allowed for this Delegation Control. The allowed subscriptions will determine the available Service Provider Actions. Only support operators for the allowed subscriptions are allowed to create Delegated Resource Access Request. + DelegationSubscriptionIds []string `mandatory:"false" json:"delegationSubscriptionIds"` + + // Set to true to allow all Delegated Resource Access Request to be approved automatically during maintenance. + IsAutoApproveDuringMaintenance *bool `mandatory:"false" json:"isAutoApproveDuringMaintenance"` + + // The OCID of the selected resources that this Delegation Control is applicable to. + ResourceIds []string `mandatory:"false" json:"resourceIds"` + + // List of pre-approved Service Provider Action names. The list of pre-defined Service Provider Actions can be obtained from the ListServiceProviderActions API. Delegated Resource Access Requests associated with a resource governed by this Delegation Control will be + // automatically approved if the Delegated Resource Access Request only contain Service Provider Actions in the pre-approved list. + PreApprovedServiceProviderActionNames []string `mandatory:"false" json:"preApprovedServiceProviderActionNames"` + + // The OCID of the OCI Notification topic to publish messages related to this Delegation Control. + NotificationTopicId *string `mandatory:"false" json:"notificationTopicId"` + + // The format of the OCI Notification messages for this Delegation Control. + NotificationMessageFormat DelegationControlNotificationMessageFormatEnum `mandatory:"false" json:"notificationMessageFormat,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // 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 UpdateDelegationControlDetails) 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 UpdateDelegationControlDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDelegationControlNotificationMessageFormatEnum(string(m.NotificationMessageFormat)); !ok && m.NotificationMessageFormat != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NotificationMessageFormat: %s. Supported values are: %s.", m.NotificationMessageFormat, strings.Join(GetDelegationControlNotificationMessageFormatEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/update_delegation_control_request_response.go b/delegateaccesscontrol/update_delegation_control_request_response.go new file mode 100644 index 0000000000..6623856e05 --- /dev/null +++ b/delegateaccesscontrol/update_delegation_control_request_response.go @@ -0,0 +1,110 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDelegationControlRequest wrapper for the UpdateDelegationControl operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/UpdateDelegationControl.go.html to see an example of how to use UpdateDelegationControlRequest. +type UpdateDelegationControlRequest struct { + + // unique Delegation Control identifier + DelegationControlId *string `mandatory:"true" contributesTo:"path" name:"delegationControlId"` + + // Details for the new DelegationControl. + UpdateDelegationControlDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateDelegationControlRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDelegationControlRequest) 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 UpdateDelegationControlRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDelegationControlRequest) 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 UpdateDelegationControlRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDelegationControlResponse wrapper for the UpdateDelegationControl operation +type UpdateDelegationControlResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegationControl instance + DelegationControl `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"` + + // 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"` + + // URI of the resource + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateDelegationControlResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDelegationControlResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/update_delegation_subscription_details.go b/delegateaccesscontrol/update_delegation_subscription_details.go new file mode 100644 index 0000000000..4fd5fdedb5 --- /dev/null +++ b/delegateaccesscontrol/update_delegation_subscription_details.go @@ -0,0 +1,53 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDelegationSubscriptionDetails Details for updating the Delegation Subscription. +type UpdateDelegationSubscriptionDetails struct { + + // Description of the Delegation Subscription. + Description *string `mandatory:"false" json:"description"` + + // 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 UpdateDelegationSubscriptionDetails) 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 UpdateDelegationSubscriptionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/update_delegation_subscription_request_response.go b/delegateaccesscontrol/update_delegation_subscription_request_response.go new file mode 100644 index 0000000000..4903c36f19 --- /dev/null +++ b/delegateaccesscontrol/update_delegation_subscription_request_response.go @@ -0,0 +1,110 @@ +// 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 delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDelegationSubscriptionRequest wrapper for the UpdateDelegationSubscription operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/delegateaccesscontrol/UpdateDelegationSubscription.go.html to see an example of how to use UpdateDelegationSubscriptionRequest. +type UpdateDelegationSubscriptionRequest struct { + + // unique Delegation Subscription identifier + DelegationSubscriptionId *string `mandatory:"true" contributesTo:"path" name:"delegationSubscriptionId"` + + // Details for the DelegationSubscription to be updated. + UpdateDelegationSubscriptionDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateDelegationSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDelegationSubscriptionRequest) 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 UpdateDelegationSubscriptionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDelegationSubscriptionRequest) 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 UpdateDelegationSubscriptionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDelegationSubscriptionResponse wrapper for the UpdateDelegationSubscription operation +type UpdateDelegationSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DelegationSubscription instance + DelegationSubscription `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"` + + // 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"` + + // URI of the resource + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateDelegationSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDelegationSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/delegateaccesscontrol/work_request.go b/delegateaccesscontrol/work_request.go new file mode 100644 index 0000000000..02cd24b0dc --- /dev/null +++ b/delegateaccesscontrol/work_request.go @@ -0,0 +1,78 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest A description of workrequest status +type WorkRequest struct { + + // Type of the work request + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The id of the work request. + Id *string `mandatory:"true" json:"id"` + + // The ocid of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Percentage of the request completed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the request was started, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), + // section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the object was finished, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/work_request_error.go b/delegateaccesscontrol/work_request_error.go new file mode 100644 index 0000000000..6ebc70cf83 --- /dev/null +++ b/delegateaccesscontrol/work_request_error.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestError An error encountered while executing a work request. +type WorkRequestError struct { + + // A machine-usable code for the error that occured. Error codes are listed on + // (https://docs.cloud.oracle.com/Content/API/References/apierrors.htm) + Code *string `mandatory:"true" json:"code"` + + // A human readable description of the issue encountered. + Message *string `mandatory:"true" json:"message"` + + // The time the error occured. An RFC3339 formatted datetime string. + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/work_request_error_collection.go b/delegateaccesscontrol/work_request_error_collection.go new file mode 100644 index 0000000000..574e76398d --- /dev/null +++ b/delegateaccesscontrol/work_request_error_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection Results of a workRequestError search. Contains both WorkRequestError items and other information, such as metadata. +type WorkRequestErrorCollection struct { + + // List of workRequestError objects. + Items []WorkRequestError `mandatory:"true" json:"items"` +} + +func (m WorkRequestErrorCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestErrorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/work_request_log_entry.go b/delegateaccesscontrol/work_request_log_entry.go new file mode 100644 index 0000000000..92c92dfb71 --- /dev/null +++ b/delegateaccesscontrol/work_request_log_entry.go @@ -0,0 +1,46 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntry A log message from the execution of a work request. +type WorkRequestLogEntry struct { + + // Human-readable log message. + Message *string `mandatory:"true" json:"message"` + + // The time the log message was written. An RFC3339 formatted datetime string + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntry) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/work_request_log_entry_collection.go b/delegateaccesscontrol/work_request_log_entry_collection.go new file mode 100644 index 0000000000..98a7a942bc --- /dev/null +++ b/delegateaccesscontrol/work_request_log_entry_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection Results of a workRequestLog search. Contains both workRequestLog items and other information, such as metadata. +type WorkRequestLogEntryCollection struct { + + // List of workRequestLogEntries. + Items []WorkRequestLogEntry `mandatory:"true" json:"items"` +} + +func (m WorkRequestLogEntryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/work_request_resource.go b/delegateaccesscontrol/work_request_resource.go new file mode 100644 index 0000000000..111352c886 --- /dev/null +++ b/delegateaccesscontrol/work_request_resource.go @@ -0,0 +1,61 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestResource A resource created or operated on by a work request. +type WorkRequestResource struct { + + // The resource type the work request affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource is affected by the work tracked in the work request. + // A resource being created, updated, or deleted will remain in the IN_PROGRESS state until + // work is complete for that resource at which point it will transition to CREATED, UPDATED, + // or DELETED, respectively. + ActionType ActionTypeEnum `mandatory:"true" json:"actionType"` + + // The identifier of the resource the work request affects. + Identifier *string `mandatory:"true" json:"identifier"` + + // The URI path that the user can do a GET on to access the resource metadata + EntityUri *string `mandatory:"false" json:"entityUri"` + + // Additional information that helps to explain the resource. + Metadata map[string]string `mandatory:"false" json:"metadata"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/work_request_resource_metadata_key.go b/delegateaccesscontrol/work_request_resource_metadata_key.go new file mode 100644 index 0000000000..d659239f52 --- /dev/null +++ b/delegateaccesscontrol/work_request_resource_metadata_key.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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "strings" +) + +// WorkRequestResourceMetadataKeyEnum Enum with underlying type: string +type WorkRequestResourceMetadataKeyEnum string + +// Set of constants representing the allowable values for WorkRequestResourceMetadataKeyEnum +const ( + WorkRequestResourceMetadataKeyVmClusterId WorkRequestResourceMetadataKeyEnum = "VM_CLUSTER_ID" + WorkRequestResourceMetadataKeyHostnames WorkRequestResourceMetadataKeyEnum = "HOSTNAMES" + WorkRequestResourceMetadataKeyCommands WorkRequestResourceMetadataKeyEnum = "COMMANDS" + WorkRequestResourceMetadataKeyResultLocation WorkRequestResourceMetadataKeyEnum = "RESULT_LOCATION" +) + +var mappingWorkRequestResourceMetadataKeyEnum = map[string]WorkRequestResourceMetadataKeyEnum{ + "VM_CLUSTER_ID": WorkRequestResourceMetadataKeyVmClusterId, + "HOSTNAMES": WorkRequestResourceMetadataKeyHostnames, + "COMMANDS": WorkRequestResourceMetadataKeyCommands, + "RESULT_LOCATION": WorkRequestResourceMetadataKeyResultLocation, +} + +var mappingWorkRequestResourceMetadataKeyEnumLowerCase = map[string]WorkRequestResourceMetadataKeyEnum{ + "vm_cluster_id": WorkRequestResourceMetadataKeyVmClusterId, + "hostnames": WorkRequestResourceMetadataKeyHostnames, + "commands": WorkRequestResourceMetadataKeyCommands, + "result_location": WorkRequestResourceMetadataKeyResultLocation, +} + +// GetWorkRequestResourceMetadataKeyEnumValues Enumerates the set of values for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumValues() []WorkRequestResourceMetadataKeyEnum { + values := make([]WorkRequestResourceMetadataKeyEnum, 0) + for _, v := range mappingWorkRequestResourceMetadataKeyEnum { + values = append(values, v) + } + return values +} + +// GetWorkRequestResourceMetadataKeyEnumStringValues Enumerates the set of values in String for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumStringValues() []string { + return []string{ + "VM_CLUSTER_ID", + "HOSTNAMES", + "COMMANDS", + "RESULT_LOCATION", + } +} + +// GetMappingWorkRequestResourceMetadataKeyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingWorkRequestResourceMetadataKeyEnum(val string) (WorkRequestResourceMetadataKeyEnum, bool) { + enum, ok := mappingWorkRequestResourceMetadataKeyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/delegateaccesscontrol/work_request_summary.go b/delegateaccesscontrol/work_request_summary.go new file mode 100644 index 0000000000..521e794965 --- /dev/null +++ b/delegateaccesscontrol/work_request_summary.go @@ -0,0 +1,78 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary A summary of the status of a work request. +type WorkRequestSummary struct { + + // Type of the work request + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // Status of current work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The id of the work request. + Id *string `mandatory:"true" json:"id"` + + // The ocid of the compartment that contains the work request. Work requests should be scoped to + // the same compartment as the resource the work request affects. If the work request affects multiple resources, + // and those resources are not in the same compartment, it is up to the service team to pick the primary + // resource whose compartment should be used + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Percentage of the request completed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the request was created, as described in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the request was started, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339), + // section 14.29. + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the object was finished, as described in RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/delegateaccesscontrol/work_request_summary_collection.go b/delegateaccesscontrol/work_request_summary_collection.go new file mode 100644 index 0000000000..316d141555 --- /dev/null +++ b/delegateaccesscontrol/work_request_summary_collection.go @@ -0,0 +1,43 @@ +// 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. + +// Oracle Delegate Access Control API +// +// Oracle Delegate Access Control allows ExaCC and ExaCS customers to delegate management of their Exadata resources operators outside their tenancies. +// With Delegate Access Control, Support Providers can deliver managed services using comprehensive and robust tooling built on the OCI platform. +// Customers maintain control over who has access to the delegated resources in their tenancy and what actions can be taken. +// Enterprises managing resources across multiple tenants can use Delegate Access Control to streamline management tasks. +// Using logging service, customers can view a near real-time audit report of all actions performed by a Service Provider operator. +// + +package delegateaccesscontrol + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection Results of a workRequest search. Contains both WorkRequest items and other information, such as metadata. +type WorkRequestSummaryCollection struct { + + // List of workRequestSummary objects. + Items []WorkRequestSummary `mandatory:"true" json:"items"` +} + +func (m WorkRequestSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/filestorage/cancel_downgrade_shape_mount_target_request_response.go b/filestorage/cancel_downgrade_shape_mount_target_request_response.go new file mode 100644 index 0000000000..dba810d901 --- /dev/null +++ b/filestorage/cancel_downgrade_shape_mount_target_request_response.go @@ -0,0 +1,102 @@ +// 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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelDowngradeShapeMountTargetRequest wrapper for the CancelDowngradeShapeMountTarget operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/CancelDowngradeShapeMountTarget.go.html to see an example of how to use CancelDowngradeShapeMountTargetRequest. +type CancelDowngradeShapeMountTargetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the mount target. + MountTargetId *string `mandatory:"true" contributesTo:"path" name:"mountTargetId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + 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 CancelDowngradeShapeMountTargetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelDowngradeShapeMountTargetRequest) 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 CancelDowngradeShapeMountTargetRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelDowngradeShapeMountTargetRequest) 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 CancelDowngradeShapeMountTargetRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelDowngradeShapeMountTargetResponse wrapper for the CancelDowngradeShapeMountTarget operation +type CancelDowngradeShapeMountTargetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MountTarget instance + MountTarget `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 CancelDowngradeShapeMountTargetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelDowngradeShapeMountTargetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/create_mount_target_details.go b/filestorage/create_mount_target_details.go index c49d878d9b..b68de5fe94 100644 --- a/filestorage/create_mount_target_details.go +++ b/filestorage/create_mount_target_details.go @@ -56,13 +56,6 @@ type CreateMountTargetDetails struct { // A private IP address of your choice. Must be an available IP address within // the subnet's CIDR. If you don't specify a value, Oracle automatically // assigns a private IP address from the subnet. - // Note: This attribute value is stored in the PrivateIp (https://docs.cloud.oracle.com/en-us/iaas/api/#/en/iaas/20160918/PrivateIp/) resource, - // not in the `mountTarget` resource. - // To update the `ipAddress`, use `GetMountTarget` to obtain the - // OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the mount target's - // private IPs (`privateIpIds`). Then, you can use - // UpdatePrivateIp (https://docs.cloud.oracle.com/en-us/iaas/api/#/en/iaas/20160918/PrivateIp/UpdatePrivateIp) - // to update the `ipAddress` value. // Example: `10.0.3.3` IpAddress *string `mandatory:"false" json:"ipAddress"` @@ -89,6 +82,10 @@ type CreateMountTargetDetails struct { // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Throughput for mount target in Gbps. Currently only 1 Gbps of requestedThroughput is supported during create MountTarget. + // Available shapes and corresponding throughput are listed at Mount Target Performance (https://docs.oracle.com/iaas/Content/File/Tasks/managingmounttargets.htm#performance). + RequestedThroughput *int64 `mandatory:"false" json:"requestedThroughput"` } func (m CreateMountTargetDetails) String() string { diff --git a/filestorage/filestorage_client.go b/filestorage/filestorage_client.go index 624162681a..aacdc9ff77 100644 --- a/filestorage/filestorage_client.go +++ b/filestorage/filestorage_client.go @@ -92,6 +92,63 @@ func (client *FileStorageClient) ConfigurationProvider() *common.ConfigurationPr return client.config } +// CancelDowngradeShapeMountTarget Cancel scheduled downgrade shape request for mount target. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/CancelDowngradeShapeMountTarget.go.html to see an example of how to use CancelDowngradeShapeMountTarget API. +func (client FileStorageClient) CancelDowngradeShapeMountTarget(ctx context.Context, request CancelDowngradeShapeMountTargetRequest) (response CancelDowngradeShapeMountTargetResponse, 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.cancelDowngradeShapeMountTarget, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelDowngradeShapeMountTargetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelDowngradeShapeMountTargetResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelDowngradeShapeMountTargetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelDowngradeShapeMountTargetResponse") + } + return +} + +// cancelDowngradeShapeMountTarget implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) cancelDowngradeShapeMountTarget(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mountTargets/{mountTargetId}/actions/cancelShapeDowngrade", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelDowngradeShapeMountTargetResponse + 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/filestorage/20171215/MountTarget/CancelDowngradeShapeMountTarget" + err = common.PostProcessServiceError(err, "FileStorage", "CancelDowngradeShapeMountTarget", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeFileSystemCompartment Moves a file system and its associated snapshots 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 @@ -2594,6 +2651,63 @@ func (client FileStorageClient) pauseFilesystemSnapshotPolicy(ctx context.Contex return response, err } +// ScheduleDowngradeShapeMountTarget Schedule a downgrade shape of the mount target. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/ScheduleDowngradeShapeMountTarget.go.html to see an example of how to use ScheduleDowngradeShapeMountTarget API. +func (client FileStorageClient) ScheduleDowngradeShapeMountTarget(ctx context.Context, request ScheduleDowngradeShapeMountTargetRequest) (response ScheduleDowngradeShapeMountTargetResponse, 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.scheduleDowngradeShapeMountTarget, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ScheduleDowngradeShapeMountTargetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ScheduleDowngradeShapeMountTargetResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ScheduleDowngradeShapeMountTargetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ScheduleDowngradeShapeMountTargetResponse") + } + return +} + +// scheduleDowngradeShapeMountTarget implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) scheduleDowngradeShapeMountTarget(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mountTargets/{mountTargetId}/actions/scheduleShapeDowngrade", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ScheduleDowngradeShapeMountTargetResponse + 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/filestorage/20171215/MountTarget/ScheduleDowngradeShapeMountTarget" + err = common.PostProcessServiceError(err, "FileStorage", "ScheduleDowngradeShapeMountTarget", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UnpauseFilesystemSnapshotPolicy This operation unpauses a paused file system snapshot policy and updates the lifecycle state of the file system snapshot policy from // INACTIVE to ACTIVE. By default, file system snapshot policies are in the ACTIVE state. When a file system snapshot policy is not paused, or in the ACTIVE state, file systems that are associated with the // policy will have snapshots created and deleted according to the schedules defined in the policy. @@ -3111,6 +3225,63 @@ func (client FileStorageClient) updateSnapshot(ctx context.Context, request comm return response, err } +// UpgradeShapeMountTarget Upgrade shape request for mount target. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/UpgradeShapeMountTarget.go.html to see an example of how to use UpgradeShapeMountTarget API. +func (client FileStorageClient) UpgradeShapeMountTarget(ctx context.Context, request UpgradeShapeMountTargetRequest) (response UpgradeShapeMountTargetResponse, 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.upgradeShapeMountTarget, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpgradeShapeMountTargetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpgradeShapeMountTargetResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpgradeShapeMountTargetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpgradeShapeMountTargetResponse") + } + return +} + +// upgradeShapeMountTarget implements the OCIOperation interface (enables retrying operations) +func (client FileStorageClient) upgradeShapeMountTarget(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mountTargets/{mountTargetId}/actions/upgradeShape", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpgradeShapeMountTargetResponse + 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/filestorage/20171215/MountTarget/UpgradeShapeMountTarget" + err = common.PostProcessServiceError(err, "FileStorage", "UpgradeShapeMountTarget", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ValidateKeyTabs Validates keytab contents for the secret details passed on the request or validte keytab contents associated with // the mount target passed in the request. The keytabs are deserialized, the contents are validated for compatibility // and the principal, key version number and encryption type of each entry is provided as part of the response. diff --git a/filestorage/list_export_sets_request_response.go b/filestorage/list_export_sets_request_response.go index 687d667121..e89b223dad 100644 --- a/filestorage/list_export_sets_request_response.go +++ b/filestorage/list_export_sets_request_response.go @@ -27,7 +27,7 @@ type ListExportSetsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/list_exports_request_response.go b/filestorage/list_exports_request_response.go index d140c63d0f..49fac638ee 100644 --- a/filestorage/list_exports_request_response.go +++ b/filestorage/list_exports_request_response.go @@ -23,7 +23,7 @@ type ListExportsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/list_file_systems_request_response.go b/filestorage/list_file_systems_request_response.go index ffc8658b03..856d7d5d01 100644 --- a/filestorage/list_file_systems_request_response.go +++ b/filestorage/list_file_systems_request_response.go @@ -27,7 +27,7 @@ type ListFileSystemsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/list_filesystem_snapshot_policies_request_response.go b/filestorage/list_filesystem_snapshot_policies_request_response.go index ede7048daf..ab4b8fd53d 100644 --- a/filestorage/list_filesystem_snapshot_policies_request_response.go +++ b/filestorage/list_filesystem_snapshot_policies_request_response.go @@ -27,7 +27,7 @@ type ListFilesystemSnapshotPoliciesRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/list_mount_targets_request_response.go b/filestorage/list_mount_targets_request_response.go index 16e85ec4c3..b33852c919 100644 --- a/filestorage/list_mount_targets_request_response.go +++ b/filestorage/list_mount_targets_request_response.go @@ -27,7 +27,7 @@ type ListMountTargetsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/list_outbound_connectors_request_response.go b/filestorage/list_outbound_connectors_request_response.go index b49248ef7d..d054125987 100644 --- a/filestorage/list_outbound_connectors_request_response.go +++ b/filestorage/list_outbound_connectors_request_response.go @@ -27,7 +27,7 @@ type ListOutboundConnectorsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/list_replication_targets_request_response.go b/filestorage/list_replication_targets_request_response.go index f095542118..b2198900b8 100644 --- a/filestorage/list_replication_targets_request_response.go +++ b/filestorage/list_replication_targets_request_response.go @@ -27,7 +27,7 @@ type ListReplicationTargetsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/list_replications_request_response.go b/filestorage/list_replications_request_response.go index 2e865b7dee..5ddf9c398c 100644 --- a/filestorage/list_replications_request_response.go +++ b/filestorage/list_replications_request_response.go @@ -27,7 +27,7 @@ type ListReplicationsRequest struct { // For list pagination. The maximum number of results per page, // or items to return in a paginated "List" call. - // 1 is the minimum, 1000 is the maximum. + // 1 is the minimum, 4096 is the maximum. // For important details about how pagination works, // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `500` diff --git a/filestorage/mount_target.go b/filestorage/mount_target.go index 47b6a170a0..b447aa8813 100644 --- a/filestorage/mount_target.go +++ b/filestorage/mount_target.go @@ -72,6 +72,22 @@ type MountTarget struct { Kerberos *Kerberos `mandatory:"false" json:"kerberos"` + // The date and time the mount target current billing cycle will end and next one starts, expressed + // in RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. + // Example: `2016-08-25T21:10:29.600Z` + TimeBillingCycleEnd *common.SDKTime `mandatory:"false" json:"timeBillingCycleEnd"` + + // Current billed throughput for mount target in Gbps. This corresponds to shape of mount target. + // Available shapes and corresponding throughput are listed at Mount Target Performance (https://docs.oracle.com/iaas/Content/File/Tasks/managingmounttargets.htm#performance). + ObservedThroughput *int64 `mandatory:"false" json:"observedThroughput"` + + // - New throughput for mount target at the end of billing cycle in Gbps. + RequestedThroughput *int64 `mandatory:"false" json:"requestedThroughput"` + + // - Reserved capacity (GB) associated with this mount target. Reserved capacity depends on observedThroughput value + // of mount target. Value is listed at Mount Target Performance (https://docs.oracle.com/iaas/Content/File/Tasks/managingmounttargets.htm#performance). + ReservedStorageCapacity *int64 `mandatory:"false" json:"reservedStorageCapacity"` + // 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/Content/General/Concepts/resourcetags.htm). @@ -116,6 +132,7 @@ const ( MountTargetLifecycleStateDeleting MountTargetLifecycleStateEnum = "DELETING" MountTargetLifecycleStateDeleted MountTargetLifecycleStateEnum = "DELETED" MountTargetLifecycleStateFailed MountTargetLifecycleStateEnum = "FAILED" + MountTargetLifecycleStateUpdating MountTargetLifecycleStateEnum = "UPDATING" ) var mappingMountTargetLifecycleStateEnum = map[string]MountTargetLifecycleStateEnum{ @@ -124,6 +141,7 @@ var mappingMountTargetLifecycleStateEnum = map[string]MountTargetLifecycleStateE "DELETING": MountTargetLifecycleStateDeleting, "DELETED": MountTargetLifecycleStateDeleted, "FAILED": MountTargetLifecycleStateFailed, + "UPDATING": MountTargetLifecycleStateUpdating, } var mappingMountTargetLifecycleStateEnumLowerCase = map[string]MountTargetLifecycleStateEnum{ @@ -132,6 +150,7 @@ var mappingMountTargetLifecycleStateEnumLowerCase = map[string]MountTargetLifecy "deleting": MountTargetLifecycleStateDeleting, "deleted": MountTargetLifecycleStateDeleted, "failed": MountTargetLifecycleStateFailed, + "updating": MountTargetLifecycleStateUpdating, } // GetMountTargetLifecycleStateEnumValues Enumerates the set of values for MountTargetLifecycleStateEnum @@ -151,6 +170,7 @@ func GetMountTargetLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "UPDATING", } } diff --git a/filestorage/mount_target_summary.go b/filestorage/mount_target_summary.go index 3d742f51b2..38a39b823d 100644 --- a/filestorage/mount_target_summary.go +++ b/filestorage/mount_target_summary.go @@ -60,6 +60,23 @@ type MountTargetSummary struct { // For more information about NSGs, see Security Rules (https://docs.cloud.oracle.com/Content/Network/Concepts/securityrules.htm). NsgIds []string `mandatory:"false" json:"nsgIds"` + // The date and time the mount target current billing cycle will end, expressed in + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339) timestamp format. Once a cycle ends, it is updated + // automatically to next timestamp which is after 30 days. + // Example: `2016-08-25T21:10:29.600Z` + TimeBillingCycleEnd *common.SDKTime `mandatory:"false" json:"timeBillingCycleEnd"` + + // Current billed throughput for mount target in Gbps. This corresponds to shape of mount target. + // Available shapes and corresponding throughput are listed at Mount Target Performance (https://docs.oracle.com/iaas/Content/File/Tasks/managingmounttargets.htm#performance). + ObservedThroughput *int64 `mandatory:"false" json:"observedThroughput"` + + // - New throughput for mount target at the end of billing cycle in Gbps. + RequestedThroughput *int64 `mandatory:"false" json:"requestedThroughput"` + + // - Reserved capacity (GB) associated with this mount target. Reserved capacity depends on observedThroughput value + // of mount target. Value is listed at Mount Target Performance (https://docs.oracle.com/iaas/Content/File/Tasks/managingmounttargets.htm#performance). + ReservedStorageCapacity *int64 `mandatory:"false" json:"reservedStorageCapacity"` + // 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/Content/General/Concepts/resourcetags.htm). @@ -101,6 +118,7 @@ const ( MountTargetSummaryLifecycleStateDeleting MountTargetSummaryLifecycleStateEnum = "DELETING" MountTargetSummaryLifecycleStateDeleted MountTargetSummaryLifecycleStateEnum = "DELETED" MountTargetSummaryLifecycleStateFailed MountTargetSummaryLifecycleStateEnum = "FAILED" + MountTargetSummaryLifecycleStateUpdating MountTargetSummaryLifecycleStateEnum = "UPDATING" ) var mappingMountTargetSummaryLifecycleStateEnum = map[string]MountTargetSummaryLifecycleStateEnum{ @@ -109,6 +127,7 @@ var mappingMountTargetSummaryLifecycleStateEnum = map[string]MountTargetSummaryL "DELETING": MountTargetSummaryLifecycleStateDeleting, "DELETED": MountTargetSummaryLifecycleStateDeleted, "FAILED": MountTargetSummaryLifecycleStateFailed, + "UPDATING": MountTargetSummaryLifecycleStateUpdating, } var mappingMountTargetSummaryLifecycleStateEnumLowerCase = map[string]MountTargetSummaryLifecycleStateEnum{ @@ -117,6 +136,7 @@ var mappingMountTargetSummaryLifecycleStateEnumLowerCase = map[string]MountTarge "deleting": MountTargetSummaryLifecycleStateDeleting, "deleted": MountTargetSummaryLifecycleStateDeleted, "failed": MountTargetSummaryLifecycleStateFailed, + "updating": MountTargetSummaryLifecycleStateUpdating, } // GetMountTargetSummaryLifecycleStateEnumValues Enumerates the set of values for MountTargetSummaryLifecycleStateEnum @@ -136,6 +156,7 @@ func GetMountTargetSummaryLifecycleStateEnumStringValues() []string { "DELETING", "DELETED", "FAILED", + "UPDATING", } } diff --git a/filestorage/schedule_downgrade_shape_mount_target_details.go b/filestorage/schedule_downgrade_shape_mount_target_details.go new file mode 100644 index 0000000000..5e66852fcb --- /dev/null +++ b/filestorage/schedule_downgrade_shape_mount_target_details.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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduleDowngradeShapeMountTargetDetails Shape details about the Mount Target. +type ScheduleDowngradeShapeMountTargetDetails struct { + + // New throughput for mount target in Gbps. Available shapes and corresponding throughput are listed at + // Mount Target Performance (https://docs.oracle.com/iaas/Content/File/Tasks/managingmounttargets.htm#performance). + RequestedThroughput *int64 `mandatory:"false" json:"requestedThroughput"` +} + +func (m ScheduleDowngradeShapeMountTargetDetails) 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 ScheduleDowngradeShapeMountTargetDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/filestorage/schedule_downgrade_shape_mount_target_request_response.go b/filestorage/schedule_downgrade_shape_mount_target_request_response.go new file mode 100644 index 0000000000..e8cdb2eb03 --- /dev/null +++ b/filestorage/schedule_downgrade_shape_mount_target_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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ScheduleDowngradeShapeMountTargetRequest wrapper for the ScheduleDowngradeShapeMountTarget operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/ScheduleDowngradeShapeMountTarget.go.html to see an example of how to use ScheduleDowngradeShapeMountTargetRequest. +type ScheduleDowngradeShapeMountTargetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the mount target. + MountTargetId *string `mandatory:"true" contributesTo:"path" name:"mountTargetId"` + + // Details for changing the shape of mount target. + ScheduleDowngradeShapeMountTargetDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + 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 ScheduleDowngradeShapeMountTargetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ScheduleDowngradeShapeMountTargetRequest) 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 ScheduleDowngradeShapeMountTargetRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ScheduleDowngradeShapeMountTargetRequest) 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 ScheduleDowngradeShapeMountTargetRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScheduleDowngradeShapeMountTargetResponse wrapper for the ScheduleDowngradeShapeMountTarget operation +type ScheduleDowngradeShapeMountTargetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MountTarget instance + MountTarget `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 ScheduleDowngradeShapeMountTargetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ScheduleDowngradeShapeMountTargetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/filestorage/upgrade_shape_mount_target_details.go b/filestorage/upgrade_shape_mount_target_details.go new file mode 100644 index 0000000000..2540522308 --- /dev/null +++ b/filestorage/upgrade_shape_mount_target_details.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. + +// File Storage API +// +// Use the File Storage service API to manage file systems, mount targets, and snapshots. +// For more information, see Overview of File Storage (https://docs.cloud.oracle.com/iaas/Content/File/Concepts/filestorageoverview.htm). +// + +package filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpgradeShapeMountTargetDetails Shape details about the Mount Target. +type UpgradeShapeMountTargetDetails struct { + + // New throughput for mount target in Gbps. Available shapes and corresponding throughput are listed at + // Mount Target Performance (https://docs.oracle.com/iaas/Content/File/Tasks/managingmounttargets.htm#performance). + RequestedThroughput *int64 `mandatory:"false" json:"requestedThroughput"` +} + +func (m UpgradeShapeMountTargetDetails) 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 UpgradeShapeMountTargetDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/filestorage/upgrade_shape_mount_target_request_response.go b/filestorage/upgrade_shape_mount_target_request_response.go new file mode 100644 index 0000000000..aef83d3fff --- /dev/null +++ b/filestorage/upgrade_shape_mount_target_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 filestorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpgradeShapeMountTargetRequest wrapper for the UpgradeShapeMountTarget operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/filestorage/UpgradeShapeMountTarget.go.html to see an example of how to use UpgradeShapeMountTargetRequest. +type UpgradeShapeMountTargetRequest struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the mount target. + MountTargetId *string `mandatory:"true" contributesTo:"path" name:"mountTargetId"` + + // Details for changing the shape of mount target. + UpgradeShapeMountTargetDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + 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 UpgradeShapeMountTargetRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpgradeShapeMountTargetRequest) 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 UpgradeShapeMountTargetRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpgradeShapeMountTargetRequest) 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 UpgradeShapeMountTargetRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpgradeShapeMountTargetResponse wrapper for the UpgradeShapeMountTarget operation +type UpgradeShapeMountTargetResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MountTarget instance + MountTarget `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 UpgradeShapeMountTargetResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpgradeShapeMountTargetResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/fusionapps/fusion_environment_family.go b/fusionapps/fusion_environment_family.go index 095df39670..b2d6e1001d 100644 --- a/fusionapps/fusion_environment_family.go +++ b/fusionapps/fusion_environment_family.go @@ -54,6 +54,9 @@ type FusionEnvironmentFamily struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Indicates when the family received the last subscription update + TimeLastSubscriptionUpdate *common.SDKTime `mandatory:"false" json:"timeLastSubscriptionUpdate"` } func (m FusionEnvironmentFamily) String() string { diff --git a/keymanagement/auto_key_rotation_details.go b/keymanagement/auto_key_rotation_details.go index c318b769bf..d51fa686cd 100644 --- a/keymanagement/auto_key_rotation_details.go +++ b/keymanagement/auto_key_rotation_details.go @@ -18,22 +18,22 @@ import ( // AutoKeyRotationDetails The details of auto rotation schedule for the Key being create updated or imported. type AutoKeyRotationDetails struct { - // The interval of auto key rotation. For auto key rotation the interval should between 30 day and 365 days (1 year) + // The interval of auto key rotation. For auto key rotation the interval should between 60 day and 365 days (1 year). Note: User must specify this parameter when creating a new schedule. RotationIntervalInDays *int `mandatory:"false" json:"rotationIntervalInDays"` - // A property indicating scheduled start date expressed as date YYYY-MM-DD String. Example: `2023-04-04T00:00:00Z` . + // A property indicating scheduled start date expressed as date YYYY-MM-DD String. Example: `2023-04-04T00:00:00Z. The time has no significance when scheduling an auto key rotation as this can be done anytime approximately the scheduled day, KMS ignores the time and replaces it with 00:00, for example 2023-04-04T15:14:13Z will be used as 2023-04-04T00:00:00Z . Note : Today’s date will be used if not specified by customer. TimeOfScheduleStart *common.SDKTime `mandatory:"false" json:"timeOfScheduleStart"` - // A property indicating Next estimated scheduled Time, as per the interval, expressed as date YYYY-MM-DD String. Example: `2023-04-04T00:00:00Z` . + // A property indicating Next estimated scheduled Time, as per the interval, expressed as date YYYY-MM-DD String. Example: `2023-04-04T00:00:00Z`. The time has no significance when scheduling an auto key rotation as this can be done anytime approximately the scheduled day, KMS ignores the time and replaces it with 00:00, for example 2023-04-04T15:14:13Z will be used as 2023-04-04T00:00:00Z. TimeOfNextRotation *common.SDKTime `mandatory:"false" json:"timeOfNextRotation"` - // A property indicating Last rotation Date Example: `2023-04-04T00:00:00Z`. + // A property indicating Last rotation Date. Example: `2023-04-04T00:00:00Z`. TimeOfLastRotation *common.SDKTime `mandatory:"false" json:"timeOfLastRotation"` // The status of last execution of auto key rotation. LastRotationStatus AutoKeyRotationDetailsLastRotationStatusEnum `mandatory:"false" json:"lastRotationStatus,omitempty"` - // The last execution status message. + // The last execution status message of auto key rotation. LastRotationMessage *string `mandatory:"false" json:"lastRotationMessage"` } diff --git a/keymanagement/cancel_hsm_cluster_deletion_request_response.go b/keymanagement/cancel_hsm_cluster_deletion_request_response.go index 750cbf4317..70e6005a13 100644 --- a/keymanagement/cancel_hsm_cluster_deletion_request_response.go +++ b/keymanagement/cancel_hsm_cluster_deletion_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CancelHsmClusterDeletion.go.html to see an example of how to use CancelHsmClusterDeletionRequest. type CancelHsmClusterDeletionRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // For optimistic concurrency control. In the PUT or DELETE call for a diff --git a/keymanagement/change_hsm_cluster_compartment_details.go b/keymanagement/change_hsm_cluster_compartment_details.go index 8b6885cf68..1ca4415f61 100644 --- a/keymanagement/change_hsm_cluster_compartment_details.go +++ b/keymanagement/change_hsm_cluster_compartment_details.go @@ -15,10 +15,10 @@ import ( "strings" ) -// ChangeHsmClusterCompartmentDetails The details of the compartment you wish to move the Hsm. +// ChangeHsmClusterCompartmentDetails The details of the compartment you wish to move the hsm cluster to. type ChangeHsmClusterCompartmentDetails struct { - // The [OCID] of the compartment to move the hsm to. + // The [OCID] of the compartment to move the hsm cluster to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } diff --git a/keymanagement/change_hsm_cluster_compartment_request_response.go b/keymanagement/change_hsm_cluster_compartment_request_response.go index be0ac89849..0edb0e9270 100644 --- a/keymanagement/change_hsm_cluster_compartment_request_response.go +++ b/keymanagement/change_hsm_cluster_compartment_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ChangeHsmClusterCompartment.go.html to see an example of how to use ChangeHsmClusterCompartmentRequest. type ChangeHsmClusterCompartmentRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // Details of change HSM Cluster compartment. diff --git a/keymanagement/create_hsm_cluster_details.go b/keymanagement/create_hsm_cluster_details.go index aa1718b417..fea57c502c 100644 --- a/keymanagement/create_hsm_cluster_details.go +++ b/keymanagement/create_hsm_cluster_details.go @@ -15,13 +15,13 @@ import ( "strings" ) -// CreateHsmClusterDetails The details of the HSM resource that you want to create. +// CreateHsmClusterDetails The details of the HSM cluster resource that you want to create. type CreateHsmClusterDetails struct { - // The OCID of the compartment where you want to create this HSM resource. + // The OCID of the compartment where you want to create this HSM cluster resource. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // A user-friendly name for the HSM resource. It does not have to be unique, and it is changeable. + // A user-friendly display name for the HSM cluster resource. It does not have to be unique, and it is changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` diff --git a/keymanagement/download_certificate_signing_request_request_response.go b/keymanagement/download_certificate_signing_request_request_response.go index acb2181be7..151247a724 100644 --- a/keymanagement/download_certificate_signing_request_request_response.go +++ b/keymanagement/download_certificate_signing_request_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/DownloadCertificateSigningRequest.go.html to see an example of how to use DownloadCertificateSigningRequestRequest. type DownloadCertificateSigningRequestRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // Unique identifier for the request. If provided, the returned request ID diff --git a/keymanagement/get_hsm_cluster_request_response.go b/keymanagement/get_hsm_cluster_request_response.go index b6e24451f7..c9fe37a13a 100644 --- a/keymanagement/get_hsm_cluster_request_response.go +++ b/keymanagement/get_hsm_cluster_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetHsmCluster.go.html to see an example of how to use GetHsmClusterRequest. type GetHsmClusterRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // Unique identifier for the request. If provided, the returned request ID diff --git a/keymanagement/get_hsm_partition_request_response.go b/keymanagement/get_hsm_partition_request_response.go index f2f39a345c..bed4e2f227 100644 --- a/keymanagement/get_hsm_partition_request_response.go +++ b/keymanagement/get_hsm_partition_request_response.go @@ -18,10 +18,10 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetHsmPartition.go.html to see an example of how to use GetHsmPartitionRequest. type GetHsmPartitionRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` - // The OCID of the HSM Partition. + // The OCID of the HSM Partition. This is a unique identifier which each hsmPartition will have. HsmPartitionId *string `mandatory:"true" contributesTo:"path" name:"hsmPartitionId"` // Unique identifier for the request. If provided, the returned request ID diff --git a/keymanagement/get_pre_co_user_credentials_request_response.go b/keymanagement/get_pre_co_user_credentials_request_response.go index b0139f8f16..b50e92e838 100644 --- a/keymanagement/get_pre_co_user_credentials_request_response.go +++ b/keymanagement/get_pre_co_user_credentials_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/GetPreCoUserCredentials.go.html to see an example of how to use GetPreCoUserCredentialsRequest. type GetPreCoUserCredentialsRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // Unique identifier for the request. If provided, the returned request ID diff --git a/keymanagement/hsm_cluster.go b/keymanagement/hsm_cluster.go index 9bf9925d9e..e9298a2958 100644 --- a/keymanagement/hsm_cluster.go +++ b/keymanagement/hsm_cluster.go @@ -24,7 +24,7 @@ type HsmCluster struct { // The OCID of the compartment that contains this HSMCluster resource. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // A user-friendly name for the HSMCluster resource. It does not have to be unique, and it is changeable. + // A user-friendly display name for the HSMCluster resource. It does not have to be unique, and it is changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` @@ -40,7 +40,7 @@ type HsmCluster struct { // Example: `ACTIVE` LifecycleState HsmClusterLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // DNS name for the Hsm Cluster. + // DNS name for the HSM Cluster -- this will contain information about the region as well. DnsName *string `mandatory:"true" json:"dnsName"` // An optional property indicating when to delete the key, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. diff --git a/keymanagement/hsm_cluster_collection.go b/keymanagement/hsm_cluster_collection.go index e3b52788a1..f74693be8d 100644 --- a/keymanagement/hsm_cluster_collection.go +++ b/keymanagement/hsm_cluster_collection.go @@ -18,7 +18,7 @@ import ( // HsmClusterCollection HsmClusterCollection object with page of HsmClusterSummary objects. type HsmClusterCollection struct { - // List of Hsm Clusters. + // List of HSM Cluster Summary Objects. Items []HsmClusterSummary `mandatory:"true" json:"items"` } diff --git a/keymanagement/hsm_cluster_summary.go b/keymanagement/hsm_cluster_summary.go index 44cc6381b9..7754098411 100644 --- a/keymanagement/hsm_cluster_summary.go +++ b/keymanagement/hsm_cluster_summary.go @@ -15,7 +15,7 @@ import ( "strings" ) -// HsmClusterSummary The details of the HSM resource. +// HsmClusterSummary An object which encapsulates the details of a given HSM Cluster. type HsmClusterSummary struct { // The OCID of a HSMCluster resource. @@ -32,7 +32,7 @@ type HsmClusterSummary struct { // Example: `ACTIVE` LifecycleState HsmClusterLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` - // DNS name for the HSMCluster. + // DNS name for the HSMCluster -- this will contain information about the region as well. DnsName *string `mandatory:"true" json:"dnsName"` // The date and time a dedicated KMS resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. diff --git a/keymanagement/hsm_partition.go b/keymanagement/hsm_partition.go index 858d622f6b..4d14673c5a 100644 --- a/keymanagement/hsm_partition.go +++ b/keymanagement/hsm_partition.go @@ -18,13 +18,13 @@ import ( // HsmPartition Dedicated KMS-HSM Partition Management type HsmPartition struct { - // The OCID of the HSM resource. + // The OCID of the HSM resource. Each HSM resource has a unique OCID as an identifier. Id *string `mandatory:"true" json:"id"` // The OCID of the compartment that contains a particular HSM resource. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Details of PortNumber and PortType. + // Details of a single portInformation item include the PortNumber (an integer used as an identifier) and the PortType (refers to either an enum value of Managementutility,Clientutility, or null) PortInformation []PortInformation `mandatory:"true" json:"portInformation"` // The date and time a HSMPartition was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. @@ -35,7 +35,8 @@ type HsmPartition struct { // Example: `2018-04-03T21:10:29.600Z` TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` - // The HSMPartition's current lifecycle state. + // A HSMCluster resource's current lifecycle state. + // Example: `ACTIVE` LifecycleState HsmPartitionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } @@ -67,6 +68,10 @@ const ( HsmPartitionLifecycleStateInactive HsmPartitionLifecycleStateEnum = "INACTIVE" HsmPartitionLifecycleStateActivating HsmPartitionLifecycleStateEnum = "ACTIVATING" HsmPartitionLifecycleStateActivationRequired HsmPartitionLifecycleStateEnum = "ACTIVATION_REQUIRED" + HsmPartitionLifecycleStateSchedulingDeletion HsmPartitionLifecycleStateEnum = "SCHEDULING_DELETION" + HsmPartitionLifecycleStatePendingDeletion HsmPartitionLifecycleStateEnum = "PENDING_DELETION" + HsmPartitionLifecycleStateDeleting HsmPartitionLifecycleStateEnum = "DELETING" + HsmPartitionLifecycleStateDeleted HsmPartitionLifecycleStateEnum = "DELETED" ) var mappingHsmPartitionLifecycleStateEnum = map[string]HsmPartitionLifecycleStateEnum{ @@ -74,6 +79,10 @@ var mappingHsmPartitionLifecycleStateEnum = map[string]HsmPartitionLifecycleStat "INACTIVE": HsmPartitionLifecycleStateInactive, "ACTIVATING": HsmPartitionLifecycleStateActivating, "ACTIVATION_REQUIRED": HsmPartitionLifecycleStateActivationRequired, + "SCHEDULING_DELETION": HsmPartitionLifecycleStateSchedulingDeletion, + "PENDING_DELETION": HsmPartitionLifecycleStatePendingDeletion, + "DELETING": HsmPartitionLifecycleStateDeleting, + "DELETED": HsmPartitionLifecycleStateDeleted, } var mappingHsmPartitionLifecycleStateEnumLowerCase = map[string]HsmPartitionLifecycleStateEnum{ @@ -81,6 +90,10 @@ var mappingHsmPartitionLifecycleStateEnumLowerCase = map[string]HsmPartitionLife "inactive": HsmPartitionLifecycleStateInactive, "activating": HsmPartitionLifecycleStateActivating, "activation_required": HsmPartitionLifecycleStateActivationRequired, + "scheduling_deletion": HsmPartitionLifecycleStateSchedulingDeletion, + "pending_deletion": HsmPartitionLifecycleStatePendingDeletion, + "deleting": HsmPartitionLifecycleStateDeleting, + "deleted": HsmPartitionLifecycleStateDeleted, } // GetHsmPartitionLifecycleStateEnumValues Enumerates the set of values for HsmPartitionLifecycleStateEnum @@ -99,6 +112,10 @@ func GetHsmPartitionLifecycleStateEnumStringValues() []string { "INACTIVE", "ACTIVATING", "ACTIVATION_REQUIRED", + "SCHEDULING_DELETION", + "PENDING_DELETION", + "DELETING", + "DELETED", } } diff --git a/keymanagement/hsm_partition_collection.go b/keymanagement/hsm_partition_collection.go index c301e5c2cf..f3ef4b805d 100644 --- a/keymanagement/hsm_partition_collection.go +++ b/keymanagement/hsm_partition_collection.go @@ -15,7 +15,7 @@ import ( "strings" ) -// HsmPartitionCollection HsmPartitionCollection object with page of HsmPartitionSummary objects. +// HsmPartitionCollection HsmPartitionCollection object with page of HsmPartitionSummary objects. A HsmPartitionSummary object contains details about the corresponding HSM. type HsmPartitionCollection struct { // List of HsmPartitionSummaries. diff --git a/keymanagement/hsm_partition_summary.go b/keymanagement/hsm_partition_summary.go index 2337c1d578..e0d59f1fac 100644 --- a/keymanagement/hsm_partition_summary.go +++ b/keymanagement/hsm_partition_summary.go @@ -15,22 +15,23 @@ import ( "strings" ) -// HsmPartitionSummary The details of the Hsm. +// HsmPartitionSummary An object which encapsulates the details of a given HSM. type HsmPartitionSummary struct { - // The OCID of the HSM resource. + // The OCID of the HSM resource. Each HSM resource will have a unique OCID identifier. Id *string `mandatory:"true" json:"id"` // The OCID of the HSMCluster that contains a particular HSM resource. HsmClusterId *string `mandatory:"true" json:"hsmClusterId"` - // The Hsm's current lifecycle state. + // A HSMCluster resource's current lifecycle state. + // Example: `ACTIVE` LifecycleState HsmPartitionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID of the compartment that contains a particular HSM resource. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Port summary. + // Details of a single portInformation item include the PortNumber (an integer used as an identifier) and the PortType (refers to either an enum value of Managementutility,Clientutility, or null) PortInformation []PortInformation `mandatory:"true" json:"portInformation"` // The date and time an HSM was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. diff --git a/keymanagement/list_hsm_partitions_request_response.go b/keymanagement/list_hsm_partitions_request_response.go index 6e6a5395a8..b249e7825c 100644 --- a/keymanagement/list_hsm_partitions_request_response.go +++ b/keymanagement/list_hsm_partitions_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListHsmPartitions.go.html to see an example of how to use ListHsmPartitionsRequest. type ListHsmPartitionsRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // The maximum number of items to return in a paginated "List" call. diff --git a/keymanagement/port_information.go b/keymanagement/port_information.go index 6fbecea61a..13b4fc0365 100644 --- a/keymanagement/port_information.go +++ b/keymanagement/port_information.go @@ -15,13 +15,13 @@ import ( "strings" ) -// PortInformation The details of the port. +// PortInformation Details of a single portInformation item include the PortNumber (an integer used as an identifier) and the PortType (this refers to either an enum value of Management Utility, Client Utility, or null) type PortInformation struct { - // The port number of the cavium server. + // The port number is a unique identifier which is typically used as the loadbalancer listener. PortNumber *int `mandatory:"true" json:"portNumber"` - // Port type associated for the port number. + // Port type associated for the port number. The two port type enums are `CLIENTUTILITY` and `MANAGEMENTUTILITY`. The CLIENTUTILITY enum corresponds to a port which is used by the client daemon. The MANAGEMENTUTILITY enum corresponds to a port used by user management utility. PortType PortInformationPortTypeEnum `mandatory:"true" json:"portType"` } diff --git a/keymanagement/pre_co_user_credentials.go b/keymanagement/pre_co_user_credentials.go index 14c2caf543..dc9b3df513 100644 --- a/keymanagement/pre_co_user_credentials.go +++ b/keymanagement/pre_co_user_credentials.go @@ -18,7 +18,7 @@ import ( // PreCoUserCredentials Pre Crypto officer user credentials. type PreCoUserCredentials struct { - // The pre crypto officer username.. + // The pre crypto officer username, which should be chosen as a non confidential string. Username *string `mandatory:"true" json:"username"` // The base 64 encoded pre crypto officer password. diff --git a/keymanagement/schedule_hsm_cluster_deletion_request_response.go b/keymanagement/schedule_hsm_cluster_deletion_request_response.go index 44d90e08cd..df705c09b0 100644 --- a/keymanagement/schedule_hsm_cluster_deletion_request_response.go +++ b/keymanagement/schedule_hsm_cluster_deletion_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ScheduleHsmClusterDeletion.go.html to see an example of how to use ScheduleHsmClusterDeletionRequest. type ScheduleHsmClusterDeletionRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // Details of ScheduleHsmClusterDeletionDetails diff --git a/keymanagement/update_hsm_cluster_request_response.go b/keymanagement/update_hsm_cluster_request_response.go index ca255ccdad..cd11e61bbb 100644 --- a/keymanagement/update_hsm_cluster_request_response.go +++ b/keymanagement/update_hsm_cluster_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UpdateHsmCluster.go.html to see an example of how to use UpdateHsmClusterRequest. type UpdateHsmClusterRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // Details of the HsmCluster Resource diff --git a/keymanagement/upload_partition_certificates_details.go b/keymanagement/upload_partition_certificates_details.go index aaaeea8734..7427d8e64d 100644 --- a/keymanagement/upload_partition_certificates_details.go +++ b/keymanagement/upload_partition_certificates_details.go @@ -15,13 +15,13 @@ import ( "strings" ) -// UploadPartitionCertificatesDetails The details of the partition certificates. +// UploadPartitionCertificatesDetails An object that encapsulates the necessary partition certificates. type UploadPartitionCertificatesDetails struct { - // Base64 encoded (StandardCharsets.UTF_8) Partition Certificate. + // Base64 encoded (StandardCharsets.UTF_8) Partition Certificate, which gets created when the CSR is signed. PartitionCertificate *string `mandatory:"true" json:"partitionCertificate"` - // Base64 encoded (StandardCharsets.UTF_8) Partition Owner Certificate. + // Base64 encoded (StandardCharsets.UTF_8) Partition Owner Certificate, which is used to help sign the CSR. PartitionOwnerCertificate *string `mandatory:"true" json:"partitionOwnerCertificate"` } diff --git a/keymanagement/upload_partition_certificates_request_response.go b/keymanagement/upload_partition_certificates_request_response.go index 31465d4818..cdb215498d 100644 --- a/keymanagement/upload_partition_certificates_request_response.go +++ b/keymanagement/upload_partition_certificates_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/UploadPartitionCertificates.go.html to see an example of how to use UploadPartitionCertificatesRequest. type UploadPartitionCertificatesRequest struct { - // The OCID of the HSM Cluster. + // The OCID of the HSM Cluster. This is a unique identifier assigned to each hsmCluster. HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` // To upload partition certificates. diff --git a/keymanagement/vault.go b/keymanagement/vault.go index 586339c8cc..b4969b72a4 100644 --- a/keymanagement/vault.go +++ b/keymanagement/vault.go @@ -75,6 +75,9 @@ type Vault struct { // A Boolean value that indicates whether the Vault is primary Vault or replica Vault. IsPrimary *bool `mandatory:"false" json:"isPrimary"` + // A Boolean value that indicates whether the Vault has cross region replication capability. Always true for Virtual Private Vaults. + IsVaultReplicable *bool `mandatory:"false" json:"isVaultReplicable"` + ExternalKeyManagerMetadataSummary *ExternalKeyManagerMetadataSummary `mandatory:"false" json:"externalKeyManagerMetadataSummary"` } diff --git a/loadbalancer/backend.go b/loadbalancer/backend.go index 9b24199886..b69e7fc309 100644 --- a/loadbalancer/backend.go +++ b/loadbalancer/backend.go @@ -57,6 +57,8 @@ type Backend struct { Offline *bool `mandatory:"true" json:"offline"` // The maximum number of simultaneous connections the load balancer can make to the backend. + // If this is not set then the maximum number of simultaneous connections the load balancer + // can make to the backend is unlimited. // Example: `300` MaxConnections *int `mandatory:"false" json:"maxConnections"` } diff --git a/loadbalancer/backend_details.go b/loadbalancer/backend_details.go index 566d7a28e5..b6a42ad3f1 100644 --- a/loadbalancer/backend_details.go +++ b/loadbalancer/backend_details.go @@ -36,6 +36,8 @@ type BackendDetails struct { Weight *int `mandatory:"false" json:"weight"` // The maximum number of simultaneous connections the load balancer can make to the backend. + // If this is not set then the maximum number of simultaneous connections the load balancer + // can make to the backend is unlimited. // Example: `300` MaxConnections *int `mandatory:"false" json:"maxConnections"` diff --git a/loadbalancer/backend_set.go b/loadbalancer/backend_set.go index 626e444041..167d87e5ad 100644 --- a/loadbalancer/backend_set.go +++ b/loadbalancer/backend_set.go @@ -41,7 +41,9 @@ type BackendSet struct { HealthChecker *HealthChecker `mandatory:"true" json:"healthChecker"` // The maximum number of simultaneous connections the load balancer can make to any backend - // in the backend set unless the backend has its own maxConnections setting. + // in the backend set unless the backend has its own maxConnections setting. If this is not + // set then the number of simultaneous connections the load balancer can make to any backend + // in the backend set unless the backend has its own maxConnections setting is unlimited. // Example: `300` BackendMaxConnections *int `mandatory:"false" json:"backendMaxConnections"` diff --git a/loadbalancer/backend_set_details.go b/loadbalancer/backend_set_details.go index a6cd57e12a..2708bed219 100644 --- a/loadbalancer/backend_set_details.go +++ b/loadbalancer/backend_set_details.go @@ -34,7 +34,9 @@ type BackendSetDetails struct { Backends []BackendDetails `mandatory:"false" json:"backends"` // The maximum number of simultaneous connections the load balancer can make to any backend - // in the backend set unless the backend has its own maxConnections setting. + // in the backend set unless the backend has its own maxConnections setting. If this is not + // set then the number of simultaneous connections the load balancer can make to any backend + // in the backend set unless the backend has its own maxConnections setting is unlimited. // Example: `300` BackendMaxConnections *int `mandatory:"false" json:"backendMaxConnections"` diff --git a/loadbalancer/create_backend_details.go b/loadbalancer/create_backend_details.go index 7a323e6623..9bf0f762cc 100644 --- a/loadbalancer/create_backend_details.go +++ b/loadbalancer/create_backend_details.go @@ -38,6 +38,8 @@ type CreateBackendDetails struct { Weight *int `mandatory:"false" json:"weight"` // The maximum number of simultaneous connections the load balancer can make to the backend. + // If this is not set then number of simultaneous connections the load balancer can make to + // the backend is unlimited. // Example: `300` MaxConnections *int `mandatory:"false" json:"maxConnections"` diff --git a/loadbalancer/create_backend_set_details.go b/loadbalancer/create_backend_set_details.go index 26f74fd397..8773d77558 100644 --- a/loadbalancer/create_backend_set_details.go +++ b/loadbalancer/create_backend_set_details.go @@ -41,7 +41,9 @@ type CreateBackendSetDetails struct { Backends []BackendDetails `mandatory:"false" json:"backends"` // The maximum number of simultaneous connections the load balancer can make to any backend - // in the backend set unless the backend has its own maxConnections setting. + // in the backend set unless the backend has its own maxConnections setting. If this is not + // set then the number of simultaneous connections the load balancer can make to any backend + // in the backend set unless the backend has its own maxConnections setting is unlimited. // Example: `300` BackendMaxConnections *int `mandatory:"false" json:"backendMaxConnections"` diff --git a/loadbalancer/create_load_balancer_details.go b/loadbalancer/create_load_balancer_details.go index fc42eb9c85..9d257dd8d8 100644 --- a/loadbalancer/create_load_balancer_details.go +++ b/loadbalancer/create_load_balancer_details.go @@ -64,6 +64,31 @@ type CreateLoadBalancerDetails struct { // Example: "ipMode":"IPV6" IpMode CreateLoadBalancerDetailsIpModeEnum `mandatory:"false" json:"ipMode,omitempty"` + // Whether or not the load balancer has the Request Id feature enabled for HTTP listeners. + // If "true", the load balancer will attach a unique request id header to every request + // passed through from the load balancer to load balancer backends. This same request id + // header also will be added to the response the lb received from the backend handling + // the request before the load balancer returns the response to the requestor. The name + // of the unique request id header is set the by value of requestIdHeader. + // If "false", the loadbalancer not add this unique request id header to either the request + // passed through to the load balancer backends nor to the reponse returned to the user. + // New load balancers have the Request Id feature disabled unless isRequestIdEnabled is set to true. + // Example: `true` + IsRequestIdEnabled *bool `mandatory:"false" json:"isRequestIdEnabled"` + + // If isRequestIdEnabled is true then this field contains the name of the header field + // that contains the unique request id that is attached to every request from + // the load balancer to the load balancer backends and to every response from the load + // balancer. + // If a request to the load balancer already contains a header with same name as specified + // in requestIdHeader then the load balancer will not change the value of that field. + // If isRequestIdEnabled is false then this field is ignored. + // If this field is not set or is set to "" then this field defaults to X-Request-Id + // **Notes:** + // * Unless the header name is "" it must start with "X-" prefix. + // * Setting the header name to "" will set it to the default: X-Request-Id. + RequestIdHeader *string `mandatory:"false" json:"requestIdHeader"` + // An array of reserved Ips. ReservedIps []ReservedIp `mandatory:"false" json:"reservedIps"` diff --git a/loadbalancer/ip_max_connections.go b/loadbalancer/ip_max_connections.go index d6e216e8d6..011294af2c 100644 --- a/loadbalancer/ip_max_connections.go +++ b/loadbalancer/ip_max_connections.go @@ -23,7 +23,10 @@ type IpMaxConnections struct { // Example: '["129.213.176.0/24", "150.136.187.0/24", "2002::1234:abcd:ffff:c0a8:101/64"]' IpAddresses []string `mandatory:"true" json:"ipAddresses"` - // The max number of connections that the specified IPs can make to the Listener. + // The maximum number of simultaneous connections that the specified IPs can make to the + // Listener. IPs without a maxConnections setting can make either defaultMaxConnections + // simultaneous connections to a listener or, if no defaultMaxConnections is specified, an + // unlimited number of simultaneous connections to a listener. MaxConnections *int `mandatory:"true" json:"maxConnections"` } diff --git a/loadbalancer/load_balancer.go b/loadbalancer/load_balancer.go index a96dee33f6..5a9ba212c6 100644 --- a/loadbalancer/load_balancer.go +++ b/loadbalancer/load_balancer.go @@ -70,6 +70,26 @@ type LoadBalancer struct { // Example: `true` IsDeleteProtectionEnabled *bool `mandatory:"false" json:"isDeleteProtectionEnabled"` + // Whether or not the load balancer has the Request Id feature enabled for HTTP listeners. + // If "true", the load balancer will attach a unique request id header to every request + // passed through from the load balancer to load balancer backends. This same request id + // header also will be added to the response the lb received from the backend handling + // the request before the load balancer returns the response to the requestor. The name + // of the unique request id header is set the by value of requestIdHeader. + // If "false", the loadbalancer not add this unique request id header to either the request + // passed through to the load balancer backends nor to the reponse returned to the user. + // Example: `true` + IsRequestIdEnabled *bool `mandatory:"false" json:"isRequestIdEnabled"` + + // If isRequestIdEnabled is true then this field contains the name of the header field + // that contains the unique request id that is attached to every request from + // the load balancer to the load balancer backends and to every response from the load + // balancer. + // If a request to the load balancer already contains a header with same name as specified + // in requestIdHeader then the load balancer will not change the value of that field. + // If this field is set to "" this field defaults to X-Request-Id. + RequestIdHeader *string `mandatory:"false" json:"requestIdHeader"` + // An array of subnet OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). SubnetIds []string `mandatory:"false" json:"subnetIds"` diff --git a/loadbalancer/update_backend_details.go b/loadbalancer/update_backend_details.go index d74e59bf00..952f25d355 100644 --- a/loadbalancer/update_backend_details.go +++ b/loadbalancer/update_backend_details.go @@ -44,6 +44,8 @@ type UpdateBackendDetails struct { Offline *bool `mandatory:"true" json:"offline"` // The maximum number of simultaneous connections the load balancer can make to the backend. + // If this is not set then the maximum number of simultaneous connections the load balancer + // can make to the backend is unlimited. // Example: `300` MaxConnections *int `mandatory:"false" json:"maxConnections"` } diff --git a/loadbalancer/update_backend_set_details.go b/loadbalancer/update_backend_set_details.go index 96e38dc812..13ab5a78fd 100644 --- a/loadbalancer/update_backend_set_details.go +++ b/loadbalancer/update_backend_set_details.go @@ -35,7 +35,9 @@ type UpdateBackendSetDetails struct { HealthChecker *HealthCheckerDetails `mandatory:"true" json:"healthChecker"` // The maximum number of simultaneous connections the load balancer can make to any backend - // in the backend set unless the backend has its own maxConnections setting. + // in the backend set unless the backend has its own maxConnections setting. If this is not + // set then the number of simultaneous connections the load balancer can make to any backend + // in the backend set unless the backend has its own maxConnections setting is unlimited. // Example: `300` BackendMaxConnections *int `mandatory:"false" json:"backendMaxConnections"` diff --git a/loadbalancer/update_load_balancer_details.go b/loadbalancer/update_load_balancer_details.go index 8dfb13d849..355acc0835 100644 --- a/loadbalancer/update_load_balancer_details.go +++ b/loadbalancer/update_load_balancer_details.go @@ -32,6 +32,30 @@ type UpdateLoadBalancerDetails struct { // Example: `true` IsDeleteProtectionEnabled *bool `mandatory:"false" json:"isDeleteProtectionEnabled"` + // Whether or not the load balancer has the Request Id feature enabled for HTTP listeners. + // If "true", the load balancer will attach a unique request id header to every request + // passed through from the load balancer to load balancer backends. This same request id + // header also will be added to the response the lb received from the backend handling + // the request before the load balancer returns the response to the requestor. The name + // of the unique request id header is set the by value of requestIdHeader. + // If "false", the loadbalancer not add this unique request id header to either the request + // passed through to the load balancer backends nor to the reponse returned to the user. + // New load balancers have the Request Id feature enabled unless isRequestIdEnabled is set to False. + // Example: `true` + IsRequestIdEnabled *bool `mandatory:"false" json:"isRequestIdEnabled"` + + // If isRequestIdEnabled is true then this field contains the name of the header field + // that contains the unique request id that is attached to every request from + // the load balancer to the load balancer backends and to every response from the load + // balancer. + // If a request to the load balancer already contains a header with same name as specified + // in requestIdHeader then the load balancer will not change the value of that field. + // If isRequestIdEnabled is false then this field is ignored. + // **Notes:** + // * Unless the header name is "" it must start with "X-" prefix. + // * Setting the header name to "" will set it to the default: X-Request-Id. + RequestIdHeader *string `mandatory:"false" json:"requestIdHeader"` + // 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/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` diff --git a/mysql/create_db_system_details.go b/mysql/create_db_system_details.go index c1799c3236..1a68df3487 100644 --- a/mysql/create_db_system_details.go +++ b/mysql/create_db_system_details.go @@ -124,6 +124,11 @@ type CreateDbSystemDetails struct { DatabaseManagement DatabaseManagementStatusEnum `mandatory:"false" json:"databaseManagement,omitempty"` SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` + + // The list of customer email addresses that receive information from Oracle about the specified OCI DB System resource. + // Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. + // Up to 10 email addresses can be added to the customer contacts for a DB System. + CustomerContacts []CustomerContact `mandatory:"false" json:"customerContacts"` } func (m CreateDbSystemDetails) String() string { @@ -175,6 +180,7 @@ func (m *CreateDbSystemDetails) UnmarshalJSON(data []byte) (e error) { CrashRecovery CrashRecoveryStatusEnum `json:"crashRecovery"` DatabaseManagement DatabaseManagementStatusEnum `json:"databaseManagement"` SecureConnections *SecureConnectionDetails `json:"secureConnections"` + CustomerContacts []CustomerContact `json:"customerContacts"` CompartmentId *string `json:"compartmentId"` ShapeName *string `json:"shapeName"` SubnetId *string `json:"subnetId"` @@ -241,6 +247,8 @@ func (m *CreateDbSystemDetails) UnmarshalJSON(data []byte) (e error) { m.SecureConnections = model.SecureConnections + m.CustomerContacts = make([]CustomerContact, len(model.CustomerContacts)) + copy(m.CustomerContacts, model.CustomerContacts) m.CompartmentId = model.CompartmentId m.ShapeName = model.ShapeName diff --git a/mysql/customer_contact.go b/mysql/customer_contact.go new file mode 100644 index 0000000000..a1865090da --- /dev/null +++ b/mysql/customer_contact.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. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CustomerContact Customer contact information that will be used by Oracle to provide notifications needed by DB System administrators. +type CustomerContact struct { + + // The email address used by Oracle to send notifications regarding the DB System. + Email *string `mandatory:"true" json:"email"` +} + +func (m CustomerContact) 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 CustomerContact) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/mysql/db_system.go b/mysql/db_system.go index 77fc678114..4a50bc2a07 100644 --- a/mysql/db_system.go +++ b/mysql/db_system.go @@ -139,6 +139,11 @@ type DbSystem struct { DatabaseManagement DatabaseManagementStatusEnum `mandatory:"false" json:"databaseManagement,omitempty"` SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` + + // The list of customer email addresses that receive information from Oracle about the specified OCI DB System resource. + // Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. + // Up to 10 email addresses can be added to the customer contacts for a DB System. + CustomerContacts []CustomerContact `mandatory:"false" json:"customerContacts"` } func (m DbSystem) String() string { @@ -193,6 +198,7 @@ func (m *DbSystem) UnmarshalJSON(data []byte) (e error) { PointInTimeRecoveryDetails *PointInTimeRecoveryDetails `json:"pointInTimeRecoveryDetails"` DatabaseManagement DatabaseManagementStatusEnum `json:"databaseManagement"` SecureConnections *SecureConnectionDetails `json:"secureConnections"` + CustomerContacts []CustomerContact `json:"customerContacts"` Id *string `json:"id"` DisplayName *string `json:"displayName"` CompartmentId *string `json:"compartmentId"` @@ -268,6 +274,8 @@ func (m *DbSystem) UnmarshalJSON(data []byte) (e error) { m.SecureConnections = model.SecureConnections + m.CustomerContacts = make([]CustomerContact, len(model.CustomerContacts)) + copy(m.CustomerContacts, model.CustomerContacts) m.Id = model.Id m.DisplayName = model.DisplayName diff --git a/mysql/update_db_system_details.go b/mysql/update_db_system_details.go index cc3ed64f91..4c982585da 100644 --- a/mysql/update_db_system_details.go +++ b/mysql/update_db_system_details.go @@ -124,6 +124,11 @@ type UpdateDbSystemDetails struct { DatabaseManagement DatabaseManagementStatusEnum `mandatory:"false" json:"databaseManagement,omitempty"` SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` + + // The list of customer email addresses that receive information from Oracle about the specified OCI DB System resource. + // Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. + // Up to 10 email addresses can be added to the customer contacts for a DB System. + CustomerContacts []CustomerContact `mandatory:"false" json:"customerContacts"` } func (m UpdateDbSystemDetails) String() string { diff --git a/objectstorage/access_target_details.go b/objectstorage/access_target_details.go new file mode 100644 index 0000000000..733dedc3c3 --- /dev/null +++ b/objectstorage/access_target_details.go @@ -0,0 +1,48 @@ +// 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. + +// Object Storage Service API +// +// Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. +// For more information, see Overview of Object Storage (https://docs.cloud.oracle.com/Content/Object/Concepts/objectstorageoverview.htm) and +// Overview of Archive Storage (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). +// + +package objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AccessTargetDetails Details of the targets that can be accessed by the private endpoint. +type AccessTargetDetails struct { + + // The Object Storage namespace which the private endpoint can access. Wildcards ('*') are allowed. If value is '*', it means all namespaces can be accessed. It cannot be a regex. + Namespace *string `mandatory:"true" json:"namespace"` + + // The compartment ID which the private endpoint can access. Wildcards ('*') are allowed. If value is '*', it means all compartments in the specified namespace can be accessed. It cannot be a regex. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The name of the bucket. Avoid entering confidential information. Wildcards ('*') are allowed. If value is '*', it means all buckets in the specified namespace and compartment can be accessed. It cannot be a regex. + // Example: my-new-bucket1 + Bucket *string `mandatory:"true" json:"bucket"` +} + +func (m AccessTargetDetails) 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 AccessTargetDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/objectstorage/commit_multipart_upload_request_response.go b/objectstorage/commit_multipart_upload_request_response.go index 150748aec2..56d7599ae4 100644 --- a/objectstorage/commit_multipart_upload_request_response.go +++ b/objectstorage/commit_multipart_upload_request_response.go @@ -147,7 +147,7 @@ type CommitMultipartUploadResponse struct { // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // Base-64 representation of the multipart object hash. + // Base-64 representation of the multipart object MD5 hash. // The multipart object hash is calculated by taking the MD5 hashes of the parts passed to this call, // concatenating the binary representation of those hashes in order of their part numbers, // and then calculating the MD5 hash of the concatenated values. The multipart object hash is followed diff --git a/objectstorage/create_private_endpoint_details.go b/objectstorage/create_private_endpoint_details.go new file mode 100644 index 0000000000..49fe1faa72 --- /dev/null +++ b/objectstorage/create_private_endpoint_details.go @@ -0,0 +1,82 @@ +// 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. + +// Object Storage Service API +// +// Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. +// For more information, see Overview of Object Storage (https://docs.cloud.oracle.com/Content/Object/Concepts/objectstorageoverview.htm) and +// Overview of Archive Storage (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). +// + +package objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreatePrivateEndpointDetails Details to create a private endpoint +type CreatePrivateEndpointDetails struct { + + // This name associated with the endpoint. Valid characters are uppercase or lowercase letters, numbers, hyphens, + // underscores, and periods. + // Example: my-new-private-endpoint1 + Name *string `mandatory:"true" json:"name"` + + // The ID of the compartment in which to create the Private Endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the customer's subnet where the private endpoint VNIC will reside. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // A prefix to use for the private endpoint. The customer VCN's DNS records are + // updated with this prefix. The prefix input from the customer will be the first sub-domain in the endpointFqdn. + // Example: If the prefix chosen is "abc", then the endpointFqdn will be 'abc.private.objectstorage..oraclecloud.com' + Prefix *string `mandatory:"true" json:"prefix"` + + // A list of targets that can be accessed by the private endpoint. + AccessTargets []AccessTargetDetails `mandatory:"true" json:"accessTargets"` + + // A list of additional prefix that you can provide along with any other prefix. These resulting endpointFqdn's are added to the + // customer VCN's DNS record. + AdditionalPrefixes []string `mandatory:"false" json:"additionalPrefixes"` + + // The private IP address to assign to this private endpoint. If you provide a value, + // it must be an available IP address in the customer's subnet. If it's not available, an error + // is returned. + // If you do not provide a value, an available IP address in the subnet is automatically chosen. + PrivateEndpointIp *string `mandatory:"false" json:"privateEndpointIp"` + + // A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to. + // For more information about NSGs, see + // NetworkSecurityGroup. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreatePrivateEndpointDetails) 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 CreatePrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/objectstorage/create_private_endpoint_request_response.go b/objectstorage/create_private_endpoint_request_response.go new file mode 100644 index 0000000000..5b7b05d530 --- /dev/null +++ b/objectstorage/create_private_endpoint_request_response.go @@ -0,0 +1,112 @@ +// 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 objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreatePrivateEndpointRequest wrapper for the CreatePrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/CreatePrivateEndpoint.go.html to see an example of how to use CreatePrivateEndpointRequest. +type CreatePrivateEndpointRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // Details to create a private endpoint. + CreatePrivateEndpointDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-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 CreatePrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreatePrivateEndpointRequest) 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 CreatePrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// ReplaceMandatoryParamInPath replaces the mandatory parameter in the path with the value provided. +// Not all services are supporting this feature and this method will be a no-op for those services. +func (request CreatePrivateEndpointRequest) ReplaceMandatoryParamInPath(client *common.BaseClient, mandatoryParamMap map[string][]common.TemplateParamForPerRealmEndpoint) { + if mandatoryParamMap["namespaceName"] != nil { + templateParam := mandatoryParamMap["namespaceName"] + for _, template := range templateParam { + replacementParam := *request.NamespaceName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreatePrivateEndpointRequest) 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 CreatePrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreatePrivateEndpointResponse wrapper for the CreatePrivateEndpoint operation +type CreatePrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. If you need to contact Oracle about a + // particular request, provide this request ID. + 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, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` +} + +func (response CreatePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreatePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/objectstorage/delete_private_endpoint_request_response.go b/objectstorage/delete_private_endpoint_request_response.go new file mode 100644 index 0000000000..67ed7e83e0 --- /dev/null +++ b/objectstorage/delete_private_endpoint_request_response.go @@ -0,0 +1,128 @@ +// 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 objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeletePrivateEndpointRequest wrapper for the DeletePrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/DeletePrivateEndpoint.go.html to see an example of how to use DeletePrivateEndpointRequest. +type DeletePrivateEndpointRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The name of the private endpoint. Avoid entering confidential information. + // Example: `my-new-pe-1` + PeName *string `mandatory:"true" contributesTo:"path" name:"peName"` + + // The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of + // the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload + // the resource. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-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 DeletePrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeletePrivateEndpointRequest) 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 DeletePrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// ReplaceMandatoryParamInPath replaces the mandatory parameter in the path with the value provided. +// Not all services are supporting this feature and this method will be a no-op for those services. +func (request DeletePrivateEndpointRequest) ReplaceMandatoryParamInPath(client *common.BaseClient, mandatoryParamMap map[string][]common.TemplateParamForPerRealmEndpoint) { + if mandatoryParamMap["namespaceName"] != nil { + templateParam := mandatoryParamMap["namespaceName"] + for _, template := range templateParam { + replacementParam := *request.NamespaceName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } + if mandatoryParamMap["peName"] != nil { + templateParam := mandatoryParamMap["peName"] + for _, template := range templateParam { + replacementParam := *request.PeName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeletePrivateEndpointRequest) 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 DeletePrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeletePrivateEndpointResponse wrapper for the DeletePrivateEndpoint operation +type DeletePrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. If you need to contact Oracle about a + // particular request, provide this request ID. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeletePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeletePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/objectstorage/fqdns.go b/objectstorage/fqdns.go new file mode 100644 index 0000000000..032166e13a --- /dev/null +++ b/objectstorage/fqdns.go @@ -0,0 +1,42 @@ +// 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. + +// Object Storage Service API +// +// Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. +// For more information, see Overview of Object Storage (https://docs.cloud.oracle.com/Content/Object/Concepts/objectstorageoverview.htm) and +// Overview of Archive Storage (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). +// + +package objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Fqdns The object representing FQDN details formed using prefix and additionalPrefixes. +type Fqdns struct { + PrefixFqdns *PrefixFqdns `mandatory:"false" json:"prefixFqdns"` + + // An object containing FQDNs formed using additionalPrefixes. + AdditionalPrefixesFqdns map[string]PrefixFqdns `mandatory:"false" json:"additionalPrefixesFqdns"` +} + +func (m Fqdns) 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 Fqdns) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/objectstorage/get_private_endpoint_request_response.go b/objectstorage/get_private_endpoint_request_response.go new file mode 100644 index 0000000000..a174f751b2 --- /dev/null +++ b/objectstorage/get_private_endpoint_request_response.go @@ -0,0 +1,141 @@ +// 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 objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetPrivateEndpointRequest wrapper for the GetPrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/GetPrivateEndpoint.go.html to see an example of how to use GetPrivateEndpointRequest. +type GetPrivateEndpointRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The name of the private endpoint. Avoid entering confidential information. + // Example: `my-new-pe-1` + PeName *string `mandatory:"true" contributesTo:"path" name:"peName"` + + // The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of + // the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload + // the resource. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // The entity tag (ETag) to avoid matching. Wildcards ('*') are not allowed. If the specified ETag does not + // match the ETag of the existing resource, the request returns the expected response. If the ETag matches + // the ETag of the existing resource, the request returns an HTTP 304 status without a response body. + IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-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 GetPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPrivateEndpointRequest) 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 GetPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// ReplaceMandatoryParamInPath replaces the mandatory parameter in the path with the value provided. +// Not all services are supporting this feature and this method will be a no-op for those services. +func (request GetPrivateEndpointRequest) ReplaceMandatoryParamInPath(client *common.BaseClient, mandatoryParamMap map[string][]common.TemplateParamForPerRealmEndpoint) { + if mandatoryParamMap["namespaceName"] != nil { + templateParam := mandatoryParamMap["namespaceName"] + for _, template := range templateParam { + replacementParam := *request.NamespaceName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } + if mandatoryParamMap["peName"] != nil { + templateParam := mandatoryParamMap["peName"] + for _, template := range templateParam { + replacementParam := *request.PeName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPrivateEndpointRequest) 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 GetPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetPrivateEndpointResponse wrapper for the GetPrivateEndpoint operation +type GetPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PrivateEndpoint instance + PrivateEndpoint `presentIn:"body"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The entity tag (ETag) for the Private Endpoint. + ETag *string `presentIn:"header" name:"etag"` + + // Flag to indicate whether or not the object was modified. If this is true, + // the getter for the object itself will return null. Callers should check this + // if they specified one of the request params that might result in a conditional + // response (like 'if-match'/'if-none-match'). + IsNotModified bool +} + +func (response GetPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/objectstorage/list_object_versions_request_response.go b/objectstorage/list_object_versions_request_response.go index 90dc19b69e..88de09c800 100644 --- a/objectstorage/list_object_versions_request_response.go +++ b/objectstorage/list_object_versions_request_response.go @@ -28,10 +28,10 @@ type ListObjectVersionsRequest struct { // The string to use for matching against the start of object names in a list query. Prefix *string `mandatory:"false" contributesTo:"query" name:"prefix"` - // Object names returned by a list query must be greater or equal to this parameter. + // Returns object names which are lexicographically greater than or equal to this parameter. Start *string `mandatory:"false" contributesTo:"query" name:"start"` - // Object names returned by a list query must be strictly less than this parameter. + // Returns object names which are lexicographically strictly less than this parameter. End *string `mandatory:"false" contributesTo:"query" name:"end"` // For list pagination. The maximum number of results per page, or items to return in a paginated @@ -56,7 +56,7 @@ type ListObjectVersionsRequest struct { // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` - // Object names returned by a list query must be greater than this parameter. + // Returns object names which are lexicographically strictly greater than this parameter. StartAfter *string `mandatory:"false" contributesTo:"query" name:"startAfter"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" call. For important diff --git a/objectstorage/list_objects_request_response.go b/objectstorage/list_objects_request_response.go index 166a40d958..232faa7e33 100644 --- a/objectstorage/list_objects_request_response.go +++ b/objectstorage/list_objects_request_response.go @@ -28,10 +28,10 @@ type ListObjectsRequest struct { // The string to use for matching against the start of object names in a list query. Prefix *string `mandatory:"false" contributesTo:"query" name:"prefix"` - // Object names returned by a list query must be greater or equal to this parameter. + // Returns object names which are lexicographically greater than or equal to this parameter. Start *string `mandatory:"false" contributesTo:"query" name:"start"` - // Object names returned by a list query must be strictly less than this parameter. + // Returns object names which are lexicographically strictly less than this parameter. End *string `mandatory:"false" contributesTo:"query" name:"end"` // For list pagination. The maximum number of results per page, or items to return in a paginated @@ -56,7 +56,7 @@ type ListObjectsRequest struct { // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` - // Object names returned by a list query must be greater than this parameter. + // Returns object names which are lexicographically strictly greater than this parameter. StartAfter *string `mandatory:"false" contributesTo:"query" name:"startAfter"` // Metadata about the request. This information will not be transmitted to the service, but diff --git a/objectstorage/list_private_endpoints_request_response.go b/objectstorage/list_private_endpoints_request_response.go new file mode 100644 index 0000000000..7b9842372f --- /dev/null +++ b/objectstorage/list_private_endpoints_request_response.go @@ -0,0 +1,195 @@ +// 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 objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListPrivateEndpointsRequest wrapper for the ListPrivateEndpoints operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/ListPrivateEndpoints.go.html to see an example of how to use ListPrivateEndpointsRequest. +type ListPrivateEndpointsRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The ID of the compartment in which to list buckets. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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"` + + // PrivateEndpoint summary in list of PrivateEndpoints includes the 'namespace', 'name', 'compartmentId', + // 'createdBy', 'timeCreated', 'timeModified' and 'etag' fields. + // This parameter can also include 'tags' (freeformTags and definedTags). + // The only supported value of this parameter is 'tags' for now. Example 'tags'. + Fields []ListPrivateEndpointsFieldsEnum `contributesTo:"query" name:"fields" omitEmpty:"true" collectionFormat:"csv"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // The lifecycle state of the Private Endpoint + LifecycleState PrivateEndpointLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" 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 ListPrivateEndpointsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListPrivateEndpointsRequest) 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 ListPrivateEndpointsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// ReplaceMandatoryParamInPath replaces the mandatory parameter in the path with the value provided. +// Not all services are supporting this feature and this method will be a no-op for those services. +func (request ListPrivateEndpointsRequest) ReplaceMandatoryParamInPath(client *common.BaseClient, mandatoryParamMap map[string][]common.TemplateParamForPerRealmEndpoint) { + if mandatoryParamMap["namespaceName"] != nil { + templateParam := mandatoryParamMap["namespaceName"] + for _, template := range templateParam { + replacementParam := *request.NamespaceName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } + if mandatoryParamMap["compartmentId"] != nil { + templateParam := mandatoryParamMap["compartmentId"] + for _, template := range templateParam { + replacementParam := *request.CompartmentId + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPrivateEndpointsRequest) 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 ListPrivateEndpointsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.Fields { + if _, ok := GetMappingListPrivateEndpointsFieldsEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Fields: %s. Supported values are: %s.", val, strings.Join(GetListPrivateEndpointsFieldsEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingPrivateEndpointLifecycleStateEnum(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(GetPrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListPrivateEndpointsResponse wrapper for the ListPrivateEndpoints operation +type ListPrivateEndpointsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []PrivateEndpointSummary instances + Items []PrivateEndpointSummary `presentIn:"body"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For paginating a list of PEs. + // In the GET request, set the limit to the number of Private Endpoint items that you want returned in the response. + // If the `opc-next-page` header appears in the response, then this is a partial list and there are additional + // Private Endpoint's to get. Include the header's value as the `page` parameter in the subsequent GET request to get the + // next batch of PEs. Repeat this process to retrieve the entire list of Private Endpoint's. + // By default, the page limit is set to 25 Private Endpoint's per page, but you can specify a value from 1 to 1000. + // For more 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 ListPrivateEndpointsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListPrivateEndpointsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListPrivateEndpointsFieldsEnum Enum with underlying type: string +type ListPrivateEndpointsFieldsEnum string + +// Set of constants representing the allowable values for ListPrivateEndpointsFieldsEnum +const ( + ListPrivateEndpointsFieldsTags ListPrivateEndpointsFieldsEnum = "tags" +) + +var mappingListPrivateEndpointsFieldsEnum = map[string]ListPrivateEndpointsFieldsEnum{ + "tags": ListPrivateEndpointsFieldsTags, +} + +var mappingListPrivateEndpointsFieldsEnumLowerCase = map[string]ListPrivateEndpointsFieldsEnum{ + "tags": ListPrivateEndpointsFieldsTags, +} + +// GetListPrivateEndpointsFieldsEnumValues Enumerates the set of values for ListPrivateEndpointsFieldsEnum +func GetListPrivateEndpointsFieldsEnumValues() []ListPrivateEndpointsFieldsEnum { + values := make([]ListPrivateEndpointsFieldsEnum, 0) + for _, v := range mappingListPrivateEndpointsFieldsEnum { + values = append(values, v) + } + return values +} + +// GetListPrivateEndpointsFieldsEnumStringValues Enumerates the set of values in String for ListPrivateEndpointsFieldsEnum +func GetListPrivateEndpointsFieldsEnumStringValues() []string { + return []string{ + "tags", + } +} + +// GetMappingListPrivateEndpointsFieldsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPrivateEndpointsFieldsEnum(val string) (ListPrivateEndpointsFieldsEnum, bool) { + enum, ok := mappingListPrivateEndpointsFieldsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/objectstorage/list_work_requests_request_response.go b/objectstorage/list_work_requests_request_response.go index 669a8544f5..53e11065e0 100644 --- a/objectstorage/list_work_requests_request_response.go +++ b/objectstorage/list_work_requests_request_response.go @@ -21,6 +21,9 @@ type ListWorkRequestsRequest struct { // The ID of the compartment in which to list buckets. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + // The name of the privateEndpoint for which to list work requests. + PrivateEndpointName *string `mandatory:"false" contributesTo:"query" name:"privateEndpointName"` + // The client request ID for tracing. OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` diff --git a/objectstorage/objectstorage_client.go b/objectstorage/objectstorage_client.go index 911ff67e6e..34278ff9f5 100644 --- a/objectstorage/objectstorage_client.go +++ b/objectstorage/objectstorage_client.go @@ -607,6 +607,71 @@ func (client ObjectStorageClient) createPreauthenticatedRequest(ctx context.Cont return response, err } +// CreatePrivateEndpoint Create a PrivateEndpoint. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/CreatePrivateEndpoint.go.html to see an example of how to use CreatePrivateEndpoint API. +// A default retry strategy applies to this operation CreatePrivateEndpoint() +func (client ObjectStorageClient) CreatePrivateEndpoint(ctx context.Context, request CreatePrivateEndpointRequest) (response CreatePrivateEndpointResponse, 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.createPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreatePrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreatePrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreatePrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePrivateEndpointResponse") + } + return +} + +// createPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) createPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/pe", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + host := client.Host + request.(CreatePrivateEndpointRequest).ReplaceMandatoryParamInPath(&client.BaseClient, client.requiredParamsInEndpoint) + common.SetMissingTemplateParams(&client.BaseClient) + defer func() { + client.Host = host + }() + + var response CreatePrivateEndpointResponse + 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/objectstorage/20160918/PrivateEndpoint/CreatePrivateEndpoint" + err = common.PostProcessServiceError(err, "ObjectStorage", "CreatePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateReplicationPolicy Creates a replication policy for the specified bucket. // // # See also @@ -1001,6 +1066,71 @@ func (client ObjectStorageClient) deletePreauthenticatedRequest(ctx context.Cont return response, err } +// DeletePrivateEndpoint Deletes a Private Endpoint if it exists in the given namespace. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/DeletePrivateEndpoint.go.html to see an example of how to use DeletePrivateEndpoint API. +// A default retry strategy applies to this operation DeletePrivateEndpoint() +func (client ObjectStorageClient) DeletePrivateEndpoint(ctx context.Context, request DeletePrivateEndpointRequest) (response DeletePrivateEndpointResponse, 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.deletePrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeletePrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeletePrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeletePrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeletePrivateEndpointResponse") + } + return +} + +// deletePrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) deletePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/n/{namespaceName}/pe/{peName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + host := client.Host + request.(DeletePrivateEndpointRequest).ReplaceMandatoryParamInPath(&client.BaseClient, client.requiredParamsInEndpoint) + common.SetMissingTemplateParams(&client.BaseClient) + defer func() { + client.Host = host + }() + + var response DeletePrivateEndpointResponse + 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/objectstorage/20160918/PrivateEndpoint/DeletePrivateEndpoint" + err = common.PostProcessServiceError(err, "ObjectStorage", "DeletePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteReplicationPolicy Deletes the replication policy associated with the source bucket. // // # See also @@ -1525,6 +1655,71 @@ func (client ObjectStorageClient) getPreauthenticatedRequest(ctx context.Context return response, err } +// GetPrivateEndpoint Gets the current representation of the given Private Endpoint in the given Object Storage namespace. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/GetPrivateEndpoint.go.html to see an example of how to use GetPrivateEndpoint API. +// A default retry strategy applies to this operation GetPrivateEndpoint() +func (client ObjectStorageClient) GetPrivateEndpoint(ctx context.Context, request GetPrivateEndpointRequest) (response GetPrivateEndpointResponse, 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.getPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPrivateEndpointResponse") + } + return +} + +// getPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) getPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/pe/{peName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + host := client.Host + request.(GetPrivateEndpointRequest).ReplaceMandatoryParamInPath(&client.BaseClient, client.requiredParamsInEndpoint) + common.SetMissingTemplateParams(&client.BaseClient) + defer func() { + client.Host = host + }() + + var response GetPrivateEndpointResponse + 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/objectstorage/20160918/PrivateEndpoint/GetPrivateEndpoint" + err = common.PostProcessServiceError(err, "ObjectStorage", "GetPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetReplicationPolicy Get the replication policy. // // # See also @@ -2258,6 +2453,74 @@ func (client ObjectStorageClient) listPreauthenticatedRequests(ctx context.Conte return response, err } +// ListPrivateEndpoints Gets a list of all PrivateEndpointSummary in a compartment associated with a namespace. +// To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/ListPrivateEndpoints.go.html to see an example of how to use ListPrivateEndpoints API. +// A default retry strategy applies to this operation ListPrivateEndpoints() +func (client ObjectStorageClient) ListPrivateEndpoints(ctx context.Context, request ListPrivateEndpointsRequest) (response ListPrivateEndpointsResponse, 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.listPrivateEndpoints, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListPrivateEndpointsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListPrivateEndpointsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListPrivateEndpointsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPrivateEndpointsResponse") + } + return +} + +// listPrivateEndpoints implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) listPrivateEndpoints(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/n/{namespaceName}/pe", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + host := client.Host + request.(ListPrivateEndpointsRequest).ReplaceMandatoryParamInPath(&client.BaseClient, client.requiredParamsInEndpoint) + common.SetMissingTemplateParams(&client.BaseClient) + defer func() { + client.Host = host + }() + + var response ListPrivateEndpointsResponse + 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/objectstorage/20160918/PrivateEndpointSummary/ListPrivateEndpoints" + err = common.PostProcessServiceError(err, "ObjectStorage", "ListPrivateEndpoints", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListReplicationPolicies List the replication policies associated with a bucket. // // # See also @@ -3079,8 +3342,8 @@ func (client ObjectStorageClient) renameObject(ctx context.Context, request comm return response, err } -// RestoreObjects Restores one or more objects specified by the objectName parameter. -// By default objects will be restored for 24 hours. Duration can be configured using the hours parameter. +// RestoreObjects Restores the object specified by the objectName parameter. +// By default object will be restored for 24 hours. Duration can be configured using the hours parameter. // // # See also // @@ -3348,6 +3611,76 @@ func (client ObjectStorageClient) updateObjectStorageTier(ctx context.Context, r return response, err } +// UpdatePrivateEndpoint Performs a partial or full update of a user-defined data associated with the Private Endpoint. +// Use UpdatePrivateEndpoint to move a Private Endpoint from one compartment to another within the same tenancy. Supply the compartmentID +// of the compartment that you want to move the Private Endpoint to. Or use it to update the name, subnetId, endpointFqdn or privateEndpointIp or accessTargets of the Private Endpoint. +// For more 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). +// This API follows replace semantics (rather than merge semantics). That means if the body provides values for +// parameters and the resource has exisiting ones, this operation will replace those existing values. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/UpdatePrivateEndpoint.go.html to see an example of how to use UpdatePrivateEndpoint API. +// A default retry strategy applies to this operation UpdatePrivateEndpoint() +func (client ObjectStorageClient) UpdatePrivateEndpoint(ctx context.Context, request UpdatePrivateEndpointRequest) (response UpdatePrivateEndpointResponse, 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.updatePrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdatePrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdatePrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdatePrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdatePrivateEndpointResponse") + } + return +} + +// updatePrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client ObjectStorageClient) updatePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/n/{namespaceName}/pe/{peName}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + host := client.Host + request.(UpdatePrivateEndpointRequest).ReplaceMandatoryParamInPath(&client.BaseClient, client.requiredParamsInEndpoint) + common.SetMissingTemplateParams(&client.BaseClient) + defer func() { + client.Host = host + }() + + var response UpdatePrivateEndpointResponse + 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/objectstorage/20160918/PrivateEndpoint/UpdatePrivateEndpoint" + err = common.PostProcessServiceError(err, "ObjectStorage", "UpdatePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateRetentionRule Updates the specified retention rule. Rule changes take effect typically within 30 seconds. // // # See also diff --git a/objectstorage/prefix_fqdns.go b/objectstorage/prefix_fqdns.go new file mode 100644 index 0000000000..554865495e --- /dev/null +++ b/objectstorage/prefix_fqdns.go @@ -0,0 +1,47 @@ +// 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. + +// Object Storage Service API +// +// Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. +// For more information, see Overview of Object Storage (https://docs.cloud.oracle.com/Content/Object/Concepts/objectstorageoverview.htm) and +// Overview of Archive Storage (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). +// + +package objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrefixFqdns An object containing FQDNs +type PrefixFqdns struct { + + // ObjectStorage API FQDN + ObjectStorageApiFqdn *string `mandatory:"false" json:"objectStorageApiFqdn"` + + // S3 Compatibility API FQDN + S3CompatibilityApiFqdn *string `mandatory:"false" json:"s3CompatibilityApiFqdn"` + + // Swift API FQDN + SwiftApiFqdn *string `mandatory:"false" json:"swiftApiFqdn"` +} + +func (m PrefixFqdns) 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 PrefixFqdns) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/objectstorage/private_endpoint.go b/objectstorage/private_endpoint.go new file mode 100644 index 0000000000..37ed61d8d7 --- /dev/null +++ b/objectstorage/private_endpoint.go @@ -0,0 +1,170 @@ +// 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. + +// Object Storage Service API +// +// Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. +// For more information, see Overview of Object Storage (https://docs.cloud.oracle.com/Content/Object/Concepts/objectstorageoverview.htm) and +// Overview of Archive Storage (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). +// + +package objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrivateEndpoint A private endpoint makes your service accessible through a private IP in the customer's private network. A private endpoint has a name and is associated with a namespace and a single compartment. +type PrivateEndpoint struct { + + // This name associated with the endpoint. Valid characters are uppercase or lowercase letters, numbers, hyphens, + // underscores, and periods. + // Example: my-new-private-endpoint1 + Name *string `mandatory:"true" json:"name"` + + // The Object Storage namespace associated with the private enpoint. + Namespace *string `mandatory:"true" json:"namespace"` + + // The compartment which is associated with the Private Endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the user who created the Private Endpoint. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // The date and time the Private Endpoint was created, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.29). + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the Private Endpoint was updated, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.29). + TimeModified *common.SDKTime `mandatory:"true" json:"timeModified"` + + // The OCID of the customer's subnet where the private endpoint VNIC will reside. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The private IP address to assign to this private endpoint. If you provide a value, + // it must be an available IP address in the customer's subnet. If it's not available, an error + // is returned. + // If you do not provide a value, an available IP address in the subnet is automatically chosen. + PrivateEndpointIp *string `mandatory:"true" json:"privateEndpointIp"` + + // A prefix to use for the private endpoint. The customer VCN's DNS records are + // updated with this prefix. The prefix input from the customer will be the first sub-domain in the endpointFqdn. + // Example: If the prefix chosen is "abc", then the endpointFqdn will be 'abc.private.objectstorage..oraclecloud.com' + Prefix *string `mandatory:"true" json:"prefix"` + + Fqdns *Fqdns `mandatory:"true" json:"fqdns"` + + // The entity tag (ETag) for the Private Endpoint. + Etag *string `mandatory:"true" json:"etag"` + + // A list of targets that can be accessed by the private endpoint. At least one or more access targets is required for a private endpoint. + AccessTargets []AccessTargetDetails `mandatory:"true" json:"accessTargets"` + + // A list of additional prefix that you can provide along with any other prefix. These resulting endpointFqdn's are added to the + // customer VCN's DNS record. + AdditionalPrefixes []string `mandatory:"false" json:"additionalPrefixes"` + + // A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to. + // For more information about NSGs, see + // NetworkSecurityGroup. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // The Private Endpoint's lifecycle state. + LifecycleState PrivateEndpointLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/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/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the PrivateEndpoint. + Id *string `mandatory:"false" json:"id"` +} + +func (m PrivateEndpoint) 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 PrivateEndpoint) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingPrivateEndpointLifecycleStateEnum(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(GetPrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PrivateEndpointLifecycleStateEnum Enum with underlying type: string +type PrivateEndpointLifecycleStateEnum string + +// Set of constants representing the allowable values for PrivateEndpointLifecycleStateEnum +const ( + PrivateEndpointLifecycleStateCreating PrivateEndpointLifecycleStateEnum = "CREATING" + PrivateEndpointLifecycleStateActive PrivateEndpointLifecycleStateEnum = "ACTIVE" + PrivateEndpointLifecycleStateInactive PrivateEndpointLifecycleStateEnum = "INACTIVE" + PrivateEndpointLifecycleStateUpdating PrivateEndpointLifecycleStateEnum = "UPDATING" + PrivateEndpointLifecycleStateDeleting PrivateEndpointLifecycleStateEnum = "DELETING" + PrivateEndpointLifecycleStateDeleted PrivateEndpointLifecycleStateEnum = "DELETED" + PrivateEndpointLifecycleStateFailed PrivateEndpointLifecycleStateEnum = "FAILED" +) + +var mappingPrivateEndpointLifecycleStateEnum = map[string]PrivateEndpointLifecycleStateEnum{ + "CREATING": PrivateEndpointLifecycleStateCreating, + "ACTIVE": PrivateEndpointLifecycleStateActive, + "INACTIVE": PrivateEndpointLifecycleStateInactive, + "UPDATING": PrivateEndpointLifecycleStateUpdating, + "DELETING": PrivateEndpointLifecycleStateDeleting, + "DELETED": PrivateEndpointLifecycleStateDeleted, + "FAILED": PrivateEndpointLifecycleStateFailed, +} + +var mappingPrivateEndpointLifecycleStateEnumLowerCase = map[string]PrivateEndpointLifecycleStateEnum{ + "creating": PrivateEndpointLifecycleStateCreating, + "active": PrivateEndpointLifecycleStateActive, + "inactive": PrivateEndpointLifecycleStateInactive, + "updating": PrivateEndpointLifecycleStateUpdating, + "deleting": PrivateEndpointLifecycleStateDeleting, + "deleted": PrivateEndpointLifecycleStateDeleted, + "failed": PrivateEndpointLifecycleStateFailed, +} + +// GetPrivateEndpointLifecycleStateEnumValues Enumerates the set of values for PrivateEndpointLifecycleStateEnum +func GetPrivateEndpointLifecycleStateEnumValues() []PrivateEndpointLifecycleStateEnum { + values := make([]PrivateEndpointLifecycleStateEnum, 0) + for _, v := range mappingPrivateEndpointLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetPrivateEndpointLifecycleStateEnumStringValues Enumerates the set of values in String for PrivateEndpointLifecycleStateEnum +func GetPrivateEndpointLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "INACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingPrivateEndpointLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPrivateEndpointLifecycleStateEnum(val string) (PrivateEndpointLifecycleStateEnum, bool) { + enum, ok := mappingPrivateEndpointLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/objectstorage/private_endpoint_summary.go b/objectstorage/private_endpoint_summary.go new file mode 100644 index 0000000000..49f246d7fa --- /dev/null +++ b/objectstorage/private_endpoint_summary.go @@ -0,0 +1,75 @@ +// 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. + +// Object Storage Service API +// +// Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. +// For more information, see Overview of Object Storage (https://docs.cloud.oracle.com/Content/Object/Concepts/objectstorageoverview.htm) and +// Overview of Archive Storage (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). +// + +package objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrivateEndpointSummary To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, +// talk to an administrator. If you are an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). +type PrivateEndpointSummary struct { + + // The name given to the Private Endpoint. Avoid entering confidential information. + // Example: my-new-pe1 + Name *string `mandatory:"true" json:"name"` + + // The Object Storage namespace with which the Private Endpoint is associated. + Namespace *string `mandatory:"true" json:"namespace"` + + // The compartment ID in which the Private Endpoint is authorized. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the user who created the Private Endpoint. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // The date and time the Private Endpoint was created, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.29). + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the Private Endpoint was updated, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.29). + TimeModified *common.SDKTime `mandatory:"true" json:"timeModified"` + + // A prefix to use for the private endpoint. The customer VCN's DNS records are + // updated with this prefix. The prefix input from the customer will be the first sub-domain in the endpointFqdn. + // Example: If the prefix chosen is "abc", then the endpointFqdn will be 'abc.private.objectstorage..oraclecloud.com' + Prefix *string `mandatory:"true" json:"prefix"` + + Fqdns *Fqdns `mandatory:"true" json:"fqdns"` + + // The entity tag for the Private Endpoint. + Etag *string `mandatory:"true" json:"etag"` + + // The summaries of Private Endpoints' lifecycle state. + LifecycleState PrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +func (m PrivateEndpointSummary) 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 PrivateEndpointSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPrivateEndpointLifecycleStateEnum(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(GetPrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/objectstorage/put_object_request_response.go b/objectstorage/put_object_request_response.go index 8d6b6ef7d2..edf1380785 100644 --- a/objectstorage/put_object_request_response.go +++ b/objectstorage/put_object_request_response.go @@ -53,7 +53,7 @@ type PutObjectRequest struct { // The only allowed value for this parameter is "100-Continue" (case-insensitive). Expect *string `mandatory:"false" contributesTo:"header" name:"Expect"` - // The optional base-64 header that defines the encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object + // The optional header that defines the base64-encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object // Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the // MD5 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error // is returned with the message: @@ -211,7 +211,7 @@ type PutObjectResponse struct { // request, provide this request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - // The base-64 encoded MD5 hash of the request body as computed by the server. + // The base64-encoded MD5 hash of the request body as computed by the server. OpcContentMd5 *string `presentIn:"header" name:"opc-content-md5"` // The entity tag (ETag) for the object. diff --git a/objectstorage/restore_objects_request_response.go b/objectstorage/restore_objects_request_response.go index 2bfdd27e49..d7c65f543d 100644 --- a/objectstorage/restore_objects_request_response.go +++ b/objectstorage/restore_objects_request_response.go @@ -25,7 +25,7 @@ type RestoreObjectsRequest struct { // Example: `my-new-bucket1` BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` - // Request to restore objects. + // Request to restore object. RestoreObjectsDetails `contributesTo:"body"` // The client request ID for tracing. diff --git a/objectstorage/update_private_endpoint_details.go b/objectstorage/update_private_endpoint_details.go new file mode 100644 index 0000000000..41dc63c0b4 --- /dev/null +++ b/objectstorage/update_private_endpoint_details.go @@ -0,0 +1,59 @@ +// 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. + +// Object Storage Service API +// +// Use Object Storage and Archive Storage APIs to manage buckets, objects, and related resources. +// For more information, see Overview of Object Storage (https://docs.cloud.oracle.com/Content/Object/Concepts/objectstorageoverview.htm) and +// Overview of Archive Storage (https://docs.cloud.oracle.com/Content/Archive/Concepts/archivestorageoverview.htm). +// + +package objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdatePrivateEndpointDetails Information that can be updated for a private endpoint. +type UpdatePrivateEndpointDetails struct { + + // This name associated with the endpoint. Valid characters are uppercase or lowercase letters, numbers, hyphens, + // underscores, and periods. + // Example: my-new-private-endpoint1 + Name *string `mandatory:"false" json:"name"` + + // The Object Storage namespace which will associated with the private endpoint. + Namespace *string `mandatory:"false" json:"namespace"` + + // A list of targets that can be accessed by the private endpoint. + AccessTargets []AccessTargetDetails `mandatory:"false" json:"accessTargets"` + + // 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/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/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdatePrivateEndpointDetails) 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 UpdatePrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/objectstorage/update_private_endpoint_request_response.go b/objectstorage/update_private_endpoint_request_response.go new file mode 100644 index 0000000000..86f8f7b300 --- /dev/null +++ b/objectstorage/update_private_endpoint_request_response.go @@ -0,0 +1,131 @@ +// 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 objectstorage + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdatePrivateEndpointRequest wrapper for the UpdatePrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/objectstorage/UpdatePrivateEndpoint.go.html to see an example of how to use UpdatePrivateEndpointRequest. +type UpdatePrivateEndpointRequest struct { + + // The Object Storage namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The name of the private endpoint. Avoid entering confidential information. + // Example: `my-new-pe-1` + PeName *string `mandatory:"true" contributesTo:"path" name:"peName"` + + // Request object for updating the Private Endpoint. + UpdatePrivateEndpointDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` + + // The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of + // the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload + // the resource. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdatePrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdatePrivateEndpointRequest) 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 UpdatePrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// ReplaceMandatoryParamInPath replaces the mandatory parameter in the path with the value provided. +// Not all services are supporting this feature and this method will be a no-op for those services. +func (request UpdatePrivateEndpointRequest) ReplaceMandatoryParamInPath(client *common.BaseClient, mandatoryParamMap map[string][]common.TemplateParamForPerRealmEndpoint) { + if mandatoryParamMap["namespaceName"] != nil { + templateParam := mandatoryParamMap["namespaceName"] + for _, template := range templateParam { + replacementParam := *request.NamespaceName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } + if mandatoryParamMap["peName"] != nil { + templateParam := mandatoryParamMap["peName"] + for _, template := range templateParam { + replacementParam := *request.PeName + if template.EndsWithDot { + replacementParam = replacementParam + "." + } + client.Host = strings.Replace(client.Host, template.Template, replacementParam, -1) + } + } +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdatePrivateEndpointRequest) 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 UpdatePrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdatePrivateEndpointResponse wrapper for the UpdatePrivateEndpoint operation +type UpdatePrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. If you need to contact Oracle about a + // particular request, provide this request ID. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. + OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular + // request, provide this request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdatePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/objectstorage/upload_part_request_response.go b/objectstorage/upload_part_request_response.go index 61cb635df6..c4627ef60e 100644 --- a/objectstorage/upload_part_request_response.go +++ b/objectstorage/upload_part_request_response.go @@ -59,7 +59,7 @@ type UploadPartRequest struct { // The only allowed value for this parameter is "100-Continue" (case-insensitive). Expect *string `mandatory:"false" contributesTo:"header" name:"Expect"` - // The optional base-64 header that defines the encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object + // The optional header that defines the base64-encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object // Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the // MD5 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error // is returned with the message: diff --git a/objectstorage/work_request.go b/objectstorage/work_request.go index 5c456538d1..98e822d431 100644 --- a/objectstorage/work_request.go +++ b/objectstorage/work_request.go @@ -81,18 +81,27 @@ type WorkRequestOperationTypeEnum string // Set of constants representing the allowable values for WorkRequestOperationTypeEnum const ( - WorkRequestOperationTypeCopyObject WorkRequestOperationTypeEnum = "COPY_OBJECT" - WorkRequestOperationTypeReencrypt WorkRequestOperationTypeEnum = "REENCRYPT" + WorkRequestOperationTypeCopyObject WorkRequestOperationTypeEnum = "COPY_OBJECT" + WorkRequestOperationTypeReencrypt WorkRequestOperationTypeEnum = "REENCRYPT" + WorkRequestOperationTypePrivateEndpointCreate WorkRequestOperationTypeEnum = "PRIVATE_ENDPOINT_CREATE" + WorkRequestOperationTypePrivateEndpointUpdate WorkRequestOperationTypeEnum = "PRIVATE_ENDPOINT_UPDATE" + WorkRequestOperationTypePrivateEndpointDelete WorkRequestOperationTypeEnum = "PRIVATE_ENDPOINT_DELETE" ) var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnum{ - "COPY_OBJECT": WorkRequestOperationTypeCopyObject, - "REENCRYPT": WorkRequestOperationTypeReencrypt, + "COPY_OBJECT": WorkRequestOperationTypeCopyObject, + "REENCRYPT": WorkRequestOperationTypeReencrypt, + "PRIVATE_ENDPOINT_CREATE": WorkRequestOperationTypePrivateEndpointCreate, + "PRIVATE_ENDPOINT_UPDATE": WorkRequestOperationTypePrivateEndpointUpdate, + "PRIVATE_ENDPOINT_DELETE": WorkRequestOperationTypePrivateEndpointDelete, } var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperationTypeEnum{ - "copy_object": WorkRequestOperationTypeCopyObject, - "reencrypt": WorkRequestOperationTypeReencrypt, + "copy_object": WorkRequestOperationTypeCopyObject, + "reencrypt": WorkRequestOperationTypeReencrypt, + "private_endpoint_create": WorkRequestOperationTypePrivateEndpointCreate, + "private_endpoint_update": WorkRequestOperationTypePrivateEndpointUpdate, + "private_endpoint_delete": WorkRequestOperationTypePrivateEndpointDelete, } // GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum @@ -109,6 +118,9 @@ func GetWorkRequestOperationTypeEnumStringValues() []string { return []string{ "COPY_OBJECT", "REENCRYPT", + "PRIVATE_ENDPOINT_CREATE", + "PRIVATE_ENDPOINT_UPDATE", + "PRIVATE_ENDPOINT_DELETE", } } diff --git a/objectstorage/work_request_resource_metadata_key.go b/objectstorage/work_request_resource_metadata_key.go index 78086392c0..4ee793674b 100644 --- a/objectstorage/work_request_resource_metadata_key.go +++ b/objectstorage/work_request_resource_metadata_key.go @@ -20,24 +20,27 @@ type WorkRequestResourceMetadataKeyEnum string // Set of constants representing the allowable values for WorkRequestResourceMetadataKeyEnum const ( - WorkRequestResourceMetadataKeyRegion WorkRequestResourceMetadataKeyEnum = "REGION" - WorkRequestResourceMetadataKeyNamespace WorkRequestResourceMetadataKeyEnum = "NAMESPACE" - WorkRequestResourceMetadataKeyBucket WorkRequestResourceMetadataKeyEnum = "BUCKET" - WorkRequestResourceMetadataKeyObject WorkRequestResourceMetadataKeyEnum = "OBJECT" + WorkRequestResourceMetadataKeyRegion WorkRequestResourceMetadataKeyEnum = "REGION" + WorkRequestResourceMetadataKeyNamespace WorkRequestResourceMetadataKeyEnum = "NAMESPACE" + WorkRequestResourceMetadataKeyBucket WorkRequestResourceMetadataKeyEnum = "BUCKET" + WorkRequestResourceMetadataKeyObject WorkRequestResourceMetadataKeyEnum = "OBJECT" + WorkRequestResourceMetadataKeyPrivateEndpointName WorkRequestResourceMetadataKeyEnum = "PRIVATE_ENDPOINT_NAME" ) var mappingWorkRequestResourceMetadataKeyEnum = map[string]WorkRequestResourceMetadataKeyEnum{ - "REGION": WorkRequestResourceMetadataKeyRegion, - "NAMESPACE": WorkRequestResourceMetadataKeyNamespace, - "BUCKET": WorkRequestResourceMetadataKeyBucket, - "OBJECT": WorkRequestResourceMetadataKeyObject, + "REGION": WorkRequestResourceMetadataKeyRegion, + "NAMESPACE": WorkRequestResourceMetadataKeyNamespace, + "BUCKET": WorkRequestResourceMetadataKeyBucket, + "OBJECT": WorkRequestResourceMetadataKeyObject, + "PRIVATE_ENDPOINT_NAME": WorkRequestResourceMetadataKeyPrivateEndpointName, } var mappingWorkRequestResourceMetadataKeyEnumLowerCase = map[string]WorkRequestResourceMetadataKeyEnum{ - "region": WorkRequestResourceMetadataKeyRegion, - "namespace": WorkRequestResourceMetadataKeyNamespace, - "bucket": WorkRequestResourceMetadataKeyBucket, - "object": WorkRequestResourceMetadataKeyObject, + "region": WorkRequestResourceMetadataKeyRegion, + "namespace": WorkRequestResourceMetadataKeyNamespace, + "bucket": WorkRequestResourceMetadataKeyBucket, + "object": WorkRequestResourceMetadataKeyObject, + "private_endpoint_name": WorkRequestResourceMetadataKeyPrivateEndpointName, } // GetWorkRequestResourceMetadataKeyEnumValues Enumerates the set of values for WorkRequestResourceMetadataKeyEnum @@ -56,6 +59,7 @@ func GetWorkRequestResourceMetadataKeyEnumStringValues() []string { "NAMESPACE", "BUCKET", "OBJECT", + "PRIVATE_ENDPOINT_NAME", } } diff --git a/objectstorage/work_request_summary.go b/objectstorage/work_request_summary.go index b0b70b203e..1a45723c3b 100644 --- a/objectstorage/work_request_summary.go +++ b/objectstorage/work_request_summary.go @@ -81,18 +81,27 @@ type WorkRequestSummaryOperationTypeEnum string // Set of constants representing the allowable values for WorkRequestSummaryOperationTypeEnum const ( - WorkRequestSummaryOperationTypeCopyObject WorkRequestSummaryOperationTypeEnum = "COPY_OBJECT" - WorkRequestSummaryOperationTypeReencrypt WorkRequestSummaryOperationTypeEnum = "REENCRYPT" + WorkRequestSummaryOperationTypeCopyObject WorkRequestSummaryOperationTypeEnum = "COPY_OBJECT" + WorkRequestSummaryOperationTypeReencrypt WorkRequestSummaryOperationTypeEnum = "REENCRYPT" + WorkRequestSummaryOperationTypePrivateEndpointCreate WorkRequestSummaryOperationTypeEnum = "PRIVATE_ENDPOINT_CREATE" + WorkRequestSummaryOperationTypePrivateEndpointUpdate WorkRequestSummaryOperationTypeEnum = "PRIVATE_ENDPOINT_UPDATE" + WorkRequestSummaryOperationTypePrivateEndpointDelete WorkRequestSummaryOperationTypeEnum = "PRIVATE_ENDPOINT_DELETE" ) var mappingWorkRequestSummaryOperationTypeEnum = map[string]WorkRequestSummaryOperationTypeEnum{ - "COPY_OBJECT": WorkRequestSummaryOperationTypeCopyObject, - "REENCRYPT": WorkRequestSummaryOperationTypeReencrypt, + "COPY_OBJECT": WorkRequestSummaryOperationTypeCopyObject, + "REENCRYPT": WorkRequestSummaryOperationTypeReencrypt, + "PRIVATE_ENDPOINT_CREATE": WorkRequestSummaryOperationTypePrivateEndpointCreate, + "PRIVATE_ENDPOINT_UPDATE": WorkRequestSummaryOperationTypePrivateEndpointUpdate, + "PRIVATE_ENDPOINT_DELETE": WorkRequestSummaryOperationTypePrivateEndpointDelete, } var mappingWorkRequestSummaryOperationTypeEnumLowerCase = map[string]WorkRequestSummaryOperationTypeEnum{ - "copy_object": WorkRequestSummaryOperationTypeCopyObject, - "reencrypt": WorkRequestSummaryOperationTypeReencrypt, + "copy_object": WorkRequestSummaryOperationTypeCopyObject, + "reencrypt": WorkRequestSummaryOperationTypeReencrypt, + "private_endpoint_create": WorkRequestSummaryOperationTypePrivateEndpointCreate, + "private_endpoint_update": WorkRequestSummaryOperationTypePrivateEndpointUpdate, + "private_endpoint_delete": WorkRequestSummaryOperationTypePrivateEndpointDelete, } // GetWorkRequestSummaryOperationTypeEnumValues Enumerates the set of values for WorkRequestSummaryOperationTypeEnum @@ -109,6 +118,9 @@ func GetWorkRequestSummaryOperationTypeEnumStringValues() []string { return []string{ "COPY_OBJECT", "REENCRYPT", + "PRIVATE_ENDPOINT_CREATE", + "PRIVATE_ENDPOINT_UPDATE", + "PRIVATE_ENDPOINT_DELETE", } } diff --git a/ocvp/cluster.go b/ocvp/cluster.go index 678b528d94..a25888a9a3 100644 --- a/ocvp/cluster.go +++ b/ocvp/cluster.go @@ -140,6 +140,10 @@ type Cluster struct { // Datastores used for the Cluster. Datastores []DatastoreDetails `mandatory:"false" json:"datastores"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m Cluster) String() string { diff --git a/ocvp/cluster_summary.go b/ocvp/cluster_summary.go index 9dcea91118..551383c5f8 100644 --- a/ocvp/cluster_summary.go +++ b/ocvp/cluster_summary.go @@ -90,6 +90,10 @@ type ClusterSummary struct { // The initial OCPU count of the Cluster's ESXi hosts. InitialHostOcpuCount *float32 `mandatory:"false" json:"initialHostOcpuCount"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m ClusterSummary) String() string { diff --git a/ocvp/datastore_cluster_types.go b/ocvp/datastore_cluster_types.go new file mode 100644 index 0000000000..ae17edff7b --- /dev/null +++ b/ocvp/datastore_cluster_types.go @@ -0,0 +1,57 @@ +// 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.cloud.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "strings" +) + +// DatastoreClusterTypesEnum Enum with underlying type: string +type DatastoreClusterTypesEnum string + +// Set of constants representing the allowable values for DatastoreClusterTypesEnum +const ( + DatastoreClusterTypesManagement DatastoreClusterTypesEnum = "MANAGEMENT" + DatastoreClusterTypesWorkload DatastoreClusterTypesEnum = "WORKLOAD" +) + +var mappingDatastoreClusterTypesEnum = map[string]DatastoreClusterTypesEnum{ + "MANAGEMENT": DatastoreClusterTypesManagement, + "WORKLOAD": DatastoreClusterTypesWorkload, +} + +var mappingDatastoreClusterTypesEnumLowerCase = map[string]DatastoreClusterTypesEnum{ + "management": DatastoreClusterTypesManagement, + "workload": DatastoreClusterTypesWorkload, +} + +// GetDatastoreClusterTypesEnumValues Enumerates the set of values for DatastoreClusterTypesEnum +func GetDatastoreClusterTypesEnumValues() []DatastoreClusterTypesEnum { + values := make([]DatastoreClusterTypesEnum, 0) + for _, v := range mappingDatastoreClusterTypesEnum { + values = append(values, v) + } + return values +} + +// GetDatastoreClusterTypesEnumStringValues Enumerates the set of values in String for DatastoreClusterTypesEnum +func GetDatastoreClusterTypesEnumStringValues() []string { + return []string{ + "MANAGEMENT", + "WORKLOAD", + } +} + +// GetMappingDatastoreClusterTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDatastoreClusterTypesEnum(val string) (DatastoreClusterTypesEnum, bool) { + enum, ok := mappingDatastoreClusterTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/ocvp/datastore_details.go b/ocvp/datastore_details.go index 21c798336c..727c91098e 100644 --- a/ocvp/datastore_details.go +++ b/ocvp/datastore_details.go @@ -16,7 +16,7 @@ import ( "strings" ) -// DatastoreDetails Datastore summary for a getting an Sddc. +// DatastoreDetails Datastore details for a getting an Sddc. type DatastoreDetails struct { // A list of OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. diff --git a/ocvp/delete_cluster_request_response.go b/ocvp/delete_cluster_request_response.go index 49319cce5d..27da4e1dde 100644 --- a/ocvp/delete_cluster_request_response.go +++ b/ocvp/delete_cluster_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DeleteCluster.go.html to see an example of how to use DeleteClusterRequest. type DeleteClusterRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` // For optimistic concurrency control. In the PUT or DELETE call diff --git a/ocvp/esxi_host.go b/ocvp/esxi_host.go index 36f02538b6..d6ce653e24 100644 --- a/ocvp/esxi_host.go +++ b/ocvp/esxi_host.go @@ -134,6 +134,10 @@ type EsxiHost struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m EsxiHost) String() string { diff --git a/ocvp/esxi_host_summary.go b/ocvp/esxi_host_summary.go index 350abff9d4..4beee4467c 100644 --- a/ocvp/esxi_host_summary.go +++ b/ocvp/esxi_host_summary.go @@ -123,6 +123,10 @@ type EsxiHostSummary struct { // Indicates whether this host is in the progress of swapping billing. IsBillingSwappingInProgress *bool `mandatory:"false" json:"isBillingSwappingInProgress"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m EsxiHostSummary) String() string { diff --git a/ocvp/get_cluster_request_response.go b/ocvp/get_cluster_request_response.go index 048586fe5e..c646eca180 100644 --- a/ocvp/get_cluster_request_response.go +++ b/ocvp/get_cluster_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/GetCluster.go.html to see an example of how to use GetClusterRequest. type GetClusterRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` // Unique identifier for the request. If you need to contact Oracle about a particular diff --git a/ocvp/list_esxi_hosts_request_response.go b/ocvp/list_esxi_hosts_request_response.go index 3a8bc26329..fa72aebd13 100644 --- a/ocvp/list_esxi_hosts_request_response.go +++ b/ocvp/list_esxi_hosts_request_response.go @@ -21,7 +21,7 @@ type ListEsxiHostsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC. SddcId *string `mandatory:"false" contributesTo:"query" name:"sddcId"` - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. ClusterId *string `mandatory:"false" contributesTo:"query" name:"clusterId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Compute instance. diff --git a/ocvp/list_supported_vmware_software_versions_request_response.go b/ocvp/list_supported_vmware_software_versions_request_response.go index 3a8b2b1669..e1dc370199 100644 --- a/ocvp/list_supported_vmware_software_versions_request_response.go +++ b/ocvp/list_supported_vmware_software_versions_request_response.go @@ -41,6 +41,9 @@ type ListSupportedVmwareSoftwareVersionsRequest struct { // A filter to return only resources that match or support the given ESXi host shape. HostShapeName *string `mandatory:"false" contributesTo:"query" name:"hostShapeName"` + // A filter to return only VMware software versions that the given VMware software version can be upgraded to. + VersionToUpgrade *string `mandatory:"false" contributesTo:"query" name:"versionToUpgrade"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata diff --git a/ocvp/operation_types.go b/ocvp/operation_types.go index b92fb8a564..c2428e3e7d 100644 --- a/ocvp/operation_types.go +++ b/ocvp/operation_types.go @@ -19,51 +19,90 @@ type OperationTypesEnum string // Set of constants representing the allowable values for OperationTypesEnum const ( - OperationTypesCreateSddc OperationTypesEnum = "CREATE_SDDC" - OperationTypesDeleteSddc OperationTypesEnum = "DELETE_SDDC" - OperationTypesCreateCluster OperationTypesEnum = "CREATE_CLUSTER" - OperationTypesDeleteCluster OperationTypesEnum = "DELETE_CLUSTER" - OperationTypesCreateEsxiHost OperationTypesEnum = "CREATE_ESXI_HOST" - OperationTypesDeleteEsxiHost OperationTypesEnum = "DELETE_ESXI_HOST" - OperationTypesUpgradeHcx OperationTypesEnum = "UPGRADE_HCX" - OperationTypesDowngradeHcx OperationTypesEnum = "DOWNGRADE_HCX" - OperationTypesCancelDowngradeHcx OperationTypesEnum = "CANCEL_DOWNGRADE_HCX" - OperationTypesRefreshHcxLicenseStatus OperationTypesEnum = "REFRESH_HCX_LICENSE_STATUS" - OperationTypesSwapBilling OperationTypesEnum = "SWAP_BILLING" - OperationTypesReplaceHost OperationTypesEnum = "REPLACE_HOST" - OperationTypesInPlaceUpgrade OperationTypesEnum = "IN_PLACE_UPGRADE" + OperationTypesCreateSddc OperationTypesEnum = "CREATE_SDDC" + OperationTypesDeleteSddc OperationTypesEnum = "DELETE_SDDC" + OperationTypesCreateCluster OperationTypesEnum = "CREATE_CLUSTER" + OperationTypesDeleteCluster OperationTypesEnum = "DELETE_CLUSTER" + OperationTypesCreateEsxiHost OperationTypesEnum = "CREATE_ESXI_HOST" + OperationTypesDeleteEsxiHost OperationTypesEnum = "DELETE_ESXI_HOST" + OperationTypesUpgradeHcx OperationTypesEnum = "UPGRADE_HCX" + OperationTypesDowngradeHcx OperationTypesEnum = "DOWNGRADE_HCX" + OperationTypesCancelDowngradeHcx OperationTypesEnum = "CANCEL_DOWNGRADE_HCX" + OperationTypesRefreshHcxLicenseStatus OperationTypesEnum = "REFRESH_HCX_LICENSE_STATUS" + OperationTypesSwapBilling OperationTypesEnum = "SWAP_BILLING" + OperationTypesReplaceHost OperationTypesEnum = "REPLACE_HOST" + OperationTypesInPlaceUpgrade OperationTypesEnum = "IN_PLACE_UPGRADE" + OperationTypesCreateDatastore OperationTypesEnum = "CREATE_DATASTORE" + OperationTypesUpdateDatastore OperationTypesEnum = "UPDATE_DATASTORE" + OperationTypesAddBlockVolumeToDatastore OperationTypesEnum = "ADD_BLOCK_VOLUME_TO_DATASTORE" + OperationTypesDeleteDatastore OperationTypesEnum = "DELETE_DATASTORE" + OperationTypesCreateDatastoreCluster OperationTypesEnum = "CREATE_DATASTORE_CLUSTER" + OperationTypesUpdateDatastoreCluster OperationTypesEnum = "UPDATE_DATASTORE_CLUSTER" + OperationTypesAttachDatastoreClusterToEsxiHost OperationTypesEnum = "ATTACH_DATASTORE_CLUSTER_TO_ESXI_HOST" + OperationTypesAttachDatastoreClusterToCluster OperationTypesEnum = "ATTACH_DATASTORE_CLUSTER_TO_CLUSTER" + OperationTypesDetachDatastoreClusterFromEsxiHost OperationTypesEnum = "DETACH_DATASTORE_CLUSTER_FROM_ESXI_HOST" + OperationTypesDetachDatastoreClusterFromCluster OperationTypesEnum = "DETACH_DATASTORE_CLUSTER_FROM_CLUSTER" + OperationTypesDeleteDatastoreCluster OperationTypesEnum = "DELETE_DATASTORE_CLUSTER" + OperationTypesAddDatastoreToDatastoreCluster OperationTypesEnum = "ADD_DATASTORE_TO_DATASTORE_CLUSTER" + OperationTypesRemoveDatastoreFromDatastoreCluster OperationTypesEnum = "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER" ) var mappingOperationTypesEnum = map[string]OperationTypesEnum{ - "CREATE_SDDC": OperationTypesCreateSddc, - "DELETE_SDDC": OperationTypesDeleteSddc, - "CREATE_CLUSTER": OperationTypesCreateCluster, - "DELETE_CLUSTER": OperationTypesDeleteCluster, - "CREATE_ESXI_HOST": OperationTypesCreateEsxiHost, - "DELETE_ESXI_HOST": OperationTypesDeleteEsxiHost, - "UPGRADE_HCX": OperationTypesUpgradeHcx, - "DOWNGRADE_HCX": OperationTypesDowngradeHcx, - "CANCEL_DOWNGRADE_HCX": OperationTypesCancelDowngradeHcx, - "REFRESH_HCX_LICENSE_STATUS": OperationTypesRefreshHcxLicenseStatus, - "SWAP_BILLING": OperationTypesSwapBilling, - "REPLACE_HOST": OperationTypesReplaceHost, - "IN_PLACE_UPGRADE": OperationTypesInPlaceUpgrade, + "CREATE_SDDC": OperationTypesCreateSddc, + "DELETE_SDDC": OperationTypesDeleteSddc, + "CREATE_CLUSTER": OperationTypesCreateCluster, + "DELETE_CLUSTER": OperationTypesDeleteCluster, + "CREATE_ESXI_HOST": OperationTypesCreateEsxiHost, + "DELETE_ESXI_HOST": OperationTypesDeleteEsxiHost, + "UPGRADE_HCX": OperationTypesUpgradeHcx, + "DOWNGRADE_HCX": OperationTypesDowngradeHcx, + "CANCEL_DOWNGRADE_HCX": OperationTypesCancelDowngradeHcx, + "REFRESH_HCX_LICENSE_STATUS": OperationTypesRefreshHcxLicenseStatus, + "SWAP_BILLING": OperationTypesSwapBilling, + "REPLACE_HOST": OperationTypesReplaceHost, + "IN_PLACE_UPGRADE": OperationTypesInPlaceUpgrade, + "CREATE_DATASTORE": OperationTypesCreateDatastore, + "UPDATE_DATASTORE": OperationTypesUpdateDatastore, + "ADD_BLOCK_VOLUME_TO_DATASTORE": OperationTypesAddBlockVolumeToDatastore, + "DELETE_DATASTORE": OperationTypesDeleteDatastore, + "CREATE_DATASTORE_CLUSTER": OperationTypesCreateDatastoreCluster, + "UPDATE_DATASTORE_CLUSTER": OperationTypesUpdateDatastoreCluster, + "ATTACH_DATASTORE_CLUSTER_TO_ESXI_HOST": OperationTypesAttachDatastoreClusterToEsxiHost, + "ATTACH_DATASTORE_CLUSTER_TO_CLUSTER": OperationTypesAttachDatastoreClusterToCluster, + "DETACH_DATASTORE_CLUSTER_FROM_ESXI_HOST": OperationTypesDetachDatastoreClusterFromEsxiHost, + "DETACH_DATASTORE_CLUSTER_FROM_CLUSTER": OperationTypesDetachDatastoreClusterFromCluster, + "DELETE_DATASTORE_CLUSTER": OperationTypesDeleteDatastoreCluster, + "ADD_DATASTORE_TO_DATASTORE_CLUSTER": OperationTypesAddDatastoreToDatastoreCluster, + "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER": OperationTypesRemoveDatastoreFromDatastoreCluster, } var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ - "create_sddc": OperationTypesCreateSddc, - "delete_sddc": OperationTypesDeleteSddc, - "create_cluster": OperationTypesCreateCluster, - "delete_cluster": OperationTypesDeleteCluster, - "create_esxi_host": OperationTypesCreateEsxiHost, - "delete_esxi_host": OperationTypesDeleteEsxiHost, - "upgrade_hcx": OperationTypesUpgradeHcx, - "downgrade_hcx": OperationTypesDowngradeHcx, - "cancel_downgrade_hcx": OperationTypesCancelDowngradeHcx, - "refresh_hcx_license_status": OperationTypesRefreshHcxLicenseStatus, - "swap_billing": OperationTypesSwapBilling, - "replace_host": OperationTypesReplaceHost, - "in_place_upgrade": OperationTypesInPlaceUpgrade, + "create_sddc": OperationTypesCreateSddc, + "delete_sddc": OperationTypesDeleteSddc, + "create_cluster": OperationTypesCreateCluster, + "delete_cluster": OperationTypesDeleteCluster, + "create_esxi_host": OperationTypesCreateEsxiHost, + "delete_esxi_host": OperationTypesDeleteEsxiHost, + "upgrade_hcx": OperationTypesUpgradeHcx, + "downgrade_hcx": OperationTypesDowngradeHcx, + "cancel_downgrade_hcx": OperationTypesCancelDowngradeHcx, + "refresh_hcx_license_status": OperationTypesRefreshHcxLicenseStatus, + "swap_billing": OperationTypesSwapBilling, + "replace_host": OperationTypesReplaceHost, + "in_place_upgrade": OperationTypesInPlaceUpgrade, + "create_datastore": OperationTypesCreateDatastore, + "update_datastore": OperationTypesUpdateDatastore, + "add_block_volume_to_datastore": OperationTypesAddBlockVolumeToDatastore, + "delete_datastore": OperationTypesDeleteDatastore, + "create_datastore_cluster": OperationTypesCreateDatastoreCluster, + "update_datastore_cluster": OperationTypesUpdateDatastoreCluster, + "attach_datastore_cluster_to_esxi_host": OperationTypesAttachDatastoreClusterToEsxiHost, + "attach_datastore_cluster_to_cluster": OperationTypesAttachDatastoreClusterToCluster, + "detach_datastore_cluster_from_esxi_host": OperationTypesDetachDatastoreClusterFromEsxiHost, + "detach_datastore_cluster_from_cluster": OperationTypesDetachDatastoreClusterFromCluster, + "delete_datastore_cluster": OperationTypesDeleteDatastoreCluster, + "add_datastore_to_datastore_cluster": OperationTypesAddDatastoreToDatastoreCluster, + "remove_datastore_from_datastore_cluster": OperationTypesRemoveDatastoreFromDatastoreCluster, } // GetOperationTypesEnumValues Enumerates the set of values for OperationTypesEnum @@ -91,6 +130,19 @@ func GetOperationTypesEnumStringValues() []string { "SWAP_BILLING", "REPLACE_HOST", "IN_PLACE_UPGRADE", + "CREATE_DATASTORE", + "UPDATE_DATASTORE", + "ADD_BLOCK_VOLUME_TO_DATASTORE", + "DELETE_DATASTORE", + "CREATE_DATASTORE_CLUSTER", + "UPDATE_DATASTORE_CLUSTER", + "ATTACH_DATASTORE_CLUSTER_TO_ESXI_HOST", + "ATTACH_DATASTORE_CLUSTER_TO_CLUSTER", + "DETACH_DATASTORE_CLUSTER_FROM_ESXI_HOST", + "DETACH_DATASTORE_CLUSTER_FROM_CLUSTER", + "DELETE_DATASTORE_CLUSTER", + "ADD_DATASTORE_TO_DATASTORE_CLUSTER", + "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER", } } diff --git a/ocvp/sddc.go b/ocvp/sddc.go index c2aadafa7b..fa7852258d 100644 --- a/ocvp/sddc.go +++ b/ocvp/sddc.go @@ -168,6 +168,10 @@ type Sddc struct { // The current state of the SDDC. LifecycleState LifecycleStatesEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m Sddc) String() string { diff --git a/ocvp/sddc_summary.go b/ocvp/sddc_summary.go index 7fad0e4a02..9a899dfd96 100644 --- a/ocvp/sddc_summary.go +++ b/ocvp/sddc_summary.go @@ -87,6 +87,10 @@ type SddcSummary struct { // Indicates whether this SDDC is designated for only single ESXi host. IsSingleHostSddc *bool `mandatory:"false" json:"isSingleHostSddc"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m SddcSummary) String() string { diff --git a/ocvp/update_cluster_request_response.go b/ocvp/update_cluster_request_response.go index 0bed56fa8a..d0e06599e6 100644 --- a/ocvp/update_cluster_request_response.go +++ b/ocvp/update_cluster_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/UpdateCluster.go.html to see an example of how to use UpdateClusterRequest. type UpdateClusterRequest struct { - // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cluster. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` // The information to be updated. diff --git a/recovery/change_protected_database_subscription_details.go b/recovery/change_protected_database_subscription_details.go new file mode 100644 index 0000000000..4a63e622d9 --- /dev/null +++ b/recovery/change_protected_database_subscription_details.go @@ -0,0 +1,42 @@ +// 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. + +// Oracle Database Autonomous Recovery Service API +// +// Use Oracle Database Autonomous Recovery Service API to manage Protected Databases. +// + +package recovery + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeProtectedDatabaseSubscriptionDetails Subscription details of the new cloud service environment, such as Microsoft Azure, where the protected database will be provisioned. +type ChangeProtectedDatabaseSubscriptionDetails struct { + + // The OCID of the new cloud service subscription to which you want to link the protected database. + SubscriptionId *string `mandatory:"false" json:"subscriptionId"` + + // Indicates whether it is a Universal Credit Model (UCM) subscription. + IsDefault *bool `mandatory:"false" json:"isDefault"` +} + +func (m ChangeProtectedDatabaseSubscriptionDetails) 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 ChangeProtectedDatabaseSubscriptionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/recovery/change_protected_database_subscription_request_response.go b/recovery/change_protected_database_subscription_request_response.go new file mode 100644 index 0000000000..ee40c7d3c2 --- /dev/null +++ b/recovery/change_protected_database_subscription_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 recovery + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeProtectedDatabaseSubscriptionRequest wrapper for the ChangeProtectedDatabaseSubscription operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/recovery/ChangeProtectedDatabaseSubscription.go.html to see an example of how to use ChangeProtectedDatabaseSubscriptionRequest. +type ChangeProtectedDatabaseSubscriptionRequest struct { + + // The protected database OCID. + ProtectedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"protectedDatabaseId"` + + // Associate a protected database with a different subscription. + ChangeProtectedDatabaseSubscriptionDetails `contributesTo:"body"` + + // Unique identifier for the request. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeProtectedDatabaseSubscriptionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeProtectedDatabaseSubscriptionRequest) 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 ChangeProtectedDatabaseSubscriptionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeProtectedDatabaseSubscriptionRequest) 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 ChangeProtectedDatabaseSubscriptionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeProtectedDatabaseSubscriptionResponse wrapper for the ChangeProtectedDatabaseSubscription operation +type ChangeProtectedDatabaseSubscriptionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier of the work 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 ChangeProtectedDatabaseSubscriptionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeProtectedDatabaseSubscriptionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/recovery/create_protected_database_details.go b/recovery/create_protected_database_details.go index 205d71ab70..1087f81aff 100644 --- a/recovery/create_protected_database_details.go +++ b/recovery/create_protected_database_details.go @@ -57,6 +57,10 @@ type CreateProtectedDatabaseDetails struct { // Real-time data protection substantially reduces the window of potential data loss that exists between successive archived redo log backups. IsRedoLogsShipped *bool `mandatory:"false" json:"isRedoLogsShipped"` + // The OCID of the cloud service subscription to which you want to link the protected database. + // For example, specify the Microsoft Azure subscription ID if you want to provision the protected database in Azure. + SubscriptionId *string `mandatory:"false" json:"subscriptionId"` + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff --git a/recovery/create_protection_policy_details.go b/recovery/create_protection_policy_details.go index b6ca8892ca..33f43c961d 100644 --- a/recovery/create_protection_policy_details.go +++ b/recovery/create_protection_policy_details.go @@ -27,6 +27,13 @@ type CreateProtectionPolicyDetails struct { // Compartment Identifier CompartmentId *string `mandatory:"true" json:"compartmentId"` + // Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned. + // This parameter is applicable if your Oracle Database runs in a different cloud service environment, such as Microsoft Azure. + // If you set the mustEnforceCloudLocality parameter to TRUE, then Recovery Service stores the database backups locally in the same cloud service environment where the database resides. For example, if your Oracle Database is provisioned on Microsoft Azure, then Recovery Service stores the database backups in Azure. + // Note: + // You cannot change the mustEnforceCloudLocality setting for a protection policy after you create it. + MustEnforceCloudLocality *bool `mandatory:"false" json:"mustEnforceCloudLocality"` + // An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy. // * The retention lock feature controls whether Recovery Service strictly preserves backups for the duration defined in a policy. Retention lock is useful to enforce recovery window compliance and to prevent unintentional modifications to protected database backups. // * Recovery Service enforces a 14-day delay before the retention lock set for a policy can take effect. Therefore, you must set policyLockedDateTime to a date that occurs 14 days after the current date. diff --git a/recovery/protected_database.go b/recovery/protected_database.go index dab80cfd50..8fd71afc98 100644 --- a/recovery/protected_database.go +++ b/recovery/protected_database.go @@ -99,6 +99,9 @@ type ProtectedDatabase struct { Metrics *Metrics `mandatory:"false" json:"metrics"` + // The OCID of the cloud service subscription to which the protected database is linked. + SubscriptionId *string `mandatory:"false" json:"subscriptionId"` + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff --git a/recovery/protected_database_summary.go b/recovery/protected_database_summary.go index 3b1f9b0b16..7788b750a4 100644 --- a/recovery/protected_database_summary.go +++ b/recovery/protected_database_summary.go @@ -79,6 +79,9 @@ type ProtectedDatabaseSummary struct { Metrics *MetricsSummary `mandatory:"false" json:"metrics"` + // The OCID of the cloud service subscription to which the protected database is linked. + SubscriptionId *string `mandatory:"false" json:"subscriptionId"` + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. // Example: `{"bar-key": "value"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` diff --git a/recovery/protection_policy.go b/recovery/protection_policy.go index be2c8522bc..5f7bc7aa59 100644 --- a/recovery/protection_policy.go +++ b/recovery/protection_policy.go @@ -37,6 +37,9 @@ type ProtectionPolicy struct { // An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy. PolicyLockedDateTime *string `mandatory:"false" json:"policyLockedDateTime"` + // Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned. + MustEnforceCloudLocality *bool `mandatory:"false" json:"mustEnforceCloudLocality"` + // An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` diff --git a/recovery/protection_policy_summary.go b/recovery/protection_policy_summary.go index d8957a93d6..dda6076501 100644 --- a/recovery/protection_policy_summary.go +++ b/recovery/protection_policy_summary.go @@ -38,6 +38,9 @@ type ProtectionPolicySummary struct { // An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy. PolicyLockedDateTime *string `mandatory:"false" json:"policyLockedDateTime"` + // Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned. + MustEnforceCloudLocality *bool `mandatory:"false" json:"mustEnforceCloudLocality"` + // The time the Protection Policy was created. An RFC3339 formatted datetime string TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` diff --git a/recovery/recovery_databaserecovery_client.go b/recovery/recovery_databaserecovery_client.go index bf20d5e658..49f0811b08 100644 --- a/recovery/recovery_databaserecovery_client.go +++ b/recovery/recovery_databaserecovery_client.go @@ -207,6 +207,64 @@ func (client DatabaseRecoveryClient) changeProtectedDatabaseCompartment(ctx cont return response, err } +// ChangeProtectedDatabaseSubscription Associates the protected database with a new cloud service environment, such as Microsoft Azure. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/recovery/ChangeProtectedDatabaseSubscription.go.html to see an example of how to use ChangeProtectedDatabaseSubscription API. +// A default retry strategy applies to this operation ChangeProtectedDatabaseSubscription() +func (client DatabaseRecoveryClient) ChangeProtectedDatabaseSubscription(ctx context.Context, request ChangeProtectedDatabaseSubscriptionRequest) (response ChangeProtectedDatabaseSubscriptionResponse, 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.changeProtectedDatabaseSubscription, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeProtectedDatabaseSubscriptionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeProtectedDatabaseSubscriptionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeProtectedDatabaseSubscriptionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeProtectedDatabaseSubscriptionResponse") + } + return +} + +// changeProtectedDatabaseSubscription implements the OCIOperation interface (enables retrying operations) +func (client DatabaseRecoveryClient) changeProtectedDatabaseSubscription(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/protectedDatabases/{protectedDatabaseId}/actions/changeSubscription", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeProtectedDatabaseSubscriptionResponse + 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/recovery-service/20210216/ProtectedDatabase/ChangeProtectedDatabaseSubscription" + err = common.PostProcessServiceError(err, "DatabaseRecovery", "ChangeProtectedDatabaseSubscription", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeProtectionPolicyCompartment Moves a protection policy resource from the existing compartment to the specified compartment. When provided, If-Match is checked against ETag values of the resource. // // # See also diff --git a/waf/dynamic_http_response_body.go b/waf/dynamic_http_response_body.go new file mode 100644 index 0000000000..6a529f7490 --- /dev/null +++ b/waf/dynamic_http_response_body.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. + +// Web Application Firewall (WAF) API +// +// API for the Web Application Firewall service. +// Use this API to manage regional Web App Firewalls and corresponding policies for protecting HTTP services. +// + +package waf + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DynamicHttpResponseBody Allows returning dynamically generated HTTP response body based on the provided template. +// The template allows variable interpolation by specifying variable name between the '${' and '}' delimiters. +// Escape sequences using '\' are supported to allow usage of '\\' and '\${' in the template to return '\' and '\${' in final response. +// The following variables are supported: +// * http.request.id - the HTTP request ID. For example: "d5fa953f75ef417e4c8008ef9336d779". +// Example: +// +// { +// "type": "DYNAMIC", +// "template": "{\n \"code\": 403,\n \"message\":\"Unauthorised\",\n \"incidentId\": \"${http.request.id}\"\n}" +// } +// +// Example with escape sequence: +// +// { +// "type": "DYNAMIC", +// "template": "\\${Returned as plain text}" +// } +type DynamicHttpResponseBody struct { + + // Dynamic response body + Template *string `mandatory:"true" json:"template"` +} + +func (m DynamicHttpResponseBody) 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 DynamicHttpResponseBody) 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 DynamicHttpResponseBody) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDynamicHttpResponseBody DynamicHttpResponseBody + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeDynamicHttpResponseBody + }{ + "DYNAMIC", + (MarshalTypeDynamicHttpResponseBody)(m), + } + + return json.Marshal(&s) +} diff --git a/waf/http_response_body.go b/waf/http_response_body.go index 17482677f8..d687272715 100644 --- a/waf/http_response_body.go +++ b/waf/http_response_body.go @@ -51,6 +51,10 @@ func (m *httpresponsebody) UnmarshalPolymorphicJSON(data []byte) (interface{}, e var err error switch m.Type { + case "DYNAMIC": + mm := DynamicHttpResponseBody{} + err = json.Unmarshal(data, &mm) + return mm, err case "STATIC_TEXT": mm := StaticTextHttpResponseBody{} err = json.Unmarshal(data, &mm) @@ -83,14 +87,17 @@ type HttpResponseBodyTypeEnum string // Set of constants representing the allowable values for HttpResponseBodyTypeEnum const ( HttpResponseBodyTypeStaticText HttpResponseBodyTypeEnum = "STATIC_TEXT" + HttpResponseBodyTypeDynamic HttpResponseBodyTypeEnum = "DYNAMIC" ) var mappingHttpResponseBodyTypeEnum = map[string]HttpResponseBodyTypeEnum{ "STATIC_TEXT": HttpResponseBodyTypeStaticText, + "DYNAMIC": HttpResponseBodyTypeDynamic, } var mappingHttpResponseBodyTypeEnumLowerCase = map[string]HttpResponseBodyTypeEnum{ "static_text": HttpResponseBodyTypeStaticText, + "dynamic": HttpResponseBodyTypeDynamic, } // GetHttpResponseBodyTypeEnumValues Enumerates the set of values for HttpResponseBodyTypeEnum @@ -106,6 +113,7 @@ func GetHttpResponseBodyTypeEnumValues() []HttpResponseBodyTypeEnum { func GetHttpResponseBodyTypeEnumStringValues() []string { return []string{ "STATIC_TEXT", + "DYNAMIC", } }