diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb33df456..9c9cc9e910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## 65.58.0 - 2024-02-06 +### Added +- Support for the Globally Distributed Database service +- Support for secret auto-rotation in the Secret Management service +- Support for dedicated key management in the Key Management service +- Support for resource locking operations in the Digital Media service +- Support for data sources, including prometheus emitter, in the Management Agent service +- Support for Bring Your Own Certificates (BYOC) in the MySQL HeatWave Database service + +### Breaking Changes +- The property Type was changed from ListWorkRequestsTypeEnum to []OperationTypesEnum and made mandatory in the ListWorkRequestsRequest model in the Management Agent Service +- The Enums EditModesEnum and DatatypesEnum were removed in the Management Agent Service + + ## 65.57.0 - 2024-01-30 ### Added - Support for OCI Control Center service diff --git a/Makefile b/Makefile index a05d1a2132..528cb5ae11 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com -GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech 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 ##SPECNAME## +GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech 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 ##SPECNAME## NON_GEN_TARGETS = common common/auth objectstorage/transfer example TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS) diff --git a/README.md b/README.md index fcdcf93d06..1efc4f015c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Are you a Developer using the OCI SDK? If so, please fill out our survey to help ## Dependencies -- Install [Go programming language](https://golang.org/dl/), Go1.17, 1.18, 1.19 and 1.20 is supported By OCI Go SDK. +- Install [Go programming language](https://golang.org/dl/), Go1.17, 1.18, 1.19, 1.20, and 1.21 are supported By OCI Go SDK. - Install [GNU Make](https://www.gnu.org/software/make/), using the package manager or binary distribution tool appropriate for your platform. ## Versioning diff --git a/common/version.go b/common/version.go index 8557a47ffa..52d2aed96f 100644 --- a/common/version.go +++ b/common/version.go @@ -12,7 +12,7 @@ import ( const ( major = "65" - minor = "57" + minor = "58" patch = "0" tag = "" ) diff --git a/generativeai/generativeai_client.go b/generativeai/generativeai_client.go index b891be14e3..25c3985127 100644 --- a/generativeai/generativeai_client.go +++ b/generativeai/generativeai_client.go @@ -148,7 +148,7 @@ func (client GenerativeAiClient) changeDedicatedAiClusterCompartment(ctx context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/DedicatedAiCluster/ChangeDedicatedAiClusterCompartment" err = common.PostProcessServiceError(err, "GenerativeAi", "ChangeDedicatedAiClusterCompartment", apiReferenceLink) return response, err } @@ -211,7 +211,7 @@ func (client GenerativeAiClient) changeEndpointCompartment(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Endpoint/ChangeEndpointCompartment" err = common.PostProcessServiceError(err, "GenerativeAi", "ChangeEndpointCompartment", apiReferenceLink) return response, err } @@ -274,7 +274,7 @@ func (client GenerativeAiClient) changeModelCompartment(ctx context.Context, req defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Model/ChangeModelCompartment" err = common.PostProcessServiceError(err, "GenerativeAi", "ChangeModelCompartment", apiReferenceLink) return response, err } @@ -337,7 +337,7 @@ func (client GenerativeAiClient) createDedicatedAiCluster(ctx context.Context, r defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/DedicatedAiCluster/CreateDedicatedAiCluster" err = common.PostProcessServiceError(err, "GenerativeAi", "CreateDedicatedAiCluster", apiReferenceLink) return response, err } @@ -401,7 +401,7 @@ func (client GenerativeAiClient) createEndpoint(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Endpoint/CreateEndpoint" err = common.PostProcessServiceError(err, "GenerativeAi", "CreateEndpoint", apiReferenceLink) return response, err } @@ -465,7 +465,7 @@ func (client GenerativeAiClient) createModel(ctx context.Context, request common defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Model/CreateModel" err = common.PostProcessServiceError(err, "GenerativeAi", "CreateModel", apiReferenceLink) return response, err } @@ -524,7 +524,7 @@ func (client GenerativeAiClient) deleteDedicatedAiCluster(ctx context.Context, r defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/DedicatedAiCluster/DeleteDedicatedAiCluster" err = common.PostProcessServiceError(err, "GenerativeAi", "DeleteDedicatedAiCluster", apiReferenceLink) return response, err } @@ -582,7 +582,7 @@ func (client GenerativeAiClient) deleteEndpoint(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Endpoint/DeleteEndpoint" err = common.PostProcessServiceError(err, "GenerativeAi", "DeleteEndpoint", apiReferenceLink) return response, err } @@ -640,7 +640,7 @@ func (client GenerativeAiClient) deleteModel(ctx context.Context, request common defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Model/DeleteModel" err = common.PostProcessServiceError(err, "GenerativeAi", "DeleteModel", apiReferenceLink) return response, err } @@ -698,7 +698,7 @@ func (client GenerativeAiClient) getDedicatedAiCluster(ctx context.Context, requ defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/DedicatedAiCluster/GetDedicatedAiCluster" err = common.PostProcessServiceError(err, "GenerativeAi", "GetDedicatedAiCluster", apiReferenceLink) return response, err } @@ -756,7 +756,7 @@ func (client GenerativeAiClient) getEndpoint(ctx context.Context, request common defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Endpoint/GetEndpoint" err = common.PostProcessServiceError(err, "GenerativeAi", "GetEndpoint", apiReferenceLink) return response, err } @@ -814,7 +814,7 @@ func (client GenerativeAiClient) getModel(ctx context.Context, request common.OC defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Model/GetModel" err = common.PostProcessServiceError(err, "GenerativeAi", "GetModel", apiReferenceLink) return response, err } @@ -872,7 +872,7 @@ func (client GenerativeAiClient) getWorkRequest(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/WorkRequest/GetWorkRequest" err = common.PostProcessServiceError(err, "GenerativeAi", "GetWorkRequest", apiReferenceLink) return response, err } @@ -930,7 +930,7 @@ func (client GenerativeAiClient) listDedicatedAiClusters(ctx context.Context, re defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/DedicatedAiClusterCollection/ListDedicatedAiClusters" err = common.PostProcessServiceError(err, "GenerativeAi", "ListDedicatedAiClusters", apiReferenceLink) return response, err } @@ -988,7 +988,7 @@ func (client GenerativeAiClient) listEndpoints(ctx context.Context, request comm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/EndpointCollection/ListEndpoints" err = common.PostProcessServiceError(err, "GenerativeAi", "ListEndpoints", apiReferenceLink) return response, err } @@ -1046,7 +1046,7 @@ func (client GenerativeAiClient) listModels(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/ModelCollection/ListModels" err = common.PostProcessServiceError(err, "GenerativeAi", "ListModels", apiReferenceLink) return response, err } @@ -1104,7 +1104,7 @@ func (client GenerativeAiClient) listWorkRequestErrors(ctx context.Context, requ defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/WorkRequestError/ListWorkRequestErrors" err = common.PostProcessServiceError(err, "GenerativeAi", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -1162,7 +1162,7 @@ func (client GenerativeAiClient) listWorkRequestLogs(ctx context.Context, reques defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/WorkRequestLogEntry/ListWorkRequestLogs" err = common.PostProcessServiceError(err, "GenerativeAi", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -1220,7 +1220,7 @@ func (client GenerativeAiClient) listWorkRequests(ctx context.Context, request c defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/WorkRequest/ListWorkRequests" err = common.PostProcessServiceError(err, "GenerativeAi", "ListWorkRequests", apiReferenceLink) return response, err } @@ -1278,7 +1278,7 @@ func (client GenerativeAiClient) updateDedicatedAiCluster(ctx context.Context, r defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/DedicatedAiCluster/UpdateDedicatedAiCluster" err = common.PostProcessServiceError(err, "GenerativeAi", "UpdateDedicatedAiCluster", apiReferenceLink) return response, err } @@ -1336,7 +1336,7 @@ func (client GenerativeAiClient) updateEndpoint(ctx context.Context, request com defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Endpoint/UpdateEndpoint" err = common.PostProcessServiceError(err, "GenerativeAi", "UpdateEndpoint", apiReferenceLink) return response, err } @@ -1394,7 +1394,7 @@ func (client GenerativeAiClient) updateModel(ctx context.Context, request common defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai/20231130/Model/UpdateModel" err = common.PostProcessServiceError(err, "GenerativeAi", "UpdateModel", apiReferenceLink) return response, err } diff --git a/generativeaiinference/generativeaiinference_client.go b/generativeaiinference/generativeaiinference_client.go index 33d5e4784f..ac7278f5bd 100644 --- a/generativeaiinference/generativeaiinference_client.go +++ b/generativeaiinference/generativeaiinference_client.go @@ -149,7 +149,7 @@ func (client GenerativeAiInferenceClient) embedText(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/20231130/EmbedTextResult/EmbedText" err = common.PostProcessServiceError(err, "GenerativeAiInference", "EmbedText", apiReferenceLink) return response, err } @@ -212,7 +212,7 @@ func (client GenerativeAiInferenceClient) generateText(ctx context.Context, requ defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/20231130/GenerateTextResult/GenerateText" err = common.PostProcessServiceError(err, "GenerativeAiInference", "GenerateText", apiReferenceLink) return response, err } @@ -275,7 +275,7 @@ func (client GenerativeAiInferenceClient) summarizeText(ctx context.Context, req defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/20231130/SummarizeTextResult/SummarizeText" err = common.PostProcessServiceError(err, "GenerativeAiInference", "SummarizeText", apiReferenceLink) return response, err } diff --git a/globallydistributeddatabase/action_type.go b/globallydistributeddatabase/action_type.go new file mode 100644 index 0000000000..4a0c599e11 --- /dev/null +++ b/globallydistributeddatabase/action_type.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/change_private_endpoint_compartment_details.go b/globallydistributeddatabase/change_private_endpoint_compartment_details.go new file mode 100644 index 0000000000..64401cf3db --- /dev/null +++ b/globallydistributeddatabase/change_private_endpoint_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangePrivateEndpointCompartmentDetails The configuration details for moving the resource for private endpoint to other compartment. +type ChangePrivateEndpointCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the resource to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangePrivateEndpointCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangePrivateEndpointCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/change_private_endpoint_compartment_request_response.go b/globallydistributeddatabase/change_private_endpoint_compartment_request_response.go new file mode 100644 index 0000000000..df13f99ea9 --- /dev/null +++ b/globallydistributeddatabase/change_private_endpoint_compartment_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangePrivateEndpointCompartmentRequest wrapper for the ChangePrivateEndpointCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ChangePrivateEndpointCompartment.go.html to see an example of how to use ChangePrivateEndpointCompartmentRequest. +type ChangePrivateEndpointCompartmentRequest struct { + + // Request to move the private endpoint to a different compartment. + ChangePrivateEndpointCompartmentDetails `contributesTo:"body"` + + // Oracle Sharded Database PrivateEndpoint identifier + PrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"privateEndpointId"` + + // 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangePrivateEndpointCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangePrivateEndpointCompartmentRequest) 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 ChangePrivateEndpointCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangePrivateEndpointCompartmentRequest) 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 ChangePrivateEndpointCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangePrivateEndpointCompartmentResponse wrapper for the ChangePrivateEndpointCompartment operation +type ChangePrivateEndpointCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 ChangePrivateEndpointCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangePrivateEndpointCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/change_sharded_database_compartment_details.go b/globallydistributeddatabase/change_sharded_database_compartment_details.go new file mode 100644 index 0000000000..f23c3456e2 --- /dev/null +++ b/globallydistributeddatabase/change_sharded_database_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeShardedDatabaseCompartmentDetails The configuration details for moving the resource for sharded database to other compartment. +type ChangeShardedDatabaseCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the resource to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeShardedDatabaseCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeShardedDatabaseCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/change_sharded_database_compartment_request_response.go b/globallydistributeddatabase/change_sharded_database_compartment_request_response.go new file mode 100644 index 0000000000..262a8c5a2b --- /dev/null +++ b/globallydistributeddatabase/change_sharded_database_compartment_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeShardedDatabaseCompartmentRequest wrapper for the ChangeShardedDatabaseCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ChangeShardedDatabaseCompartment.go.html to see an example of how to use ChangeShardedDatabaseCompartmentRequest. +type ChangeShardedDatabaseCompartmentRequest struct { + + // Request to move the sharded database to a different compartment. + ChangeShardedDatabaseCompartmentDetails `contributesTo:"body"` + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeShardedDatabaseCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeShardedDatabaseCompartmentRequest) 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 ChangeShardedDatabaseCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeShardedDatabaseCompartmentRequest) 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 ChangeShardedDatabaseCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeShardedDatabaseCompartmentResponse wrapper for the ChangeShardedDatabaseCompartment operation +type ChangeShardedDatabaseCompartmentResponse 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 work. You can use this to query its status. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response ChangeShardedDatabaseCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeShardedDatabaseCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/configure_sharded_database_gsms_details.go b/globallydistributeddatabase/configure_sharded_database_gsms_details.go new file mode 100644 index 0000000000..9bffcd38b9 --- /dev/null +++ b/globallydistributeddatabase/configure_sharded_database_gsms_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConfigureShardedDatabaseGsmsDetails Details of the request to configure new global service manager(GSM) instances for the sharded database. +type ConfigureShardedDatabaseGsmsDetails struct { + + // Names of old global service manager(GSM) instances corresponding to which new GSM instances need to be configured. + OldGsmNames []string `mandatory:"true" json:"oldGsmNames"` + + // Flag to indicate if new global service manager(GSM) instances shall use latest image or re-use image used by existing + // GSM instances. + IsLatestGsmImage *bool `mandatory:"true" json:"isLatestGsmImage"` +} + +func (m ConfigureShardedDatabaseGsmsDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ConfigureShardedDatabaseGsmsDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/configure_sharded_database_gsms_request_response.go b/globallydistributeddatabase/configure_sharded_database_gsms_request_response.go new file mode 100644 index 0000000000..12459cc674 --- /dev/null +++ b/globallydistributeddatabase/configure_sharded_database_gsms_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ConfigureShardedDatabaseGsmsRequest wrapper for the ConfigureShardedDatabaseGsms operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ConfigureShardedDatabaseGsms.go.html to see an example of how to use ConfigureShardedDatabaseGsmsRequest. +type ConfigureShardedDatabaseGsmsRequest struct { + + // Details to configure the new GSM instances for the sharded database. + ConfigureShardedDatabaseGsmsDetails `contributesTo:"body"` + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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"` + + // 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 ConfigureShardedDatabaseGsmsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ConfigureShardedDatabaseGsmsRequest) 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 ConfigureShardedDatabaseGsmsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConfigureShardedDatabaseGsmsRequest) 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 ConfigureShardedDatabaseGsmsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConfigureShardedDatabaseGsmsResponse wrapper for the ConfigureShardedDatabaseGsms operation +type ConfigureShardedDatabaseGsmsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 ConfigureShardedDatabaseGsmsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ConfigureShardedDatabaseGsmsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/configure_sharding_request_response.go b/globallydistributeddatabase/configure_sharding_request_response.go new file mode 100644 index 0000000000..c3450b2521 --- /dev/null +++ b/globallydistributeddatabase/configure_sharding_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ConfigureShardingRequest wrapper for the ConfigureSharding operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ConfigureSharding.go.html to see an example of how to use ConfigureShardingRequest. +type ConfigureShardingRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // The flag to indicate whether chunks need to be re-balanced. This flag is not applicable for USER-defined + // sharding type. + IsRebalanceRequired *bool `mandatory:"false" contributesTo:"query" name:"isRebalanceRequired"` + + // 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"` + + // 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 ConfigureShardingRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ConfigureShardingRequest) 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 ConfigureShardingRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ConfigureShardingRequest) 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 ConfigureShardingRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConfigureShardingResponse wrapper for the ConfigureSharding operation +type ConfigureShardingResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 ConfigureShardingResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ConfigureShardingResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/connection_string.go b/globallydistributeddatabase/connection_string.go new file mode 100644 index 0000000000..f53b2422e1 --- /dev/null +++ b/globallydistributeddatabase/connection_string.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConnectionString Details of sharded database connection String. +type ConnectionString struct { + + // Collection of connection strings. + AllConnectionStrings map[string]string `mandatory:"true" json:"allConnectionStrings"` +} + +func (m ConnectionString) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ConnectionString) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/create_dedicated_catalog_detail.go b/globallydistributeddatabase/create_dedicated_catalog_detail.go new file mode 100644 index 0000000000..5ae04fb050 --- /dev/null +++ b/globallydistributeddatabase/create_dedicated_catalog_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDedicatedCatalogDetail Details required for creation of ATP-D based catalog. +type CreateDedicatedCatalogDetail struct { + + // Admin password for the catalog database. + AdminPassword *string `mandatory:"true" json:"adminPassword"` + + // The compute count for the catalog database. It has to be in multiple of 2. + ComputeCount *float32 `mandatory:"true" json:"computeCount"` + + // The data disk group size to be allocated in GBs for the catalog database. + DataStorageSizeInGbs *float64 `mandatory:"true" json:"dataStorageSizeInGbs"` + + // Determines the auto-scaling mode for the catalog database. + IsAutoScalingEnabled *bool `mandatory:"true" json:"isAutoScalingEnabled"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the cloud Autonomous Exadata VM Cluster. + CloudAutonomousVmClusterId *string `mandatory:"true" json:"cloudAutonomousVmClusterId"` + + EncryptionKeyDetails *DedicatedShardOrCatalogEncryptionKeyDetails `mandatory:"false" json:"encryptionKeyDetails"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the peer cloud Autonomous Exadata VM Cluster. + PeerCloudAutonomousVmClusterId *string `mandatory:"false" json:"peerCloudAutonomousVmClusterId"` +} + +func (m CreateDedicatedCatalogDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateDedicatedCatalogDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/create_dedicated_shard_detail.go b/globallydistributeddatabase/create_dedicated_shard_detail.go new file mode 100644 index 0000000000..1c7e337ba9 --- /dev/null +++ b/globallydistributeddatabase/create_dedicated_shard_detail.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDedicatedShardDetail Details required for creation of ATP-D based shard. +type CreateDedicatedShardDetail struct { + + // Admin password for shard database. + AdminPassword *string `mandatory:"true" json:"adminPassword"` + + // The compute count for the shard database. It has to be in multiples of 2. + ComputeCount *float32 `mandatory:"true" json:"computeCount"` + + // The data disk group size to be allocated in GBs for the shard database. + DataStorageSizeInGbs *float64 `mandatory:"true" json:"dataStorageSizeInGbs"` + + // Determines the auto-scaling mode for the shard database. + IsAutoScalingEnabled *bool `mandatory:"true" json:"isAutoScalingEnabled"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the cloud Autonomous Exadata VM Cluster. + CloudAutonomousVmClusterId *string `mandatory:"true" json:"cloudAutonomousVmClusterId"` + + EncryptionKeyDetails *DedicatedShardOrCatalogEncryptionKeyDetails `mandatory:"false" json:"encryptionKeyDetails"` + + // The shard space name for the shard database. Shard space for existing shard cannot be changed, once shard is created. + // Shard space name shall be used while creation of new shards. For User defined sharding, every shard must have a unique + // shard space name. For system defined sharding, shard space name is not required. + ShardSpace *string `mandatory:"false" json:"shardSpace"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the peer cloud Autonomous Exadata VM Cluster. + PeerCloudAutonomousVmClusterId *string `mandatory:"false" json:"peerCloudAutonomousVmClusterId"` +} + +func (m CreateDedicatedShardDetail) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateDedicatedShardDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/create_dedicated_sharded_database.go b/globallydistributeddatabase/create_dedicated_sharded_database.go new file mode 100644 index 0000000000..55312f9447 --- /dev/null +++ b/globallydistributeddatabase/create_dedicated_sharded_database.go @@ -0,0 +1,225 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDedicatedShardedDatabase Request details for creation of ATP-Dedicated based sharded database. +type CreateDedicatedShardedDatabase struct { + + // Identifier of the compartment where sharded database is to be created. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Oracle sharded database display name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Oracle Database version of the Autonomous Container Database. + DbVersion *string `mandatory:"true" json:"dbVersion"` + + // The character set for the new shard database being created. Use database api ListAutonomousDatabaseCharacterSets to + // get the list of allowed character set for autonomous dedicated database. See documentation: + // https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/AutonomousDatabaseCharacterSets/ListAutonomousDatabaseCharacterSets + CharacterSet *string `mandatory:"true" json:"characterSet"` + + // The national character set for the new shard database being created. Use database api ListAutonomousDatabaseCharacterSets to + // get the list of allowed national character set for autonomous dedicated database. See documentation: + // https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/AutonomousDatabaseCharacterSets/ListAutonomousDatabaseCharacterSets + NcharacterSet *string `mandatory:"true" json:"ncharacterSet"` + + // The listener port number for sharded database. + ListenerPort *int `mandatory:"true" json:"listenerPort"` + + // The TLS listener port number for sharded database. + ListenerPortTls *int `mandatory:"true" json:"listenerPortTls"` + + // Ons port local for sharded database. + OnsPortLocal *int `mandatory:"true" json:"onsPortLocal"` + + // Ons remote port for sharded database. + OnsPortRemote *int `mandatory:"true" json:"onsPortRemote"` + + // Unique name prefix for the sharded databases. Only alpha-numeric values are allowed. First character + // has to be a letter followed by any combination of letter and number. + Prefix *string `mandatory:"true" json:"prefix"` + + // Collection of ATP-Dedicated shards that needs to be created. + ShardDetails []CreateDedicatedShardDetail `mandatory:"true" json:"shardDetails"` + + // Collection of ATP-Dedicated catalogs that needs to be created. + CatalogDetails []CreateDedicatedCatalogDetail `mandatory:"true" json:"catalogDetails"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The certificate common name used in all cloudAutonomousVmClusters for the sharded database topology. Eg. Production. + // All the clusters used in one sharded database topology shall have same CABundle setup. Valid characterset for + // clusterCertificateCommonName include uppercase or lowercase letters, numbers, hyphens, underscores, and period. + ClusterCertificateCommonName *string `mandatory:"false" json:"clusterCertificateCommonName"` + + // The default number of unique chunks in a shardspace. The value of chunks must be + // greater than 2 times the size of the largest shardgroup in any shardspace. + Chunks *int `mandatory:"false" json:"chunks"` + + // Possible workload types. + DbWorkload CreateDedicatedShardedDatabaseDbWorkloadEnum `mandatory:"true" json:"dbWorkload"` + + // Sharding Method. + ShardingMethod CreateDedicatedShardedDatabaseShardingMethodEnum `mandatory:"true" json:"shardingMethod"` +} + +// GetCompartmentId returns CompartmentId +func (m CreateDedicatedShardedDatabase) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m CreateDedicatedShardedDatabase) GetDisplayName() *string { + return m.DisplayName +} + +// GetFreeformTags returns FreeformTags +func (m CreateDedicatedShardedDatabase) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateDedicatedShardedDatabase) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateDedicatedShardedDatabase) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateDedicatedShardedDatabase) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCreateDedicatedShardedDatabaseDbWorkloadEnum(string(m.DbWorkload)); !ok && m.DbWorkload != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DbWorkload: %s. Supported values are: %s.", m.DbWorkload, strings.Join(GetCreateDedicatedShardedDatabaseDbWorkloadEnumStringValues(), ","))) + } + if _, ok := GetMappingCreateDedicatedShardedDatabaseShardingMethodEnum(string(m.ShardingMethod)); !ok && m.ShardingMethod != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ShardingMethod: %s. Supported values are: %s.", m.ShardingMethod, strings.Join(GetCreateDedicatedShardedDatabaseShardingMethodEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateDedicatedShardedDatabase) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateDedicatedShardedDatabase CreateDedicatedShardedDatabase + s := struct { + DiscriminatorParam string `json:"dbDeploymentType"` + MarshalTypeCreateDedicatedShardedDatabase + }{ + "DEDICATED", + (MarshalTypeCreateDedicatedShardedDatabase)(m), + } + + return json.Marshal(&s) +} + +// CreateDedicatedShardedDatabaseDbWorkloadEnum Enum with underlying type: string +type CreateDedicatedShardedDatabaseDbWorkloadEnum string + +// Set of constants representing the allowable values for CreateDedicatedShardedDatabaseDbWorkloadEnum +const ( + CreateDedicatedShardedDatabaseDbWorkloadOltp CreateDedicatedShardedDatabaseDbWorkloadEnum = "OLTP" + CreateDedicatedShardedDatabaseDbWorkloadDw CreateDedicatedShardedDatabaseDbWorkloadEnum = "DW" +) + +var mappingCreateDedicatedShardedDatabaseDbWorkloadEnum = map[string]CreateDedicatedShardedDatabaseDbWorkloadEnum{ + "OLTP": CreateDedicatedShardedDatabaseDbWorkloadOltp, + "DW": CreateDedicatedShardedDatabaseDbWorkloadDw, +} + +var mappingCreateDedicatedShardedDatabaseDbWorkloadEnumLowerCase = map[string]CreateDedicatedShardedDatabaseDbWorkloadEnum{ + "oltp": CreateDedicatedShardedDatabaseDbWorkloadOltp, + "dw": CreateDedicatedShardedDatabaseDbWorkloadDw, +} + +// GetCreateDedicatedShardedDatabaseDbWorkloadEnumValues Enumerates the set of values for CreateDedicatedShardedDatabaseDbWorkloadEnum +func GetCreateDedicatedShardedDatabaseDbWorkloadEnumValues() []CreateDedicatedShardedDatabaseDbWorkloadEnum { + values := make([]CreateDedicatedShardedDatabaseDbWorkloadEnum, 0) + for _, v := range mappingCreateDedicatedShardedDatabaseDbWorkloadEnum { + values = append(values, v) + } + return values +} + +// GetCreateDedicatedShardedDatabaseDbWorkloadEnumStringValues Enumerates the set of values in String for CreateDedicatedShardedDatabaseDbWorkloadEnum +func GetCreateDedicatedShardedDatabaseDbWorkloadEnumStringValues() []string { + return []string{ + "OLTP", + "DW", + } +} + +// GetMappingCreateDedicatedShardedDatabaseDbWorkloadEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateDedicatedShardedDatabaseDbWorkloadEnum(val string) (CreateDedicatedShardedDatabaseDbWorkloadEnum, bool) { + enum, ok := mappingCreateDedicatedShardedDatabaseDbWorkloadEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// CreateDedicatedShardedDatabaseShardingMethodEnum Enum with underlying type: string +type CreateDedicatedShardedDatabaseShardingMethodEnum string + +// Set of constants representing the allowable values for CreateDedicatedShardedDatabaseShardingMethodEnum +const ( + CreateDedicatedShardedDatabaseShardingMethodUser CreateDedicatedShardedDatabaseShardingMethodEnum = "USER" + CreateDedicatedShardedDatabaseShardingMethodSystem CreateDedicatedShardedDatabaseShardingMethodEnum = "SYSTEM" +) + +var mappingCreateDedicatedShardedDatabaseShardingMethodEnum = map[string]CreateDedicatedShardedDatabaseShardingMethodEnum{ + "USER": CreateDedicatedShardedDatabaseShardingMethodUser, + "SYSTEM": CreateDedicatedShardedDatabaseShardingMethodSystem, +} + +var mappingCreateDedicatedShardedDatabaseShardingMethodEnumLowerCase = map[string]CreateDedicatedShardedDatabaseShardingMethodEnum{ + "user": CreateDedicatedShardedDatabaseShardingMethodUser, + "system": CreateDedicatedShardedDatabaseShardingMethodSystem, +} + +// GetCreateDedicatedShardedDatabaseShardingMethodEnumValues Enumerates the set of values for CreateDedicatedShardedDatabaseShardingMethodEnum +func GetCreateDedicatedShardedDatabaseShardingMethodEnumValues() []CreateDedicatedShardedDatabaseShardingMethodEnum { + values := make([]CreateDedicatedShardedDatabaseShardingMethodEnum, 0) + for _, v := range mappingCreateDedicatedShardedDatabaseShardingMethodEnum { + values = append(values, v) + } + return values +} + +// GetCreateDedicatedShardedDatabaseShardingMethodEnumStringValues Enumerates the set of values in String for CreateDedicatedShardedDatabaseShardingMethodEnum +func GetCreateDedicatedShardedDatabaseShardingMethodEnumStringValues() []string { + return []string{ + "USER", + "SYSTEM", + } +} + +// GetMappingCreateDedicatedShardedDatabaseShardingMethodEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateDedicatedShardedDatabaseShardingMethodEnum(val string) (CreateDedicatedShardedDatabaseShardingMethodEnum, bool) { + enum, ok := mappingCreateDedicatedShardedDatabaseShardingMethodEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/create_private_endpoint_details.go b/globallydistributeddatabase/create_private_endpoint_details.go new file mode 100644 index 0000000000..c3d1a993f2 --- /dev/null +++ b/globallydistributeddatabase/create_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreatePrivateEndpointDetails Details required for private endpoint creation. +type CreatePrivateEndpointDetails struct { + + // Identifier of the compartment where private endpoint is to be created. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Identifier of the customer subnet against which private endpoint is to be created. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Private endpoint display name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // PrivateEndpoint description. + Description *string `mandatory:"false" json:"description"` + + // The OCIDs of the network security groups that the private endpoint belongs to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m 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/globallydistributeddatabase/create_private_endpoint_request_response.go b/globallydistributeddatabase/create_private_endpoint_request_response.go new file mode 100644 index 0000000000..e3411556e2 --- /dev/null +++ b/globallydistributeddatabase/create_private_endpoint_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 globallydistributeddatabase + +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/globallydistributeddatabase/CreatePrivateEndpoint.go.html to see an example of how to use CreatePrivateEndpointRequest. +type CreatePrivateEndpointRequest struct { + + // Details of PrivateEndpoint to be created. + CreatePrivateEndpointDetails `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 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 + +} + +// 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 + + // The PrivateEndpoint instance + PrivateEndpoint `presentIn:"body"` + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +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/globallydistributeddatabase/create_sharded_database_details.go b/globallydistributeddatabase/create_sharded_database_details.go new file mode 100644 index 0000000000..fdce50ff64 --- /dev/null +++ b/globallydistributeddatabase/create_sharded_database_details.go @@ -0,0 +1,157 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateShardedDatabaseDetails Details required for Sharded database creation. +type CreateShardedDatabaseDetails interface { + + // Identifier of the compartment where sharded database is to be created. + GetCompartmentId() *string + + // Oracle sharded database display name. + GetDisplayName() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} +} + +type createshardeddatabasedetails struct { + JsonData []byte + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + DisplayName *string `mandatory:"true" json:"displayName"` + DbDeploymentType string `json:"dbDeploymentType"` +} + +// UnmarshalJSON unmarshals json +func (m *createshardeddatabasedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreateshardeddatabasedetails createshardeddatabasedetails + s := struct { + Model Unmarshalercreateshardeddatabasedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.DisplayName = s.Model.DisplayName + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.DbDeploymentType = s.Model.DbDeploymentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createshardeddatabasedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.DbDeploymentType { + case "DEDICATED": + mm := CreateDedicatedShardedDatabase{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateShardedDatabaseDetails: %s.", m.DbDeploymentType) + return *m, nil + } +} + +// GetFreeformTags returns FreeformTags +func (m createshardeddatabasedetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m createshardeddatabasedetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetCompartmentId returns CompartmentId +func (m createshardeddatabasedetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m createshardeddatabasedetails) GetDisplayName() *string { + return m.DisplayName +} + +func (m createshardeddatabasedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createshardeddatabasedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateShardedDatabaseDetailsDbDeploymentTypeEnum Enum with underlying type: string +type CreateShardedDatabaseDetailsDbDeploymentTypeEnum string + +// Set of constants representing the allowable values for CreateShardedDatabaseDetailsDbDeploymentTypeEnum +const ( + CreateShardedDatabaseDetailsDbDeploymentTypeDedicated CreateShardedDatabaseDetailsDbDeploymentTypeEnum = "DEDICATED" +) + +var mappingCreateShardedDatabaseDetailsDbDeploymentTypeEnum = map[string]CreateShardedDatabaseDetailsDbDeploymentTypeEnum{ + "DEDICATED": CreateShardedDatabaseDetailsDbDeploymentTypeDedicated, +} + +var mappingCreateShardedDatabaseDetailsDbDeploymentTypeEnumLowerCase = map[string]CreateShardedDatabaseDetailsDbDeploymentTypeEnum{ + "dedicated": CreateShardedDatabaseDetailsDbDeploymentTypeDedicated, +} + +// GetCreateShardedDatabaseDetailsDbDeploymentTypeEnumValues Enumerates the set of values for CreateShardedDatabaseDetailsDbDeploymentTypeEnum +func GetCreateShardedDatabaseDetailsDbDeploymentTypeEnumValues() []CreateShardedDatabaseDetailsDbDeploymentTypeEnum { + values := make([]CreateShardedDatabaseDetailsDbDeploymentTypeEnum, 0) + for _, v := range mappingCreateShardedDatabaseDetailsDbDeploymentTypeEnum { + values = append(values, v) + } + return values +} + +// GetCreateShardedDatabaseDetailsDbDeploymentTypeEnumStringValues Enumerates the set of values in String for CreateShardedDatabaseDetailsDbDeploymentTypeEnum +func GetCreateShardedDatabaseDetailsDbDeploymentTypeEnumStringValues() []string { + return []string{ + "DEDICATED", + } +} + +// GetMappingCreateShardedDatabaseDetailsDbDeploymentTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateShardedDatabaseDetailsDbDeploymentTypeEnum(val string) (CreateShardedDatabaseDetailsDbDeploymentTypeEnum, bool) { + enum, ok := mappingCreateShardedDatabaseDetailsDbDeploymentTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/create_sharded_database_request_response.go b/globallydistributeddatabase/create_sharded_database_request_response.go new file mode 100644 index 0000000000..1291546e3a --- /dev/null +++ b/globallydistributeddatabase/create_sharded_database_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateShardedDatabaseRequest wrapper for the CreateShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/CreateShardedDatabase.go.html to see an example of how to use CreateShardedDatabaseRequest. +type CreateShardedDatabaseRequest struct { + + // Details of Sharded database to be created. + CreateShardedDatabaseDetails `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 CreateShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateShardedDatabaseRequest) 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 CreateShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateShardedDatabaseRequest) 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 CreateShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateShardedDatabaseResponse wrapper for the CreateShardedDatabase operation +type CreateShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ShardedDatabase instance + ShardedDatabase `presentIn:"body"` + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/dedicated_catalog_details.go b/globallydistributeddatabase/dedicated_catalog_details.go new file mode 100644 index 0000000000..a003483491 --- /dev/null +++ b/globallydistributeddatabase/dedicated_catalog_details.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DedicatedCatalogDetails Details of ATP-D based catalog. +type DedicatedCatalogDetails struct { + + // Catalog name + Name *string `mandatory:"true" json:"name"` + + // The compute amount available to the underlying autonomous database associated with shard or catalog. + ComputeCount *float32 `mandatory:"true" json:"computeCount"` + + // The data disk group size to be allocated in GBs. + DataStorageSizeInGbs *float64 `mandatory:"true" json:"dataStorageSizeInGbs"` + + // Name of the shard-group to which the catalog belongs. + ShardGroup *string `mandatory:"true" json:"shardGroup"` + + // The time the catalog was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the catalog was last created. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Status of shard or catalog or gsm for the sharded database. + Status DedicatedCatalogDetailsStatusEnum `mandatory:"true" json:"status"` + + // Determines the auto-scaling mode. + IsAutoScalingEnabled *bool `mandatory:"true" json:"isAutoScalingEnabled"` + + // Identifier of the primary cloudAutonomousVmCluster for the catalog. + CloudAutonomousVmClusterId *string `mandatory:"true" json:"cloudAutonomousVmClusterId"` + + EncryptionKeyDetails *DedicatedShardOrCatalogEncryptionKeyDetails `mandatory:"false" json:"encryptionKeyDetails"` + + // The time the ssl certificate associated with catalog expires. An RFC3339 formatted datetime string + TimeSslCertificateExpires *common.SDKTime `mandatory:"false" json:"timeSslCertificateExpires"` + + // Identifier of the underlying supporting resource. + SupportingResourceId *string `mandatory:"false" json:"supportingResourceId"` + + // Identifier of the underlying container database. + ContainerDatabaseId *string `mandatory:"false" json:"containerDatabaseId"` + + // Identifier of the underlying container database parent. + ContainerDatabaseParentId *string `mandatory:"false" json:"containerDatabaseParentId"` + + // Identifier of the peer cloudAutonomousVmCluster for the catalog. + PeerCloudAutonomousVmClusterId *string `mandatory:"false" json:"peerCloudAutonomousVmClusterId"` + + // Additional metadata related to catalog's underlying supporting resource. + Metadata map[string]interface{} `mandatory:"false" json:"metadata"` +} + +func (m DedicatedCatalogDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DedicatedCatalogDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDedicatedCatalogDetailsStatusEnum(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(GetDedicatedCatalogDetailsStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DedicatedCatalogDetailsStatusEnum Enum with underlying type: string +type DedicatedCatalogDetailsStatusEnum string + +// Set of constants representing the allowable values for DedicatedCatalogDetailsStatusEnum +const ( + DedicatedCatalogDetailsStatusFailed DedicatedCatalogDetailsStatusEnum = "FAILED" + DedicatedCatalogDetailsStatusDeleting DedicatedCatalogDetailsStatusEnum = "DELETING" + DedicatedCatalogDetailsStatusDeleted DedicatedCatalogDetailsStatusEnum = "DELETED" + DedicatedCatalogDetailsStatusUpdating DedicatedCatalogDetailsStatusEnum = "UPDATING" + DedicatedCatalogDetailsStatusCreating DedicatedCatalogDetailsStatusEnum = "CREATING" + DedicatedCatalogDetailsStatusCreated DedicatedCatalogDetailsStatusEnum = "CREATED" + DedicatedCatalogDetailsStatusReadyForConfiguration DedicatedCatalogDetailsStatusEnum = "READY_FOR_CONFIGURATION" + DedicatedCatalogDetailsStatusConfigured DedicatedCatalogDetailsStatusEnum = "CONFIGURED" + DedicatedCatalogDetailsStatusNeedsAttention DedicatedCatalogDetailsStatusEnum = "NEEDS_ATTENTION" +) + +var mappingDedicatedCatalogDetailsStatusEnum = map[string]DedicatedCatalogDetailsStatusEnum{ + "FAILED": DedicatedCatalogDetailsStatusFailed, + "DELETING": DedicatedCatalogDetailsStatusDeleting, + "DELETED": DedicatedCatalogDetailsStatusDeleted, + "UPDATING": DedicatedCatalogDetailsStatusUpdating, + "CREATING": DedicatedCatalogDetailsStatusCreating, + "CREATED": DedicatedCatalogDetailsStatusCreated, + "READY_FOR_CONFIGURATION": DedicatedCatalogDetailsStatusReadyForConfiguration, + "CONFIGURED": DedicatedCatalogDetailsStatusConfigured, + "NEEDS_ATTENTION": DedicatedCatalogDetailsStatusNeedsAttention, +} + +var mappingDedicatedCatalogDetailsStatusEnumLowerCase = map[string]DedicatedCatalogDetailsStatusEnum{ + "failed": DedicatedCatalogDetailsStatusFailed, + "deleting": DedicatedCatalogDetailsStatusDeleting, + "deleted": DedicatedCatalogDetailsStatusDeleted, + "updating": DedicatedCatalogDetailsStatusUpdating, + "creating": DedicatedCatalogDetailsStatusCreating, + "created": DedicatedCatalogDetailsStatusCreated, + "ready_for_configuration": DedicatedCatalogDetailsStatusReadyForConfiguration, + "configured": DedicatedCatalogDetailsStatusConfigured, + "needs_attention": DedicatedCatalogDetailsStatusNeedsAttention, +} + +// GetDedicatedCatalogDetailsStatusEnumValues Enumerates the set of values for DedicatedCatalogDetailsStatusEnum +func GetDedicatedCatalogDetailsStatusEnumValues() []DedicatedCatalogDetailsStatusEnum { + values := make([]DedicatedCatalogDetailsStatusEnum, 0) + for _, v := range mappingDedicatedCatalogDetailsStatusEnum { + values = append(values, v) + } + return values +} + +// GetDedicatedCatalogDetailsStatusEnumStringValues Enumerates the set of values in String for DedicatedCatalogDetailsStatusEnum +func GetDedicatedCatalogDetailsStatusEnumStringValues() []string { + return []string{ + "FAILED", + "DELETING", + "DELETED", + "UPDATING", + "CREATING", + "CREATED", + "READY_FOR_CONFIGURATION", + "CONFIGURED", + "NEEDS_ATTENTION", + } +} + +// GetMappingDedicatedCatalogDetailsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDedicatedCatalogDetailsStatusEnum(val string) (DedicatedCatalogDetailsStatusEnum, bool) { + enum, ok := mappingDedicatedCatalogDetailsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/dedicated_shard_details.go b/globallydistributeddatabase/dedicated_shard_details.go new file mode 100644 index 0000000000..cac0a5278c --- /dev/null +++ b/globallydistributeddatabase/dedicated_shard_details.go @@ -0,0 +1,159 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DedicatedShardDetails Details of ATP-D based shard. +type DedicatedShardDetails struct { + + // Name of the shard. + Name *string `mandatory:"true" json:"name"` + + // The compute amount available to the underlying autonomous database associated with shard. + ComputeCount *float32 `mandatory:"true" json:"computeCount"` + + // The data disk group size to be allocated in GBs. + DataStorageSizeInGbs *float64 `mandatory:"true" json:"dataStorageSizeInGbs"` + + // Name of the shard-group to which the shard belongs. + ShardGroup *string `mandatory:"true" json:"shardGroup"` + + // The time the the shard was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the shard was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Status of shard or catalog or gsm for the sharded database. + Status DedicatedShardDetailsStatusEnum `mandatory:"true" json:"status"` + + // Determines the auto-scaling mode. + IsAutoScalingEnabled *bool `mandatory:"true" json:"isAutoScalingEnabled"` + + // Identifier of the primary cloudAutonomousVmCluster for the shard. + CloudAutonomousVmClusterId *string `mandatory:"true" json:"cloudAutonomousVmClusterId"` + + EncryptionKeyDetails *DedicatedShardOrCatalogEncryptionKeyDetails `mandatory:"false" json:"encryptionKeyDetails"` + + // The time the ssl certificate associated with shard expires. An RFC3339 formatted datetime string + TimeSslCertificateExpires *common.SDKTime `mandatory:"false" json:"timeSslCertificateExpires"` + + // Shard space name. + ShardSpace *string `mandatory:"false" json:"shardSpace"` + + // Identifier of the underlying supporting resource. + SupportingResourceId *string `mandatory:"false" json:"supportingResourceId"` + + // Identifier of the underlying container database. + ContainerDatabaseId *string `mandatory:"false" json:"containerDatabaseId"` + + // Identifier of the underlying container database parent. + ContainerDatabaseParentId *string `mandatory:"false" json:"containerDatabaseParentId"` + + // Identifier of the peer cloudAutonomousVmCluster for the shard. + PeerCloudAutonomousVmClusterId *string `mandatory:"false" json:"peerCloudAutonomousVmClusterId"` + + // Additional metadata related to shard's underlying supporting resource. + Metadata map[string]interface{} `mandatory:"false" json:"metadata"` +} + +func (m DedicatedShardDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DedicatedShardDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDedicatedShardDetailsStatusEnum(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(GetDedicatedShardDetailsStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DedicatedShardDetailsStatusEnum Enum with underlying type: string +type DedicatedShardDetailsStatusEnum string + +// Set of constants representing the allowable values for DedicatedShardDetailsStatusEnum +const ( + DedicatedShardDetailsStatusFailed DedicatedShardDetailsStatusEnum = "FAILED" + DedicatedShardDetailsStatusDeleting DedicatedShardDetailsStatusEnum = "DELETING" + DedicatedShardDetailsStatusDeleted DedicatedShardDetailsStatusEnum = "DELETED" + DedicatedShardDetailsStatusUpdating DedicatedShardDetailsStatusEnum = "UPDATING" + DedicatedShardDetailsStatusCreating DedicatedShardDetailsStatusEnum = "CREATING" + DedicatedShardDetailsStatusCreated DedicatedShardDetailsStatusEnum = "CREATED" + DedicatedShardDetailsStatusReadyForConfiguration DedicatedShardDetailsStatusEnum = "READY_FOR_CONFIGURATION" + DedicatedShardDetailsStatusConfigured DedicatedShardDetailsStatusEnum = "CONFIGURED" + DedicatedShardDetailsStatusNeedsAttention DedicatedShardDetailsStatusEnum = "NEEDS_ATTENTION" +) + +var mappingDedicatedShardDetailsStatusEnum = map[string]DedicatedShardDetailsStatusEnum{ + "FAILED": DedicatedShardDetailsStatusFailed, + "DELETING": DedicatedShardDetailsStatusDeleting, + "DELETED": DedicatedShardDetailsStatusDeleted, + "UPDATING": DedicatedShardDetailsStatusUpdating, + "CREATING": DedicatedShardDetailsStatusCreating, + "CREATED": DedicatedShardDetailsStatusCreated, + "READY_FOR_CONFIGURATION": DedicatedShardDetailsStatusReadyForConfiguration, + "CONFIGURED": DedicatedShardDetailsStatusConfigured, + "NEEDS_ATTENTION": DedicatedShardDetailsStatusNeedsAttention, +} + +var mappingDedicatedShardDetailsStatusEnumLowerCase = map[string]DedicatedShardDetailsStatusEnum{ + "failed": DedicatedShardDetailsStatusFailed, + "deleting": DedicatedShardDetailsStatusDeleting, + "deleted": DedicatedShardDetailsStatusDeleted, + "updating": DedicatedShardDetailsStatusUpdating, + "creating": DedicatedShardDetailsStatusCreating, + "created": DedicatedShardDetailsStatusCreated, + "ready_for_configuration": DedicatedShardDetailsStatusReadyForConfiguration, + "configured": DedicatedShardDetailsStatusConfigured, + "needs_attention": DedicatedShardDetailsStatusNeedsAttention, +} + +// GetDedicatedShardDetailsStatusEnumValues Enumerates the set of values for DedicatedShardDetailsStatusEnum +func GetDedicatedShardDetailsStatusEnumValues() []DedicatedShardDetailsStatusEnum { + values := make([]DedicatedShardDetailsStatusEnum, 0) + for _, v := range mappingDedicatedShardDetailsStatusEnum { + values = append(values, v) + } + return values +} + +// GetDedicatedShardDetailsStatusEnumStringValues Enumerates the set of values in String for DedicatedShardDetailsStatusEnum +func GetDedicatedShardDetailsStatusEnumStringValues() []string { + return []string{ + "FAILED", + "DELETING", + "DELETED", + "UPDATING", + "CREATING", + "CREATED", + "READY_FOR_CONFIGURATION", + "CONFIGURED", + "NEEDS_ATTENTION", + } +} + +// GetMappingDedicatedShardDetailsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDedicatedShardDetailsStatusEnum(val string) (DedicatedShardDetailsStatusEnum, bool) { + enum, ok := mappingDedicatedShardDetailsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/dedicated_shard_or_catalog_encryption_key_details.go b/globallydistributeddatabase/dedicated_shard_or_catalog_encryption_key_details.go new file mode 100644 index 0000000000..b00a4888d0 --- /dev/null +++ b/globallydistributeddatabase/dedicated_shard_or_catalog_encryption_key_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DedicatedShardOrCatalogEncryptionKeyDetails Details of encryption key to be used to encrypt data for shards and catalog for sharded database. For system-defined +// sharding type, all shards have to use same encryptionKeyDetails. For system-defined sharding, if encryptionKeyDetails +// are not specified for catalog, then Oracle managed key will be used for catalog. +// For user-defined sharding type, if encryptionKeyDetails are not provided for any shard or catalog, then Oracle managed +// key will be used for such shard or catalog. For system-defined or user-defined sharding type, if the shard or catalog +// has a peer in region other than primary shard or catalog region, then make sure to provide virtual vault for such shard +// or catalog, which is also replicated to peer region (the region where peer or standby shard or catalog exists). +type DedicatedShardOrCatalogEncryptionKeyDetails struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the vault in customer tenancy where KMS key is present. + // For shard or catalog with cross-region data guard enabled, user needs to make sure to provide virtual private vault only, + // which is also replicated in the region of standby shard. + VaultId *string `mandatory:"true" json:"vaultId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the KMS key in vault identified by vaultId in customer tenancy + // that is used as the master encryption key. + KmsKeyId *string `mandatory:"true" json:"kmsKeyId"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the KMS key version for key identified by kmsKeyId + // that is used in data encryption (TDE) operations. + KmsKeyVersionId *string `mandatory:"false" json:"kmsKeyVersionId"` +} + +func (m DedicatedShardOrCatalogEncryptionKeyDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DedicatedShardOrCatalogEncryptionKeyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/dedicated_sharded_database.go b/globallydistributeddatabase/dedicated_sharded_database.go new file mode 100644 index 0000000000..149b880d52 --- /dev/null +++ b/globallydistributeddatabase/dedicated_sharded_database.go @@ -0,0 +1,283 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DedicatedShardedDatabase Details of ATP-D based sharded database. +type DedicatedShardedDatabase struct { + + // Sharded Database identifier + Id *string `mandatory:"true" json:"id"` + + // Identifier of the compartment in which sharded database exists. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Oracle sharded database display name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the the Sharded Database was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the Sharded Database was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Detailed message for the lifecycle state. + LifecycleStateDetails *string `mandatory:"true" json:"lifecycleStateDetails"` + + // The character set for the database. + CharacterSet *string `mandatory:"true" json:"characterSet"` + + // The national character set for the database. + NcharacterSet *string `mandatory:"true" json:"ncharacterSet"` + + // Oracle Database version number. + DbVersion *string `mandatory:"true" json:"dbVersion"` + + // Unique prefix for the sharded database. + Prefix *string `mandatory:"true" json:"prefix"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The certificate common name used in all cloudAutonomousVmClusters for the sharded database topology. Eg. Production. + // All the clusters used in one sharded database topology shall have same CABundle setup. Valid characterset for + // clusterCertificateCommonName include uppercase or lowercase letters, numbers, hyphens, underscores, and period. + ClusterCertificateCommonName *string `mandatory:"false" json:"clusterCertificateCommonName"` + + // The default number of unique chunks in a shardspace. The value of chunks must be + // greater than 2 times the size of the largest shardgroup in any shardspace. + Chunks *int `mandatory:"false" json:"chunks"` + + // The GSM listener port number. + ListenerPort *int `mandatory:"false" json:"listenerPort"` + + // The TLS listener port number for sharded database. + ListenerPortTls *int `mandatory:"false" json:"listenerPortTls"` + + // Ons local port number. + OnsPortLocal *int `mandatory:"false" json:"onsPortLocal"` + + // Ons remote port number. + OnsPortRemote *int `mandatory:"false" json:"onsPortRemote"` + + // The OCID of private endpoint being used by the sharded database. + PrivateEndpoint *string `mandatory:"false" json:"privateEndpoint"` + + ConnectionStrings *ConnectionString `mandatory:"false" json:"connectionStrings"` + + // Timezone associated with the sharded database. + TimeZone *string `mandatory:"false" json:"timeZone"` + + // Details of GSM instances for the sharded database. + Gsms []GsmDetails `mandatory:"false" json:"gsms"` + + // Details of ATP-D based shards. + ShardDetails []DedicatedShardDetails `mandatory:"false" json:"shardDetails"` + + // Details of ATP-D based catalogs. + CatalogDetails []DedicatedCatalogDetails `mandatory:"false" json:"catalogDetails"` + + // Possible workload types. + DbWorkload DedicatedShardedDatabaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"` + + // Sharding Method. + ShardingMethod DedicatedShardedDatabaseShardingMethodEnum `mandatory:"true" json:"shardingMethod"` + + // Lifecycle states for sharded databases. + LifecycleState ShardedDatabaseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m DedicatedShardedDatabase) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m DedicatedShardedDatabase) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m DedicatedShardedDatabase) GetDisplayName() *string { + return m.DisplayName +} + +// GetTimeCreated returns TimeCreated +func (m DedicatedShardedDatabase) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m DedicatedShardedDatabase) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m DedicatedShardedDatabase) GetLifecycleState() ShardedDatabaseLifecycleStateEnum { + return m.LifecycleState +} + +// GetLifecycleStateDetails returns LifecycleStateDetails +func (m DedicatedShardedDatabase) GetLifecycleStateDetails() *string { + return m.LifecycleStateDetails +} + +// GetFreeformTags returns FreeformTags +func (m DedicatedShardedDatabase) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m DedicatedShardedDatabase) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m DedicatedShardedDatabase) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m DedicatedShardedDatabase) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DedicatedShardedDatabase) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDedicatedShardedDatabaseDbWorkloadEnum(string(m.DbWorkload)); !ok && m.DbWorkload != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DbWorkload: %s. Supported values are: %s.", m.DbWorkload, strings.Join(GetDedicatedShardedDatabaseDbWorkloadEnumStringValues(), ","))) + } + if _, ok := GetMappingDedicatedShardedDatabaseShardingMethodEnum(string(m.ShardingMethod)); !ok && m.ShardingMethod != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ShardingMethod: %s. Supported values are: %s.", m.ShardingMethod, strings.Join(GetDedicatedShardedDatabaseShardingMethodEnumStringValues(), ","))) + } + + if _, ok := GetMappingShardedDatabaseLifecycleStateEnum(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(GetShardedDatabaseLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DedicatedShardedDatabase) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDedicatedShardedDatabase DedicatedShardedDatabase + s := struct { + DiscriminatorParam string `json:"dbDeploymentType"` + MarshalTypeDedicatedShardedDatabase + }{ + "DEDICATED", + (MarshalTypeDedicatedShardedDatabase)(m), + } + + return json.Marshal(&s) +} + +// DedicatedShardedDatabaseDbWorkloadEnum Enum with underlying type: string +type DedicatedShardedDatabaseDbWorkloadEnum string + +// Set of constants representing the allowable values for DedicatedShardedDatabaseDbWorkloadEnum +const ( + DedicatedShardedDatabaseDbWorkloadOltp DedicatedShardedDatabaseDbWorkloadEnum = "OLTP" + DedicatedShardedDatabaseDbWorkloadDw DedicatedShardedDatabaseDbWorkloadEnum = "DW" +) + +var mappingDedicatedShardedDatabaseDbWorkloadEnum = map[string]DedicatedShardedDatabaseDbWorkloadEnum{ + "OLTP": DedicatedShardedDatabaseDbWorkloadOltp, + "DW": DedicatedShardedDatabaseDbWorkloadDw, +} + +var mappingDedicatedShardedDatabaseDbWorkloadEnumLowerCase = map[string]DedicatedShardedDatabaseDbWorkloadEnum{ + "oltp": DedicatedShardedDatabaseDbWorkloadOltp, + "dw": DedicatedShardedDatabaseDbWorkloadDw, +} + +// GetDedicatedShardedDatabaseDbWorkloadEnumValues Enumerates the set of values for DedicatedShardedDatabaseDbWorkloadEnum +func GetDedicatedShardedDatabaseDbWorkloadEnumValues() []DedicatedShardedDatabaseDbWorkloadEnum { + values := make([]DedicatedShardedDatabaseDbWorkloadEnum, 0) + for _, v := range mappingDedicatedShardedDatabaseDbWorkloadEnum { + values = append(values, v) + } + return values +} + +// GetDedicatedShardedDatabaseDbWorkloadEnumStringValues Enumerates the set of values in String for DedicatedShardedDatabaseDbWorkloadEnum +func GetDedicatedShardedDatabaseDbWorkloadEnumStringValues() []string { + return []string{ + "OLTP", + "DW", + } +} + +// GetMappingDedicatedShardedDatabaseDbWorkloadEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDedicatedShardedDatabaseDbWorkloadEnum(val string) (DedicatedShardedDatabaseDbWorkloadEnum, bool) { + enum, ok := mappingDedicatedShardedDatabaseDbWorkloadEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// DedicatedShardedDatabaseShardingMethodEnum Enum with underlying type: string +type DedicatedShardedDatabaseShardingMethodEnum string + +// Set of constants representing the allowable values for DedicatedShardedDatabaseShardingMethodEnum +const ( + DedicatedShardedDatabaseShardingMethodUser DedicatedShardedDatabaseShardingMethodEnum = "USER" + DedicatedShardedDatabaseShardingMethodSystem DedicatedShardedDatabaseShardingMethodEnum = "SYSTEM" +) + +var mappingDedicatedShardedDatabaseShardingMethodEnum = map[string]DedicatedShardedDatabaseShardingMethodEnum{ + "USER": DedicatedShardedDatabaseShardingMethodUser, + "SYSTEM": DedicatedShardedDatabaseShardingMethodSystem, +} + +var mappingDedicatedShardedDatabaseShardingMethodEnumLowerCase = map[string]DedicatedShardedDatabaseShardingMethodEnum{ + "user": DedicatedShardedDatabaseShardingMethodUser, + "system": DedicatedShardedDatabaseShardingMethodSystem, +} + +// GetDedicatedShardedDatabaseShardingMethodEnumValues Enumerates the set of values for DedicatedShardedDatabaseShardingMethodEnum +func GetDedicatedShardedDatabaseShardingMethodEnumValues() []DedicatedShardedDatabaseShardingMethodEnum { + values := make([]DedicatedShardedDatabaseShardingMethodEnum, 0) + for _, v := range mappingDedicatedShardedDatabaseShardingMethodEnum { + values = append(values, v) + } + return values +} + +// GetDedicatedShardedDatabaseShardingMethodEnumStringValues Enumerates the set of values in String for DedicatedShardedDatabaseShardingMethodEnum +func GetDedicatedShardedDatabaseShardingMethodEnumStringValues() []string { + return []string{ + "USER", + "SYSTEM", + } +} + +// GetMappingDedicatedShardedDatabaseShardingMethodEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDedicatedShardedDatabaseShardingMethodEnum(val string) (DedicatedShardedDatabaseShardingMethodEnum, bool) { + enum, ok := mappingDedicatedShardedDatabaseShardingMethodEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/dedicated_sharded_database_summary.go b/globallydistributeddatabase/dedicated_sharded_database_summary.go new file mode 100644 index 0000000000..dce2ec4616 --- /dev/null +++ b/globallydistributeddatabase/dedicated_sharded_database_summary.go @@ -0,0 +1,272 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DedicatedShardedDatabaseSummary Summary of ATP-D based sharded database. +type DedicatedShardedDatabaseSummary struct { + + // Sharded Database identifier + Id *string `mandatory:"true" json:"id"` + + // Identifier of the compartment where sharded database exists. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Oracle sharded database display name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the the Sharded Database was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the Sharded Database was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Detailed message for the lifecycle state. + LifecycleStateDetails *string `mandatory:"true" json:"lifecycleStateDetails"` + + // The character set for the sharded database. + CharacterSet *string `mandatory:"true" json:"characterSet"` + + // The national character set for the sharded database. + NcharacterSet *string `mandatory:"true" json:"ncharacterSet"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The certificate common name used in all cloudAutonomousVmClusters for the sharded database topology. Eg. Production. + // All the clusters used in one sharded database topology shall have same CABundle setup. Valid characterset for + // clusterCertificateCommonName include uppercase or lowercase letters, numbers, hyphens, underscores, and period. + ClusterCertificateCommonName *string `mandatory:"false" json:"clusterCertificateCommonName"` + + // The default number of unique chunks in a shardspace. The value of chunks must be + // greater than 2 times the size of the largest shardgroup in any shardspace. + Chunks *int `mandatory:"false" json:"chunks"` + + // Oracle Database version of the Autonomous Container Database. + DbVersion *string `mandatory:"false" json:"dbVersion"` + + // The listener port number for the sharded database. + ListenerPort *int `mandatory:"false" json:"listenerPort"` + + // The TLS listener port number for sharded database. + ListenerPortTls *int `mandatory:"false" json:"listenerPortTls"` + + // Ons local port number. + OnsPortLocal *int `mandatory:"false" json:"onsPortLocal"` + + // Ons remote port number. + OnsPortRemote *int `mandatory:"false" json:"onsPortRemote"` + + // Name prefix for the sharded databases. + Prefix *string `mandatory:"false" json:"prefix"` + + // Total cpu count usage for shards and catalogs of the sharded database. + TotalCpuCount *int `mandatory:"false" json:"totalCpuCount"` + + // The aggregarted value of dataStorageSizeInGbs for all shards and catalogs. + TotalDataStorageSizeInGbs *float64 `mandatory:"false" json:"totalDataStorageSizeInGbs"` + + // Possible workload types. + DbWorkload DedicatedShardedDatabaseSummaryDbWorkloadEnum `mandatory:"true" json:"dbWorkload"` + + // Sharding Method. + ShardingMethod DedicatedShardedDatabaseSummaryShardingMethodEnum `mandatory:"true" json:"shardingMethod"` + + // Lifecycle state of sharded database. + LifecycleState ShardedDatabaseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m DedicatedShardedDatabaseSummary) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m DedicatedShardedDatabaseSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m DedicatedShardedDatabaseSummary) GetDisplayName() *string { + return m.DisplayName +} + +// GetTimeCreated returns TimeCreated +func (m DedicatedShardedDatabaseSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m DedicatedShardedDatabaseSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m DedicatedShardedDatabaseSummary) GetLifecycleState() ShardedDatabaseLifecycleStateEnum { + return m.LifecycleState +} + +// GetLifecycleStateDetails returns LifecycleStateDetails +func (m DedicatedShardedDatabaseSummary) GetLifecycleStateDetails() *string { + return m.LifecycleStateDetails +} + +// GetFreeformTags returns FreeformTags +func (m DedicatedShardedDatabaseSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m DedicatedShardedDatabaseSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m DedicatedShardedDatabaseSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m DedicatedShardedDatabaseSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DedicatedShardedDatabaseSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDedicatedShardedDatabaseSummaryDbWorkloadEnum(string(m.DbWorkload)); !ok && m.DbWorkload != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DbWorkload: %s. Supported values are: %s.", m.DbWorkload, strings.Join(GetDedicatedShardedDatabaseSummaryDbWorkloadEnumStringValues(), ","))) + } + if _, ok := GetMappingDedicatedShardedDatabaseSummaryShardingMethodEnum(string(m.ShardingMethod)); !ok && m.ShardingMethod != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ShardingMethod: %s. Supported values are: %s.", m.ShardingMethod, strings.Join(GetDedicatedShardedDatabaseSummaryShardingMethodEnumStringValues(), ","))) + } + + if _, ok := GetMappingShardedDatabaseLifecycleStateEnum(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(GetShardedDatabaseLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DedicatedShardedDatabaseSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDedicatedShardedDatabaseSummary DedicatedShardedDatabaseSummary + s := struct { + DiscriminatorParam string `json:"dbDeploymentType"` + MarshalTypeDedicatedShardedDatabaseSummary + }{ + "DEDICATED", + (MarshalTypeDedicatedShardedDatabaseSummary)(m), + } + + return json.Marshal(&s) +} + +// DedicatedShardedDatabaseSummaryDbWorkloadEnum Enum with underlying type: string +type DedicatedShardedDatabaseSummaryDbWorkloadEnum string + +// Set of constants representing the allowable values for DedicatedShardedDatabaseSummaryDbWorkloadEnum +const ( + DedicatedShardedDatabaseSummaryDbWorkloadOltp DedicatedShardedDatabaseSummaryDbWorkloadEnum = "OLTP" + DedicatedShardedDatabaseSummaryDbWorkloadDw DedicatedShardedDatabaseSummaryDbWorkloadEnum = "DW" +) + +var mappingDedicatedShardedDatabaseSummaryDbWorkloadEnum = map[string]DedicatedShardedDatabaseSummaryDbWorkloadEnum{ + "OLTP": DedicatedShardedDatabaseSummaryDbWorkloadOltp, + "DW": DedicatedShardedDatabaseSummaryDbWorkloadDw, +} + +var mappingDedicatedShardedDatabaseSummaryDbWorkloadEnumLowerCase = map[string]DedicatedShardedDatabaseSummaryDbWorkloadEnum{ + "oltp": DedicatedShardedDatabaseSummaryDbWorkloadOltp, + "dw": DedicatedShardedDatabaseSummaryDbWorkloadDw, +} + +// GetDedicatedShardedDatabaseSummaryDbWorkloadEnumValues Enumerates the set of values for DedicatedShardedDatabaseSummaryDbWorkloadEnum +func GetDedicatedShardedDatabaseSummaryDbWorkloadEnumValues() []DedicatedShardedDatabaseSummaryDbWorkloadEnum { + values := make([]DedicatedShardedDatabaseSummaryDbWorkloadEnum, 0) + for _, v := range mappingDedicatedShardedDatabaseSummaryDbWorkloadEnum { + values = append(values, v) + } + return values +} + +// GetDedicatedShardedDatabaseSummaryDbWorkloadEnumStringValues Enumerates the set of values in String for DedicatedShardedDatabaseSummaryDbWorkloadEnum +func GetDedicatedShardedDatabaseSummaryDbWorkloadEnumStringValues() []string { + return []string{ + "OLTP", + "DW", + } +} + +// GetMappingDedicatedShardedDatabaseSummaryDbWorkloadEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDedicatedShardedDatabaseSummaryDbWorkloadEnum(val string) (DedicatedShardedDatabaseSummaryDbWorkloadEnum, bool) { + enum, ok := mappingDedicatedShardedDatabaseSummaryDbWorkloadEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// DedicatedShardedDatabaseSummaryShardingMethodEnum Enum with underlying type: string +type DedicatedShardedDatabaseSummaryShardingMethodEnum string + +// Set of constants representing the allowable values for DedicatedShardedDatabaseSummaryShardingMethodEnum +const ( + DedicatedShardedDatabaseSummaryShardingMethodUser DedicatedShardedDatabaseSummaryShardingMethodEnum = "USER" + DedicatedShardedDatabaseSummaryShardingMethodSystem DedicatedShardedDatabaseSummaryShardingMethodEnum = "SYSTEM" +) + +var mappingDedicatedShardedDatabaseSummaryShardingMethodEnum = map[string]DedicatedShardedDatabaseSummaryShardingMethodEnum{ + "USER": DedicatedShardedDatabaseSummaryShardingMethodUser, + "SYSTEM": DedicatedShardedDatabaseSummaryShardingMethodSystem, +} + +var mappingDedicatedShardedDatabaseSummaryShardingMethodEnumLowerCase = map[string]DedicatedShardedDatabaseSummaryShardingMethodEnum{ + "user": DedicatedShardedDatabaseSummaryShardingMethodUser, + "system": DedicatedShardedDatabaseSummaryShardingMethodSystem, +} + +// GetDedicatedShardedDatabaseSummaryShardingMethodEnumValues Enumerates the set of values for DedicatedShardedDatabaseSummaryShardingMethodEnum +func GetDedicatedShardedDatabaseSummaryShardingMethodEnumValues() []DedicatedShardedDatabaseSummaryShardingMethodEnum { + values := make([]DedicatedShardedDatabaseSummaryShardingMethodEnum, 0) + for _, v := range mappingDedicatedShardedDatabaseSummaryShardingMethodEnum { + values = append(values, v) + } + return values +} + +// GetDedicatedShardedDatabaseSummaryShardingMethodEnumStringValues Enumerates the set of values in String for DedicatedShardedDatabaseSummaryShardingMethodEnum +func GetDedicatedShardedDatabaseSummaryShardingMethodEnumStringValues() []string { + return []string{ + "USER", + "SYSTEM", + } +} + +// GetMappingDedicatedShardedDatabaseSummaryShardingMethodEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDedicatedShardedDatabaseSummaryShardingMethodEnum(val string) (DedicatedShardedDatabaseSummaryShardingMethodEnum, bool) { + enum, ok := mappingDedicatedShardedDatabaseSummaryShardingMethodEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/delete_private_endpoint_request_response.go b/globallydistributeddatabase/delete_private_endpoint_request_response.go new file mode 100644 index 0000000000..c94f1b5037 --- /dev/null +++ b/globallydistributeddatabase/delete_private_endpoint_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 globallydistributeddatabase + +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/globallydistributeddatabase/DeletePrivateEndpoint.go.html to see an example of how to use DeletePrivateEndpointRequest. +type DeletePrivateEndpointRequest struct { + + // Oracle Sharded Database PrivateEndpoint identifier + PrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"privateEndpointId"` + + // 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 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 + +} + +// 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 work. You can use this to query its status. + 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 DeletePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeletePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/delete_sharded_database_request_response.go b/globallydistributeddatabase/delete_sharded_database_request_response.go new file mode 100644 index 0000000000..fc78178e01 --- /dev/null +++ b/globallydistributeddatabase/delete_sharded_database_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteShardedDatabaseRequest wrapper for the DeleteShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/DeleteShardedDatabase.go.html to see an example of how to use DeleteShardedDatabaseRequest. +type DeleteShardedDatabaseRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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 DeleteShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteShardedDatabaseRequest) 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 DeleteShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteShardedDatabaseRequest) 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 DeleteShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteShardedDatabaseResponse wrapper for the DeleteShardedDatabase operation +type DeleteShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 DeleteShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/download_gsm_certificate_signing_request_request_response.go b/globallydistributeddatabase/download_gsm_certificate_signing_request_request_response.go new file mode 100644 index 0000000000..2b10b4e3ad --- /dev/null +++ b/globallydistributeddatabase/download_gsm_certificate_signing_request_request_response.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// DownloadGsmCertificateSigningRequestRequest wrapper for the DownloadGsmCertificateSigningRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/DownloadGsmCertificateSigningRequest.go.html to see an example of how to use DownloadGsmCertificateSigningRequestRequest. +type DownloadGsmCertificateSigningRequestRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DownloadGsmCertificateSigningRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DownloadGsmCertificateSigningRequestRequest) 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 DownloadGsmCertificateSigningRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DownloadGsmCertificateSigningRequestRequest) 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 DownloadGsmCertificateSigningRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DownloadGsmCertificateSigningRequestResponse wrapper for the DownloadGsmCertificateSigningRequest operation +type DownloadGsmCertificateSigningRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Size of the file. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // The date and time the certificate signing request was created. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` +} + +func (response DownloadGsmCertificateSigningRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DownloadGsmCertificateSigningRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/fetch_connection_string_request_response.go b/globallydistributeddatabase/fetch_connection_string_request_response.go new file mode 100644 index 0000000000..b01f7c88eb --- /dev/null +++ b/globallydistributeddatabase/fetch_connection_string_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// FetchConnectionStringRequest wrapper for the FetchConnectionString operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/FetchConnectionString.go.html to see an example of how to use FetchConnectionStringRequest. +type FetchConnectionStringRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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"` + + // 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 FetchConnectionStringRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request FetchConnectionStringRequest) 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 FetchConnectionStringRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request FetchConnectionStringRequest) 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 FetchConnectionStringRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FetchConnectionStringResponse wrapper for the FetchConnectionString operation +type FetchConnectionStringResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ConnectionString instance + ConnectionString `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 FetchConnectionStringResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response FetchConnectionStringResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/fetch_shardable_cloud_autonomous_vm_clusters_details.go b/globallydistributeddatabase/fetch_shardable_cloud_autonomous_vm_clusters_details.go new file mode 100644 index 0000000000..03d730e29b --- /dev/null +++ b/globallydistributeddatabase/fetch_shardable_cloud_autonomous_vm_clusters_details.go @@ -0,0 +1,127 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FetchShardableCloudAutonomousVmClustersDetails Details required for fetch sharded cloud autonomous vm clusters. +type FetchShardableCloudAutonomousVmClustersDetails struct { + + // Compartment id of cloud autonomous vm clusters. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Lifecycle states for shardable Cloud autonomous vm cluster. + LifecycleState FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // Detailed message for the lifecycle state. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // List only clusters for which atleast given minimum CDB count is available. + MinimumAvailableCdbCount *int `mandatory:"false" json:"minimumAvailableCdbCount"` + + // Flag to indicate of response shall also include clusters for which no more capacity is left to create new resources. + AreDepletedClustersIncluded *bool `mandatory:"false" json:"areDepletedClustersIncluded"` + + // Region code of regions for which sharded cloud autonomous vm clusters need to be fetched. + Regions []string `mandatory:"false" json:"regions"` +} + +func (m FetchShardableCloudAutonomousVmClustersDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m FetchShardableCloudAutonomousVmClustersDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum(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(GetFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum Enum with underlying type: string +type FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum string + +// Set of constants representing the allowable values for FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum +const ( + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateActive FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "ACTIVE" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateFailed FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "FAILED" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateNeedsAttention FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "NEEDS_ATTENTION" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateInactive FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "INACTIVE" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateDeleting FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "DELETING" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateDeleted FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "DELETED" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateUpdating FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "UPDATING" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateCreating FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "CREATING" + FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateUnavailable FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = "UNAVAILABLE" +) + +var mappingFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum = map[string]FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum{ + "ACTIVE": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateActive, + "FAILED": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateFailed, + "NEEDS_ATTENTION": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateNeedsAttention, + "INACTIVE": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateInactive, + "DELETING": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateDeleting, + "DELETED": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateDeleted, + "UPDATING": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateUpdating, + "CREATING": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateCreating, + "UNAVAILABLE": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateUnavailable, +} + +var mappingFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnumLowerCase = map[string]FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum{ + "active": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateActive, + "failed": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateFailed, + "needs_attention": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateNeedsAttention, + "inactive": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateInactive, + "deleting": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateDeleting, + "deleted": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateDeleted, + "updating": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateUpdating, + "creating": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateCreating, + "unavailable": FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateUnavailable, +} + +// GetFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnumValues Enumerates the set of values for FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum +func GetFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnumValues() []FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum { + values := make([]FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum, 0) + for _, v := range mappingFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnumStringValues Enumerates the set of values in String for FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum +func GetFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "FAILED", + "NEEDS_ATTENTION", + "INACTIVE", + "DELETING", + "DELETED", + "UPDATING", + "CREATING", + "UNAVAILABLE", + } +} + +// GetMappingFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum(val string) (FetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnum, bool) { + enum, ok := mappingFetchShardableCloudAutonomousVmClustersDetailsLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/fetch_shardable_cloud_autonomous_vm_clusters_request_response.go b/globallydistributeddatabase/fetch_shardable_cloud_autonomous_vm_clusters_request_response.go new file mode 100644 index 0000000000..b5c7096930 --- /dev/null +++ b/globallydistributeddatabase/fetch_shardable_cloud_autonomous_vm_clusters_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// FetchShardableCloudAutonomousVmClustersRequest wrapper for the FetchShardableCloudAutonomousVmClusters operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/FetchShardableCloudAutonomousVmClusters.go.html to see an example of how to use FetchShardableCloudAutonomousVmClustersRequest. +type FetchShardableCloudAutonomousVmClustersRequest struct { + + // Request payload to get sharded cloud autonomous vm clusters. + FetchShardableCloudAutonomousVmClustersDetails `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 FetchShardableCloudAutonomousVmClustersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request FetchShardableCloudAutonomousVmClustersRequest) 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 FetchShardableCloudAutonomousVmClustersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request FetchShardableCloudAutonomousVmClustersRequest) 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 FetchShardableCloudAutonomousVmClustersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FetchShardableCloudAutonomousVmClustersResponse wrapper for the FetchShardableCloudAutonomousVmClusters operation +type FetchShardableCloudAutonomousVmClustersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ShardableCloudAutonomousVmClusters instance + ShardableCloudAutonomousVmClusters `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 FetchShardableCloudAutonomousVmClustersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response FetchShardableCloudAutonomousVmClustersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/generate_gsm_certificate_signing_request_request_response.go b/globallydistributeddatabase/generate_gsm_certificate_signing_request_request_response.go new file mode 100644 index 0000000000..e5f11eac8d --- /dev/null +++ b/globallydistributeddatabase/generate_gsm_certificate_signing_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GenerateGsmCertificateSigningRequestRequest wrapper for the GenerateGsmCertificateSigningRequest operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GenerateGsmCertificateSigningRequest.go.html to see an example of how to use GenerateGsmCertificateSigningRequestRequest. +type GenerateGsmCertificateSigningRequestRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GenerateGsmCertificateSigningRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GenerateGsmCertificateSigningRequestRequest) 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 GenerateGsmCertificateSigningRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GenerateGsmCertificateSigningRequestRequest) 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 GenerateGsmCertificateSigningRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GenerateGsmCertificateSigningRequestResponse wrapper for the GenerateGsmCertificateSigningRequest operation +type GenerateGsmCertificateSigningRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 GenerateGsmCertificateSigningRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GenerateGsmCertificateSigningRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/generate_wallet_details.go b/globallydistributeddatabase/generate_wallet_details.go new file mode 100644 index 0000000000..c720df0252 --- /dev/null +++ b/globallydistributeddatabase/generate_wallet_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GenerateWalletDetails Details to create and download an Oracle Sharded Database wallet. +type GenerateWalletDetails struct { + + // The password to encrypt the keys inside the wallet. The password must be at least 8 characters long and must include at least 1 letter and either 1 numeric character or 1 special character. + Password *string `mandatory:"true" json:"password"` +} + +func (m GenerateWalletDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m GenerateWalletDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/generate_wallet_request_response.go b/globallydistributeddatabase/generate_wallet_request_response.go new file mode 100644 index 0000000000..a93186b7bb --- /dev/null +++ b/globallydistributeddatabase/generate_wallet_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// GenerateWalletRequest wrapper for the GenerateWallet operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GenerateWallet.go.html to see an example of how to use GenerateWalletRequest. +type GenerateWalletRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // Details for generating sharded database wallet. + GenerateWalletDetails `contributesTo:"body"` + + // 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GenerateWalletRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GenerateWalletRequest) 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 GenerateWalletRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GenerateWalletRequest) 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 GenerateWalletRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GenerateWalletResponse wrapper for the GenerateWallet operation +type GenerateWalletResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Size of the file. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // The date and time the wallet was created. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` +} + +func (response GenerateWalletResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GenerateWalletResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/get_media_workflow_job_fact_request_response.go b/globallydistributeddatabase/get_private_endpoint_request_response.go similarity index 61% rename from mediaservices/get_media_workflow_job_fact_request_response.go rename to globallydistributeddatabase/get_private_endpoint_request_response.go index 53e13f11f5..7424987947 100644 --- a/mediaservices/get_media_workflow_job_fact_request_response.go +++ b/globallydistributeddatabase/get_private_endpoint_request_response.go @@ -2,7 +2,7 @@ // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 mediaservices +package globallydistributeddatabase import ( "fmt" @@ -11,18 +11,15 @@ import ( "strings" ) -// GetMediaWorkflowJobFactRequest wrapper for the GetMediaWorkflowJobFact operation +// GetPrivateEndpointRequest wrapper for the GetPrivateEndpoint operation // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflowJobFact.go.html to see an example of how to use GetMediaWorkflowJobFactRequest. -type GetMediaWorkflowJobFactRequest struct { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GetPrivateEndpoint.go.html to see an example of how to use GetPrivateEndpointRequest. +type GetPrivateEndpointRequest struct { - // Unique MediaWorkflowJob identifier. - MediaWorkflowJobId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowJobId"` - - // Identifier of the MediaWorkflowJobFact within a MediaWorkflowJob. - Key *int `mandatory:"true" contributesTo:"path" name:"key"` + // Oracle Sharded Database PrivateEndpoint identifier + PrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"privateEndpointId"` // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` @@ -32,12 +29,12 @@ type GetMediaWorkflowJobFactRequest struct { RequestMetadata common.RequestMetadata } -func (request GetMediaWorkflowJobFactRequest) String() string { +func (request GetPrivateEndpointRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface -func (request GetMediaWorkflowJobFactRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { +func (request GetPrivateEndpointRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { _, err := request.ValidateEnumValue() if err != nil { @@ -47,21 +44,21 @@ func (request GetMediaWorkflowJobFactRequest) HTTPRequest(method, path string, b } // BinaryRequestBody implements the OCIRequest interface -func (request GetMediaWorkflowJobFactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { +func (request GetPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { return nil, false } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. -func (request GetMediaWorkflowJobFactRequest) RetryPolicy() *common.RetryPolicy { +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 GetMediaWorkflowJobFactRequest) ValidateEnumValue() (bool, error) { +func (request GetPrivateEndpointRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -69,28 +66,28 @@ func (request GetMediaWorkflowJobFactRequest) ValidateEnumValue() (bool, error) return false, nil } -// GetMediaWorkflowJobFactResponse wrapper for the GetMediaWorkflowJobFact operation -type GetMediaWorkflowJobFactResponse struct { +// GetPrivateEndpointResponse wrapper for the GetPrivateEndpoint operation +type GetPrivateEndpointResponse struct { // The underlying http response RawResponse *http.Response - // The MediaWorkflowJobFact instance - MediaWorkflowJobFact `presentIn:"body"` - - // For optimistic concurrency control. See `if-match`. - Etag *string `presentIn:"header" name:"etag"` + // The PrivateEndpoint instance + PrivateEndpoint `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 GetMediaWorkflowJobFactResponse) String() string { +func (response GetPrivateEndpointResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface -func (response GetMediaWorkflowJobFactResponse) HTTPResponse() *http.Response { +func (response GetPrivateEndpointResponse) HTTPResponse() *http.Response { return response.RawResponse } diff --git a/globallydistributeddatabase/get_sharded_database_request_response.go b/globallydistributeddatabase/get_sharded_database_request_response.go new file mode 100644 index 0000000000..11ea0feec0 --- /dev/null +++ b/globallydistributeddatabase/get_sharded_database_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetShardedDatabaseRequest wrapper for the GetShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GetShardedDatabase.go.html to see an example of how to use GetShardedDatabaseRequest. +type GetShardedDatabaseRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // Comma separated names of argument corresponding to which metadata need to be retrived, namely VM_CLUSTER_INFO, ADDITIONAL_RESOURCE_INFO. + // An example is metadata=VM_CLUSTER_INFO,ADDITIONAL_RESOURCE_INFO. + Metadata *string `mandatory:"false" contributesTo:"query" name:"metadata"` + + // 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 GetShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetShardedDatabaseRequest) 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 GetShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetShardedDatabaseRequest) 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 GetShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetShardedDatabaseResponse wrapper for the GetShardedDatabase operation +type GetShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ShardedDatabase instance + ShardedDatabase `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 GetShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/get_work_request_request_response.go b/globallydistributeddatabase/get_work_request_request_response.go new file mode 100644 index 0000000000..8f0b1cfe1e --- /dev/null +++ b/globallydistributeddatabase/get_work_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 globallydistributeddatabase + +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/globallydistributeddatabase/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The ID of the asynchronous request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/globallydistributeddatabase_shardeddatabaseservice_client.go b/globallydistributeddatabase/globallydistributeddatabase_shardeddatabaseservice_client.go new file mode 100644 index 0000000000..1cc396c678 --- /dev/null +++ b/globallydistributeddatabase/globallydistributeddatabase_shardeddatabaseservice_client.go @@ -0,0 +1,1883 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ShardedDatabaseServiceClient a client for ShardedDatabaseService +type ShardedDatabaseServiceClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewShardedDatabaseServiceClientWithConfigurationProvider Creates a new default ShardedDatabaseService client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewShardedDatabaseServiceClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ShardedDatabaseServiceClient, err error) { + if enabled := common.CheckForEnabledServices("globallydistributeddatabase"); !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 newShardedDatabaseServiceClientFromBaseClient(baseClient, provider) +} + +// NewShardedDatabaseServiceClientWithOboToken Creates a new default ShardedDatabaseService 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 NewShardedDatabaseServiceClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ShardedDatabaseServiceClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newShardedDatabaseServiceClientFromBaseClient(baseClient, configProvider) +} + +func newShardedDatabaseServiceClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ShardedDatabaseServiceClient, err error) { + // ShardedDatabaseService service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ShardedDatabaseService")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ShardedDatabaseServiceClient{BaseClient: baseClient} + client.BasePath = "20230301" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ShardedDatabaseServiceClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("globallydistributeddatabase", "https://globaldb.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ShardedDatabaseServiceClient) 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 *ShardedDatabaseServiceClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ChangePrivateEndpointCompartment Move the private endpoint to the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ChangePrivateEndpointCompartment.go.html to see an example of how to use ChangePrivateEndpointCompartment API. +// A default retry strategy applies to this operation ChangePrivateEndpointCompartment() +func (client ShardedDatabaseServiceClient) ChangePrivateEndpointCompartment(ctx context.Context, request ChangePrivateEndpointCompartmentRequest) (response ChangePrivateEndpointCompartmentResponse, 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.changePrivateEndpointCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangePrivateEndpointCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangePrivateEndpointCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangePrivateEndpointCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangePrivateEndpointCompartmentResponse") + } + return +} + +// changePrivateEndpointCompartment implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) changePrivateEndpointCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/privateEndpoints/{privateEndpointId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangePrivateEndpointCompartmentResponse + 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, "ShardedDatabaseService", "ChangePrivateEndpointCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeShardedDatabaseCompartment Move the sharded database database and its dependent resources to the specified compartment. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ChangeShardedDatabaseCompartment.go.html to see an example of how to use ChangeShardedDatabaseCompartment API. +// A default retry strategy applies to this operation ChangeShardedDatabaseCompartment() +func (client ShardedDatabaseServiceClient) ChangeShardedDatabaseCompartment(ctx context.Context, request ChangeShardedDatabaseCompartmentRequest) (response ChangeShardedDatabaseCompartmentResponse, 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.changeShardedDatabaseCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeShardedDatabaseCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeShardedDatabaseCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeShardedDatabaseCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeShardedDatabaseCompartmentResponse") + } + return +} + +// changeShardedDatabaseCompartment implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) changeShardedDatabaseCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeShardedDatabaseCompartmentResponse + 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, "ShardedDatabaseService", "ChangeShardedDatabaseCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ConfigureShardedDatabaseGsms Configure new Global Service Manager(GSM aka shard manager) instances for the sharded database. Specify the names +// of old GSM instances that need to be replaced via parameter oldGsmNames in the request payload. Also specify +// whether rotated GSM instances shall be provisioned with latest image of GSM software or the image used by +// existing GSM instances shall be used. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ConfigureShardedDatabaseGsms.go.html to see an example of how to use ConfigureShardedDatabaseGsms API. +// A default retry strategy applies to this operation ConfigureShardedDatabaseGsms() +func (client ShardedDatabaseServiceClient) ConfigureShardedDatabaseGsms(ctx context.Context, request ConfigureShardedDatabaseGsmsRequest) (response ConfigureShardedDatabaseGsmsResponse, 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.configureShardedDatabaseGsms, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ConfigureShardedDatabaseGsmsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ConfigureShardedDatabaseGsmsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ConfigureShardedDatabaseGsmsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConfigureShardedDatabaseGsmsResponse") + } + return +} + +// configureShardedDatabaseGsms implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) configureShardedDatabaseGsms(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/configureGsms", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ConfigureShardedDatabaseGsmsResponse + 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, "ShardedDatabaseService", "ConfigureShardedDatabaseGsms", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ConfigureSharding Once all components of sharded database are provisioned, and signed GSM certificates are successfully uploaded, this +// api shall be invoked to configure sharding on the sharded database. Note that this 'ConfigureSharding' API also needs to be +// invoked after successfully adding a new shard to the sharded database using PATCH api. If this API is not +// invoked after successfully adding a new shard, then that new shard will not be a participant in sharding topology of +// the sharded database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ConfigureSharding.go.html to see an example of how to use ConfigureSharding API. +// A default retry strategy applies to this operation ConfigureSharding() +func (client ShardedDatabaseServiceClient) ConfigureSharding(ctx context.Context, request ConfigureShardingRequest) (response ConfigureShardingResponse, 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.configureSharding, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ConfigureShardingResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ConfigureShardingResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ConfigureShardingResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ConfigureShardingResponse") + } + return +} + +// configureSharding implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) configureSharding(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/configureSharding", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ConfigureShardingResponse + 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, "ShardedDatabaseService", "ConfigureSharding", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreatePrivateEndpoint Creates a PrivateEndpoint. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/CreatePrivateEndpoint.go.html to see an example of how to use CreatePrivateEndpoint API. +// A default retry strategy applies to this operation CreatePrivateEndpoint() +func (client ShardedDatabaseServiceClient) 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() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + 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 ShardedDatabaseServiceClient) createPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/privateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreatePrivateEndpointResponse + 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, "ShardedDatabaseService", "CreatePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateShardedDatabase Creates a Sharded Database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/CreateShardedDatabase.go.html to see an example of how to use CreateShardedDatabase API. +// A default retry strategy applies to this operation CreateShardedDatabase() +func (client ShardedDatabaseServiceClient) CreateShardedDatabase(ctx context.Context, request CreateShardedDatabaseRequest) (response CreateShardedDatabaseResponse, 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.createShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateShardedDatabaseResponse") + } + return +} + +// createShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) createShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateShardedDatabaseResponse + 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, "ShardedDatabaseService", "CreateShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &shardeddatabase{}) + return response, err +} + +// DeletePrivateEndpoint Delete the given private endpoint. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/DeletePrivateEndpoint.go.html to see an example of how to use DeletePrivateEndpoint API. +// A default retry strategy applies to this operation DeletePrivateEndpoint() +func (client ShardedDatabaseServiceClient) 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() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + 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 ShardedDatabaseServiceClient) deletePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/privateEndpoints/{privateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeletePrivateEndpointResponse + 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, "ShardedDatabaseService", "DeletePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteShardedDatabase Terminate the given sharded databases. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/DeleteShardedDatabase.go.html to see an example of how to use DeleteShardedDatabase API. +// A default retry strategy applies to this operation DeleteShardedDatabase() +func (client ShardedDatabaseServiceClient) DeleteShardedDatabase(ctx context.Context, request DeleteShardedDatabaseRequest) (response DeleteShardedDatabaseResponse, 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.deleteShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteShardedDatabaseResponse") + } + return +} + +// deleteShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) deleteShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/shardedDatabases/{shardedDatabaseId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteShardedDatabaseResponse + 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, "ShardedDatabaseService", "DeleteShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DownloadGsmCertificateSigningRequest Generate the common certificate signing request for GSMs. Download the .csr file from +// API response. Users can use this .csr file to generate the CA signed certificate, and as a next step +// use 'uploadSignedCertificateAndGenerateWallet' API to upload the CA signed certificate to GSM, and +// generate wallets for the GSM instances of the sharded database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/DownloadGsmCertificateSigningRequest.go.html to see an example of how to use DownloadGsmCertificateSigningRequest API. +// A default retry strategy applies to this operation DownloadGsmCertificateSigningRequest() +func (client ShardedDatabaseServiceClient) DownloadGsmCertificateSigningRequest(ctx context.Context, request DownloadGsmCertificateSigningRequestRequest) (response DownloadGsmCertificateSigningRequestResponse, 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.downloadGsmCertificateSigningRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DownloadGsmCertificateSigningRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DownloadGsmCertificateSigningRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DownloadGsmCertificateSigningRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DownloadGsmCertificateSigningRequestResponse") + } + return +} + +// downloadGsmCertificateSigningRequest implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) downloadGsmCertificateSigningRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/downloadGsmCertificateSigningRequest", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DownloadGsmCertificateSigningRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ShardedDatabaseService", "DownloadGsmCertificateSigningRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// FetchConnectionString Gets the Sharded Database Connection Strings. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/FetchConnectionString.go.html to see an example of how to use FetchConnectionString API. +// A default retry strategy applies to this operation FetchConnectionString() +func (client ShardedDatabaseServiceClient) FetchConnectionString(ctx context.Context, request FetchConnectionStringRequest) (response FetchConnectionStringResponse, 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.fetchConnectionString, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = FetchConnectionStringResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = FetchConnectionStringResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(FetchConnectionStringResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into FetchConnectionStringResponse") + } + return +} + +// fetchConnectionString implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) fetchConnectionString(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/getConnectionString", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response FetchConnectionStringResponse + 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, "ShardedDatabaseService", "FetchConnectionString", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// FetchShardableCloudAutonomousVmClusters List of cloudAutonomousVMClusters for the given tenancy, that can be sharded. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/FetchShardableCloudAutonomousVmClusters.go.html to see an example of how to use FetchShardableCloudAutonomousVmClusters API. +// A default retry strategy applies to this operation FetchShardableCloudAutonomousVmClusters() +func (client ShardedDatabaseServiceClient) FetchShardableCloudAutonomousVmClusters(ctx context.Context, request FetchShardableCloudAutonomousVmClustersRequest) (response FetchShardableCloudAutonomousVmClustersResponse, 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.fetchShardableCloudAutonomousVmClusters, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = FetchShardableCloudAutonomousVmClustersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = FetchShardableCloudAutonomousVmClustersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(FetchShardableCloudAutonomousVmClustersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into FetchShardableCloudAutonomousVmClustersResponse") + } + return +} + +// fetchShardableCloudAutonomousVmClusters implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) fetchShardableCloudAutonomousVmClusters(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/actions/listShardableCloudAutonomousVmClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response FetchShardableCloudAutonomousVmClustersResponse + 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, "ShardedDatabaseService", "FetchShardableCloudAutonomousVmClusters", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GenerateGsmCertificateSigningRequest Generate the certificate signing request for GSM instances of the sharded database. Once certificate signing +// request is generated, then customers can download the certificate signing request using +// 'downloadGsmCertificateSigningRequest' api call. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GenerateGsmCertificateSigningRequest.go.html to see an example of how to use GenerateGsmCertificateSigningRequest API. +// A default retry strategy applies to this operation GenerateGsmCertificateSigningRequest() +func (client ShardedDatabaseServiceClient) GenerateGsmCertificateSigningRequest(ctx context.Context, request GenerateGsmCertificateSigningRequestRequest) (response GenerateGsmCertificateSigningRequestResponse, 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.generateGsmCertificateSigningRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GenerateGsmCertificateSigningRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GenerateGsmCertificateSigningRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GenerateGsmCertificateSigningRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GenerateGsmCertificateSigningRequestResponse") + } + return +} + +// generateGsmCertificateSigningRequest implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) generateGsmCertificateSigningRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/generateGsmCertificateSigningRequest", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GenerateGsmCertificateSigningRequestResponse + 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, "ShardedDatabaseService", "GenerateGsmCertificateSigningRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GenerateWallet Generate the wallet associated with sharded database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GenerateWallet.go.html to see an example of how to use GenerateWallet API. +// A default retry strategy applies to this operation GenerateWallet() +func (client ShardedDatabaseServiceClient) GenerateWallet(ctx context.Context, request GenerateWalletRequest) (response GenerateWalletResponse, 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.generateWallet, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GenerateWalletResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GenerateWalletResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GenerateWalletResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GenerateWalletResponse") + } + return +} + +// generateWallet implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) generateWallet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/generateWallet", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GenerateWalletResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ShardedDatabaseService", "GenerateWallet", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPrivateEndpoint Get the PrivateEndpoint resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GetPrivateEndpoint.go.html to see an example of how to use GetPrivateEndpoint API. +// A default retry strategy applies to this operation GetPrivateEndpoint() +func (client ShardedDatabaseServiceClient) 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 ShardedDatabaseServiceClient) getPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/privateEndpoints/{privateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetPrivateEndpointResponse + 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, "ShardedDatabaseService", "GetPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetShardedDatabase Gets the details of the Sharded database identified by given id. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/GetShardedDatabase.go.html to see an example of how to use GetShardedDatabase API. +// A default retry strategy applies to this operation GetShardedDatabase() +func (client ShardedDatabaseServiceClient) GetShardedDatabase(ctx context.Context, request GetShardedDatabaseRequest) (response GetShardedDatabaseResponse, 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.getShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetShardedDatabaseResponse") + } + return +} + +// getShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) getShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/shardedDatabases/{shardedDatabaseId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetShardedDatabaseResponse + 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, "ShardedDatabaseService", "GetShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &shardeddatabase{}) + return response, err +} + +// 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/globallydistributeddatabase/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client ShardedDatabaseServiceClient) 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 ShardedDatabaseServiceClient) 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, "ShardedDatabaseService", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListPrivateEndpoints List of PrivateEndpoints. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ListPrivateEndpoints.go.html to see an example of how to use ListPrivateEndpoints API. +// A default retry strategy applies to this operation ListPrivateEndpoints() +func (client ShardedDatabaseServiceClient) 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 ShardedDatabaseServiceClient) listPrivateEndpoints(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/privateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListPrivateEndpointsResponse + 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, "ShardedDatabaseService", "ListPrivateEndpoints", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListShardedDatabases List of Sharded databases. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ListShardedDatabases.go.html to see an example of how to use ListShardedDatabases API. +// A default retry strategy applies to this operation ListShardedDatabases() +func (client ShardedDatabaseServiceClient) ListShardedDatabases(ctx context.Context, request ListShardedDatabasesRequest) (response ListShardedDatabasesResponse, 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.listShardedDatabases, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListShardedDatabasesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListShardedDatabasesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListShardedDatabasesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListShardedDatabasesResponse") + } + return +} + +// listShardedDatabases implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) listShardedDatabases(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/shardedDatabases", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListShardedDatabasesResponse + 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, "ShardedDatabaseService", "ListShardedDatabases", 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/globallydistributeddatabase/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client ShardedDatabaseServiceClient) 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 ShardedDatabaseServiceClient) 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, "ShardedDatabaseService", "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/globallydistributeddatabase/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client ShardedDatabaseServiceClient) 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 ShardedDatabaseServiceClient) 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, "ShardedDatabaseService", "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/globallydistributeddatabase/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client ShardedDatabaseServiceClient) 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 ShardedDatabaseServiceClient) 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, "ShardedDatabaseService", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PatchShardedDatabase Patch operation to add, remove or update shards to the sharded database topology. In single patch +// operation, multiple shards can be either added, or removed or updated. Combination of inserts, update +// and remove in single operation is not allowed. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/PatchShardedDatabase.go.html to see an example of how to use PatchShardedDatabase API. +// A default retry strategy applies to this operation PatchShardedDatabase() +func (client ShardedDatabaseServiceClient) PatchShardedDatabase(ctx context.Context, request PatchShardedDatabaseRequest) (response PatchShardedDatabaseResponse, 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.patchShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PatchShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PatchShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PatchShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PatchShardedDatabaseResponse") + } + return +} + +// patchShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) patchShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPatch, "/shardedDatabases/{shardedDatabaseId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PatchShardedDatabaseResponse + 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, "ShardedDatabaseService", "PatchShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// PrevalidateShardedDatabase Sharded database pre-validation request. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/PrevalidateShardedDatabase.go.html to see an example of how to use PrevalidateShardedDatabase API. +// A default retry strategy applies to this operation PrevalidateShardedDatabase() +func (client ShardedDatabaseServiceClient) PrevalidateShardedDatabase(ctx context.Context, request PrevalidateShardedDatabaseRequest) (response PrevalidateShardedDatabaseResponse, 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.prevalidateShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = PrevalidateShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = PrevalidateShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(PrevalidateShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into PrevalidateShardedDatabaseResponse") + } + return +} + +// prevalidateShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) prevalidateShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/actions/prevalidate", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response PrevalidateShardedDatabaseResponse + 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, "ShardedDatabaseService", "PrevalidateShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// StartShardedDatabase Start the shards, catalog and GSMs of Sharded Database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/StartShardedDatabase.go.html to see an example of how to use StartShardedDatabase API. +// A default retry strategy applies to this operation StartShardedDatabase() +func (client ShardedDatabaseServiceClient) StartShardedDatabase(ctx context.Context, request StartShardedDatabaseRequest) (response StartShardedDatabaseResponse, 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.startShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = StartShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = StartShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(StartShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StartShardedDatabaseResponse") + } + return +} + +// startShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) startShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/startDatabase", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response StartShardedDatabaseResponse + 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, "ShardedDatabaseService", "StartShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// StopShardedDatabase Stop the shards, catalog and GSM instances for the sharded database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/StopShardedDatabase.go.html to see an example of how to use StopShardedDatabase API. +// A default retry strategy applies to this operation StopShardedDatabase() +func (client ShardedDatabaseServiceClient) StopShardedDatabase(ctx context.Context, request StopShardedDatabaseRequest) (response StopShardedDatabaseResponse, 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.stopShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = StopShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = StopShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(StopShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StopShardedDatabaseResponse") + } + return +} + +// stopShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) stopShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/stopDatabase", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response StopShardedDatabaseResponse + 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, "ShardedDatabaseService", "StopShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdatePrivateEndpoint Updates the configuration of privateendpoint. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/UpdatePrivateEndpoint.go.html to see an example of how to use UpdatePrivateEndpoint API. +// A default retry strategy applies to this operation UpdatePrivateEndpoint() +func (client ShardedDatabaseServiceClient) 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() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + 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 ShardedDatabaseServiceClient) updatePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/privateEndpoints/{privateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdatePrivateEndpointResponse + 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, "ShardedDatabaseService", "UpdatePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateShardedDatabase Updates the configuration of sharded database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/UpdateShardedDatabase.go.html to see an example of how to use UpdateShardedDatabase API. +// A default retry strategy applies to this operation UpdateShardedDatabase() +func (client ShardedDatabaseServiceClient) UpdateShardedDatabase(ctx context.Context, request UpdateShardedDatabaseRequest) (response UpdateShardedDatabaseResponse, 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.updateShardedDatabase, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateShardedDatabaseResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateShardedDatabaseResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateShardedDatabaseResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateShardedDatabaseResponse") + } + return +} + +// updateShardedDatabase implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) updateShardedDatabase(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/shardedDatabases/{shardedDatabaseId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateShardedDatabaseResponse + 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, "ShardedDatabaseService", "UpdateShardedDatabase", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &shardeddatabase{}) + return response, err +} + +// UploadSignedCertificateAndGenerateWallet Upload the CA signed certificate to the GSM instances and generate wallets for GSM instances of the +// sharded database. Customer shall provide the CA signed certificate key details by adding the certificate +// in request body. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/UploadSignedCertificateAndGenerateWallet.go.html to see an example of how to use UploadSignedCertificateAndGenerateWallet API. +// A default retry strategy applies to this operation UploadSignedCertificateAndGenerateWallet() +func (client ShardedDatabaseServiceClient) UploadSignedCertificateAndGenerateWallet(ctx context.Context, request UploadSignedCertificateAndGenerateWalletRequest) (response UploadSignedCertificateAndGenerateWalletResponse, 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.uploadSignedCertificateAndGenerateWallet, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UploadSignedCertificateAndGenerateWalletResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UploadSignedCertificateAndGenerateWalletResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UploadSignedCertificateAndGenerateWalletResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UploadSignedCertificateAndGenerateWalletResponse") + } + return +} + +// uploadSignedCertificateAndGenerateWallet implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) uploadSignedCertificateAndGenerateWallet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/uploadSignedCertificateAndGenerateWallet", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UploadSignedCertificateAndGenerateWalletResponse + 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, "ShardedDatabaseService", "UploadSignedCertificateAndGenerateWallet", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ValidateNetwork Validate the network connectivity between components of sharded database. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ValidateNetwork.go.html to see an example of how to use ValidateNetwork API. +// A default retry strategy applies to this operation ValidateNetwork() +func (client ShardedDatabaseServiceClient) ValidateNetwork(ctx context.Context, request ValidateNetworkRequest) (response ValidateNetworkResponse, 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.validateNetwork, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ValidateNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ValidateNetworkResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ValidateNetworkResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ValidateNetworkResponse") + } + return +} + +// validateNetwork implements the OCIOperation interface (enables retrying operations) +func (client ShardedDatabaseServiceClient) validateNetwork(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/shardedDatabases/{shardedDatabaseId}/actions/validateNetwork", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ValidateNetworkResponse + 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, "ShardedDatabaseService", "ValidateNetwork", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/globallydistributeddatabase/gsm_details.go b/globallydistributeddatabase/gsm_details.go new file mode 100644 index 0000000000..a759d5e04f --- /dev/null +++ b/globallydistributeddatabase/gsm_details.go @@ -0,0 +1,136 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GsmDetails Details of global service manager(GSM also known as shard director) instances for sharded database. +type GsmDetails struct { + + // Name of the GSM instance + Name *string `mandatory:"true" json:"name"` + + // The compute count for the GSM instance. + ComputeCount *float32 `mandatory:"true" json:"computeCount"` + + // The data disk group size to be allocated in GBs. + DataStorageSizeInGbs *float64 `mandatory:"true" json:"dataStorageSizeInGbs"` + + // The time the GSM instance was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the GSM instance was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Status of shard or catalog or gsm for the sharded database. + Status GsmDetailsStatusEnum `mandatory:"true" json:"status"` + + // The time the ssl certificate associated with GSM expires. An RFC3339 formatted datetime string + TimeSslCertificateExpires *common.SDKTime `mandatory:"false" json:"timeSslCertificateExpires"` + + // Identifier of the underlying supporting resource. + SupportingResourceId *string `mandatory:"false" json:"supportingResourceId"` + + // Additional metadata related to GSM's underlying supporting resource. + Metadata map[string]interface{} `mandatory:"false" json:"metadata"` +} + +func (m GsmDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m GsmDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGsmDetailsStatusEnum(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(GetGsmDetailsStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GsmDetailsStatusEnum Enum with underlying type: string +type GsmDetailsStatusEnum string + +// Set of constants representing the allowable values for GsmDetailsStatusEnum +const ( + GsmDetailsStatusFailed GsmDetailsStatusEnum = "FAILED" + GsmDetailsStatusDeleting GsmDetailsStatusEnum = "DELETING" + GsmDetailsStatusDeleted GsmDetailsStatusEnum = "DELETED" + GsmDetailsStatusUpdating GsmDetailsStatusEnum = "UPDATING" + GsmDetailsStatusCreating GsmDetailsStatusEnum = "CREATING" + GsmDetailsStatusCreated GsmDetailsStatusEnum = "CREATED" + GsmDetailsStatusReadyForConfiguration GsmDetailsStatusEnum = "READY_FOR_CONFIGURATION" + GsmDetailsStatusConfigured GsmDetailsStatusEnum = "CONFIGURED" + GsmDetailsStatusNeedsAttention GsmDetailsStatusEnum = "NEEDS_ATTENTION" +) + +var mappingGsmDetailsStatusEnum = map[string]GsmDetailsStatusEnum{ + "FAILED": GsmDetailsStatusFailed, + "DELETING": GsmDetailsStatusDeleting, + "DELETED": GsmDetailsStatusDeleted, + "UPDATING": GsmDetailsStatusUpdating, + "CREATING": GsmDetailsStatusCreating, + "CREATED": GsmDetailsStatusCreated, + "READY_FOR_CONFIGURATION": GsmDetailsStatusReadyForConfiguration, + "CONFIGURED": GsmDetailsStatusConfigured, + "NEEDS_ATTENTION": GsmDetailsStatusNeedsAttention, +} + +var mappingGsmDetailsStatusEnumLowerCase = map[string]GsmDetailsStatusEnum{ + "failed": GsmDetailsStatusFailed, + "deleting": GsmDetailsStatusDeleting, + "deleted": GsmDetailsStatusDeleted, + "updating": GsmDetailsStatusUpdating, + "creating": GsmDetailsStatusCreating, + "created": GsmDetailsStatusCreated, + "ready_for_configuration": GsmDetailsStatusReadyForConfiguration, + "configured": GsmDetailsStatusConfigured, + "needs_attention": GsmDetailsStatusNeedsAttention, +} + +// GetGsmDetailsStatusEnumValues Enumerates the set of values for GsmDetailsStatusEnum +func GetGsmDetailsStatusEnumValues() []GsmDetailsStatusEnum { + values := make([]GsmDetailsStatusEnum, 0) + for _, v := range mappingGsmDetailsStatusEnum { + values = append(values, v) + } + return values +} + +// GetGsmDetailsStatusEnumStringValues Enumerates the set of values in String for GsmDetailsStatusEnum +func GetGsmDetailsStatusEnumStringValues() []string { + return []string{ + "FAILED", + "DELETING", + "DELETED", + "UPDATING", + "CREATING", + "CREATED", + "READY_FOR_CONFIGURATION", + "CONFIGURED", + "NEEDS_ATTENTION", + } +} + +// GetMappingGsmDetailsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGsmDetailsStatusEnum(val string) (GsmDetailsStatusEnum, bool) { + enum, ok := mappingGsmDetailsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/list_private_endpoints_request_response.go b/globallydistributeddatabase/list_private_endpoints_request_response.go new file mode 100644 index 0000000000..5e9aff2c61 --- /dev/null +++ b/globallydistributeddatabase/list_private_endpoints_request_response.go @@ -0,0 +1,206 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +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/globallydistributeddatabase/ListPrivateEndpoints.go.html to see an example of how to use ListPrivateEndpointsRequest. +type ListPrivateEndpointsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources their lifecycleState matches the given lifecycleState. + LifecycleState PrivateEndpointLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListPrivateEndpointsSortOrderEnum `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. + SortBy ListPrivateEndpointsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only private endpoint that match the entire 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 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 + +} + +// 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{} + 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 _, ok := GetMappingListPrivateEndpointsSortOrderEnum(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(GetListPrivateEndpointsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListPrivateEndpointsSortByEnum(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(GetListPrivateEndpointsSortByEnumStringValues(), ","))) + } + 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 PrivateEndpointCollection instances + PrivateEndpointCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListPrivateEndpointsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListPrivateEndpointsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListPrivateEndpointsSortOrderEnum Enum with underlying type: string +type ListPrivateEndpointsSortOrderEnum string + +// Set of constants representing the allowable values for ListPrivateEndpointsSortOrderEnum +const ( + ListPrivateEndpointsSortOrderAsc ListPrivateEndpointsSortOrderEnum = "ASC" + ListPrivateEndpointsSortOrderDesc ListPrivateEndpointsSortOrderEnum = "DESC" +) + +var mappingListPrivateEndpointsSortOrderEnum = map[string]ListPrivateEndpointsSortOrderEnum{ + "ASC": ListPrivateEndpointsSortOrderAsc, + "DESC": ListPrivateEndpointsSortOrderDesc, +} + +var mappingListPrivateEndpointsSortOrderEnumLowerCase = map[string]ListPrivateEndpointsSortOrderEnum{ + "asc": ListPrivateEndpointsSortOrderAsc, + "desc": ListPrivateEndpointsSortOrderDesc, +} + +// GetListPrivateEndpointsSortOrderEnumValues Enumerates the set of values for ListPrivateEndpointsSortOrderEnum +func GetListPrivateEndpointsSortOrderEnumValues() []ListPrivateEndpointsSortOrderEnum { + values := make([]ListPrivateEndpointsSortOrderEnum, 0) + for _, v := range mappingListPrivateEndpointsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListPrivateEndpointsSortOrderEnumStringValues Enumerates the set of values in String for ListPrivateEndpointsSortOrderEnum +func GetListPrivateEndpointsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListPrivateEndpointsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPrivateEndpointsSortOrderEnum(val string) (ListPrivateEndpointsSortOrderEnum, bool) { + enum, ok := mappingListPrivateEndpointsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListPrivateEndpointsSortByEnum Enum with underlying type: string +type ListPrivateEndpointsSortByEnum string + +// Set of constants representing the allowable values for ListPrivateEndpointsSortByEnum +const ( + ListPrivateEndpointsSortByTimecreated ListPrivateEndpointsSortByEnum = "timeCreated" + ListPrivateEndpointsSortByTimeupdated ListPrivateEndpointsSortByEnum = "timeUpdated" +) + +var mappingListPrivateEndpointsSortByEnum = map[string]ListPrivateEndpointsSortByEnum{ + "timeCreated": ListPrivateEndpointsSortByTimecreated, + "timeUpdated": ListPrivateEndpointsSortByTimeupdated, +} + +var mappingListPrivateEndpointsSortByEnumLowerCase = map[string]ListPrivateEndpointsSortByEnum{ + "timecreated": ListPrivateEndpointsSortByTimecreated, + "timeupdated": ListPrivateEndpointsSortByTimeupdated, +} + +// GetListPrivateEndpointsSortByEnumValues Enumerates the set of values for ListPrivateEndpointsSortByEnum +func GetListPrivateEndpointsSortByEnumValues() []ListPrivateEndpointsSortByEnum { + values := make([]ListPrivateEndpointsSortByEnum, 0) + for _, v := range mappingListPrivateEndpointsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListPrivateEndpointsSortByEnumStringValues Enumerates the set of values in String for ListPrivateEndpointsSortByEnum +func GetListPrivateEndpointsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "timeUpdated", + } +} + +// GetMappingListPrivateEndpointsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPrivateEndpointsSortByEnum(val string) (ListPrivateEndpointsSortByEnum, bool) { + enum, ok := mappingListPrivateEndpointsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/list_sharded_databases_request_response.go b/globallydistributeddatabase/list_sharded_databases_request_response.go new file mode 100644 index 0000000000..d0ebdb2ef9 --- /dev/null +++ b/globallydistributeddatabase/list_sharded_databases_request_response.go @@ -0,0 +1,206 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListShardedDatabasesRequest wrapper for the ListShardedDatabases operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ListShardedDatabases.go.html to see an example of how to use ListShardedDatabasesRequest. +type ListShardedDatabasesRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources their lifecycleState matches the given lifecycleState. + LifecycleState ShardedDatabaseLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListShardedDatabasesSortOrderEnum `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. + SortBy ListShardedDatabasesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A filter to return only sharded databases that match the entire 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 ListShardedDatabasesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListShardedDatabasesRequest) 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 ListShardedDatabasesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListShardedDatabasesRequest) 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 ListShardedDatabasesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingShardedDatabaseLifecycleStateEnum(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(GetShardedDatabaseLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListShardedDatabasesSortOrderEnum(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(GetListShardedDatabasesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListShardedDatabasesSortByEnum(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(GetListShardedDatabasesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListShardedDatabasesResponse wrapper for the ListShardedDatabases operation +type ListShardedDatabasesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ShardedDatabaseCollection instances + ShardedDatabaseCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListShardedDatabasesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListShardedDatabasesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListShardedDatabasesSortOrderEnum Enum with underlying type: string +type ListShardedDatabasesSortOrderEnum string + +// Set of constants representing the allowable values for ListShardedDatabasesSortOrderEnum +const ( + ListShardedDatabasesSortOrderAsc ListShardedDatabasesSortOrderEnum = "ASC" + ListShardedDatabasesSortOrderDesc ListShardedDatabasesSortOrderEnum = "DESC" +) + +var mappingListShardedDatabasesSortOrderEnum = map[string]ListShardedDatabasesSortOrderEnum{ + "ASC": ListShardedDatabasesSortOrderAsc, + "DESC": ListShardedDatabasesSortOrderDesc, +} + +var mappingListShardedDatabasesSortOrderEnumLowerCase = map[string]ListShardedDatabasesSortOrderEnum{ + "asc": ListShardedDatabasesSortOrderAsc, + "desc": ListShardedDatabasesSortOrderDesc, +} + +// GetListShardedDatabasesSortOrderEnumValues Enumerates the set of values for ListShardedDatabasesSortOrderEnum +func GetListShardedDatabasesSortOrderEnumValues() []ListShardedDatabasesSortOrderEnum { + values := make([]ListShardedDatabasesSortOrderEnum, 0) + for _, v := range mappingListShardedDatabasesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListShardedDatabasesSortOrderEnumStringValues Enumerates the set of values in String for ListShardedDatabasesSortOrderEnum +func GetListShardedDatabasesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListShardedDatabasesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListShardedDatabasesSortOrderEnum(val string) (ListShardedDatabasesSortOrderEnum, bool) { + enum, ok := mappingListShardedDatabasesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListShardedDatabasesSortByEnum Enum with underlying type: string +type ListShardedDatabasesSortByEnum string + +// Set of constants representing the allowable values for ListShardedDatabasesSortByEnum +const ( + ListShardedDatabasesSortByTimecreated ListShardedDatabasesSortByEnum = "timeCreated" + ListShardedDatabasesSortByTimeupdated ListShardedDatabasesSortByEnum = "timeUpdated" +) + +var mappingListShardedDatabasesSortByEnum = map[string]ListShardedDatabasesSortByEnum{ + "timeCreated": ListShardedDatabasesSortByTimecreated, + "timeUpdated": ListShardedDatabasesSortByTimeupdated, +} + +var mappingListShardedDatabasesSortByEnumLowerCase = map[string]ListShardedDatabasesSortByEnum{ + "timecreated": ListShardedDatabasesSortByTimecreated, + "timeupdated": ListShardedDatabasesSortByTimeupdated, +} + +// GetListShardedDatabasesSortByEnumValues Enumerates the set of values for ListShardedDatabasesSortByEnum +func GetListShardedDatabasesSortByEnumValues() []ListShardedDatabasesSortByEnum { + values := make([]ListShardedDatabasesSortByEnum, 0) + for _, v := range mappingListShardedDatabasesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListShardedDatabasesSortByEnumStringValues Enumerates the set of values in String for ListShardedDatabasesSortByEnum +func GetListShardedDatabasesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "timeUpdated", + } +} + +// GetMappingListShardedDatabasesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListShardedDatabasesSortByEnum(val string) (ListShardedDatabasesSortByEnum, bool) { + enum, ok := mappingListShardedDatabasesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/list_work_request_errors_request_response.go b/globallydistributeddatabase/list_work_request_errors_request_response.go new file mode 100644 index 0000000000..2fb2d450c6 --- /dev/null +++ b/globallydistributeddatabase/list_work_request_errors_request_response.go @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +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/globallydistributeddatabase/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"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + 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 timeAccepted 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 pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimeaccepted ListWorkRequestErrorsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timeAccepted": ListWorkRequestErrorsSortByTimeaccepted, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timeaccepted": ListWorkRequestErrorsSortByTimeaccepted, +} + +// 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{ + "timeAccepted", + } +} + +// 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/globallydistributeddatabase/list_work_request_logs_request_response.go b/globallydistributeddatabase/list_work_request_logs_request_response.go new file mode 100644 index 0000000000..ab59f5cb4c --- /dev/null +++ b/globallydistributeddatabase/list_work_request_logs_request_response.go @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +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/globallydistributeddatabase/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"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + 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 timeAccepted 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 pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimeaccepted ListWorkRequestLogsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timeAccepted": ListWorkRequestLogsSortByTimeaccepted, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timeaccepted": ListWorkRequestLogsSortByTimeaccepted, +} + +// 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{ + "timeAccepted", + } +} + +// 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/globallydistributeddatabase/list_work_requests_request_response.go b/globallydistributeddatabase/list_work_requests_request_response.go new file mode 100644 index 0000000000..5d767c0919 --- /dev/null +++ b/globallydistributeddatabase/list_work_requests_request_response.go @@ -0,0 +1,267 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 globallydistributeddatabase + +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/globallydistributeddatabase/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The ID of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // A filter to return only resources their lifecycleState matches 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"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + 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 pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// 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" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "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", + "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/globallydistributeddatabase/operation_status.go b/globallydistributeddatabase/operation_status.go new file mode 100644 index 0000000000..187ae8d90d --- /dev/null +++ b/globallydistributeddatabase/operation_status.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "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", + "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/globallydistributeddatabase/operation_type.go b/globallydistributeddatabase/operation_type.go new file mode 100644 index 0000000000..6fe22d4fc5 --- /dev/null +++ b/globallydistributeddatabase/operation_type.go @@ -0,0 +1,120 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypeCreateShardedDatabase OperationTypeEnum = "CREATE_SHARDED_DATABASE" + OperationTypeDeleteShardedDatabase OperationTypeEnum = "DELETE_SHARDED_DATABASE" + OperationTypeUpdateShardedDatabase OperationTypeEnum = "UPDATE_SHARDED_DATABASE" + OperationTypeConfigureShardedDatabaseGsms OperationTypeEnum = "CONFIGURE_SHARDED_DATABASE_GSMS" + OperationTypeStartShardedDatabase OperationTypeEnum = "START_SHARDED_DATABASE" + OperationTypeStopShardedDatabase OperationTypeEnum = "STOP_SHARDED_DATABASE" + OperationTypeValidateNetwork OperationTypeEnum = "VALIDATE_NETWORK" + OperationTypeChangeShardedDbCompartment OperationTypeEnum = "CHANGE_SHARDED_DB_COMPARTMENT" + OperationTypeCreatePrivateEndpoint OperationTypeEnum = "CREATE_PRIVATE_ENDPOINT" + OperationTypeUpdatePrivateEndpoint OperationTypeEnum = "UPDATE_PRIVATE_ENDPOINT" + OperationTypeDeletePrivateEndpoint OperationTypeEnum = "DELETE_PRIVATE_ENDPOINT" + OperationTypeChangePrivateEndpointCompartment OperationTypeEnum = "CHANGE_PRIVATE_ENDPOINT_COMPARTMENT" + OperationTypeInsertShards OperationTypeEnum = "INSERT_SHARDS" + OperationTypeRemoveShards OperationTypeEnum = "REMOVE_SHARDS" + OperationTypeMergeCatalogShards OperationTypeEnum = "MERGE_CATALOG_SHARDS" + OperationTypeUploadSignedCertAndGenerateWallet OperationTypeEnum = "UPLOAD_SIGNED_CERT_AND_GENERATE_WALLET" + OperationTypeGenerateGsmCertSigningReq OperationTypeEnum = "GENERATE_GSM_CERT_SIGNING_REQ" + OperationTypeConfigureSharding OperationTypeEnum = "CONFIGURE_SHARDING" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "CREATE_SHARDED_DATABASE": OperationTypeCreateShardedDatabase, + "DELETE_SHARDED_DATABASE": OperationTypeDeleteShardedDatabase, + "UPDATE_SHARDED_DATABASE": OperationTypeUpdateShardedDatabase, + "CONFIGURE_SHARDED_DATABASE_GSMS": OperationTypeConfigureShardedDatabaseGsms, + "START_SHARDED_DATABASE": OperationTypeStartShardedDatabase, + "STOP_SHARDED_DATABASE": OperationTypeStopShardedDatabase, + "VALIDATE_NETWORK": OperationTypeValidateNetwork, + "CHANGE_SHARDED_DB_COMPARTMENT": OperationTypeChangeShardedDbCompartment, + "CREATE_PRIVATE_ENDPOINT": OperationTypeCreatePrivateEndpoint, + "UPDATE_PRIVATE_ENDPOINT": OperationTypeUpdatePrivateEndpoint, + "DELETE_PRIVATE_ENDPOINT": OperationTypeDeletePrivateEndpoint, + "CHANGE_PRIVATE_ENDPOINT_COMPARTMENT": OperationTypeChangePrivateEndpointCompartment, + "INSERT_SHARDS": OperationTypeInsertShards, + "REMOVE_SHARDS": OperationTypeRemoveShards, + "MERGE_CATALOG_SHARDS": OperationTypeMergeCatalogShards, + "UPLOAD_SIGNED_CERT_AND_GENERATE_WALLET": OperationTypeUploadSignedCertAndGenerateWallet, + "GENERATE_GSM_CERT_SIGNING_REQ": OperationTypeGenerateGsmCertSigningReq, + "CONFIGURE_SHARDING": OperationTypeConfigureSharding, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "create_sharded_database": OperationTypeCreateShardedDatabase, + "delete_sharded_database": OperationTypeDeleteShardedDatabase, + "update_sharded_database": OperationTypeUpdateShardedDatabase, + "configure_sharded_database_gsms": OperationTypeConfigureShardedDatabaseGsms, + "start_sharded_database": OperationTypeStartShardedDatabase, + "stop_sharded_database": OperationTypeStopShardedDatabase, + "validate_network": OperationTypeValidateNetwork, + "change_sharded_db_compartment": OperationTypeChangeShardedDbCompartment, + "create_private_endpoint": OperationTypeCreatePrivateEndpoint, + "update_private_endpoint": OperationTypeUpdatePrivateEndpoint, + "delete_private_endpoint": OperationTypeDeletePrivateEndpoint, + "change_private_endpoint_compartment": OperationTypeChangePrivateEndpointCompartment, + "insert_shards": OperationTypeInsertShards, + "remove_shards": OperationTypeRemoveShards, + "merge_catalog_shards": OperationTypeMergeCatalogShards, + "upload_signed_cert_and_generate_wallet": OperationTypeUploadSignedCertAndGenerateWallet, + "generate_gsm_cert_signing_req": OperationTypeGenerateGsmCertSigningReq, + "configure_sharding": OperationTypeConfigureSharding, +} + +// 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_SHARDED_DATABASE", + "DELETE_SHARDED_DATABASE", + "UPDATE_SHARDED_DATABASE", + "CONFIGURE_SHARDED_DATABASE_GSMS", + "START_SHARDED_DATABASE", + "STOP_SHARDED_DATABASE", + "VALIDATE_NETWORK", + "CHANGE_SHARDED_DB_COMPARTMENT", + "CREATE_PRIVATE_ENDPOINT", + "UPDATE_PRIVATE_ENDPOINT", + "DELETE_PRIVATE_ENDPOINT", + "CHANGE_PRIVATE_ENDPOINT_COMPARTMENT", + "INSERT_SHARDS", + "REMOVE_SHARDS", + "MERGE_CATALOG_SHARDS", + "UPLOAD_SIGNED_CERT_AND_GENERATE_WALLET", + "GENERATE_GSM_CERT_SIGNING_REQ", + "CONFIGURE_SHARDING", + } +} + +// 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/globallydistributeddatabase/patch_insert_instruction.go b/globallydistributeddatabase/patch_insert_instruction.go new file mode 100644 index 0000000000..0f67b19ba4 --- /dev/null +++ b/globallydistributeddatabase/patch_insert_instruction.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchInsertInstruction An operation that inserts a value into an array, shifting array items as necessary and handling NOT_FOUND exceptions by creating the implied containing structure. +type PatchInsertInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A value to be inserted into the target. + Value *interface{} `mandatory:"true" json:"value"` +} + +// GetSelection returns Selection +func (m PatchInsertInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchInsertInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchInsertInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchInsertInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchInsertInstruction PatchInsertInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchInsertInstruction + }{ + "INSERT", + (MarshalTypePatchInsertInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/globallydistributeddatabase/patch_instruction.go b/globallydistributeddatabase/patch_instruction.go new file mode 100644 index 0000000000..ce166b2559 --- /dev/null +++ b/globallydistributeddatabase/patch_instruction.go @@ -0,0 +1,143 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchInstruction A single instruction to be included as part of Patch request content. +type PatchInstruction interface { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + GetSelection() *string +} + +type patchinstruction struct { + JsonData []byte + Selection *string `mandatory:"true" json:"selection"` + Operation string `json:"operation"` +} + +// UnmarshalJSON unmarshals json +func (m *patchinstruction) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerpatchinstruction patchinstruction + s := struct { + Model Unmarshalerpatchinstruction + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Selection = s.Model.Selection + m.Operation = s.Model.Operation + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *patchinstruction) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Operation { + case "REMOVE": + mm := PatchRemoveInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "INSERT": + mm := PatchInsertInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + case "MERGE": + mm := PatchMergeInstruction{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for PatchInstruction: %s.", m.Operation) + return *m, nil + } +} + +// GetSelection returns Selection +func (m patchinstruction) GetSelection() *string { + return m.Selection +} + +func (m patchinstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m patchinstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PatchInstructionOperationEnum Enum with underlying type: string +type PatchInstructionOperationEnum string + +// Set of constants representing the allowable values for PatchInstructionOperationEnum +const ( + PatchInstructionOperationInsert PatchInstructionOperationEnum = "INSERT" + PatchInstructionOperationRemove PatchInstructionOperationEnum = "REMOVE" + PatchInstructionOperationMerge PatchInstructionOperationEnum = "MERGE" +) + +var mappingPatchInstructionOperationEnum = map[string]PatchInstructionOperationEnum{ + "INSERT": PatchInstructionOperationInsert, + "REMOVE": PatchInstructionOperationRemove, + "MERGE": PatchInstructionOperationMerge, +} + +var mappingPatchInstructionOperationEnumLowerCase = map[string]PatchInstructionOperationEnum{ + "insert": PatchInstructionOperationInsert, + "remove": PatchInstructionOperationRemove, + "merge": PatchInstructionOperationMerge, +} + +// GetPatchInstructionOperationEnumValues Enumerates the set of values for PatchInstructionOperationEnum +func GetPatchInstructionOperationEnumValues() []PatchInstructionOperationEnum { + values := make([]PatchInstructionOperationEnum, 0) + for _, v := range mappingPatchInstructionOperationEnum { + values = append(values, v) + } + return values +} + +// GetPatchInstructionOperationEnumStringValues Enumerates the set of values in String for PatchInstructionOperationEnum +func GetPatchInstructionOperationEnumStringValues() []string { + return []string{ + "INSERT", + "REMOVE", + "MERGE", + } +} + +// GetMappingPatchInstructionOperationEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPatchInstructionOperationEnum(val string) (PatchInstructionOperationEnum, bool) { + enum, ok := mappingPatchInstructionOperationEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/patch_merge_instruction.go b/globallydistributeddatabase/patch_merge_instruction.go new file mode 100644 index 0000000000..fd2d72cd53 --- /dev/null +++ b/globallydistributeddatabase/patch_merge_instruction.go @@ -0,0 +1,70 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchMergeInstruction An operation that recursively updates items of the selection, or adding the value if the selection is empty. +// If the value is not an object, it is used directly, otherwise each key-value member is used +// to create or update a member of the same name in the target and the same process is applied recursively for each object-typed value +// (similar to RFC 7396 (https://tools.ietf.org/html/rfc7396#section-2) JSON Merge Patch, except that null values are copied +// rather than transformed into deletions). +// NOT_FOUND exceptions are handled by creating the implied containing structure. +// To avoid referential errors if an item's descendant is also in the selection, items of the selection are processed in order of decreasing depth. +type PatchMergeInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` + + // A value to be merged into the target. + Value *interface{} `mandatory:"false" json:"value"` +} + +// GetSelection returns Selection +func (m PatchMergeInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchMergeInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchMergeInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchMergeInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchMergeInstruction PatchMergeInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchMergeInstruction + }{ + "MERGE", + (MarshalTypePatchMergeInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/globallydistributeddatabase/patch_remove_instruction.go b/globallydistributeddatabase/patch_remove_instruction.go new file mode 100644 index 0000000000..39a2ce0302 --- /dev/null +++ b/globallydistributeddatabase/patch_remove_instruction.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchRemoveInstruction An operation that deletes items, ignoring NOT_FOUND exceptions. +// To avoid referential errors if an item's descendant is also in the selection, items of the selection are processed in order of decreasing depth. +type PatchRemoveInstruction struct { + + // The set of values to which the operation applies as a JMESPath expression (https://jmespath.org/specification.html) for evaluation against the context resource. + // An operation fails if the selection yields an exception, except as otherwise specified. + // Note that comparisons involving non-primitive values (objects or arrays) are not supported and will always evaluate to false. + Selection *string `mandatory:"true" json:"selection"` +} + +// GetSelection returns Selection +func (m PatchRemoveInstruction) GetSelection() *string { + return m.Selection +} + +func (m PatchRemoveInstruction) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchRemoveInstruction) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PatchRemoveInstruction) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchRemoveInstruction PatchRemoveInstruction + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchRemoveInstruction + }{ + "REMOVE", + (MarshalTypePatchRemoveInstruction)(m), + } + + return json.Marshal(&s) +} diff --git a/globallydistributeddatabase/patch_sharded_database_details.go b/globallydistributeddatabase/patch_sharded_database_details.go new file mode 100644 index 0000000000..6d235a37d0 --- /dev/null +++ b/globallydistributeddatabase/patch_sharded_database_details.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchShardedDatabaseDetails Provide PatchInstuction(s) in items array. All instructions in items have to be of same type. +// All instructions in items have to either PatchInsertInstruction type, PatchRemoveInstruction or +// PatchMergeInstruction. Multiple instructions of different types is not allowed to be performed in +// single operation. +type PatchShardedDatabaseDetails struct { + + // List of patch instructions. + Items []PatchInstruction `mandatory:"false" json:"items"` +} + +func (m PatchShardedDatabaseDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatchShardedDatabaseDetails) 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 *PatchShardedDatabaseDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []patchinstruction `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Items = make([]PatchInstruction, len(model.Items)) + for i, n := range model.Items { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Items[i] = nn.(PatchInstruction) + } else { + m.Items[i] = nil + } + } + return +} diff --git a/globallydistributeddatabase/patch_sharded_database_request_response.go b/globallydistributeddatabase/patch_sharded_database_request_response.go new file mode 100644 index 0000000000..1ceaa7275a --- /dev/null +++ b/globallydistributeddatabase/patch_sharded_database_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PatchShardedDatabaseRequest wrapper for the PatchShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/PatchShardedDatabase.go.html to see an example of how to use PatchShardedDatabaseRequest. +type PatchShardedDatabaseRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // The payload containing instructions to patch the sharded database. + PatchShardedDatabaseDetails `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 PatchShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PatchShardedDatabaseRequest) 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 PatchShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PatchShardedDatabaseRequest) 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 PatchShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PatchShardedDatabaseResponse wrapper for the PatchShardedDatabase operation +type PatchShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 PatchShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PatchShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/prevalidate_create_payload.go b/globallydistributeddatabase/prevalidate_create_payload.go new file mode 100644 index 0000000000..d263ca079e --- /dev/null +++ b/globallydistributeddatabase/prevalidate_create_payload.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrevalidateCreatePayload Payload to prevalidate create sharded database operation. +type PrevalidateCreatePayload struct { + PrevalidatePayload CreateShardedDatabaseDetails `mandatory:"true" json:"prevalidatePayload"` +} + +func (m PrevalidateCreatePayload) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrevalidateCreatePayload) 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 PrevalidateCreatePayload) MarshalJSON() (buff []byte, e error) { + type MarshalTypePrevalidateCreatePayload PrevalidateCreatePayload + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePrevalidateCreatePayload + }{ + "CREATE", + (MarshalTypePrevalidateCreatePayload)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *PrevalidateCreatePayload) UnmarshalJSON(data []byte) (e error) { + model := struct { + PrevalidatePayload createshardeddatabasedetails `json:"prevalidatePayload"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.PrevalidatePayload.UnmarshalPolymorphicJSON(model.PrevalidatePayload.JsonData) + if e != nil { + return + } + if nn != nil { + m.PrevalidatePayload = nn.(CreateShardedDatabaseDetails) + } else { + m.PrevalidatePayload = nil + } + + return +} diff --git a/globallydistributeddatabase/prevalidate_patch_payload.go b/globallydistributeddatabase/prevalidate_patch_payload.go new file mode 100644 index 0000000000..f4201f5c76 --- /dev/null +++ b/globallydistributeddatabase/prevalidate_patch_payload.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrevalidatePatchPayload Payload to prevalidate patch sharded database operation. +type PrevalidatePatchPayload struct { + PrevalidatePayload *PatchShardedDatabaseDetails `mandatory:"true" json:"prevalidatePayload"` + + // Sharded database identifier + ShardedDatabaseId *string `mandatory:"true" json:"shardedDatabaseId"` +} + +func (m PrevalidatePatchPayload) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrevalidatePatchPayload) 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 PrevalidatePatchPayload) MarshalJSON() (buff []byte, e error) { + type MarshalTypePrevalidatePatchPayload PrevalidatePatchPayload + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePrevalidatePatchPayload + }{ + "PATCH", + (MarshalTypePrevalidatePatchPayload)(m), + } + + return json.Marshal(&s) +} diff --git a/globallydistributeddatabase/prevalidate_payload.go b/globallydistributeddatabase/prevalidate_payload.go new file mode 100644 index 0000000000..1e21ddcda3 --- /dev/null +++ b/globallydistributeddatabase/prevalidate_payload.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrevalidatePayload Payload required to run prevalidation operation for create sharded database or patch sharded database, based on operation selected. +type PrevalidatePayload interface { +} + +type prevalidatepayload struct { + JsonData []byte + Operation string `json:"operation"` +} + +// UnmarshalJSON unmarshals json +func (m *prevalidatepayload) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerprevalidatepayload prevalidatepayload + s := struct { + Model Unmarshalerprevalidatepayload + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Operation = s.Model.Operation + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *prevalidatepayload) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Operation { + case "PATCH": + mm := PrevalidatePatchPayload{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CREATE": + mm := PrevalidateCreatePayload{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for PrevalidatePayload: %s.", m.Operation) + return *m, nil + } +} + +func (m prevalidatepayload) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m prevalidatepayload) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PrevalidatePayloadOperationEnum Enum with underlying type: string +type PrevalidatePayloadOperationEnum string + +// Set of constants representing the allowable values for PrevalidatePayloadOperationEnum +const ( + PrevalidatePayloadOperationCreate PrevalidatePayloadOperationEnum = "CREATE" + PrevalidatePayloadOperationPatch PrevalidatePayloadOperationEnum = "PATCH" +) + +var mappingPrevalidatePayloadOperationEnum = map[string]PrevalidatePayloadOperationEnum{ + "CREATE": PrevalidatePayloadOperationCreate, + "PATCH": PrevalidatePayloadOperationPatch, +} + +var mappingPrevalidatePayloadOperationEnumLowerCase = map[string]PrevalidatePayloadOperationEnum{ + "create": PrevalidatePayloadOperationCreate, + "patch": PrevalidatePayloadOperationPatch, +} + +// GetPrevalidatePayloadOperationEnumValues Enumerates the set of values for PrevalidatePayloadOperationEnum +func GetPrevalidatePayloadOperationEnumValues() []PrevalidatePayloadOperationEnum { + values := make([]PrevalidatePayloadOperationEnum, 0) + for _, v := range mappingPrevalidatePayloadOperationEnum { + values = append(values, v) + } + return values +} + +// GetPrevalidatePayloadOperationEnumStringValues Enumerates the set of values in String for PrevalidatePayloadOperationEnum +func GetPrevalidatePayloadOperationEnumStringValues() []string { + return []string{ + "CREATE", + "PATCH", + } +} + +// GetMappingPrevalidatePayloadOperationEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPrevalidatePayloadOperationEnum(val string) (PrevalidatePayloadOperationEnum, bool) { + enum, ok := mappingPrevalidatePayloadOperationEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/prevalidate_sharded_database_details.go b/globallydistributeddatabase/prevalidate_sharded_database_details.go new file mode 100644 index 0000000000..301ee0efb2 --- /dev/null +++ b/globallydistributeddatabase/prevalidate_sharded_database_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrevalidateShardedDatabaseDetails Input for prevalidate sharded database API to validate various operations payload. +type PrevalidateShardedDatabaseDetails struct { + PrevalidateShardedDatabaseDetails PrevalidatePayload `mandatory:"true" json:"prevalidateShardedDatabaseDetails"` +} + +func (m PrevalidateShardedDatabaseDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrevalidateShardedDatabaseDetails) 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 *PrevalidateShardedDatabaseDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + PrevalidateShardedDatabaseDetails prevalidatepayload `json:"prevalidateShardedDatabaseDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.PrevalidateShardedDatabaseDetails.UnmarshalPolymorphicJSON(model.PrevalidateShardedDatabaseDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.PrevalidateShardedDatabaseDetails = nn.(PrevalidatePayload) + } else { + m.PrevalidateShardedDatabaseDetails = nil + } + + return +} diff --git a/globallydistributeddatabase/prevalidate_sharded_database_request_response.go b/globallydistributeddatabase/prevalidate_sharded_database_request_response.go new file mode 100644 index 0000000000..246a7fdf3e --- /dev/null +++ b/globallydistributeddatabase/prevalidate_sharded_database_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// PrevalidateShardedDatabaseRequest wrapper for the PrevalidateShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/PrevalidateShardedDatabase.go.html to see an example of how to use PrevalidateShardedDatabaseRequest. +type PrevalidateShardedDatabaseRequest struct { + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Request to pre-validate sharded database operation like CREATE, PATCH payload before executing them. + PrevalidateShardedDatabaseDetails `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 PrevalidateShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request PrevalidateShardedDatabaseRequest) 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 PrevalidateShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request PrevalidateShardedDatabaseRequest) 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 PrevalidateShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PrevalidateShardedDatabaseResponse wrapper for the PrevalidateShardedDatabase operation +type PrevalidateShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PrevalidateShardedDatabaseResult instance + PrevalidateShardedDatabaseResult `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 PrevalidateShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response PrevalidateShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/prevalidate_sharded_database_result.go b/globallydistributeddatabase/prevalidate_sharded_database_result.go new file mode 100644 index 0000000000..473c2a08bb --- /dev/null +++ b/globallydistributeddatabase/prevalidate_sharded_database_result.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrevalidateShardedDatabaseResult Response of prevalidation api. +type PrevalidateShardedDatabaseResult struct { + + // Prevalidation result based on input payload. + ValidationResult map[string]interface{} `mandatory:"true" json:"validationResult"` +} + +func (m PrevalidateShardedDatabaseResult) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrevalidateShardedDatabaseResult) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/private_endpoint.go b/globallydistributeddatabase/private_endpoint.go new file mode 100644 index 0000000000..4315b709b7 --- /dev/null +++ b/globallydistributeddatabase/private_endpoint.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrivateEndpoint PrivateEndpoint resource. +type PrivateEndpoint struct { + + // The identifier of the Private Endpoint. + Id *string `mandatory:"true" json:"id"` + + // Identifier of the compartment in which private endpoint exists. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Identifier of the subnet in which private endpoint exists. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Identifier of the VCN in which subnet exists. + VcnId *string `mandatory:"true" json:"vcnId"` + + // PrivateEndpoint display name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the PrivateEndpoint was first created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the Private Endpoint was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Lifecycle states for private endpoint. + LifecycleState PrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // PrivateEndpoint description. + Description *string `mandatory:"false" json:"description"` + + // IP address of the Private Endpoint. + PrivateIp *string `mandatory:"false" json:"privateIp"` + + // The OCIDs of the network security groups that the private endpoint belongs to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // The OCIDs of sharded databases that consumes the given private endpoint. + ShardedDatabases []string `mandatory:"false" json:"shardedDatabases"` + + // Detailed message for the lifecycle state. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +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 ( + PrivateEndpointLifecycleStateActive PrivateEndpointLifecycleStateEnum = "ACTIVE" + PrivateEndpointLifecycleStateFailed PrivateEndpointLifecycleStateEnum = "FAILED" + PrivateEndpointLifecycleStateInactive PrivateEndpointLifecycleStateEnum = "INACTIVE" + PrivateEndpointLifecycleStateDeleting PrivateEndpointLifecycleStateEnum = "DELETING" + PrivateEndpointLifecycleStateDeleted PrivateEndpointLifecycleStateEnum = "DELETED" + PrivateEndpointLifecycleStateUpdating PrivateEndpointLifecycleStateEnum = "UPDATING" + PrivateEndpointLifecycleStateCreating PrivateEndpointLifecycleStateEnum = "CREATING" +) + +var mappingPrivateEndpointLifecycleStateEnum = map[string]PrivateEndpointLifecycleStateEnum{ + "ACTIVE": PrivateEndpointLifecycleStateActive, + "FAILED": PrivateEndpointLifecycleStateFailed, + "INACTIVE": PrivateEndpointLifecycleStateInactive, + "DELETING": PrivateEndpointLifecycleStateDeleting, + "DELETED": PrivateEndpointLifecycleStateDeleted, + "UPDATING": PrivateEndpointLifecycleStateUpdating, + "CREATING": PrivateEndpointLifecycleStateCreating, +} + +var mappingPrivateEndpointLifecycleStateEnumLowerCase = map[string]PrivateEndpointLifecycleStateEnum{ + "active": PrivateEndpointLifecycleStateActive, + "failed": PrivateEndpointLifecycleStateFailed, + "inactive": PrivateEndpointLifecycleStateInactive, + "deleting": PrivateEndpointLifecycleStateDeleting, + "deleted": PrivateEndpointLifecycleStateDeleted, + "updating": PrivateEndpointLifecycleStateUpdating, + "creating": PrivateEndpointLifecycleStateCreating, +} + +// 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{ + "ACTIVE", + "FAILED", + "INACTIVE", + "DELETING", + "DELETED", + "UPDATING", + "CREATING", + } +} + +// 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/globallydistributeddatabase/private_endpoint_collection.go b/globallydistributeddatabase/private_endpoint_collection.go new file mode 100644 index 0000000000..72bcaa4026 --- /dev/null +++ b/globallydistributeddatabase/private_endpoint_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrivateEndpointCollection Collection of private endpoints. +type PrivateEndpointCollection struct { + + // Array of private endpoint summaries. + Items []PrivateEndpointSummary `mandatory:"true" json:"items"` +} + +func (m PrivateEndpointCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrivateEndpointCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/private_endpoint_summary.go b/globallydistributeddatabase/private_endpoint_summary.go new file mode 100644 index 0000000000..4f871e18be --- /dev/null +++ b/globallydistributeddatabase/private_endpoint_summary.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrivateEndpointSummary PrivateEndpoint resource summary. +type PrivateEndpointSummary struct { + + // PrivateEndpoint identifier + Id *string `mandatory:"true" json:"id"` + + // Identifier of the compartment where private endpoint exists. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Identifier of the customer subnet against which private endpoint is created. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Identifier of the VCN in which subnet exists. + VcnId *string `mandatory:"true" json:"vcnId"` + + // Private endpoint display name. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The time the the private endpoint was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the private endpoint was last updated. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // Lifecycle state of private endpoint. + LifecycleState PrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // PrivateEndpoint description. + Description *string `mandatory:"false" json:"description"` + + // The OCIDs of the network security groups that the private endpoint belongs to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // Detailed message for the lifecycle state. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +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/globallydistributeddatabase/shardable_cloud_autonomous_vm_cluster_summary.go b/globallydistributeddatabase/shardable_cloud_autonomous_vm_cluster_summary.go new file mode 100644 index 0000000000..179f51f62c --- /dev/null +++ b/globallydistributeddatabase/shardable_cloud_autonomous_vm_cluster_summary.go @@ -0,0 +1,193 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShardableCloudAutonomousVmClusterSummary Shardable cloud autonomous vm cluster summary. +type ShardableCloudAutonomousVmClusterSummary struct { + + // Cloud autonomous vmcluster identifier + Id *string `mandatory:"true" json:"id"` + + // Cloud autonomous vmcluster compartment id + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Lifecycle states for shardable Cloud autonomous vm cluster. + LifecycleState ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Cloud autonomous vmcluster displayName + DisplayName *string `mandatory:"true" json:"displayName"` + + // Detailed message for the lifecycle state. + LifecycleStateDetails *string `mandatory:"false" json:"lifecycleStateDetails"` + + // The compute model of the Cloud Autonomous VM Cluster. + ComputeModel *string `mandatory:"false" json:"computeModel"` + + // The number of Autonomous Container Databases that can be created with the currently available local storage. + AvailableContainerDatabases *int `mandatory:"false" json:"availableContainerDatabases"` + + // CPU cores available for allocation to Autonomous Databases. + AvailableCpus *float32 `mandatory:"false" json:"availableCpus"` + + // The name of the availability domain that the cloud Autonomous VM cluster is located in. + // The format of the availability domain is the same as returned by Cloud Autonomous VM Cluster API. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + + // The data disk group size allocated for Autonomous Databases, in TBs. + AutonomousDataStorageSizeInTBs *float32 `mandatory:"false" json:"autonomousDataStorageSizeInTBs"` + + // The data disk group size available for Autonomous Databases, in TBs. + AvailableAutonomousDataStorageSizeInTBs *float32 `mandatory:"false" json:"availableAutonomousDataStorageSizeInTBs"` + + // Cloud Exadata Infrastructure Identifier. + CloudExadataInfrastructureId *string `mandatory:"false" json:"cloudExadataInfrastructureId"` + + // The time zone of the Cloud Autonomous VM Cluster. + ClusterTimeZone *string `mandatory:"false" json:"clusterTimeZone"` + + // The total number of Autonomous Container Databases that can be created with the allocated local storage. + TotalContainerDatabases *int `mandatory:"false" json:"totalContainerDatabases"` + + // Cloud autonomous vmcluster subnet id + SubnetId *string `mandatory:"false" json:"subnetId"` + + // Cloud autonomous vmcluster shape + Shape *string `mandatory:"false" json:"shape"` + + // Cloud autonomous vmcluster node count + NodeCount *int `mandatory:"false" json:"nodeCount"` + + // The Oracle license model that applies to the Oracle Autonomous Database. + LicenseModel *string `mandatory:"false" json:"licenseModel"` + + // The memory allocated in GBs. + MemorySizeInGBs *int `mandatory:"false" json:"memorySizeInGBs"` + + // The amount of memory (in GBs) enabled per OCPU or ECPU. + MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` + + // The number of CPU cores on the cloud Autonomous VM cluster. + CpuCoreCount *int `mandatory:"false" json:"cpuCoreCount"` + + // The number of CPU cores enabled per VM cluster node. + CpuCoreCountPerNode *int `mandatory:"false" json:"cpuCoreCountPerNode"` + + // The number of CPU cores on the cloud Autonomous VM cluster. + OcpuCount *float32 `mandatory:"false" json:"ocpuCount"` + + // The CPUs that continue to be included in the count of CPUs available to the Autonomous Container Database even after one of its Autonomous Database is terminated or scaled down. You can release them to the available CPUs at its parent Autonomous VM Cluster level by restarting the Autonomous Container Database. + ReclaimableCpus *float32 `mandatory:"false" json:"reclaimableCpus"` + + // Number of Autonomous Container Databases that can be created in the Autonomous VM Cluster + ProvisionableAutonomousContainerDatabases *int `mandatory:"false" json:"provisionableAutonomousContainerDatabases"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m ShardableCloudAutonomousVmClusterSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ShardableCloudAutonomousVmClusterSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum(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(GetShardableCloudAutonomousVmClusterSummaryLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum Enum with underlying type: string +type ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum string + +// Set of constants representing the allowable values for ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum +const ( + ShardableCloudAutonomousVmClusterSummaryLifecycleStateActive ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "ACTIVE" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateFailed ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "FAILED" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateNeedsAttention ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "NEEDS_ATTENTION" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateInactive ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "INACTIVE" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateDeleting ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "DELETING" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateDeleted ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "DELETED" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateUpdating ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "UPDATING" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateCreating ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "CREATING" + ShardableCloudAutonomousVmClusterSummaryLifecycleStateUnavailable ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = "UNAVAILABLE" +) + +var mappingShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum = map[string]ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum{ + "ACTIVE": ShardableCloudAutonomousVmClusterSummaryLifecycleStateActive, + "FAILED": ShardableCloudAutonomousVmClusterSummaryLifecycleStateFailed, + "NEEDS_ATTENTION": ShardableCloudAutonomousVmClusterSummaryLifecycleStateNeedsAttention, + "INACTIVE": ShardableCloudAutonomousVmClusterSummaryLifecycleStateInactive, + "DELETING": ShardableCloudAutonomousVmClusterSummaryLifecycleStateDeleting, + "DELETED": ShardableCloudAutonomousVmClusterSummaryLifecycleStateDeleted, + "UPDATING": ShardableCloudAutonomousVmClusterSummaryLifecycleStateUpdating, + "CREATING": ShardableCloudAutonomousVmClusterSummaryLifecycleStateCreating, + "UNAVAILABLE": ShardableCloudAutonomousVmClusterSummaryLifecycleStateUnavailable, +} + +var mappingShardableCloudAutonomousVmClusterSummaryLifecycleStateEnumLowerCase = map[string]ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum{ + "active": ShardableCloudAutonomousVmClusterSummaryLifecycleStateActive, + "failed": ShardableCloudAutonomousVmClusterSummaryLifecycleStateFailed, + "needs_attention": ShardableCloudAutonomousVmClusterSummaryLifecycleStateNeedsAttention, + "inactive": ShardableCloudAutonomousVmClusterSummaryLifecycleStateInactive, + "deleting": ShardableCloudAutonomousVmClusterSummaryLifecycleStateDeleting, + "deleted": ShardableCloudAutonomousVmClusterSummaryLifecycleStateDeleted, + "updating": ShardableCloudAutonomousVmClusterSummaryLifecycleStateUpdating, + "creating": ShardableCloudAutonomousVmClusterSummaryLifecycleStateCreating, + "unavailable": ShardableCloudAutonomousVmClusterSummaryLifecycleStateUnavailable, +} + +// GetShardableCloudAutonomousVmClusterSummaryLifecycleStateEnumValues Enumerates the set of values for ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum +func GetShardableCloudAutonomousVmClusterSummaryLifecycleStateEnumValues() []ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum { + values := make([]ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum, 0) + for _, v := range mappingShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetShardableCloudAutonomousVmClusterSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum +func GetShardableCloudAutonomousVmClusterSummaryLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "FAILED", + "NEEDS_ATTENTION", + "INACTIVE", + "DELETING", + "DELETED", + "UPDATING", + "CREATING", + "UNAVAILABLE", + } +} + +// GetMappingShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum(val string) (ShardableCloudAutonomousVmClusterSummaryLifecycleStateEnum, bool) { + enum, ok := mappingShardableCloudAutonomousVmClusterSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/shardable_cloud_autonomous_vm_clusters.go b/globallydistributeddatabase/shardable_cloud_autonomous_vm_clusters.go new file mode 100644 index 0000000000..94e01de236 --- /dev/null +++ b/globallydistributeddatabase/shardable_cloud_autonomous_vm_clusters.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShardableCloudAutonomousVmClusters Collection of shardable cloud autonomous vm clusters. +type ShardableCloudAutonomousVmClusters struct { + + // Array of shardable cloud autonomous vm clusters summaries. + Items []ShardableCloudAutonomousVmClusterSummary `mandatory:"true" json:"items"` +} + +func (m ShardableCloudAutonomousVmClusters) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ShardableCloudAutonomousVmClusters) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/sharded_database.go b/globallydistributeddatabase/sharded_database.go new file mode 100644 index 0000000000..733d0a46e8 --- /dev/null +++ b/globallydistributeddatabase/sharded_database.go @@ -0,0 +1,291 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShardedDatabase Sharded Database resource. +type ShardedDatabase interface { + + // Sharded Database identifier + GetId() *string + + // Identifier of the compartment in which sharded database exists. + GetCompartmentId() *string + + // Oracle sharded database display name. + GetDisplayName() *string + + // The time the the Sharded Database was created. An RFC3339 formatted datetime string + GetTimeCreated() *common.SDKTime + + // The time the Sharded Database was last updated. An RFC3339 formatted datetime string + GetTimeUpdated() *common.SDKTime + + // Lifecycle states for sharded databases. + GetLifecycleState() ShardedDatabaseLifecycleStateEnum + + // Detailed message for the lifecycle state. + GetLifecycleStateDetails() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type shardeddatabase struct { + JsonData []byte + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + Id *string `mandatory:"true" json:"id"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + DisplayName *string `mandatory:"true" json:"displayName"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + LifecycleState ShardedDatabaseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + LifecycleStateDetails *string `mandatory:"true" json:"lifecycleStateDetails"` + DbDeploymentType string `json:"dbDeploymentType"` +} + +// UnmarshalJSON unmarshals json +func (m *shardeddatabase) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalershardeddatabase shardeddatabase + s := struct { + Model Unmarshalershardeddatabase + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Id = s.Model.Id + m.CompartmentId = s.Model.CompartmentId + m.DisplayName = s.Model.DisplayName + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.LifecycleState = s.Model.LifecycleState + m.LifecycleStateDetails = s.Model.LifecycleStateDetails + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.DbDeploymentType = s.Model.DbDeploymentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *shardeddatabase) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.DbDeploymentType { + case "DEDICATED": + mm := DedicatedShardedDatabase{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for ShardedDatabase: %s.", m.DbDeploymentType) + return *m, nil + } +} + +// GetFreeformTags returns FreeformTags +func (m shardeddatabase) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m shardeddatabase) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m shardeddatabase) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +// GetId returns Id +func (m shardeddatabase) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m shardeddatabase) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m shardeddatabase) GetDisplayName() *string { + return m.DisplayName +} + +// GetTimeCreated returns TimeCreated +func (m shardeddatabase) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m shardeddatabase) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m shardeddatabase) GetLifecycleState() ShardedDatabaseLifecycleStateEnum { + return m.LifecycleState +} + +// GetLifecycleStateDetails returns LifecycleStateDetails +func (m shardeddatabase) GetLifecycleStateDetails() *string { + return m.LifecycleStateDetails +} + +func (m shardeddatabase) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m shardeddatabase) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingShardedDatabaseLifecycleStateEnum(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(GetShardedDatabaseLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ShardedDatabaseLifecycleStateEnum Enum with underlying type: string +type ShardedDatabaseLifecycleStateEnum string + +// Set of constants representing the allowable values for ShardedDatabaseLifecycleStateEnum +const ( + ShardedDatabaseLifecycleStateActive ShardedDatabaseLifecycleStateEnum = "ACTIVE" + ShardedDatabaseLifecycleStateFailed ShardedDatabaseLifecycleStateEnum = "FAILED" + ShardedDatabaseLifecycleStateNeedsAttention ShardedDatabaseLifecycleStateEnum = "NEEDS_ATTENTION" + ShardedDatabaseLifecycleStateInactive ShardedDatabaseLifecycleStateEnum = "INACTIVE" + ShardedDatabaseLifecycleStateDeleting ShardedDatabaseLifecycleStateEnum = "DELETING" + ShardedDatabaseLifecycleStateDeleted ShardedDatabaseLifecycleStateEnum = "DELETED" + ShardedDatabaseLifecycleStateUpdating ShardedDatabaseLifecycleStateEnum = "UPDATING" + ShardedDatabaseLifecycleStateCreating ShardedDatabaseLifecycleStateEnum = "CREATING" + ShardedDatabaseLifecycleStateUnavailable ShardedDatabaseLifecycleStateEnum = "UNAVAILABLE" +) + +var mappingShardedDatabaseLifecycleStateEnum = map[string]ShardedDatabaseLifecycleStateEnum{ + "ACTIVE": ShardedDatabaseLifecycleStateActive, + "FAILED": ShardedDatabaseLifecycleStateFailed, + "NEEDS_ATTENTION": ShardedDatabaseLifecycleStateNeedsAttention, + "INACTIVE": ShardedDatabaseLifecycleStateInactive, + "DELETING": ShardedDatabaseLifecycleStateDeleting, + "DELETED": ShardedDatabaseLifecycleStateDeleted, + "UPDATING": ShardedDatabaseLifecycleStateUpdating, + "CREATING": ShardedDatabaseLifecycleStateCreating, + "UNAVAILABLE": ShardedDatabaseLifecycleStateUnavailable, +} + +var mappingShardedDatabaseLifecycleStateEnumLowerCase = map[string]ShardedDatabaseLifecycleStateEnum{ + "active": ShardedDatabaseLifecycleStateActive, + "failed": ShardedDatabaseLifecycleStateFailed, + "needs_attention": ShardedDatabaseLifecycleStateNeedsAttention, + "inactive": ShardedDatabaseLifecycleStateInactive, + "deleting": ShardedDatabaseLifecycleStateDeleting, + "deleted": ShardedDatabaseLifecycleStateDeleted, + "updating": ShardedDatabaseLifecycleStateUpdating, + "creating": ShardedDatabaseLifecycleStateCreating, + "unavailable": ShardedDatabaseLifecycleStateUnavailable, +} + +// GetShardedDatabaseLifecycleStateEnumValues Enumerates the set of values for ShardedDatabaseLifecycleStateEnum +func GetShardedDatabaseLifecycleStateEnumValues() []ShardedDatabaseLifecycleStateEnum { + values := make([]ShardedDatabaseLifecycleStateEnum, 0) + for _, v := range mappingShardedDatabaseLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetShardedDatabaseLifecycleStateEnumStringValues Enumerates the set of values in String for ShardedDatabaseLifecycleStateEnum +func GetShardedDatabaseLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "FAILED", + "NEEDS_ATTENTION", + "INACTIVE", + "DELETING", + "DELETED", + "UPDATING", + "CREATING", + "UNAVAILABLE", + } +} + +// GetMappingShardedDatabaseLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingShardedDatabaseLifecycleStateEnum(val string) (ShardedDatabaseLifecycleStateEnum, bool) { + enum, ok := mappingShardedDatabaseLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ShardedDatabaseDbDeploymentTypeEnum Enum with underlying type: string +type ShardedDatabaseDbDeploymentTypeEnum string + +// Set of constants representing the allowable values for ShardedDatabaseDbDeploymentTypeEnum +const ( + ShardedDatabaseDbDeploymentTypeDedicated ShardedDatabaseDbDeploymentTypeEnum = "DEDICATED" +) + +var mappingShardedDatabaseDbDeploymentTypeEnum = map[string]ShardedDatabaseDbDeploymentTypeEnum{ + "DEDICATED": ShardedDatabaseDbDeploymentTypeDedicated, +} + +var mappingShardedDatabaseDbDeploymentTypeEnumLowerCase = map[string]ShardedDatabaseDbDeploymentTypeEnum{ + "dedicated": ShardedDatabaseDbDeploymentTypeDedicated, +} + +// GetShardedDatabaseDbDeploymentTypeEnumValues Enumerates the set of values for ShardedDatabaseDbDeploymentTypeEnum +func GetShardedDatabaseDbDeploymentTypeEnumValues() []ShardedDatabaseDbDeploymentTypeEnum { + values := make([]ShardedDatabaseDbDeploymentTypeEnum, 0) + for _, v := range mappingShardedDatabaseDbDeploymentTypeEnum { + values = append(values, v) + } + return values +} + +// GetShardedDatabaseDbDeploymentTypeEnumStringValues Enumerates the set of values in String for ShardedDatabaseDbDeploymentTypeEnum +func GetShardedDatabaseDbDeploymentTypeEnumStringValues() []string { + return []string{ + "DEDICATED", + } +} + +// GetMappingShardedDatabaseDbDeploymentTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingShardedDatabaseDbDeploymentTypeEnum(val string) (ShardedDatabaseDbDeploymentTypeEnum, bool) { + enum, ok := mappingShardedDatabaseDbDeploymentTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/sharded_database_collection.go b/globallydistributeddatabase/sharded_database_collection.go new file mode 100644 index 0000000000..b9a29d0ec6 --- /dev/null +++ b/globallydistributeddatabase/sharded_database_collection.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShardedDatabaseCollection Collection of sharded databases. +type ShardedDatabaseCollection struct { + + // Array of sharded databases summaries. + Items []ShardedDatabaseSummary `mandatory:"true" json:"items"` +} + +func (m ShardedDatabaseCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ShardedDatabaseCollection) 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 *ShardedDatabaseCollection) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []shardeddatabasesummary `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Items = make([]ShardedDatabaseSummary, len(model.Items)) + for i, n := range model.Items { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Items[i] = nn.(ShardedDatabaseSummary) + } else { + m.Items[i] = nil + } + } + return +} diff --git a/globallydistributeddatabase/sharded_database_summary.go b/globallydistributeddatabase/sharded_database_summary.go new file mode 100644 index 0000000000..8b324ab4c8 --- /dev/null +++ b/globallydistributeddatabase/sharded_database_summary.go @@ -0,0 +1,221 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ShardedDatabaseSummary Sharded Database resource summary. +type ShardedDatabaseSummary interface { + + // Sharded Database identifier + GetId() *string + + // Identifier of the compartment where sharded database exists. + GetCompartmentId() *string + + // Oracle sharded database display name. + GetDisplayName() *string + + // The time the the Sharded Database was created. An RFC3339 formatted datetime string + GetTimeCreated() *common.SDKTime + + // The time the Sharded Database was last updated. An RFC3339 formatted datetime string + GetTimeUpdated() *common.SDKTime + + // Lifecycle state of sharded database. + GetLifecycleState() ShardedDatabaseLifecycleStateEnum + + // Detailed message for the lifecycle state. + GetLifecycleStateDetails() *string + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + GetFreeformTags() map[string]string + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + GetDefinedTags() map[string]map[string]interface{} + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + GetSystemTags() map[string]map[string]interface{} +} + +type shardeddatabasesummary struct { + JsonData []byte + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + Id *string `mandatory:"true" json:"id"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + DisplayName *string `mandatory:"true" json:"displayName"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + LifecycleState ShardedDatabaseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + LifecycleStateDetails *string `mandatory:"true" json:"lifecycleStateDetails"` + DbDeploymentType string `json:"dbDeploymentType"` +} + +// UnmarshalJSON unmarshals json +func (m *shardeddatabasesummary) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalershardeddatabasesummary shardeddatabasesummary + s := struct { + Model Unmarshalershardeddatabasesummary + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Id = s.Model.Id + m.CompartmentId = s.Model.CompartmentId + m.DisplayName = s.Model.DisplayName + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.LifecycleState = s.Model.LifecycleState + m.LifecycleStateDetails = s.Model.LifecycleStateDetails + m.FreeformTags = s.Model.FreeformTags + m.DefinedTags = s.Model.DefinedTags + m.SystemTags = s.Model.SystemTags + m.DbDeploymentType = s.Model.DbDeploymentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *shardeddatabasesummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.DbDeploymentType { + case "DEDICATED": + mm := DedicatedShardedDatabaseSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for ShardedDatabaseSummary: %s.", m.DbDeploymentType) + return *m, nil + } +} + +// GetFreeformTags returns FreeformTags +func (m shardeddatabasesummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m shardeddatabasesummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m shardeddatabasesummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +// GetId returns Id +func (m shardeddatabasesummary) GetId() *string { + return m.Id +} + +// GetCompartmentId returns CompartmentId +func (m shardeddatabasesummary) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetDisplayName returns DisplayName +func (m shardeddatabasesummary) GetDisplayName() *string { + return m.DisplayName +} + +// GetTimeCreated returns TimeCreated +func (m shardeddatabasesummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m shardeddatabasesummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m shardeddatabasesummary) GetLifecycleState() ShardedDatabaseLifecycleStateEnum { + return m.LifecycleState +} + +// GetLifecycleStateDetails returns LifecycleStateDetails +func (m shardeddatabasesummary) GetLifecycleStateDetails() *string { + return m.LifecycleStateDetails +} + +func (m shardeddatabasesummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m shardeddatabasesummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingShardedDatabaseLifecycleStateEnum(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(GetShardedDatabaseLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ShardedDatabaseSummaryDbDeploymentTypeEnum Enum with underlying type: string +type ShardedDatabaseSummaryDbDeploymentTypeEnum string + +// Set of constants representing the allowable values for ShardedDatabaseSummaryDbDeploymentTypeEnum +const ( + ShardedDatabaseSummaryDbDeploymentTypeDedicated ShardedDatabaseSummaryDbDeploymentTypeEnum = "DEDICATED" +) + +var mappingShardedDatabaseSummaryDbDeploymentTypeEnum = map[string]ShardedDatabaseSummaryDbDeploymentTypeEnum{ + "DEDICATED": ShardedDatabaseSummaryDbDeploymentTypeDedicated, +} + +var mappingShardedDatabaseSummaryDbDeploymentTypeEnumLowerCase = map[string]ShardedDatabaseSummaryDbDeploymentTypeEnum{ + "dedicated": ShardedDatabaseSummaryDbDeploymentTypeDedicated, +} + +// GetShardedDatabaseSummaryDbDeploymentTypeEnumValues Enumerates the set of values for ShardedDatabaseSummaryDbDeploymentTypeEnum +func GetShardedDatabaseSummaryDbDeploymentTypeEnumValues() []ShardedDatabaseSummaryDbDeploymentTypeEnum { + values := make([]ShardedDatabaseSummaryDbDeploymentTypeEnum, 0) + for _, v := range mappingShardedDatabaseSummaryDbDeploymentTypeEnum { + values = append(values, v) + } + return values +} + +// GetShardedDatabaseSummaryDbDeploymentTypeEnumStringValues Enumerates the set of values in String for ShardedDatabaseSummaryDbDeploymentTypeEnum +func GetShardedDatabaseSummaryDbDeploymentTypeEnumStringValues() []string { + return []string{ + "DEDICATED", + } +} + +// GetMappingShardedDatabaseSummaryDbDeploymentTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingShardedDatabaseSummaryDbDeploymentTypeEnum(val string) (ShardedDatabaseSummaryDbDeploymentTypeEnum, bool) { + enum, ok := mappingShardedDatabaseSummaryDbDeploymentTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/sort_order.go b/globallydistributeddatabase/sort_order.go new file mode 100644 index 0000000000..f1b94cea96 --- /dev/null +++ b/globallydistributeddatabase/sort_order.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "strings" +) + +// SortOrderEnum Enum with underlying type: string +type SortOrderEnum string + +// Set of constants representing the allowable values for SortOrderEnum +const ( + SortOrderAsc SortOrderEnum = "ASC" + SortOrderDesc SortOrderEnum = "DESC" +) + +var mappingSortOrderEnum = map[string]SortOrderEnum{ + "ASC": SortOrderAsc, + "DESC": SortOrderDesc, +} + +var mappingSortOrderEnumLowerCase = map[string]SortOrderEnum{ + "asc": SortOrderAsc, + "desc": SortOrderDesc, +} + +// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum +func GetSortOrderEnumValues() []SortOrderEnum { + values := make([]SortOrderEnum, 0) + for _, v := range mappingSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSortOrderEnumStringValues Enumerates the set of values in String for SortOrderEnum +func GetSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrderEnum(val string) (SortOrderEnum, bool) { + enum, ok := mappingSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/globallydistributeddatabase/start_sharded_database_request_response.go b/globallydistributeddatabase/start_sharded_database_request_response.go new file mode 100644 index 0000000000..d9f575de8c --- /dev/null +++ b/globallydistributeddatabase/start_sharded_database_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// StartShardedDatabaseRequest wrapper for the StartShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/StartShardedDatabase.go.html to see an example of how to use StartShardedDatabaseRequest. +type StartShardedDatabaseRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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"` + + // 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 StartShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StartShardedDatabaseRequest) 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 StartShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StartShardedDatabaseRequest) 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 StartShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StartShardedDatabaseResponse wrapper for the StartShardedDatabase operation +type StartShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 StartShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StartShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/stop_sharded_database_request_response.go b/globallydistributeddatabase/stop_sharded_database_request_response.go new file mode 100644 index 0000000000..91799b5a5d --- /dev/null +++ b/globallydistributeddatabase/stop_sharded_database_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// StopShardedDatabaseRequest wrapper for the StopShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/StopShardedDatabase.go.html to see an example of how to use StopShardedDatabaseRequest. +type StopShardedDatabaseRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // 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"` + + // 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 StopShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StopShardedDatabaseRequest) 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 StopShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StopShardedDatabaseRequest) 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 StopShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StopShardedDatabaseResponse wrapper for the StopShardedDatabase operation +type StopShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 StopShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StopShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/update_private_endpoint_details.go b/globallydistributeddatabase/update_private_endpoint_details.go new file mode 100644 index 0000000000..a6bef65cb5 --- /dev/null +++ b/globallydistributeddatabase/update_private_endpoint_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdatePrivateEndpointDetails The details of private endpoint to be updated. +type UpdatePrivateEndpointDetails struct { + + // Display name for PrivateEndpoint + DisplayName *string `mandatory:"false" json:"displayName"` + + // PrivateEndpoint description. + Description *string `mandatory:"false" json:"description"` + + // The OCIDs of the network security groups that the private endpoint belongs to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m 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/globallydistributeddatabase/update_private_endpoint_request_response.go b/globallydistributeddatabase/update_private_endpoint_request_response.go new file mode 100644 index 0000000000..db5ed0cf05 --- /dev/null +++ b/globallydistributeddatabase/update_private_endpoint_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 globallydistributeddatabase + +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/globallydistributeddatabase/UpdatePrivateEndpoint.go.html to see an example of how to use UpdatePrivateEndpointRequest. +type UpdatePrivateEndpointRequest struct { + + // Oracle Sharded Database PrivateEndpoint identifier + PrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"privateEndpointId"` + + // The configuration of private endpoint to be updated. + UpdatePrivateEndpointDetails `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"` + + // 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 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 + +} + +// 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 + + // The PrivateEndpoint instance + PrivateEndpoint `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 UpdatePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdatePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/update_sharded_database_details.go b/globallydistributeddatabase/update_sharded_database_details.go new file mode 100644 index 0000000000..aa253525f6 --- /dev/null +++ b/globallydistributeddatabase/update_sharded_database_details.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateShardedDatabaseDetails The details of sharded database to be updated. +type UpdateShardedDatabaseDetails struct { + + // Display name of the sharded database. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateShardedDatabaseDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateShardedDatabaseDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/update_sharded_database_request_response.go b/globallydistributeddatabase/update_sharded_database_request_response.go new file mode 100644 index 0000000000..c21b3fd68c --- /dev/null +++ b/globallydistributeddatabase/update_sharded_database_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateShardedDatabaseRequest wrapper for the UpdateShardedDatabase operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/UpdateShardedDatabase.go.html to see an example of how to use UpdateShardedDatabaseRequest. +type UpdateShardedDatabaseRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // The configuration of Sharded database to be updated. + UpdateShardedDatabaseDetails `contributesTo:"body"` + + // 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"` + + // 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 UpdateShardedDatabaseRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateShardedDatabaseRequest) 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 UpdateShardedDatabaseRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateShardedDatabaseRequest) 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 UpdateShardedDatabaseRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateShardedDatabaseResponse wrapper for the UpdateShardedDatabase operation +type UpdateShardedDatabaseResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ShardedDatabase instance + ShardedDatabase `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 UpdateShardedDatabaseResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateShardedDatabaseResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/upload_signed_certificate_and_generate_wallet_details.go b/globallydistributeddatabase/upload_signed_certificate_and_generate_wallet_details.go new file mode 100644 index 0000000000..184804e351 --- /dev/null +++ b/globallydistributeddatabase/upload_signed_certificate_and_generate_wallet_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UploadSignedCertificateAndGenerateWalletDetails Details of the request to upload the CA signed certificates to GSMs and generate wallets for +// GSMs of the sharded database. +type UploadSignedCertificateAndGenerateWalletDetails struct { + + // The CA signed certificate key.. + CaSignedCertificate *string `mandatory:"true" json:"caSignedCertificate"` +} + +func (m UploadSignedCertificateAndGenerateWalletDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UploadSignedCertificateAndGenerateWalletDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/globallydistributeddatabase/upload_signed_certificate_and_generate_wallet_request_response.go b/globallydistributeddatabase/upload_signed_certificate_and_generate_wallet_request_response.go new file mode 100644 index 0000000000..98982e9e83 --- /dev/null +++ b/globallydistributeddatabase/upload_signed_certificate_and_generate_wallet_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UploadSignedCertificateAndGenerateWalletRequest wrapper for the UploadSignedCertificateAndGenerateWallet operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/UploadSignedCertificateAndGenerateWallet.go.html to see an example of how to use UploadSignedCertificateAndGenerateWalletRequest. +type UploadSignedCertificateAndGenerateWalletRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // Details required to upload the CA signed certificates to GSM instances of sharded database and generate + // the wallets. + UploadSignedCertificateAndGenerateWalletDetails `contributesTo:"body"` + + // 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UploadSignedCertificateAndGenerateWalletRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UploadSignedCertificateAndGenerateWalletRequest) 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 UploadSignedCertificateAndGenerateWalletRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UploadSignedCertificateAndGenerateWalletRequest) 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 UploadSignedCertificateAndGenerateWalletRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UploadSignedCertificateAndGenerateWalletResponse wrapper for the UploadSignedCertificateAndGenerateWallet operation +type UploadSignedCertificateAndGenerateWalletResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 UploadSignedCertificateAndGenerateWalletResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UploadSignedCertificateAndGenerateWalletResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/validate_network_request_response.go b/globallydistributeddatabase/validate_network_request_response.go new file mode 100644 index 0000000000..699514f2c5 --- /dev/null +++ b/globallydistributeddatabase/validate_network_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 globallydistributeddatabase + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ValidateNetworkRequest wrapper for the ValidateNetwork operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/globallydistributeddatabase/ValidateNetwork.go.html to see an example of how to use ValidateNetworkRequest. +type ValidateNetworkRequest struct { + + // Sharded Database identifier + ShardedDatabaseId *string `mandatory:"true" contributesTo:"path" name:"shardedDatabaseId"` + + // Determines the surrogates check. Default is true. + IsSurrogate *bool `mandatory:"false" contributesTo:"query" name:"isSurrogate"` + + // Specify the name of shard or catalog. + ResourceName *string `mandatory:"false" contributesTo:"query" name:"resourceName"` + + // Determines if the given resource name is for primary or not. + IsPrimary *bool `mandatory:"false" contributesTo:"query" name:"isPrimary"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ValidateNetworkRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ValidateNetworkRequest) 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 ValidateNetworkRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ValidateNetworkRequest) 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 ValidateNetworkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ValidateNetworkResponse wrapper for the ValidateNetwork operation +type ValidateNetworkResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous work. You can use this to query its status. + 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 ValidateNetworkResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ValidateNetworkResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/globallydistributeddatabase/work_request.go b/globallydistributeddatabase/work_request.go new file mode 100644 index 0000000000..a7722659e8 --- /dev/null +++ b/globallydistributeddatabase/work_request.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/work_request_error.go b/globallydistributeddatabase/work_request_error.go new file mode 100644 index 0000000000..30b88578e5 --- /dev/null +++ b/globallydistributeddatabase/work_request_error.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/work_request_error_collection.go b/globallydistributeddatabase/work_request_error_collection.go new file mode 100644 index 0000000000..78ec7cecd6 --- /dev/null +++ b/globallydistributeddatabase/work_request_error_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/work_request_log_entry.go b/globallydistributeddatabase/work_request_log_entry.go new file mode 100644 index 0000000000..e098cb2099 --- /dev/null +++ b/globallydistributeddatabase/work_request_log_entry.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/work_request_log_entry_collection.go b/globallydistributeddatabase/work_request_log_entry_collection.go new file mode 100644 index 0000000000..a370d02df8 --- /dev/null +++ b/globallydistributeddatabase/work_request_log_entry_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/work_request_resource.go b/globallydistributeddatabase/work_request_resource.go new file mode 100644 index 0000000000..747104a6ba --- /dev/null +++ b/globallydistributeddatabase/work_request_resource.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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/work_request_resource_metadata_key.go b/globallydistributeddatabase/work_request_resource_metadata_key.go new file mode 100644 index 0000000000..1ba56b6348 --- /dev/null +++ b/globallydistributeddatabase/work_request_resource_metadata_key.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +import ( + "strings" +) + +// WorkRequestResourceMetadataKeyEnum Enum with underlying type: string +type WorkRequestResourceMetadataKeyEnum string + +// Set of constants representing the allowable values for WorkRequestResourceMetadataKeyEnum +const ( + WorkRequestResourceMetadataKeyIsDryRun WorkRequestResourceMetadataKeyEnum = "IS_DRY_RUN" +) + +var mappingWorkRequestResourceMetadataKeyEnum = map[string]WorkRequestResourceMetadataKeyEnum{ + "IS_DRY_RUN": WorkRequestResourceMetadataKeyIsDryRun, +} + +var mappingWorkRequestResourceMetadataKeyEnumLowerCase = map[string]WorkRequestResourceMetadataKeyEnum{ + "is_dry_run": WorkRequestResourceMetadataKeyIsDryRun, +} + +// 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{ + "IS_DRY_RUN", + } +} + +// 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/globallydistributeddatabase/work_request_summary.go b/globallydistributeddatabase/work_request_summary.go new file mode 100644 index 0000000000..1aefd814b9 --- /dev/null +++ b/globallydistributeddatabase/work_request_summary.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/globallydistributeddatabase/work_request_summary_collection.go b/globallydistributeddatabase/work_request_summary_collection.go new file mode 100644 index 0000000000..a67ee57584 --- /dev/null +++ b/globallydistributeddatabase/work_request_summary_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. + +// Globally Distributed Database +// +// Use the Globally Distributed Database service APIs to create and manage distributed databases. +// + +package globallydistributeddatabase + +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/keymanagement/cancel_hsm_cluster_deletion_request_response.go b/keymanagement/cancel_hsm_cluster_deletion_request_response.go new file mode 100644 index 0000000000..750cbf4317 --- /dev/null +++ b/keymanagement/cancel_hsm_cluster_deletion_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelHsmClusterDeletionRequest wrapper for the CancelHsmClusterDeletion operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // 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 provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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 CancelHsmClusterDeletionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelHsmClusterDeletionRequest) 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 CancelHsmClusterDeletionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelHsmClusterDeletionRequest) 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 CancelHsmClusterDeletionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelHsmClusterDeletionResponse wrapper for the CancelHsmClusterDeletion operation +type CancelHsmClusterDeletionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `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 CancelHsmClusterDeletionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelHsmClusterDeletionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/change_hsm_cluster_compartment_details.go b/keymanagement/change_hsm_cluster_compartment_details.go new file mode 100644 index 0000000000..8b6885cf68 --- /dev/null +++ b/keymanagement/change_hsm_cluster_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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeHsmClusterCompartmentDetails The details of the compartment you wish to move the Hsm. +type ChangeHsmClusterCompartmentDetails struct { + + // The [OCID] of the compartment to move the hsm to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeHsmClusterCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeHsmClusterCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/change_hsm_cluster_compartment_request_response.go b/keymanagement/change_hsm_cluster_compartment_request_response.go new file mode 100644 index 0000000000..be0ac89849 --- /dev/null +++ b/keymanagement/change_hsm_cluster_compartment_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeHsmClusterCompartmentRequest wrapper for the ChangeHsmClusterCompartment operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Details of change HSM Cluster compartment. + ChangeHsmClusterCompartmentDetails `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 provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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 ChangeHsmClusterCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeHsmClusterCompartmentRequest) 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 ChangeHsmClusterCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeHsmClusterCompartmentRequest) 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 ChangeHsmClusterCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeHsmClusterCompartmentResponse wrapper for the ChangeHsmClusterCompartment operation +type ChangeHsmClusterCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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 ChangeHsmClusterCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeHsmClusterCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/create_hsm_cluster_details.go b/keymanagement/create_hsm_cluster_details.go new file mode 100644 index 0000000000..aa1718b417 --- /dev/null +++ b/keymanagement/create_hsm_cluster_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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateHsmClusterDetails The details of the HSM resource that you want to create. +type CreateHsmClusterDetails struct { + + // The OCID of the compartment where you want to create this HSM 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. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // 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"` + + // 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"` +} + +func (m CreateHsmClusterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateHsmClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/create_hsm_cluster_request_response.go b/keymanagement/create_hsm_cluster_request_response.go new file mode 100644 index 0000000000..5665e3a15f --- /dev/null +++ b/keymanagement/create_hsm_cluster_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateHsmClusterRequest wrapper for the CreateHsmCluster operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateHsmCluster.go.html to see an example of how to use CreateHsmClusterRequest. +type CreateHsmClusterRequest struct { + + // Details for the new HsmCluster resource + CreateHsmClusterDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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 CreateHsmClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateHsmClusterRequest) 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 CreateHsmClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateHsmClusterRequest) 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 CreateHsmClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateHsmClusterResponse wrapper for the CreateHsmCluster operation +type CreateHsmClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `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 CreateHsmClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateHsmClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/download_certificate_signing_request_request_response.go b/keymanagement/download_certificate_signing_request_request_response.go new file mode 100644 index 0000000000..acb2181be7 --- /dev/null +++ b/keymanagement/download_certificate_signing_request_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DownloadCertificateSigningRequestRequest wrapper for the DownloadCertificateSigningRequest operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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"` + + // 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 DownloadCertificateSigningRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DownloadCertificateSigningRequestRequest) 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 DownloadCertificateSigningRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DownloadCertificateSigningRequestRequest) 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 DownloadCertificateSigningRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DownloadCertificateSigningRequestResponse wrapper for the DownloadCertificateSigningRequest operation +type DownloadCertificateSigningRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The string instance + Value *string `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 DownloadCertificateSigningRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DownloadCertificateSigningRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/get_hsm_cluster_request_response.go b/keymanagement/get_hsm_cluster_request_response.go new file mode 100644 index 0000000000..b6e24451f7 --- /dev/null +++ b/keymanagement/get_hsm_cluster_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetHsmClusterRequest wrapper for the GetHsmCluster operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 GetHsmClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHsmClusterRequest) 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 GetHsmClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHsmClusterRequest) 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 GetHsmClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetHsmClusterResponse wrapper for the GetHsmCluster operation +type GetHsmClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `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 GetHsmClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHsmClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/get_hsm_partition_request_response.go b/keymanagement/get_hsm_partition_request_response.go new file mode 100644 index 0000000000..f2f39a345c --- /dev/null +++ b/keymanagement/get_hsm_partition_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetHsmPartitionRequest wrapper for the GetHsmPartition operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // The OCID of the HSM Partition. + HsmPartitionId *string `mandatory:"true" contributesTo:"path" name:"hsmPartitionId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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 GetHsmPartitionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetHsmPartitionRequest) 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 GetHsmPartitionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetHsmPartitionRequest) 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 GetHsmPartitionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetHsmPartitionResponse wrapper for the GetHsmPartition operation +type GetHsmPartitionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmPartition instance + HsmPartition `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 GetHsmPartitionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetHsmPartitionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/get_pre_co_user_credentials_request_response.go b/keymanagement/get_pre_co_user_credentials_request_response.go new file mode 100644 index 0000000000..b0139f8f16 --- /dev/null +++ b/keymanagement/get_pre_co_user_credentials_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetPreCoUserCredentialsRequest wrapper for the GetPreCoUserCredentials operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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 GetPreCoUserCredentialsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetPreCoUserCredentialsRequest) 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 GetPreCoUserCredentialsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetPreCoUserCredentialsRequest) 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 GetPreCoUserCredentialsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetPreCoUserCredentialsResponse wrapper for the GetPreCoUserCredentials operation +type GetPreCoUserCredentialsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The PreCoUserCredentials instance + PreCoUserCredentials `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 GetPreCoUserCredentialsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetPreCoUserCredentialsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/hsm_cluster.go b/keymanagement/hsm_cluster.go new file mode 100644 index 0000000000..9bf9925d9e --- /dev/null +++ b/keymanagement/hsm_cluster.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmCluster Dedicated KMS-HSM Cluster Management +type HsmCluster struct { + + // The OCID of the HSMCluster resource. + Id *string `mandatory:"true" json:"id"` + + // 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. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time this HSM resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2023-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time this HSM resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2023-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The HSMCluster's current state. + // Example: `ACTIVE` + LifecycleState HsmClusterLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // DNS name for the Hsm Cluster. + 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. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` + + // 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"` + + // 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"` +} + +func (m HsmCluster) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmCluster) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmClusterLifecycleStateEnum(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(GetHsmClusterLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// HsmClusterLifecycleStateEnum Enum with underlying type: string +type HsmClusterLifecycleStateEnum string + +// Set of constants representing the allowable values for HsmClusterLifecycleStateEnum +const ( + HsmClusterLifecycleStateCreating HsmClusterLifecycleStateEnum = "CREATING" + HsmClusterLifecycleStateInitializationRequired HsmClusterLifecycleStateEnum = "INITIALIZATION_REQUIRED" + HsmClusterLifecycleStateInitializing HsmClusterLifecycleStateEnum = "INITIALIZING" + HsmClusterLifecycleStateActivationRequired HsmClusterLifecycleStateEnum = "ACTIVATION_REQUIRED" + HsmClusterLifecycleStateActivating HsmClusterLifecycleStateEnum = "ACTIVATING" + HsmClusterLifecycleStateActive HsmClusterLifecycleStateEnum = "ACTIVE" + HsmClusterLifecycleStateDeleting HsmClusterLifecycleStateEnum = "DELETING" + HsmClusterLifecycleStateDeleted HsmClusterLifecycleStateEnum = "DELETED" + HsmClusterLifecycleStatePendingDeletion HsmClusterLifecycleStateEnum = "PENDING_DELETION" + HsmClusterLifecycleStateSchedulingDeletion HsmClusterLifecycleStateEnum = "SCHEDULING_DELETION" + HsmClusterLifecycleStateCancellingDeletion HsmClusterLifecycleStateEnum = "CANCELLING_DELETION" +) + +var mappingHsmClusterLifecycleStateEnum = map[string]HsmClusterLifecycleStateEnum{ + "CREATING": HsmClusterLifecycleStateCreating, + "INITIALIZATION_REQUIRED": HsmClusterLifecycleStateInitializationRequired, + "INITIALIZING": HsmClusterLifecycleStateInitializing, + "ACTIVATION_REQUIRED": HsmClusterLifecycleStateActivationRequired, + "ACTIVATING": HsmClusterLifecycleStateActivating, + "ACTIVE": HsmClusterLifecycleStateActive, + "DELETING": HsmClusterLifecycleStateDeleting, + "DELETED": HsmClusterLifecycleStateDeleted, + "PENDING_DELETION": HsmClusterLifecycleStatePendingDeletion, + "SCHEDULING_DELETION": HsmClusterLifecycleStateSchedulingDeletion, + "CANCELLING_DELETION": HsmClusterLifecycleStateCancellingDeletion, +} + +var mappingHsmClusterLifecycleStateEnumLowerCase = map[string]HsmClusterLifecycleStateEnum{ + "creating": HsmClusterLifecycleStateCreating, + "initialization_required": HsmClusterLifecycleStateInitializationRequired, + "initializing": HsmClusterLifecycleStateInitializing, + "activation_required": HsmClusterLifecycleStateActivationRequired, + "activating": HsmClusterLifecycleStateActivating, + "active": HsmClusterLifecycleStateActive, + "deleting": HsmClusterLifecycleStateDeleting, + "deleted": HsmClusterLifecycleStateDeleted, + "pending_deletion": HsmClusterLifecycleStatePendingDeletion, + "scheduling_deletion": HsmClusterLifecycleStateSchedulingDeletion, + "cancelling_deletion": HsmClusterLifecycleStateCancellingDeletion, +} + +// GetHsmClusterLifecycleStateEnumValues Enumerates the set of values for HsmClusterLifecycleStateEnum +func GetHsmClusterLifecycleStateEnumValues() []HsmClusterLifecycleStateEnum { + values := make([]HsmClusterLifecycleStateEnum, 0) + for _, v := range mappingHsmClusterLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetHsmClusterLifecycleStateEnumStringValues Enumerates the set of values in String for HsmClusterLifecycleStateEnum +func GetHsmClusterLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "INITIALIZATION_REQUIRED", + "INITIALIZING", + "ACTIVATION_REQUIRED", + "ACTIVATING", + "ACTIVE", + "DELETING", + "DELETED", + "PENDING_DELETION", + "SCHEDULING_DELETION", + "CANCELLING_DELETION", + } +} + +// GetMappingHsmClusterLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHsmClusterLifecycleStateEnum(val string) (HsmClusterLifecycleStateEnum, bool) { + enum, ok := mappingHsmClusterLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/keymanagement/hsm_cluster_collection.go b/keymanagement/hsm_cluster_collection.go new file mode 100644 index 0000000000..e3b52788a1 --- /dev/null +++ b/keymanagement/hsm_cluster_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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmClusterCollection HsmClusterCollection object with page of HsmClusterSummary objects. +type HsmClusterCollection struct { + + // List of Hsm Clusters. + Items []HsmClusterSummary `mandatory:"true" json:"items"` +} + +func (m HsmClusterCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmClusterCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/hsm_cluster_summary.go b/keymanagement/hsm_cluster_summary.go new file mode 100644 index 0000000000..44cc6381b9 --- /dev/null +++ b/keymanagement/hsm_cluster_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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmClusterSummary The details of the HSM resource. +type HsmClusterSummary struct { + + // The OCID of a HSMCluster resource. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name for a HSMCluster resource. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID of the compartment that contains a particular HSMCluster resource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A HSMCluster resource's current lifecycle state. + // Example: `ACTIVE` + LifecycleState HsmClusterLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // DNS name for the HSMCluster. + 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. + // Example: `2023-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time a dedicated KMS resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2023-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // An optional property indicating when to delete the resource, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` + + // 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"` + + // 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"` +} + +func (m HsmClusterSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmClusterSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmClusterLifecycleStateEnum(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(GetHsmClusterLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/hsm_partition.go b/keymanagement/hsm_partition.go new file mode 100644 index 0000000000..858d622f6b --- /dev/null +++ b/keymanagement/hsm_partition.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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmPartition Dedicated KMS-HSM Partition Management +type HsmPartition struct { + + // The OCID of the HSM resource. + 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. + 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. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time a HSMPartition was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The HSMPartition's current lifecycle state. + LifecycleState HsmPartitionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` +} + +func (m HsmPartition) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmPartition) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmPartitionLifecycleStateEnum(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(GetHsmPartitionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// HsmPartitionLifecycleStateEnum Enum with underlying type: string +type HsmPartitionLifecycleStateEnum string + +// Set of constants representing the allowable values for HsmPartitionLifecycleStateEnum +const ( + HsmPartitionLifecycleStateActive HsmPartitionLifecycleStateEnum = "ACTIVE" + HsmPartitionLifecycleStateInactive HsmPartitionLifecycleStateEnum = "INACTIVE" + HsmPartitionLifecycleStateActivating HsmPartitionLifecycleStateEnum = "ACTIVATING" + HsmPartitionLifecycleStateActivationRequired HsmPartitionLifecycleStateEnum = "ACTIVATION_REQUIRED" +) + +var mappingHsmPartitionLifecycleStateEnum = map[string]HsmPartitionLifecycleStateEnum{ + "ACTIVE": HsmPartitionLifecycleStateActive, + "INACTIVE": HsmPartitionLifecycleStateInactive, + "ACTIVATING": HsmPartitionLifecycleStateActivating, + "ACTIVATION_REQUIRED": HsmPartitionLifecycleStateActivationRequired, +} + +var mappingHsmPartitionLifecycleStateEnumLowerCase = map[string]HsmPartitionLifecycleStateEnum{ + "active": HsmPartitionLifecycleStateActive, + "inactive": HsmPartitionLifecycleStateInactive, + "activating": HsmPartitionLifecycleStateActivating, + "activation_required": HsmPartitionLifecycleStateActivationRequired, +} + +// GetHsmPartitionLifecycleStateEnumValues Enumerates the set of values for HsmPartitionLifecycleStateEnum +func GetHsmPartitionLifecycleStateEnumValues() []HsmPartitionLifecycleStateEnum { + values := make([]HsmPartitionLifecycleStateEnum, 0) + for _, v := range mappingHsmPartitionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetHsmPartitionLifecycleStateEnumStringValues Enumerates the set of values in String for HsmPartitionLifecycleStateEnum +func GetHsmPartitionLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "INACTIVE", + "ACTIVATING", + "ACTIVATION_REQUIRED", + } +} + +// GetMappingHsmPartitionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingHsmPartitionLifecycleStateEnum(val string) (HsmPartitionLifecycleStateEnum, bool) { + enum, ok := mappingHsmPartitionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/keymanagement/hsm_partition_collection.go b/keymanagement/hsm_partition_collection.go new file mode 100644 index 0000000000..c301e5c2cf --- /dev/null +++ b/keymanagement/hsm_partition_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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmPartitionCollection HsmPartitionCollection object with page of HsmPartitionSummary objects. +type HsmPartitionCollection struct { + + // List of HsmPartitionSummaries. + Items []HsmPartitionSummary `mandatory:"true" json:"items"` +} + +func (m HsmPartitionCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmPartitionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/hsm_partition_summary.go b/keymanagement/hsm_partition_summary.go new file mode 100644 index 0000000000..2337c1d578 --- /dev/null +++ b/keymanagement/hsm_partition_summary.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HsmPartitionSummary The details of the Hsm. +type HsmPartitionSummary struct { + + // The OCID of the HSM resource. + 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. + 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. + 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. + // Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time an HSM was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2018-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` +} + +func (m HsmPartitionSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m HsmPartitionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingHsmPartitionLifecycleStateEnum(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(GetHsmPartitionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/keymanagement_kmshsmcluster_client.go b/keymanagement/keymanagement_kmshsmcluster_client.go new file mode 100644 index 0000000000..130b8c93b7 --- /dev/null +++ b/keymanagement/keymanagement_kmshsmcluster_client.go @@ -0,0 +1,829 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// KmsHsmClusterClient a client for KmsHsmCluster +type KmsHsmClusterClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewKmsHsmClusterClientWithConfigurationProvider Creates a new default KmsHsmCluster client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewKmsHsmClusterClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client KmsHsmClusterClient, err error) { + if enabled := common.CheckForEnabledServices("keymanagement"); !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 newKmsHsmClusterClientFromBaseClient(baseClient, provider) +} + +// NewKmsHsmClusterClientWithOboToken Creates a new default KmsHsmCluster 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 NewKmsHsmClusterClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client KmsHsmClusterClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newKmsHsmClusterClientFromBaseClient(baseClient, configProvider) +} + +func newKmsHsmClusterClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client KmsHsmClusterClient, err error) { + // KmsHsmCluster service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("KmsHsmCluster")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = KmsHsmClusterClient{BaseClient: baseClient} + client.BasePath = "" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *KmsHsmClusterClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("kms", "https://kms.{region}.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *KmsHsmClusterClient) 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 *KmsHsmClusterClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CancelHsmClusterDeletion Cancels deletion of specified HSM Cluster, restores it and associated HSM partitions to pre-deletion states. +// +// # See also +// +// 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 CancelHsmClusterDeletion API. +func (client KmsHsmClusterClient) CancelHsmClusterDeletion(ctx context.Context, request CancelHsmClusterDeletionRequest) (response CancelHsmClusterDeletionResponse, 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.cancelHsmClusterDeletion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelHsmClusterDeletionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelHsmClusterDeletionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelHsmClusterDeletionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelHsmClusterDeletionResponse") + } + return +} + +// cancelHsmClusterDeletion implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) cancelHsmClusterDeletion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/cancelDeletion", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelHsmClusterDeletionResponse + 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/key/release/HsmCluster/CancelHsmClusterDeletion" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "CancelHsmClusterDeletion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeHsmClusterCompartment Moves a HSM Cluster resource to a different compartment within the same tenancy. +// +// # See also +// +// 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 ChangeHsmClusterCompartment API. +func (client KmsHsmClusterClient) ChangeHsmClusterCompartment(ctx context.Context, request ChangeHsmClusterCompartmentRequest) (response ChangeHsmClusterCompartmentResponse, 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.changeHsmClusterCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeHsmClusterCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeHsmClusterCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeHsmClusterCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeHsmClusterCompartmentResponse") + } + return +} + +// changeHsmClusterCompartment implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) changeHsmClusterCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeHsmClusterCompartmentResponse + 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/key/release/HsmCluster/ChangeHsmClusterCompartment" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ChangeHsmClusterCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateHsmCluster Creates a new HSM cluster resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/CreateHsmCluster.go.html to see an example of how to use CreateHsmCluster API. +func (client KmsHsmClusterClient) CreateHsmCluster(ctx context.Context, request CreateHsmClusterRequest) (response CreateHsmClusterResponse, 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.createHsmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateHsmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateHsmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateHsmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateHsmClusterResponse") + } + return +} + +// createHsmCluster implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) createHsmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateHsmClusterResponse + 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/key/release/HsmCluster/CreateHsmCluster" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "CreateHsmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DownloadCertificateSigningRequest Retrieves the certificate signing request for the designated HSM Cluster resource. +// +// # See also +// +// 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 DownloadCertificateSigningRequest API. +func (client KmsHsmClusterClient) DownloadCertificateSigningRequest(ctx context.Context, request DownloadCertificateSigningRequestRequest) (response DownloadCertificateSigningRequestResponse, 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.downloadCertificateSigningRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DownloadCertificateSigningRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DownloadCertificateSigningRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DownloadCertificateSigningRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DownloadCertificateSigningRequestResponse") + } + return +} + +// downloadCertificateSigningRequest implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) downloadCertificateSigningRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/downloadCertificateSigningRequest", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DownloadCertificateSigningRequestResponse + 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/key/release/HsmCluster/DownloadCertificateSigningRequest" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "DownloadCertificateSigningRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHsmCluster Retrieves configuration details for the specified HSM Cluster resource. +// As a provisioning operation, this call is subject to a Key Management limit that applies to +// the total number of requests across all provisioning read operations. Key Management might +// throttle this call to reject an otherwise valid request when the total rate of provisioning +// read operations exceeds 10 requests per second for a given tenancy. +// +// # See also +// +// 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 GetHsmCluster API. +func (client KmsHsmClusterClient) GetHsmCluster(ctx context.Context, request GetHsmClusterRequest) (response GetHsmClusterResponse, 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.getHsmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetHsmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetHsmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetHsmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHsmClusterResponse") + } + return +} + +// getHsmCluster implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) getHsmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetHsmClusterResponse + 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/key/release/HsmCluster/GetHsmCluster" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "GetHsmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetHsmPartition Retrieves HSM partition details for the specified HSM cluster. +// +// # See also +// +// 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 GetHsmPartition API. +func (client KmsHsmClusterClient) GetHsmPartition(ctx context.Context, request GetHsmPartitionRequest) (response GetHsmPartitionResponse, 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.getHsmPartition, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetHsmPartitionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetHsmPartitionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetHsmPartitionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetHsmPartitionResponse") + } + return +} + +// getHsmPartition implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) getHsmPartition(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}/hsmPartitions/{hsmPartitionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetHsmPartitionResponse + 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/key/release/HsmPartition/GetHsmPartition" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "GetHsmPartition", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetPreCoUserCredentials Retrieves Pre Crypto Officer user credentials for the specified HSM cluster. +// +// # See also +// +// 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 GetPreCoUserCredentials API. +func (client KmsHsmClusterClient) GetPreCoUserCredentials(ctx context.Context, request GetPreCoUserCredentialsRequest) (response GetPreCoUserCredentialsResponse, 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.getPreCoUserCredentials, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetPreCoUserCredentialsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetPreCoUserCredentialsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetPreCoUserCredentialsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetPreCoUserCredentialsResponse") + } + return +} + +// getPreCoUserCredentials implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) getPreCoUserCredentials(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}/preCoUserCredentials", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetPreCoUserCredentialsResponse + 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/key/release/HsmCluster/GetPreCoUserCredentials" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "GetPreCoUserCredentials", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHsmClusters Lists all HSM cluster resources contained within the specified compartment. +// As a provisioning operation, this call is subject to a Key Management limit that applies to +// the total number of requests across all provisioning read operations. Key Management might +// throttle this call to reject an otherwise valid request when the total rate of provisioning +// read operations exceeds 10 requests per second for a given tenancy. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListHsmClusters.go.html to see an example of how to use ListHsmClusters API. +func (client KmsHsmClusterClient) ListHsmClusters(ctx context.Context, request ListHsmClustersRequest) (response ListHsmClustersResponse, 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.listHsmClusters, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListHsmClustersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListHsmClustersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListHsmClustersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHsmClustersResponse") + } + return +} + +// listHsmClusters implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) listHsmClusters(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListHsmClustersResponse + 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/key/release/HsmCluster/ListHsmClusters" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ListHsmClusters", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListHsmPartitions Lists all HSM partitions within the specified HSM Cluster resource. +// +// # See also +// +// 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 ListHsmPartitions API. +func (client KmsHsmClusterClient) ListHsmPartitions(ctx context.Context, request ListHsmPartitionsRequest) (response ListHsmPartitionsResponse, 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.listHsmPartitions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListHsmPartitionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListHsmPartitionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListHsmPartitionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListHsmPartitionsResponse") + } + return +} + +// listHsmPartitions implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) listHsmPartitions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/20180608/hsmClusters/{hsmClusterId}/hsmPartitions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListHsmPartitionsResponse + 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/key/release/HsmPartition/ListHsmPartitions" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ListHsmPartitions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ScheduleHsmClusterDeletion Schedules HSM cluster for deletion, update its lifecycle state to 'PENDING_DELETION' +// and deletes it after the retention period. +// +// # See also +// +// 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 ScheduleHsmClusterDeletion API. +func (client KmsHsmClusterClient) ScheduleHsmClusterDeletion(ctx context.Context, request ScheduleHsmClusterDeletionRequest) (response ScheduleHsmClusterDeletionResponse, 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.scheduleHsmClusterDeletion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ScheduleHsmClusterDeletionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ScheduleHsmClusterDeletionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ScheduleHsmClusterDeletionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ScheduleHsmClusterDeletionResponse") + } + return +} + +// scheduleHsmClusterDeletion implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) scheduleHsmClusterDeletion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/scheduleDeletion", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ScheduleHsmClusterDeletionResponse + 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/key/release/HsmCluster/ScheduleHsmClusterDeletion" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "ScheduleHsmClusterDeletion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateHsmCluster Modifies properties of an HSM cluster resource, including `displayName`, `freeformTags` and `definedTags`. +// As a provisioning operation, this call is subject to a Key Management limit that applies to +// the total number of requests across all provisioning write operations. Key Management might +// throttle this call to reject an otherwise valid request when the total rate of provisioning +// write operations exceeds 10 requests per second for a given tenancy. +// +// # See also +// +// 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 UpdateHsmCluster API. +func (client KmsHsmClusterClient) UpdateHsmCluster(ctx context.Context, request UpdateHsmClusterRequest) (response UpdateHsmClusterResponse, 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.updateHsmCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateHsmClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateHsmClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateHsmClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateHsmClusterResponse") + } + return +} + +// updateHsmCluster implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) updateHsmCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/20180608/hsmClusters/{hsmClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateHsmClusterResponse + 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/key/release/HsmCluster/UpdateHsmCluster" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "UpdateHsmCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UploadPartitionCertificates Uploads the partition owner certificates to the HSM Cluster resource. +// +// # See also +// +// 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 UploadPartitionCertificates API. +func (client KmsHsmClusterClient) UploadPartitionCertificates(ctx context.Context, request UploadPartitionCertificatesRequest) (response UploadPartitionCertificatesResponse, 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.uploadPartitionCertificates, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UploadPartitionCertificatesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UploadPartitionCertificatesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UploadPartitionCertificatesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UploadPartitionCertificatesResponse") + } + return +} + +// uploadPartitionCertificates implements the OCIOperation interface (enables retrying operations) +func (client KmsHsmClusterClient) uploadPartitionCertificates(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/20180608/hsmClusters/{hsmClusterId}/actions/uploadPartitionCertificates", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UploadPartitionCertificatesResponse + 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/key/release/HsmCluster/UploadPartitionCertificates" + err = common.PostProcessServiceError(err, "KmsHsmCluster", "UploadPartitionCertificates", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/keymanagement/list_hsm_clusters_request_response.go b/keymanagement/list_hsm_clusters_request_response.go new file mode 100644 index 0000000000..4c05b57c68 --- /dev/null +++ b/keymanagement/list_hsm_clusters_request_response.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. + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListHsmClustersRequest wrapper for the ListHsmClusters operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/keymanagement/ListHsmClusters.go.html to see an example of how to use ListHsmClustersRequest. +type ListHsmClustersRequest struct { + + // The OCID of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for `TIMECREATED` is descending. The default order for `DISPLAYNAME` + // is ascending. + SortBy ListHsmClustersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListHsmClustersSortOrderEnum `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 ListHsmClustersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHsmClustersRequest) 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 ListHsmClustersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHsmClustersRequest) 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 ListHsmClustersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListHsmClustersSortByEnum(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(GetListHsmClustersSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListHsmClustersSortOrderEnum(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(GetListHsmClustersSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListHsmClustersResponse wrapper for the ListHsmClusters operation +type ListHsmClustersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of HsmClusterCollection instances + HsmClusterCollection `presentIn:"body"` + + // 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"` + + // 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 ListHsmClustersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHsmClustersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListHsmClustersSortByEnum Enum with underlying type: string +type ListHsmClustersSortByEnum string + +// Set of constants representing the allowable values for ListHsmClustersSortByEnum +const ( + ListHsmClustersSortByTimecreated ListHsmClustersSortByEnum = "TIMECREATED" + ListHsmClustersSortByDisplayname ListHsmClustersSortByEnum = "DISPLAYNAME" +) + +var mappingListHsmClustersSortByEnum = map[string]ListHsmClustersSortByEnum{ + "TIMECREATED": ListHsmClustersSortByTimecreated, + "DISPLAYNAME": ListHsmClustersSortByDisplayname, +} + +var mappingListHsmClustersSortByEnumLowerCase = map[string]ListHsmClustersSortByEnum{ + "timecreated": ListHsmClustersSortByTimecreated, + "displayname": ListHsmClustersSortByDisplayname, +} + +// GetListHsmClustersSortByEnumValues Enumerates the set of values for ListHsmClustersSortByEnum +func GetListHsmClustersSortByEnumValues() []ListHsmClustersSortByEnum { + values := make([]ListHsmClustersSortByEnum, 0) + for _, v := range mappingListHsmClustersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListHsmClustersSortByEnumStringValues Enumerates the set of values in String for ListHsmClustersSortByEnum +func GetListHsmClustersSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListHsmClustersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmClustersSortByEnum(val string) (ListHsmClustersSortByEnum, bool) { + enum, ok := mappingListHsmClustersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListHsmClustersSortOrderEnum Enum with underlying type: string +type ListHsmClustersSortOrderEnum string + +// Set of constants representing the allowable values for ListHsmClustersSortOrderEnum +const ( + ListHsmClustersSortOrderAsc ListHsmClustersSortOrderEnum = "ASC" + ListHsmClustersSortOrderDesc ListHsmClustersSortOrderEnum = "DESC" +) + +var mappingListHsmClustersSortOrderEnum = map[string]ListHsmClustersSortOrderEnum{ + "ASC": ListHsmClustersSortOrderAsc, + "DESC": ListHsmClustersSortOrderDesc, +} + +var mappingListHsmClustersSortOrderEnumLowerCase = map[string]ListHsmClustersSortOrderEnum{ + "asc": ListHsmClustersSortOrderAsc, + "desc": ListHsmClustersSortOrderDesc, +} + +// GetListHsmClustersSortOrderEnumValues Enumerates the set of values for ListHsmClustersSortOrderEnum +func GetListHsmClustersSortOrderEnumValues() []ListHsmClustersSortOrderEnum { + values := make([]ListHsmClustersSortOrderEnum, 0) + for _, v := range mappingListHsmClustersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListHsmClustersSortOrderEnumStringValues Enumerates the set of values in String for ListHsmClustersSortOrderEnum +func GetListHsmClustersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListHsmClustersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmClustersSortOrderEnum(val string) (ListHsmClustersSortOrderEnum, bool) { + enum, ok := mappingListHsmClustersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/keymanagement/list_hsm_partitions_request_response.go b/keymanagement/list_hsm_partitions_request_response.go new file mode 100644 index 0000000000..6e6a5395a8 --- /dev/null +++ b/keymanagement/list_hsm_partitions_request_response.go @@ -0,0 +1,209 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListHsmPartitionsRequest wrapper for the ListHsmPartitions operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // 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"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for `TIMECREATED` is descending. The default order for `DISPLAYNAME` + // is ascending. + SortBy ListHsmPartitionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListHsmPartitionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // A filter that returns only resources that match the specified lifecycle state. The state value is case-insensitive. + LifecycleState HsmPartitionLifecycleStateEnum `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 ListHsmPartitionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListHsmPartitionsRequest) 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 ListHsmPartitionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListHsmPartitionsRequest) 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 ListHsmPartitionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListHsmPartitionsSortByEnum(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(GetListHsmPartitionsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListHsmPartitionsSortOrderEnum(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(GetListHsmPartitionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingHsmPartitionLifecycleStateEnum(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(GetHsmPartitionLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListHsmPartitionsResponse wrapper for the ListHsmPartitions operation +type ListHsmPartitionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of HsmPartitionCollection instances + HsmPartitionCollection `presentIn:"body"` + + // 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"` + + // 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 ListHsmPartitionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListHsmPartitionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListHsmPartitionsSortByEnum Enum with underlying type: string +type ListHsmPartitionsSortByEnum string + +// Set of constants representing the allowable values for ListHsmPartitionsSortByEnum +const ( + ListHsmPartitionsSortByTimecreated ListHsmPartitionsSortByEnum = "TIMECREATED" + ListHsmPartitionsSortByDisplayname ListHsmPartitionsSortByEnum = "DISPLAYNAME" +) + +var mappingListHsmPartitionsSortByEnum = map[string]ListHsmPartitionsSortByEnum{ + "TIMECREATED": ListHsmPartitionsSortByTimecreated, + "DISPLAYNAME": ListHsmPartitionsSortByDisplayname, +} + +var mappingListHsmPartitionsSortByEnumLowerCase = map[string]ListHsmPartitionsSortByEnum{ + "timecreated": ListHsmPartitionsSortByTimecreated, + "displayname": ListHsmPartitionsSortByDisplayname, +} + +// GetListHsmPartitionsSortByEnumValues Enumerates the set of values for ListHsmPartitionsSortByEnum +func GetListHsmPartitionsSortByEnumValues() []ListHsmPartitionsSortByEnum { + values := make([]ListHsmPartitionsSortByEnum, 0) + for _, v := range mappingListHsmPartitionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListHsmPartitionsSortByEnumStringValues Enumerates the set of values in String for ListHsmPartitionsSortByEnum +func GetListHsmPartitionsSortByEnumStringValues() []string { + return []string{ + "TIMECREATED", + "DISPLAYNAME", + } +} + +// GetMappingListHsmPartitionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmPartitionsSortByEnum(val string) (ListHsmPartitionsSortByEnum, bool) { + enum, ok := mappingListHsmPartitionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListHsmPartitionsSortOrderEnum Enum with underlying type: string +type ListHsmPartitionsSortOrderEnum string + +// Set of constants representing the allowable values for ListHsmPartitionsSortOrderEnum +const ( + ListHsmPartitionsSortOrderAsc ListHsmPartitionsSortOrderEnum = "ASC" + ListHsmPartitionsSortOrderDesc ListHsmPartitionsSortOrderEnum = "DESC" +) + +var mappingListHsmPartitionsSortOrderEnum = map[string]ListHsmPartitionsSortOrderEnum{ + "ASC": ListHsmPartitionsSortOrderAsc, + "DESC": ListHsmPartitionsSortOrderDesc, +} + +var mappingListHsmPartitionsSortOrderEnumLowerCase = map[string]ListHsmPartitionsSortOrderEnum{ + "asc": ListHsmPartitionsSortOrderAsc, + "desc": ListHsmPartitionsSortOrderDesc, +} + +// GetListHsmPartitionsSortOrderEnumValues Enumerates the set of values for ListHsmPartitionsSortOrderEnum +func GetListHsmPartitionsSortOrderEnumValues() []ListHsmPartitionsSortOrderEnum { + values := make([]ListHsmPartitionsSortOrderEnum, 0) + for _, v := range mappingListHsmPartitionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListHsmPartitionsSortOrderEnumStringValues Enumerates the set of values in String for ListHsmPartitionsSortOrderEnum +func GetListHsmPartitionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListHsmPartitionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListHsmPartitionsSortOrderEnum(val string) (ListHsmPartitionsSortOrderEnum, bool) { + enum, ok := mappingListHsmPartitionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/keymanagement/port_information.go b/keymanagement/port_information.go new file mode 100644 index 0000000000..6fbecea61a --- /dev/null +++ b/keymanagement/port_information.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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PortInformation The details of the port. +type PortInformation struct { + + // The port number of the cavium server. + PortNumber *int `mandatory:"true" json:"portNumber"` + + // Port type associated for the port number. + PortType PortInformationPortTypeEnum `mandatory:"true" json:"portType"` +} + +func (m PortInformation) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PortInformation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingPortInformationPortTypeEnum(string(m.PortType)); !ok && m.PortType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for PortType: %s. Supported values are: %s.", m.PortType, strings.Join(GetPortInformationPortTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// PortInformationPortTypeEnum Enum with underlying type: string +type PortInformationPortTypeEnum string + +// Set of constants representing the allowable values for PortInformationPortTypeEnum +const ( + PortInformationPortTypeClientutility PortInformationPortTypeEnum = "CLIENTUTILITY" + PortInformationPortTypeManagementutility PortInformationPortTypeEnum = "MANAGEMENTUTILITY" +) + +var mappingPortInformationPortTypeEnum = map[string]PortInformationPortTypeEnum{ + "CLIENTUTILITY": PortInformationPortTypeClientutility, + "MANAGEMENTUTILITY": PortInformationPortTypeManagementutility, +} + +var mappingPortInformationPortTypeEnumLowerCase = map[string]PortInformationPortTypeEnum{ + "clientutility": PortInformationPortTypeClientutility, + "managementutility": PortInformationPortTypeManagementutility, +} + +// GetPortInformationPortTypeEnumValues Enumerates the set of values for PortInformationPortTypeEnum +func GetPortInformationPortTypeEnumValues() []PortInformationPortTypeEnum { + values := make([]PortInformationPortTypeEnum, 0) + for _, v := range mappingPortInformationPortTypeEnum { + values = append(values, v) + } + return values +} + +// GetPortInformationPortTypeEnumStringValues Enumerates the set of values in String for PortInformationPortTypeEnum +func GetPortInformationPortTypeEnumStringValues() []string { + return []string{ + "CLIENTUTILITY", + "MANAGEMENTUTILITY", + } +} + +// GetMappingPortInformationPortTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPortInformationPortTypeEnum(val string) (PortInformationPortTypeEnum, bool) { + enum, ok := mappingPortInformationPortTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/keymanagement/pre_co_user_credentials.go b/keymanagement/pre_co_user_credentials.go new file mode 100644 index 0000000000..14c2caf543 --- /dev/null +++ b/keymanagement/pre_co_user_credentials.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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PreCoUserCredentials Pre Crypto officer user credentials. +type PreCoUserCredentials struct { + + // The pre crypto officer username.. + Username *string `mandatory:"true" json:"username"` + + // The base 64 encoded pre crypto officer password. + Password *string `mandatory:"true" json:"password"` +} + +func (m PreCoUserCredentials) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PreCoUserCredentials) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/schedule_hsm_cluster_deletion_details.go b/keymanagement/schedule_hsm_cluster_deletion_details.go new file mode 100644 index 0000000000..b73cc5e516 --- /dev/null +++ b/keymanagement/schedule_hsm_cluster_deletion_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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ScheduleHsmClusterDeletionDetails Details for scheduling HSM resource deletion. +type ScheduleHsmClusterDeletionDetails struct { + + // An optional property indicating when to delete the HsmCluster resource, expressed in + // RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. The specified + // time must be between 7 and 30 days from the time when the request is received. + // If this property is missing, it will be set to 30 days from the time of the request + // by default. + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` +} + +func (m ScheduleHsmClusterDeletionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ScheduleHsmClusterDeletionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/schedule_hsm_cluster_deletion_request_response.go b/keymanagement/schedule_hsm_cluster_deletion_request_response.go new file mode 100644 index 0000000000..44d90e08cd --- /dev/null +++ b/keymanagement/schedule_hsm_cluster_deletion_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ScheduleHsmClusterDeletionRequest wrapper for the ScheduleHsmClusterDeletion operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Details of ScheduleHsmClusterDeletionDetails + ScheduleHsmClusterDeletionDetails `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 provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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 ScheduleHsmClusterDeletionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ScheduleHsmClusterDeletionRequest) 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 ScheduleHsmClusterDeletionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ScheduleHsmClusterDeletionRequest) 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 ScheduleHsmClusterDeletionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ScheduleHsmClusterDeletionResponse wrapper for the ScheduleHsmClusterDeletion operation +type ScheduleHsmClusterDeletionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `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 ScheduleHsmClusterDeletionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ScheduleHsmClusterDeletionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/sign_data_details.go b/keymanagement/sign_data_details.go index fcd130ab9b..d5826971f8 100644 --- a/keymanagement/sign_data_details.go +++ b/keymanagement/sign_data_details.go @@ -38,6 +38,10 @@ type SignDataDetails struct { // Denotes whether the value of the message parameter is a raw message or a message digest. // The default value, `RAW`, indicates a message. To indicate a message digest, use `DIGEST`. MessageType SignDataDetailsMessageTypeEnum `mandatory:"false" json:"messageType,omitempty"` + + // Information that can be used to provide context for audit logging. It is a map that contains any additional + // data that you provide to include with audit logs, if audit logging is enabled. + LoggingContext map[string]string `mandatory:"false" json:"loggingContext"` } func (m SignDataDetails) String() string { diff --git a/keymanagement/update_hsm_cluster_details.go b/keymanagement/update_hsm_cluster_details.go new file mode 100644 index 0000000000..0af994e56d --- /dev/null +++ b/keymanagement/update_hsm_cluster_details.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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateHsmClusterDetails The details of the HsmCluster resource that you wish to update. +type UpdateHsmClusterDetails 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). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // A user-friendly name for the HSM resource. It does not have to be unique, and it is changeable. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. + // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` +} + +func (m UpdateHsmClusterDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateHsmClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/update_hsm_cluster_request_response.go b/keymanagement/update_hsm_cluster_request_response.go new file mode 100644 index 0000000000..ca255ccdad --- /dev/null +++ b/keymanagement/update_hsm_cluster_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateHsmClusterRequest wrapper for the UpdateHsmCluster operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // Details of the HsmCluster Resource + UpdateHsmClusterDetails `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 provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 UpdateHsmClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateHsmClusterRequest) 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 UpdateHsmClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateHsmClusterRequest) 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 UpdateHsmClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateHsmClusterResponse wrapper for the UpdateHsmCluster operation +type UpdateHsmClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The HsmCluster instance + HsmCluster `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 UpdateHsmClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateHsmClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/keymanagement/upload_partition_certificates_details.go b/keymanagement/upload_partition_certificates_details.go new file mode 100644 index 0000000000..aaaeea8734 --- /dev/null +++ b/keymanagement/upload_partition_certificates_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. + +// Vault Key Management API +// +// Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingvaults.htm) and Managing Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingkeys.htm). +// + +package keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UploadPartitionCertificatesDetails The details of the partition certificates. +type UploadPartitionCertificatesDetails struct { + + // Base64 encoded (StandardCharsets.UTF_8) Partition Certificate. + PartitionCertificate *string `mandatory:"true" json:"partitionCertificate"` + + // Base64 encoded (StandardCharsets.UTF_8) Partition Owner Certificate. + PartitionOwnerCertificate *string `mandatory:"true" json:"partitionOwnerCertificate"` +} + +func (m UploadPartitionCertificatesDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UploadPartitionCertificatesDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/keymanagement/upload_partition_certificates_request_response.go b/keymanagement/upload_partition_certificates_request_response.go new file mode 100644 index 0000000000..31465d4818 --- /dev/null +++ b/keymanagement/upload_partition_certificates_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 keymanagement + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UploadPartitionCertificatesRequest wrapper for the UploadPartitionCertificates operation +// +// # See also +// +// 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. + HsmClusterId *string `mandatory:"true" contributesTo:"path" name:"hsmClusterId"` + + // To upload partition certificates. + UploadPartitionCertificatesDetails `contributesTo:"body"` + + // Unique identifier for the request. If provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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"` + + // 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 UploadPartitionCertificatesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UploadPartitionCertificatesRequest) 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 UploadPartitionCertificatesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UploadPartitionCertificatesRequest) 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 UploadPartitionCertificatesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UploadPartitionCertificatesResponse wrapper for the UploadPartitionCertificates operation +type UploadPartitionCertificatesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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 UploadPartitionCertificatesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UploadPartitionCertificatesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/managementagent/architecture_types.go b/managementagent/architecture_types.go index e7c515d25b..203413c61f 100644 --- a/managementagent/architecture_types.go +++ b/managementagent/architecture_types.go @@ -19,24 +19,27 @@ type ArchitectureTypesEnum string // Set of constants representing the allowable values for ArchitectureTypesEnum const ( - ArchitectureTypesX8664 ArchitectureTypesEnum = "X86_64" - ArchitectureTypesSparc ArchitectureTypesEnum = "SPARC" - ArchitectureTypesX86 ArchitectureTypesEnum = "X86" - ArchitectureTypesM1 ArchitectureTypesEnum = "M1" + ArchitectureTypesX8664 ArchitectureTypesEnum = "X86_64" + ArchitectureTypesSparc ArchitectureTypesEnum = "SPARC" + ArchitectureTypesX86 ArchitectureTypesEnum = "X86" + ArchitectureTypesM1 ArchitectureTypesEnum = "M1" + ArchitectureTypesAarch64 ArchitectureTypesEnum = "AARCH64" ) var mappingArchitectureTypesEnum = map[string]ArchitectureTypesEnum{ - "X86_64": ArchitectureTypesX8664, - "SPARC": ArchitectureTypesSparc, - "X86": ArchitectureTypesX86, - "M1": ArchitectureTypesM1, + "X86_64": ArchitectureTypesX8664, + "SPARC": ArchitectureTypesSparc, + "X86": ArchitectureTypesX86, + "M1": ArchitectureTypesM1, + "AARCH64": ArchitectureTypesAarch64, } var mappingArchitectureTypesEnumLowerCase = map[string]ArchitectureTypesEnum{ - "x86_64": ArchitectureTypesX8664, - "sparc": ArchitectureTypesSparc, - "x86": ArchitectureTypesX86, - "m1": ArchitectureTypesM1, + "x86_64": ArchitectureTypesX8664, + "sparc": ArchitectureTypesSparc, + "x86": ArchitectureTypesX86, + "m1": ArchitectureTypesM1, + "aarch64": ArchitectureTypesAarch64, } // GetArchitectureTypesEnumValues Enumerates the set of values for ArchitectureTypesEnum @@ -55,6 +58,7 @@ func GetArchitectureTypesEnumStringValues() []string { "SPARC", "X86", "M1", + "AARCH64", } } diff --git a/managementagent/create_data_source_details.go b/managementagent/create_data_source_details.go new file mode 100644 index 0000000000..05dfe31719 --- /dev/null +++ b/managementagent/create_data_source_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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDataSourceDetails A new data source. +type CreateDataSourceDetails interface { + + // Unique name of the DataSource. + GetName() *string + + // Compartment owning this DataSource. + GetCompartmentId() *string +} + +type createdatasourcedetails struct { + JsonData []byte + Name *string `mandatory:"true" json:"name"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *createdatasourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatedatasourcedetails createdatasourcedetails + s := struct { + Model Unmarshalercreatedatasourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Name = s.Model.Name + m.CompartmentId = s.Model.CompartmentId + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createdatasourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "PROMETHEUS_EMITTER": + mm := CreatePrometheusEmitterDataSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for CreateDataSourceDetails: %s.", m.Type) + return *m, nil + } +} + +// GetName returns Name +func (m createdatasourcedetails) GetName() *string { + return m.Name +} + +// GetCompartmentId returns CompartmentId +func (m createdatasourcedetails) GetCompartmentId() *string { + return m.CompartmentId +} + +func (m createdatasourcedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m createdatasourcedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/managementagent/create_data_source_request_response.go b/managementagent/create_data_source_request_response.go new file mode 100644 index 0000000000..df7158985a --- /dev/null +++ b/managementagent/create_data_source_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 managementagent + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDataSourceRequest wrapper for the CreateDataSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/CreateDataSource.go.html to see an example of how to use CreateDataSourceRequest. +type CreateDataSourceRequest struct { + + // Unique Management Agent identifier + ManagementAgentId *string `mandatory:"true" contributesTo:"path" name:"managementAgentId"` + + // Details of DataSource to be created for the given Management Agent. + CreateDataSourceDetails `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"` + + // 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 CreateDataSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDataSourceRequest) 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 CreateDataSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDataSourceRequest) 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 CreateDataSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDataSourceResponse wrapper for the CreateDataSource operation +type CreateDataSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateDataSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDataSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/managementagent/create_prometheus_emitter_data_source_details.go b/managementagent/create_prometheus_emitter_data_source_details.go new file mode 100644 index 0000000000..ba24aa1055 --- /dev/null +++ b/managementagent/create_prometheus_emitter_data_source_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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreatePrometheusEmitterDataSourceDetails A Prometheus emitter data source. +type CreatePrometheusEmitterDataSourceDetails struct { + + // Unique name of the DataSource. + Name *string `mandatory:"true" json:"name"` + + // Compartment owning this DataSource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The url through which the Prometheus Exporter publishes its metrics. (http only) + Url *string `mandatory:"true" json:"url"` + + // The OCI monitoring namespace to which scraped metrics should be uploaded. + Namespace *string `mandatory:"true" json:"namespace"` + + // Comma separated metric name list. The complete set of desired scraped metrics. Use this property to limit the set of metrics uploaded if required. + AllowMetrics *string `mandatory:"false" json:"allowMetrics"` + + // The url of the network proxy that provides access to the Prometheus Exporter's endpoint (url required property). + ProxyUrl *string `mandatory:"false" json:"proxyUrl"` + + // Number in milliseconds. The timeout for connecting to the Prometheus Exporter's endpoint. + ConnectionTimeout *int `mandatory:"false" json:"connectionTimeout"` + + // Number in milliseconds. The timeout for reading the response from the Prometheus Exporter's endpoint. + ReadTimeout *int `mandatory:"false" json:"readTimeout"` + + // Number in kilobytes. The limit on the data being sent, not to exceed the agent's fixed limit of 400 (KB). + ReadDataLimitInKilobytes *int `mandatory:"false" json:"readDataLimitInKilobytes"` + + // Number in minutes. The scraping occurs at the specified interval. + ScheduleMins *int `mandatory:"false" json:"scheduleMins"` + + // OCI monitoring resource group to assign the metric to. + ResourceGroup *string `mandatory:"false" json:"resourceGroup"` + + // The names of other user-supplied properties expressed as fixed values to be used as dimensions for every uploaded datapoint. + MetricDimensions []MetricDimension `mandatory:"false" json:"metricDimensions"` +} + +// GetName returns Name +func (m CreatePrometheusEmitterDataSourceDetails) GetName() *string { + return m.Name +} + +// GetCompartmentId returns CompartmentId +func (m CreatePrometheusEmitterDataSourceDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +func (m CreatePrometheusEmitterDataSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreatePrometheusEmitterDataSourceDetails) 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 CreatePrometheusEmitterDataSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreatePrometheusEmitterDataSourceDetails CreatePrometheusEmitterDataSourceDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreatePrometheusEmitterDataSourceDetails + }{ + "PROMETHEUS_EMITTER", + (MarshalTypeCreatePrometheusEmitterDataSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/managementagent/data_source.go b/managementagent/data_source.go new file mode 100644 index 0000000000..172a966450 --- /dev/null +++ b/managementagent/data_source.go @@ -0,0 +1,145 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataSource A representation of a source configuration setup in the Management Agent. +type DataSource interface { + + // Identifier for DataSource. This represents the type and name for the data source associated with the Management Agent. + GetKey() *string + + // Unique name of the DataSource. + GetName() *string + + // Compartment owning this DataSource. + GetCompartmentId() *string + + // State of the DataSource. + GetState() LifecycleStatesEnum + + // The time the DataSource was created. An RFC3339 formatted datetime string + GetTimeCreated() *common.SDKTime + + // The time the DataSource data was last received. An RFC3339 formatted datetime string + GetTimeUpdated() *common.SDKTime +} + +type datasource struct { + JsonData []byte + Key *string `mandatory:"true" json:"key"` + Name *string `mandatory:"true" json:"name"` + CompartmentId *string `mandatory:"true" json:"compartmentId"` + State LifecycleStatesEnum `mandatory:"true" json:"state"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *datasource) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerdatasource datasource + s := struct { + Model Unmarshalerdatasource + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Key = s.Model.Key + m.Name = s.Model.Name + m.CompartmentId = s.Model.CompartmentId + m.State = s.Model.State + m.TimeCreated = s.Model.TimeCreated + m.TimeUpdated = s.Model.TimeUpdated + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *datasource) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "KUBERNETES_CLUSTER": + mm := KubernetesClusterDataSource{} + err = json.Unmarshal(data, &mm) + return mm, err + case "PROMETHEUS_EMITTER": + mm := PrometheusEmitterDataSource{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for DataSource: %s.", m.Type) + return *m, nil + } +} + +// GetKey returns Key +func (m datasource) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m datasource) GetName() *string { + return m.Name +} + +// GetCompartmentId returns CompartmentId +func (m datasource) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetState returns State +func (m datasource) GetState() LifecycleStatesEnum { + return m.State +} + +// GetTimeCreated returns TimeCreated +func (m datasource) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m datasource) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m datasource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m datasource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingLifecycleStatesEnum(string(m.State)); !ok && m.State != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for State: %s. Supported values are: %s.", m.State, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/managementagent/data_source_summary.go b/managementagent/data_source_summary.go new file mode 100644 index 0000000000..daa37876e0 --- /dev/null +++ b/managementagent/data_source_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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataSourceSummary The information about the dataSources that agent is associated to. +type DataSourceSummary interface { + + // Data source type and name identifier. + GetKey() *string + + // Unique name of the dataSource. + GetName() *string +} + +type datasourcesummary struct { + JsonData []byte + Key *string `mandatory:"true" json:"key"` + Name *string `mandatory:"true" json:"name"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *datasourcesummary) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerdatasourcesummary datasourcesummary + s := struct { + Model Unmarshalerdatasourcesummary + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Key = s.Model.Key + m.Name = s.Model.Name + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *datasourcesummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "PROMETHEUS_EMITTER": + mm := PrometheusEmitterDataSourceSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "KUBERNETES_CLUSTER": + mm := KubernetesClusterDataSourceSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for DataSourceSummary: %s.", m.Type) + return *m, nil + } +} + +// GetKey returns Key +func (m datasourcesummary) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m datasourcesummary) GetName() *string { + return m.Name +} + +func (m datasourcesummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m datasourcesummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/managementagent/data_source_summary_item.go b/managementagent/data_source_summary_item.go new file mode 100644 index 0000000000..e6440cd5d5 --- /dev/null +++ b/managementagent/data_source_summary_item.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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataSourceSummaryItem The information about the dataSources that agent is associated to. +type DataSourceSummaryItem interface { + + // Data source type and name identifier. + GetKey() *string + + // Unique name of the dataSource. + GetName() *string +} + +type datasourcesummaryitem struct { + JsonData []byte + Key *string `mandatory:"true" json:"key"` + Name *string `mandatory:"true" json:"name"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *datasourcesummaryitem) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerdatasourcesummaryitem datasourcesummaryitem + s := struct { + Model Unmarshalerdatasourcesummaryitem + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Key = s.Model.Key + m.Name = s.Model.Name + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *datasourcesummaryitem) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "PROMETHEUS_EMITTER": + mm := PrometheusEmitterDataSourceSummaryItem{} + err = json.Unmarshal(data, &mm) + return mm, err + case "KUBERNETES_CLUSTER": + mm := KubernetesClusterDataSourceSummaryItem{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for DataSourceSummaryItem: %s.", m.Type) + return *m, nil + } +} + +// GetKey returns Key +func (m datasourcesummaryitem) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m datasourcesummaryitem) GetName() *string { + return m.Name +} + +func (m datasourcesummaryitem) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m datasourcesummaryitem) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/managementagent/data_source_types.go b/managementagent/data_source_types.go new file mode 100644 index 0000000000..cedf2972a6 --- /dev/null +++ b/managementagent/data_source_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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "strings" +) + +// DataSourceTypesEnum Enum with underlying type: string +type DataSourceTypesEnum string + +// Set of constants representing the allowable values for DataSourceTypesEnum +const ( + DataSourceTypesKubernetesCluster DataSourceTypesEnum = "KUBERNETES_CLUSTER" + DataSourceTypesPrometheusEmitter DataSourceTypesEnum = "PROMETHEUS_EMITTER" +) + +var mappingDataSourceTypesEnum = map[string]DataSourceTypesEnum{ + "KUBERNETES_CLUSTER": DataSourceTypesKubernetesCluster, + "PROMETHEUS_EMITTER": DataSourceTypesPrometheusEmitter, +} + +var mappingDataSourceTypesEnumLowerCase = map[string]DataSourceTypesEnum{ + "kubernetes_cluster": DataSourceTypesKubernetesCluster, + "prometheus_emitter": DataSourceTypesPrometheusEmitter, +} + +// GetDataSourceTypesEnumValues Enumerates the set of values for DataSourceTypesEnum +func GetDataSourceTypesEnumValues() []DataSourceTypesEnum { + values := make([]DataSourceTypesEnum, 0) + for _, v := range mappingDataSourceTypesEnum { + values = append(values, v) + } + return values +} + +// GetDataSourceTypesEnumStringValues Enumerates the set of values in String for DataSourceTypesEnum +func GetDataSourceTypesEnumStringValues() []string { + return []string{ + "KUBERNETES_CLUSTER", + "PROMETHEUS_EMITTER", + } +} + +// GetMappingDataSourceTypesEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDataSourceTypesEnum(val string) (DataSourceTypesEnum, bool) { + enum, ok := mappingDataSourceTypesEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/managementagent/datatypes.go b/managementagent/datatypes.go deleted file mode 100644 index 1a6814c5bd..0000000000 --- a/managementagent/datatypes.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. -// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -// Code generated. DO NOT EDIT. - -// Management Agent API -// -// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. -// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). -// - -package managementagent - -import ( - "strings" -) - -// DatatypesEnum Enum with underlying type: string -type DatatypesEnum string - -// Set of constants representing the allowable values for DatatypesEnum -const ( - DatatypesLong DatatypesEnum = "LONG" - DatatypesDouble DatatypesEnum = "DOUBLE" - DatatypesInteger DatatypesEnum = "INTEGER" - DatatypesString DatatypesEnum = "STRING" - DatatypesBoolean DatatypesEnum = "BOOLEAN" -) - -var mappingDatatypesEnum = map[string]DatatypesEnum{ - "LONG": DatatypesLong, - "DOUBLE": DatatypesDouble, - "INTEGER": DatatypesInteger, - "STRING": DatatypesString, - "BOOLEAN": DatatypesBoolean, -} - -var mappingDatatypesEnumLowerCase = map[string]DatatypesEnum{ - "long": DatatypesLong, - "double": DatatypesDouble, - "integer": DatatypesInteger, - "string": DatatypesString, - "boolean": DatatypesBoolean, -} - -// GetDatatypesEnumValues Enumerates the set of values for DatatypesEnum -func GetDatatypesEnumValues() []DatatypesEnum { - values := make([]DatatypesEnum, 0) - for _, v := range mappingDatatypesEnum { - values = append(values, v) - } - return values -} - -// GetDatatypesEnumStringValues Enumerates the set of values in String for DatatypesEnum -func GetDatatypesEnumStringValues() []string { - return []string{ - "LONG", - "DOUBLE", - "INTEGER", - "STRING", - "BOOLEAN", - } -} - -// GetMappingDatatypesEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingDatatypesEnum(val string) (DatatypesEnum, bool) { - enum, ok := mappingDatatypesEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/managementagent/delete_data_source_request_response.go b/managementagent/delete_data_source_request_response.go new file mode 100644 index 0000000000..cd4a5413a2 --- /dev/null +++ b/managementagent/delete_data_source_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 managementagent + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDataSourceRequest wrapper for the DeleteDataSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/DeleteDataSource.go.html to see an example of how to use DeleteDataSourceRequest. +type DeleteDataSourceRequest struct { + + // Unique Management Agent identifier + ManagementAgentId *string `mandatory:"true" contributesTo:"path" name:"managementAgentId"` + + // Data source type and name identifier. + DataSourceKey *string `mandatory:"true" contributesTo:"path" name:"dataSourceKey"` + + // 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 DeleteDataSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDataSourceRequest) 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 DeleteDataSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDataSourceRequest) 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 DeleteDataSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDataSourceResponse wrapper for the DeleteDataSource operation +type DeleteDataSourceResponse 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 DeleteDataSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDataSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/managementagent/edit_modes.go b/managementagent/edit_modes.go deleted file mode 100644 index 0fbb783a15..0000000000 --- a/managementagent/edit_modes.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. -// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -// Code generated. DO NOT EDIT. - -// Management Agent API -// -// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. -// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). -// - -package managementagent - -import ( - "strings" -) - -// EditModesEnum Enum with underlying type: string -type EditModesEnum string - -// Set of constants representing the allowable values for EditModesEnum -const ( - EditModesReadOnly EditModesEnum = "READ_ONLY" - EditModesWritable EditModesEnum = "WRITABLE" - EditModesExtensible EditModesEnum = "EXTENSIBLE" -) - -var mappingEditModesEnum = map[string]EditModesEnum{ - "READ_ONLY": EditModesReadOnly, - "WRITABLE": EditModesWritable, - "EXTENSIBLE": EditModesExtensible, -} - -var mappingEditModesEnumLowerCase = map[string]EditModesEnum{ - "read_only": EditModesReadOnly, - "writable": EditModesWritable, - "extensible": EditModesExtensible, -} - -// GetEditModesEnumValues Enumerates the set of values for EditModesEnum -func GetEditModesEnumValues() []EditModesEnum { - values := make([]EditModesEnum, 0) - for _, v := range mappingEditModesEnum { - values = append(values, v) - } - return values -} - -// GetEditModesEnumStringValues Enumerates the set of values in String for EditModesEnum -func GetEditModesEnumStringValues() []string { - return []string{ - "READ_ONLY", - "WRITABLE", - "EXTENSIBLE", - } -} - -// GetMappingEditModesEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingEditModesEnum(val string) (EditModesEnum, bool) { - enum, ok := mappingEditModesEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/managementagent/get_data_source_request_response.go b/managementagent/get_data_source_request_response.go new file mode 100644 index 0000000000..fad484f358 --- /dev/null +++ b/managementagent/get_data_source_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 managementagent + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDataSourceRequest wrapper for the GetDataSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/GetDataSource.go.html to see an example of how to use GetDataSourceRequest. +type GetDataSourceRequest struct { + + // Unique Management Agent identifier + ManagementAgentId *string `mandatory:"true" contributesTo:"path" name:"managementAgentId"` + + // Data source type and name identifier. + DataSourceKey *string `mandatory:"true" contributesTo:"path" name:"dataSourceKey"` + + // 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 GetDataSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDataSourceRequest) 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 GetDataSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDataSourceRequest) 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 GetDataSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDataSourceResponse wrapper for the GetDataSource operation +type GetDataSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DataSource instance + DataSource `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 GetDataSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDataSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/managementagent/kubernetes_cluster_data_source.go b/managementagent/kubernetes_cluster_data_source.go new file mode 100644 index 0000000000..6542a3bd2e --- /dev/null +++ b/managementagent/kubernetes_cluster_data_source.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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// KubernetesClusterDataSource A Kubernetes cluster data source. +type KubernetesClusterDataSource struct { + + // Identifier for DataSource. This represents the type and name for the data source associated with the Management Agent. + Key *string `mandatory:"true" json:"key"` + + // Unique name of the DataSource. + Name *string `mandatory:"true" json:"name"` + + // Compartment owning this DataSource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the DataSource was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the DataSource data was last received. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The Kubernetes namespace + Namespace *string `mandatory:"true" json:"namespace"` + + // If the Kubernetes cluster type is Daemon set then this will be set to true. + IsDaemonSet *bool `mandatory:"false" json:"isDaemonSet"` + + // State of the DataSource. + State LifecycleStatesEnum `mandatory:"true" json:"state"` +} + +// GetKey returns Key +func (m KubernetesClusterDataSource) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m KubernetesClusterDataSource) GetName() *string { + return m.Name +} + +// GetCompartmentId returns CompartmentId +func (m KubernetesClusterDataSource) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetState returns State +func (m KubernetesClusterDataSource) GetState() LifecycleStatesEnum { + return m.State +} + +// GetTimeCreated returns TimeCreated +func (m KubernetesClusterDataSource) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m KubernetesClusterDataSource) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m KubernetesClusterDataSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m KubernetesClusterDataSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingLifecycleStatesEnum(string(m.State)); !ok && m.State != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for State: %s. Supported values are: %s.", m.State, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m KubernetesClusterDataSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypeKubernetesClusterDataSource KubernetesClusterDataSource + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeKubernetesClusterDataSource + }{ + "KUBERNETES_CLUSTER", + (MarshalTypeKubernetesClusterDataSource)(m), + } + + return json.Marshal(&s) +} diff --git a/managementagent/kubernetes_cluster_data_source_summary.go b/managementagent/kubernetes_cluster_data_source_summary.go new file mode 100644 index 0000000000..f5c3acaedd --- /dev/null +++ b/managementagent/kubernetes_cluster_data_source_summary.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// KubernetesClusterDataSourceSummary A Kubernetes collection data source summary. +type KubernetesClusterDataSourceSummary struct { + + // Data source type and name identifier. + Key *string `mandatory:"true" json:"key"` + + // Unique name of the dataSource. + Name *string `mandatory:"true" json:"name"` + + // true if the Kubernetes cluster type is Daemon set + IsDaemonSet *bool `mandatory:"false" json:"isDaemonSet"` +} + +// GetKey returns Key +func (m KubernetesClusterDataSourceSummary) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m KubernetesClusterDataSourceSummary) GetName() *string { + return m.Name +} + +func (m KubernetesClusterDataSourceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m KubernetesClusterDataSourceSummary) 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 KubernetesClusterDataSourceSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeKubernetesClusterDataSourceSummary KubernetesClusterDataSourceSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeKubernetesClusterDataSourceSummary + }{ + "KUBERNETES_CLUSTER", + (MarshalTypeKubernetesClusterDataSourceSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/managementagent/kubernetes_cluster_data_source_summary_item.go b/managementagent/kubernetes_cluster_data_source_summary_item.go new file mode 100644 index 0000000000..32825510f0 --- /dev/null +++ b/managementagent/kubernetes_cluster_data_source_summary_item.go @@ -0,0 +1,71 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// KubernetesClusterDataSourceSummaryItem A Kubernetes collection data source summary. +type KubernetesClusterDataSourceSummaryItem struct { + + // Data source type and name identifier. + Key *string `mandatory:"true" json:"key"` + + // Unique name of the dataSource. + Name *string `mandatory:"true" json:"name"` + + // true if the Kubernetes cluster type is Daemon set + IsDaemonSet *bool `mandatory:"false" json:"isDaemonSet"` +} + +// GetKey returns Key +func (m KubernetesClusterDataSourceSummaryItem) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m KubernetesClusterDataSourceSummaryItem) GetName() *string { + return m.Name +} + +func (m KubernetesClusterDataSourceSummaryItem) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m KubernetesClusterDataSourceSummaryItem) 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 KubernetesClusterDataSourceSummaryItem) MarshalJSON() (buff []byte, e error) { + type MarshalTypeKubernetesClusterDataSourceSummaryItem KubernetesClusterDataSourceSummaryItem + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeKubernetesClusterDataSourceSummaryItem + }{ + "KUBERNETES_CLUSTER", + (MarshalTypeKubernetesClusterDataSourceSummaryItem)(m), + } + + return json.Marshal(&s) +} diff --git a/managementagent/list_data_sources_request_response.go b/managementagent/list_data_sources_request_response.go new file mode 100644 index 0000000000..cee0f9df54 --- /dev/null +++ b/managementagent/list_data_sources_request_response.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. + +package managementagent + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDataSourcesRequest wrapper for the ListDataSources operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/ListDataSources.go.html to see an example of how to use ListDataSourcesRequest. +type ListDataSourcesRequest struct { + + // Unique Management Agent identifier + ManagementAgentId *string `mandatory:"true" contributesTo:"path" name:"managementAgentId"` + + // 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 ListDataSourcesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. If no value is specified dataSourceName is default. + SortBy ListDataSourcesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique name of the dataSource. + Name []string `contributesTo:"query" name:"name" collectionFormat:"multi"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListDataSourcesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDataSourcesRequest) 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 ListDataSourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDataSourcesRequest) 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 ListDataSourcesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListDataSourcesSortOrderEnum(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(GetListDataSourcesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDataSourcesSortByEnum(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(GetListDataSourcesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDataSourcesResponse wrapper for the ListDataSources operation +type ListDataSourcesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []DataSourceSummary instances + Items []DataSourceSummary `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 ListDataSourcesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDataSourcesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDataSourcesSortOrderEnum Enum with underlying type: string +type ListDataSourcesSortOrderEnum string + +// Set of constants representing the allowable values for ListDataSourcesSortOrderEnum +const ( + ListDataSourcesSortOrderAsc ListDataSourcesSortOrderEnum = "ASC" + ListDataSourcesSortOrderDesc ListDataSourcesSortOrderEnum = "DESC" +) + +var mappingListDataSourcesSortOrderEnum = map[string]ListDataSourcesSortOrderEnum{ + "ASC": ListDataSourcesSortOrderAsc, + "DESC": ListDataSourcesSortOrderDesc, +} + +var mappingListDataSourcesSortOrderEnumLowerCase = map[string]ListDataSourcesSortOrderEnum{ + "asc": ListDataSourcesSortOrderAsc, + "desc": ListDataSourcesSortOrderDesc, +} + +// GetListDataSourcesSortOrderEnumValues Enumerates the set of values for ListDataSourcesSortOrderEnum +func GetListDataSourcesSortOrderEnumValues() []ListDataSourcesSortOrderEnum { + values := make([]ListDataSourcesSortOrderEnum, 0) + for _, v := range mappingListDataSourcesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDataSourcesSortOrderEnumStringValues Enumerates the set of values in String for ListDataSourcesSortOrderEnum +func GetListDataSourcesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDataSourcesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDataSourcesSortOrderEnum(val string) (ListDataSourcesSortOrderEnum, bool) { + enum, ok := mappingListDataSourcesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDataSourcesSortByEnum Enum with underlying type: string +type ListDataSourcesSortByEnum string + +// Set of constants representing the allowable values for ListDataSourcesSortByEnum +const ( + ListDataSourcesSortByDatasourcename ListDataSourcesSortByEnum = "dataSourceName" + ListDataSourcesSortByDatasourcetype ListDataSourcesSortByEnum = "dataSourceType" +) + +var mappingListDataSourcesSortByEnum = map[string]ListDataSourcesSortByEnum{ + "dataSourceName": ListDataSourcesSortByDatasourcename, + "dataSourceType": ListDataSourcesSortByDatasourcetype, +} + +var mappingListDataSourcesSortByEnumLowerCase = map[string]ListDataSourcesSortByEnum{ + "datasourcename": ListDataSourcesSortByDatasourcename, + "datasourcetype": ListDataSourcesSortByDatasourcetype, +} + +// GetListDataSourcesSortByEnumValues Enumerates the set of values for ListDataSourcesSortByEnum +func GetListDataSourcesSortByEnumValues() []ListDataSourcesSortByEnum { + values := make([]ListDataSourcesSortByEnum, 0) + for _, v := range mappingListDataSourcesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDataSourcesSortByEnumStringValues Enumerates the set of values in String for ListDataSourcesSortByEnum +func GetListDataSourcesSortByEnumStringValues() []string { + return []string{ + "dataSourceName", + "dataSourceType", + } +} + +// GetMappingListDataSourcesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDataSourcesSortByEnum(val string) (ListDataSourcesSortByEnum, bool) { + enum, ok := mappingListDataSourcesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/managementagent/list_management_agents_request_response.go b/managementagent/list_management_agents_request_response.go index b50d6e1f11..5eb199f11d 100644 --- a/managementagent/list_management_agents_request_response.go +++ b/managementagent/list_management_agents_request_response.go @@ -72,6 +72,12 @@ type ListManagementAgentsRequest struct { // When the value is "ACCESSIBLE", insufficient permissions for a compartment will filter out resources in that compartment without rejecting the request. AccessLevel *string `mandatory:"false" contributesTo:"query" name:"accessLevel"` + // The type of the dataSource. + DataSourceType ListManagementAgentsDataSourceTypeEnum `mandatory:"false" contributesTo:"query" name:"dataSourceType" omitEmpty:"true"` + + // Unique name of the dataSource. + DataSourceName []string `contributesTo:"query" name:"dataSourceName" collectionFormat:"multi"` + // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata @@ -129,6 +135,9 @@ func (request ListManagementAgentsRequest) ValidateEnumValue() (bool, error) { if _, ok := GetMappingListManagementAgentsSortByEnum(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(GetListManagementAgentsSortByEnumStringValues(), ","))) } + if _, ok := GetMappingListManagementAgentsDataSourceTypeEnum(string(request.DataSourceType)); !ok && request.DataSourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataSourceType: %s. Supported values are: %s.", request.DataSourceType, strings.Join(GetListManagementAgentsDataSourceTypeEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -420,3 +429,45 @@ func GetMappingListManagementAgentsSortByEnum(val string) (ListManagementAgentsS enum, ok := mappingListManagementAgentsSortByEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// ListManagementAgentsDataSourceTypeEnum Enum with underlying type: string +type ListManagementAgentsDataSourceTypeEnum string + +// Set of constants representing the allowable values for ListManagementAgentsDataSourceTypeEnum +const ( + ListManagementAgentsDataSourceTypeKubernetesCluster ListManagementAgentsDataSourceTypeEnum = "KUBERNETES_CLUSTER" + ListManagementAgentsDataSourceTypePrometheusEmitter ListManagementAgentsDataSourceTypeEnum = "PROMETHEUS_EMITTER" +) + +var mappingListManagementAgentsDataSourceTypeEnum = map[string]ListManagementAgentsDataSourceTypeEnum{ + "KUBERNETES_CLUSTER": ListManagementAgentsDataSourceTypeKubernetesCluster, + "PROMETHEUS_EMITTER": ListManagementAgentsDataSourceTypePrometheusEmitter, +} + +var mappingListManagementAgentsDataSourceTypeEnumLowerCase = map[string]ListManagementAgentsDataSourceTypeEnum{ + "kubernetes_cluster": ListManagementAgentsDataSourceTypeKubernetesCluster, + "prometheus_emitter": ListManagementAgentsDataSourceTypePrometheusEmitter, +} + +// GetListManagementAgentsDataSourceTypeEnumValues Enumerates the set of values for ListManagementAgentsDataSourceTypeEnum +func GetListManagementAgentsDataSourceTypeEnumValues() []ListManagementAgentsDataSourceTypeEnum { + values := make([]ListManagementAgentsDataSourceTypeEnum, 0) + for _, v := range mappingListManagementAgentsDataSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetListManagementAgentsDataSourceTypeEnumStringValues Enumerates the set of values in String for ListManagementAgentsDataSourceTypeEnum +func GetListManagementAgentsDataSourceTypeEnumStringValues() []string { + return []string{ + "KUBERNETES_CLUSTER", + "PROMETHEUS_EMITTER", + } +} + +// GetMappingListManagementAgentsDataSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListManagementAgentsDataSourceTypeEnum(val string) (ListManagementAgentsDataSourceTypeEnum, bool) { + enum, ok := mappingListManagementAgentsDataSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/managementagent/list_work_requests_request_response.go b/managementagent/list_work_requests_request_response.go index ddce979faf..3bc7702924 100644 --- a/managementagent/list_work_requests_request_response.go +++ b/managementagent/list_work_requests_request_response.go @@ -37,7 +37,7 @@ type ListWorkRequestsRequest struct { Status ListWorkRequestsStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` // The OperationType of the workRequest - Type ListWorkRequestsTypeEnum `mandatory:"false" contributesTo:"query" name:"type" omitEmpty:"true"` + Type []OperationTypesEnum `contributesTo:"query" name:"type" omitEmpty:"true" collectionFormat:"multi"` // Filter for items with timeCreated greater or equal to provided value. // given `timeCreatedGreaterThanOrEqualTo` to the current time, in "YYYY-MM-ddThh:mmZ" format with a @@ -89,9 +89,12 @@ func (request ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { 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 := GetMappingListWorkRequestsTypeEnum(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(GetListWorkRequestsTypeEnumStringValues(), ","))) + for _, val := range request.Type { + if _, ok := GetMappingOperationTypesEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", val, strings.Join(GetOperationTypesEnumStringValues(), ","))) + } } + 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(), ","))) } @@ -194,56 +197,6 @@ func GetMappingListWorkRequestsStatusEnum(val string) (ListWorkRequestsStatusEnu return enum, ok } -// ListWorkRequestsTypeEnum Enum with underlying type: string -type ListWorkRequestsTypeEnum string - -// Set of constants representing the allowable values for ListWorkRequestsTypeEnum -const ( - ListWorkRequestsTypeDeployPlugin ListWorkRequestsTypeEnum = "DEPLOY_PLUGIN" - ListWorkRequestsTypeUpgradePlugin ListWorkRequestsTypeEnum = "UPGRADE_PLUGIN" - ListWorkRequestsTypeCreateUpgradePlugins ListWorkRequestsTypeEnum = "CREATE_UPGRADE_PLUGINS" - ListWorkRequestsTypeAgentimageUpgrade ListWorkRequestsTypeEnum = "AGENTIMAGE_UPGRADE" -) - -var mappingListWorkRequestsTypeEnum = map[string]ListWorkRequestsTypeEnum{ - "DEPLOY_PLUGIN": ListWorkRequestsTypeDeployPlugin, - "UPGRADE_PLUGIN": ListWorkRequestsTypeUpgradePlugin, - "CREATE_UPGRADE_PLUGINS": ListWorkRequestsTypeCreateUpgradePlugins, - "AGENTIMAGE_UPGRADE": ListWorkRequestsTypeAgentimageUpgrade, -} - -var mappingListWorkRequestsTypeEnumLowerCase = map[string]ListWorkRequestsTypeEnum{ - "deploy_plugin": ListWorkRequestsTypeDeployPlugin, - "upgrade_plugin": ListWorkRequestsTypeUpgradePlugin, - "create_upgrade_plugins": ListWorkRequestsTypeCreateUpgradePlugins, - "agentimage_upgrade": ListWorkRequestsTypeAgentimageUpgrade, -} - -// GetListWorkRequestsTypeEnumValues Enumerates the set of values for ListWorkRequestsTypeEnum -func GetListWorkRequestsTypeEnumValues() []ListWorkRequestsTypeEnum { - values := make([]ListWorkRequestsTypeEnum, 0) - for _, v := range mappingListWorkRequestsTypeEnum { - values = append(values, v) - } - return values -} - -// GetListWorkRequestsTypeEnumStringValues Enumerates the set of values in String for ListWorkRequestsTypeEnum -func GetListWorkRequestsTypeEnumStringValues() []string { - return []string{ - "DEPLOY_PLUGIN", - "UPGRADE_PLUGIN", - "CREATE_UPGRADE_PLUGINS", - "AGENTIMAGE_UPGRADE", - } -} - -// GetMappingListWorkRequestsTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingListWorkRequestsTypeEnum(val string) (ListWorkRequestsTypeEnum, bool) { - enum, ok := mappingListWorkRequestsTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} - // ListWorkRequestsSortOrderEnum Enum with underlying type: string type ListWorkRequestsSortOrderEnum string diff --git a/managementagent/management_agent.go b/managementagent/management_agent.go index cda6930a07..e503367f22 100644 --- a/managementagent/management_agent.go +++ b/managementagent/management_agent.go @@ -11,6 +11,7 @@ package managementagent import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -92,6 +93,9 @@ type ManagementAgent struct { // Additional properties for this Management Agent ManagementAgentProperties []ManagementAgentProperty `mandatory:"false" json:"managementAgentProperties"` + // list of dataSources associated with the agent + DataSourceList []DataSource `mandatory:"false" json:"dataSourceList"` + // 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"` @@ -128,3 +132,104 @@ func (m ManagementAgent) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *ManagementAgent) UnmarshalJSON(data []byte) (e error) { + model := struct { + InstallKeyId *string `json:"installKeyId"` + DisplayName *string `json:"displayName"` + PlatformType PlatformTypesEnum `json:"platformType"` + PlatformName *string `json:"platformName"` + PlatformVersion *string `json:"platformVersion"` + ResourceArtifactVersion *string `json:"resourceArtifactVersion"` + Host *string `json:"host"` + HostId *string `json:"hostId"` + InstallPath *string `json:"installPath"` + PluginList []ManagementAgentPluginDetails `json:"pluginList"` + IsAgentAutoUpgradable *bool `json:"isAgentAutoUpgradable"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + TimeLastHeartbeat *common.SDKTime `json:"timeLastHeartbeat"` + AvailabilityStatus AvailabilityStatusEnum `json:"availabilityStatus"` + LifecycleState LifecycleStatesEnum `json:"lifecycleState"` + LifecycleDetails *string `json:"lifecycleDetails"` + IsCustomerDeployed *bool `json:"isCustomerDeployed"` + InstallType InstallTypesEnum `json:"installType"` + ManagementAgentProperties []ManagementAgentProperty `json:"managementAgentProperties"` + DataSourceList []datasource `json:"dataSourceList"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Id *string `json:"id"` + Version *string `json:"version"` + CompartmentId *string `json:"compartmentId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.InstallKeyId = model.InstallKeyId + + m.DisplayName = model.DisplayName + + m.PlatformType = model.PlatformType + + m.PlatformName = model.PlatformName + + m.PlatformVersion = model.PlatformVersion + + m.ResourceArtifactVersion = model.ResourceArtifactVersion + + m.Host = model.Host + + m.HostId = model.HostId + + m.InstallPath = model.InstallPath + + m.PluginList = make([]ManagementAgentPluginDetails, len(model.PluginList)) + copy(m.PluginList, model.PluginList) + m.IsAgentAutoUpgradable = model.IsAgentAutoUpgradable + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.TimeLastHeartbeat = model.TimeLastHeartbeat + + m.AvailabilityStatus = model.AvailabilityStatus + + m.LifecycleState = model.LifecycleState + + m.LifecycleDetails = model.LifecycleDetails + + m.IsCustomerDeployed = model.IsCustomerDeployed + + m.InstallType = model.InstallType + + m.ManagementAgentProperties = make([]ManagementAgentProperty, len(model.ManagementAgentProperties)) + copy(m.ManagementAgentProperties, model.ManagementAgentProperties) + m.DataSourceList = make([]DataSource, len(model.DataSourceList)) + for i, n := range model.DataSourceList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.DataSourceList[i] = nn.(DataSource) + } else { + m.DataSourceList[i] = nil + } + } + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.Id = model.Id + + m.Version = model.Version + + m.CompartmentId = model.CompartmentId + + return +} diff --git a/managementagent/management_agent_summary.go b/managementagent/management_agent_summary.go index 236ff4a6b8..a8d94deac4 100644 --- a/managementagent/management_agent_summary.go +++ b/managementagent/management_agent_summary.go @@ -11,6 +11,7 @@ package managementagent import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -86,6 +87,9 @@ type ManagementAgentSummary struct { // The install type, either AGENT or GATEWAY InstallType InstallTypesEnum `mandatory:"false" json:"installType,omitempty"` + // list of dataSources summaries associated with the agent + DataSourceSummaryList []DataSourceSummaryItem `mandatory:"false" json:"dataSourceSummaryList"` + // 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"` @@ -122,3 +126,98 @@ func (m ManagementAgentSummary) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *ManagementAgentSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + InstallKeyId *string `json:"installKeyId"` + DisplayName *string `json:"displayName"` + PlatformType PlatformTypesEnum `json:"platformType"` + PlatformName *string `json:"platformName"` + PlatformVersion *string `json:"platformVersion"` + ResourceArtifactVersion *string `json:"resourceArtifactVersion"` + IsAgentAutoUpgradable *bool `json:"isAgentAutoUpgradable"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + Host *string `json:"host"` + HostId *string `json:"hostId"` + PluginList []ManagementAgentPluginDetails `json:"pluginList"` + TimeLastHeartbeat *common.SDKTime `json:"timeLastHeartbeat"` + AvailabilityStatus AvailabilityStatusEnum `json:"availabilityStatus"` + LifecycleState LifecycleStatesEnum `json:"lifecycleState"` + LifecycleDetails *string `json:"lifecycleDetails"` + IsCustomerDeployed *bool `json:"isCustomerDeployed"` + InstallType InstallTypesEnum `json:"installType"` + DataSourceSummaryList []datasourcesummaryitem `json:"dataSourceSummaryList"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Id *string `json:"id"` + Version *string `json:"version"` + CompartmentId *string `json:"compartmentId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.InstallKeyId = model.InstallKeyId + + m.DisplayName = model.DisplayName + + m.PlatformType = model.PlatformType + + m.PlatformName = model.PlatformName + + m.PlatformVersion = model.PlatformVersion + + m.ResourceArtifactVersion = model.ResourceArtifactVersion + + m.IsAgentAutoUpgradable = model.IsAgentAutoUpgradable + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.Host = model.Host + + m.HostId = model.HostId + + m.PluginList = make([]ManagementAgentPluginDetails, len(model.PluginList)) + copy(m.PluginList, model.PluginList) + m.TimeLastHeartbeat = model.TimeLastHeartbeat + + m.AvailabilityStatus = model.AvailabilityStatus + + m.LifecycleState = model.LifecycleState + + m.LifecycleDetails = model.LifecycleDetails + + m.IsCustomerDeployed = model.IsCustomerDeployed + + m.InstallType = model.InstallType + + m.DataSourceSummaryList = make([]DataSourceSummaryItem, len(model.DataSourceSummaryList)) + for i, n := range model.DataSourceSummaryList { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.DataSourceSummaryList[i] = nn.(DataSourceSummaryItem) + } else { + m.DataSourceSummaryList[i] = nil + } + } + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.Id = model.Id + + m.Version = model.Version + + m.CompartmentId = model.CompartmentId + + return +} diff --git a/managementagent/managementagent_client.go b/managementagent/managementagent_client.go index ba89101fbd..4070e40ad8 100644 --- a/managementagent/managementagent_client.go +++ b/managementagent/managementagent_client.go @@ -92,6 +92,68 @@ func (client *ManagementAgentClient) ConfigurationProvider() *common.Configurati return client.config } +// CreateDataSource Datasource creation request to given Management Agent. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/CreateDataSource.go.html to see an example of how to use CreateDataSource API. +func (client ManagementAgentClient) CreateDataSource(ctx context.Context, request CreateDataSourceRequest) (response CreateDataSourceResponse, 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.createDataSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDataSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDataSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDataSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDataSourceResponse") + } + return +} + +// createDataSource implements the OCIOperation interface (enables retrying operations) +func (client ManagementAgentClient) createDataSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/managementAgents/{managementAgentId}/dataSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDataSourceResponse + 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/management-agent/20200202/ManagementAgent/CreateDataSource" + err = common.PostProcessServiceError(err, "ManagementAgent", "CreateDataSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateManagementAgentInstallKey User creates a new install key as part of this API. // // # See also @@ -154,6 +216,63 @@ func (client ManagementAgentClient) createManagementAgentInstallKey(ctx context. return response, err } +// DeleteDataSource Datasource delete request to given Management Agent. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/DeleteDataSource.go.html to see an example of how to use DeleteDataSource API. +func (client ManagementAgentClient) DeleteDataSource(ctx context.Context, request DeleteDataSourceRequest) (response DeleteDataSourceResponse, 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.deleteDataSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDataSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDataSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDataSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDataSourceResponse") + } + return +} + +// deleteDataSource implements the OCIOperation interface (enables retrying operations) +func (client ManagementAgentClient) deleteDataSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/managementAgents/{managementAgentId}/dataSources/{dataSourceKey}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDataSourceResponse + 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/management-agent/20200202/ManagementAgent/DeleteDataSource" + err = common.PostProcessServiceError(err, "ManagementAgent", "DeleteDataSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteManagementAgent Deletes a Management Agent resource by identifier // // # See also @@ -445,6 +564,68 @@ func (client ManagementAgentClient) getAutoUpgradableConfig(ctx context.Context, return response, err } +// GetDataSource Get Datasource details for given Id and given Management Agent. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/GetDataSource.go.html to see an example of how to use GetDataSource API. +func (client ManagementAgentClient) GetDataSource(ctx context.Context, request GetDataSourceRequest) (response GetDataSourceResponse, 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.getDataSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDataSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDataSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDataSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDataSourceResponse") + } + return +} + +// getDataSource implements the OCIOperation interface (enables retrying operations) +func (client ManagementAgentClient) getDataSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managementAgents/{managementAgentId}/dataSources/{dataSourceKey}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDataSourceResponse + 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/management-agent/20200202/ManagementAgent/GetDataSource" + err = common.PostProcessServiceError(err, "ManagementAgent", "GetDataSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &datasource{}) + return response, err +} + // GetManagementAgent Gets complete details of the inventory of a given agent id // // # See also @@ -729,6 +910,79 @@ func (client ManagementAgentClient) listAvailabilityHistories(ctx context.Contex return response, err } +// listdatasourcesummary allows to unmarshal list of polymorphic DataSourceSummary +type listdatasourcesummary []datasourcesummary + +// UnmarshalPolymorphicJSON unmarshals polymorphic json list of items +func (m *listdatasourcesummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + res := make([]DataSourceSummary, len(*m)) + for i, v := range *m { + nn, err := v.UnmarshalPolymorphicJSON(v.JsonData) + if err != nil { + return nil, err + } + res[i] = nn.(DataSourceSummary) + } + return res, nil +} + +// ListDataSources A list of Management Agent Data Sources for the given Management Agent Id. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/ListDataSources.go.html to see an example of how to use ListDataSources API. +func (client ManagementAgentClient) ListDataSources(ctx context.Context, request ListDataSourcesRequest) (response ListDataSourcesResponse, 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.listDataSources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDataSourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDataSourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDataSourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDataSourcesResponse") + } + return +} + +// listDataSources implements the OCIOperation interface (enables retrying operations) +func (client ManagementAgentClient) listDataSources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/managementAgents/{managementAgentId}/dataSources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDataSourcesResponse + 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/management-agent/20200202/ManagementAgent/ListDataSources" + err = common.PostProcessServiceError(err, "ManagementAgent", "ListDataSources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listdatasourcesummary{}) + return response, err +} + // ListManagementAgentImages Get supported agent image information // // # See also @@ -1314,6 +1568,68 @@ func (client ManagementAgentClient) summarizeManagementAgentPluginCounts(ctx con return response, err } +// UpdateDataSource Datasource update request to given Management Agent. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/UpdateDataSource.go.html to see an example of how to use UpdateDataSource API. +func (client ManagementAgentClient) UpdateDataSource(ctx context.Context, request UpdateDataSourceRequest) (response UpdateDataSourceResponse, 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.updateDataSource, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateDataSourceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateDataSourceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDataSourceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDataSourceResponse") + } + return +} + +// updateDataSource implements the OCIOperation interface (enables retrying operations) +func (client ManagementAgentClient) updateDataSource(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/managementAgents/{managementAgentId}/dataSources/{dataSourceKey}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateDataSourceResponse + 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/management-agent/20200202/ManagementAgent/UpdateDataSource" + err = common.PostProcessServiceError(err, "ManagementAgent", "UpdateDataSource", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateManagementAgent API to update the console managed properties of the Management Agent. // // # See also diff --git a/managementagent/metric_dimension.go b/managementagent/metric_dimension.go new file mode 100644 index 0000000000..302d43a536 --- /dev/null +++ b/managementagent/metric_dimension.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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MetricDimension Metric Dimension item in name/value pair +type MetricDimension struct { + + // Name of the metric dimension + Name *string `mandatory:"true" json:"name"` + + // Value of the metric dimension + Value *string `mandatory:"true" json:"value"` +} + +func (m MetricDimension) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MetricDimension) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/managementagent/operation_types.go b/managementagent/operation_types.go index bd6b891c61..cc77a7161f 100644 --- a/managementagent/operation_types.go +++ b/managementagent/operation_types.go @@ -23,6 +23,9 @@ const ( OperationTypesUpgradePlugin OperationTypesEnum = "UPGRADE_PLUGIN" OperationTypesCreateUpgradePlugins OperationTypesEnum = "CREATE_UPGRADE_PLUGINS" OperationTypesAgentimageUpgrade OperationTypesEnum = "AGENTIMAGE_UPGRADE" + OperationTypesCreateDataSource OperationTypesEnum = "CREATE_DATA_SOURCE" + OperationTypesUpdateDataSource OperationTypesEnum = "UPDATE_DATA_SOURCE" + OperationTypesDeleteDataSource OperationTypesEnum = "DELETE_DATA_SOURCE" ) var mappingOperationTypesEnum = map[string]OperationTypesEnum{ @@ -30,6 +33,9 @@ var mappingOperationTypesEnum = map[string]OperationTypesEnum{ "UPGRADE_PLUGIN": OperationTypesUpgradePlugin, "CREATE_UPGRADE_PLUGINS": OperationTypesCreateUpgradePlugins, "AGENTIMAGE_UPGRADE": OperationTypesAgentimageUpgrade, + "CREATE_DATA_SOURCE": OperationTypesCreateDataSource, + "UPDATE_DATA_SOURCE": OperationTypesUpdateDataSource, + "DELETE_DATA_SOURCE": OperationTypesDeleteDataSource, } var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ @@ -37,6 +43,9 @@ var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ "upgrade_plugin": OperationTypesUpgradePlugin, "create_upgrade_plugins": OperationTypesCreateUpgradePlugins, "agentimage_upgrade": OperationTypesAgentimageUpgrade, + "create_data_source": OperationTypesCreateDataSource, + "update_data_source": OperationTypesUpdateDataSource, + "delete_data_source": OperationTypesDeleteDataSource, } // GetOperationTypesEnumValues Enumerates the set of values for OperationTypesEnum @@ -55,6 +64,9 @@ func GetOperationTypesEnumStringValues() []string { "UPGRADE_PLUGIN", "CREATE_UPGRADE_PLUGINS", "AGENTIMAGE_UPGRADE", + "CREATE_DATA_SOURCE", + "UPDATE_DATA_SOURCE", + "DELETE_DATA_SOURCE", } } diff --git a/managementagent/prometheus_emitter_data_source.go b/managementagent/prometheus_emitter_data_source.go new file mode 100644 index 0000000000..4c9d62fca4 --- /dev/null +++ b/managementagent/prometheus_emitter_data_source.go @@ -0,0 +1,133 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrometheusEmitterDataSource A Prometheus data source. +type PrometheusEmitterDataSource struct { + + // Identifier for DataSource. This represents the type and name for the data source associated with the Management Agent. + Key *string `mandatory:"true" json:"key"` + + // Unique name of the DataSource. + Name *string `mandatory:"true" json:"name"` + + // Compartment owning this DataSource. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the DataSource was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The time the DataSource data was last received. An RFC3339 formatted datetime string + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The url through which the Prometheus Exporter publishes its metrics. (http only) + Url *string `mandatory:"true" json:"url"` + + // The OCI monitoring namespace to which scraped metrics should be uploaded. + Namespace *string `mandatory:"true" json:"namespace"` + + // Comma separated metric name list. The complete set of desired scraped metrics. Use this property to limit the set of metrics uploaded if required. + AllowMetrics *string `mandatory:"false" json:"allowMetrics"` + + // The url of the network proxy that provides access to the Prometheus Exporter's endpoint (url required property). + ProxyUrl *string `mandatory:"false" json:"proxyUrl"` + + // Number in milliseconds. The timeout for connecting to the Prometheus Exporter's endpoint. + ConnectionTimeout *int `mandatory:"false" json:"connectionTimeout"` + + // Number in milliseconds. The timeout for reading the response from the Prometheus Exporter's endpoint. + ReadTimeout *int `mandatory:"false" json:"readTimeout"` + + // Number in kilobytes. The limit on the data being sent, not to exceed the agent's fixed limit of 400 (KB). + ReadDataLimit *int `mandatory:"false" json:"readDataLimit"` + + // Number in minutes. The scraping occurs at the specified interval. + ScheduleMins *int `mandatory:"false" json:"scheduleMins"` + + // OCI monitoring resource group to assign the metric to. + ResourceGroup *string `mandatory:"false" json:"resourceGroup"` + + // The names of other user-supplied properties expressed as fixed values to be used as dimensions for every uploaded datapoint. + MetricDimensions []MetricDimension `mandatory:"false" json:"metricDimensions"` + + // State of the DataSource. + State LifecycleStatesEnum `mandatory:"true" json:"state"` +} + +// GetKey returns Key +func (m PrometheusEmitterDataSource) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m PrometheusEmitterDataSource) GetName() *string { + return m.Name +} + +// GetCompartmentId returns CompartmentId +func (m PrometheusEmitterDataSource) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetState returns State +func (m PrometheusEmitterDataSource) GetState() LifecycleStatesEnum { + return m.State +} + +// GetTimeCreated returns TimeCreated +func (m PrometheusEmitterDataSource) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m PrometheusEmitterDataSource) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +func (m PrometheusEmitterDataSource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrometheusEmitterDataSource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingLifecycleStatesEnum(string(m.State)); !ok && m.State != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for State: %s. Supported values are: %s.", m.State, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PrometheusEmitterDataSource) MarshalJSON() (buff []byte, e error) { + type MarshalTypePrometheusEmitterDataSource PrometheusEmitterDataSource + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypePrometheusEmitterDataSource + }{ + "PROMETHEUS_EMITTER", + (MarshalTypePrometheusEmitterDataSource)(m), + } + + return json.Marshal(&s) +} diff --git a/managementagent/prometheus_emitter_data_source_summary.go b/managementagent/prometheus_emitter_data_source_summary.go new file mode 100644 index 0000000000..0d7520f08b --- /dev/null +++ b/managementagent/prometheus_emitter_data_source_summary.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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrometheusEmitterDataSourceSummary A Prometheus emitter data source summary. +type PrometheusEmitterDataSourceSummary struct { + + // Data source type and name identifier. + Key *string `mandatory:"true" json:"key"` + + // Unique name of the dataSource. + Name *string `mandatory:"true" json:"name"` +} + +// GetKey returns Key +func (m PrometheusEmitterDataSourceSummary) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m PrometheusEmitterDataSourceSummary) GetName() *string { + return m.Name +} + +func (m PrometheusEmitterDataSourceSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrometheusEmitterDataSourceSummary) 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 PrometheusEmitterDataSourceSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypePrometheusEmitterDataSourceSummary PrometheusEmitterDataSourceSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypePrometheusEmitterDataSourceSummary + }{ + "PROMETHEUS_EMITTER", + (MarshalTypePrometheusEmitterDataSourceSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/managementagent/prometheus_emitter_data_source_summary_item.go b/managementagent/prometheus_emitter_data_source_summary_item.go new file mode 100644 index 0000000000..dab318465d --- /dev/null +++ b/managementagent/prometheus_emitter_data_source_summary_item.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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PrometheusEmitterDataSourceSummaryItem A Prometheus emitter data source summary. +type PrometheusEmitterDataSourceSummaryItem struct { + + // Data source type and name identifier. + Key *string `mandatory:"true" json:"key"` + + // Unique name of the dataSource. + Name *string `mandatory:"true" json:"name"` +} + +// GetKey returns Key +func (m PrometheusEmitterDataSourceSummaryItem) GetKey() *string { + return m.Key +} + +// GetName returns Name +func (m PrometheusEmitterDataSourceSummaryItem) GetName() *string { + return m.Name +} + +func (m PrometheusEmitterDataSourceSummaryItem) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PrometheusEmitterDataSourceSummaryItem) 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 PrometheusEmitterDataSourceSummaryItem) MarshalJSON() (buff []byte, e error) { + type MarshalTypePrometheusEmitterDataSourceSummaryItem PrometheusEmitterDataSourceSummaryItem + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypePrometheusEmitterDataSourceSummaryItem + }{ + "PROMETHEUS_EMITTER", + (MarshalTypePrometheusEmitterDataSourceSummaryItem)(m), + } + + return json.Marshal(&s) +} diff --git a/managementagent/update_data_source_details.go b/managementagent/update_data_source_details.go new file mode 100644 index 0000000000..1887a3edae --- /dev/null +++ b/managementagent/update_data_source_details.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. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDataSourceDetails A request to change the data source. +type UpdateDataSourceDetails interface { +} + +type updatedatasourcedetails struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *updatedatasourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdatedatasourcedetails updatedatasourcedetails + s := struct { + Model Unmarshalerupdatedatasourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updatedatasourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "PROMETHEUS_EMITTER": + mm := UpdatePrometheusEmitterDataSourceDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for UpdateDataSourceDetails: %s.", m.Type) + return *m, nil + } +} + +func (m updatedatasourcedetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m updatedatasourcedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/managementagent/update_data_source_request_response.go b/managementagent/update_data_source_request_response.go new file mode 100644 index 0000000000..db5087aa6d --- /dev/null +++ b/managementagent/update_data_source_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 managementagent + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDataSourceRequest wrapper for the UpdateDataSource operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/managementagent/UpdateDataSource.go.html to see an example of how to use UpdateDataSourceRequest. +type UpdateDataSourceRequest struct { + + // Unique Management Agent identifier + ManagementAgentId *string `mandatory:"true" contributesTo:"path" name:"managementAgentId"` + + // Data source type and name identifier. + DataSourceKey *string `mandatory:"true" contributesTo:"path" name:"dataSourceKey"` + + // Details of DataSource to be update for the given Management Agent. + UpdateDataSourceDetails `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"` + + // 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 UpdateDataSourceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDataSourceRequest) 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 UpdateDataSourceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDataSourceRequest) 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 UpdateDataSourceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDataSourceResponse wrapper for the UpdateDataSource operation +type UpdateDataSourceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateDataSourceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDataSourceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/managementagent/update_prometheus_emitter_data_source_details.go b/managementagent/update_prometheus_emitter_data_source_details.go new file mode 100644 index 0000000000..e5a94c8277 --- /dev/null +++ b/managementagent/update_prometheus_emitter_data_source_details.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Management Agent API +// +// Use the Management Agent API to manage your infrastructure's management agents, including their plugins and install keys. +// For more information, see Management Agent (https://docs.cloud.oracle.com/iaas/management-agents/index.html). +// + +package managementagent + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdatePrometheusEmitterDataSourceDetails A Prometheus data source. +type UpdatePrometheusEmitterDataSourceDetails struct { + + // The url through which the Prometheus Exporter publishes its metrics. (http only) + Url *string `mandatory:"true" json:"url"` + + // Comma separated metric name list. The complete set of desired scraped metrics. Use this property to limit the set of metrics uploaded if required. + AllowMetrics *string `mandatory:"false" json:"allowMetrics"` + + // The url of the network proxy that provides access to the Prometheus Exporter's endpoint (url required property). + ProxyUrl *string `mandatory:"false" json:"proxyUrl"` + + // Number in milliseconds. The timeout for connecting to the Prometheus Exporter's endpoint. + ConnectionTimeout *int `mandatory:"false" json:"connectionTimeout"` + + // Number in milliseconds. The timeout for reading the response from the Prometheus Exporter's endpoint. + ReadTimeout *int `mandatory:"false" json:"readTimeout"` + + // Number in kilobytes. The limit on the data being sent, not to exceed the agent's fixed limit of 400 (KB). + ReadDataLimitInKilobytes *int `mandatory:"false" json:"readDataLimitInKilobytes"` + + // Number in minutes. The scraping occurs at the specified interval. + ScheduleMins *int `mandatory:"false" json:"scheduleMins"` + + // OCI monitoring resource group to assign the metric to. + ResourceGroup *string `mandatory:"false" json:"resourceGroup"` + + // The names of other user-supplied properties expressed as fixed values to be used as dimensions for every uploaded datapoint. + MetricDimensions []MetricDimension `mandatory:"false" json:"metricDimensions"` +} + +func (m UpdatePrometheusEmitterDataSourceDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdatePrometheusEmitterDataSourceDetails) 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 UpdatePrometheusEmitterDataSourceDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdatePrometheusEmitterDataSourceDetails UpdatePrometheusEmitterDataSourceDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeUpdatePrometheusEmitterDataSourceDetails + }{ + "PROMETHEUS_EMITTER", + (MarshalTypeUpdatePrometheusEmitterDataSourceDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/mediaservices/add_lock_details.go b/mediaservices/add_lock_details.go new file mode 100644 index 0000000000..29ed471332 --- /dev/null +++ b/mediaservices/add_lock_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. + +// Media Services API +// +// Media Services (includes Media Flow and Media Streams) is a fully managed service for processing media (video) source content. Use Media Flow and Media Streams to transcode and package digital video using configurable workflows and stream video outputs. +// Use the Media Services API to configure media workflows and run Media Flow jobs, create distribution channels, ingest assets, create Preview URLs and play assets. For more information, see Media Flow (https://docs.cloud.oracle.com/iaas/Content/dms-mediaflow/home.htm) and Media Streams (https://docs.cloud.oracle.com/iaas/Content/dms-mediastream/home.htm). +// + +package mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddLockDetails Request payload to add lock to the resource. The FULL lock type allows no modifications (delete, create, update). +// The DELETE lock type allows all modifications, but delete is not allowed. +// type: object +type AddLockDetails struct { + + // Type of the lock. + Type AddLockDetailsTypeEnum `mandatory:"true" json:"type"` + + // The compartment ID of the lock. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The ID of the Target that is locking this Target. Indicates that deleting this Target 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"` + + // When the lock was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m AddLockDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AddLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAddLockDetailsTypeEnum(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(GetAddLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddLockDetailsTypeEnum Enum with underlying type: string +type AddLockDetailsTypeEnum string + +// Set of constants representing the allowable values for AddLockDetailsTypeEnum +const ( + AddLockDetailsTypeFull AddLockDetailsTypeEnum = "FULL" + AddLockDetailsTypeDelete AddLockDetailsTypeEnum = "DELETE" +) + +var mappingAddLockDetailsTypeEnum = map[string]AddLockDetailsTypeEnum{ + "FULL": AddLockDetailsTypeFull, + "DELETE": AddLockDetailsTypeDelete, +} + +var mappingAddLockDetailsTypeEnumLowerCase = map[string]AddLockDetailsTypeEnum{ + "full": AddLockDetailsTypeFull, + "delete": AddLockDetailsTypeDelete, +} + +// GetAddLockDetailsTypeEnumValues Enumerates the set of values for AddLockDetailsTypeEnum +func GetAddLockDetailsTypeEnumValues() []AddLockDetailsTypeEnum { + values := make([]AddLockDetailsTypeEnum, 0) + for _, v := range mappingAddLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetAddLockDetailsTypeEnumStringValues Enumerates the set of values in String for AddLockDetailsTypeEnum +func GetAddLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingAddLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAddLockDetailsTypeEnum(val string) (AddLockDetailsTypeEnum, bool) { + enum, ok := mappingAddLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mediaservices/add_media_asset_lock_request_response.go b/mediaservices/add_media_asset_lock_request_response.go new file mode 100644 index 0000000000..fbd351d2e5 --- /dev/null +++ b/mediaservices/add_media_asset_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddMediaAssetLockRequest wrapper for the AddMediaAssetLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaAssetLock.go.html to see an example of how to use AddMediaAssetLockRequest. +type AddMediaAssetLockRequest struct { + + // The details to be updated for the AddLock. + AddLockDetails `contributesTo:"body"` + + // Unique MediaAsset identifier + MediaAssetId *string `mandatory:"true" contributesTo:"path" name:"mediaAssetId"` + + // 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"` + + // 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 AddMediaAssetLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddMediaAssetLockRequest) 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 AddMediaAssetLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddMediaAssetLockRequest) 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 AddMediaAssetLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddMediaAssetLockResponse wrapper for the AddMediaAssetLock operation +type AddMediaAssetLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaAsset instance + MediaAsset `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 AddMediaAssetLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddMediaAssetLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/add_media_workflow_configuration_lock_request_response.go b/mediaservices/add_media_workflow_configuration_lock_request_response.go new file mode 100644 index 0000000000..2e510cb457 --- /dev/null +++ b/mediaservices/add_media_workflow_configuration_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddMediaWorkflowConfigurationLockRequest wrapper for the AddMediaWorkflowConfigurationLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaWorkflowConfigurationLock.go.html to see an example of how to use AddMediaWorkflowConfigurationLockRequest. +type AddMediaWorkflowConfigurationLockRequest struct { + + // AddResourceLockDetails body parameter + AddResourceLockDetails AddLockDetails `contributesTo:"body"` + + // Unique MediaWorkflowConfiguration identifier. + MediaWorkflowConfigurationId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowConfigurationId"` + + // 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"` + + // 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"` + + // 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 AddMediaWorkflowConfigurationLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddMediaWorkflowConfigurationLockRequest) 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 AddMediaWorkflowConfigurationLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddMediaWorkflowConfigurationLockRequest) 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 AddMediaWorkflowConfigurationLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddMediaWorkflowConfigurationLockResponse wrapper for the AddMediaWorkflowConfigurationLock operation +type AddMediaWorkflowConfigurationLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaWorkflowConfiguration instance + MediaWorkflowConfiguration `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 AddMediaWorkflowConfigurationLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddMediaWorkflowConfigurationLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/add_media_workflow_job_lock_request_response.go b/mediaservices/add_media_workflow_job_lock_request_response.go new file mode 100644 index 0000000000..0f7db8e192 --- /dev/null +++ b/mediaservices/add_media_workflow_job_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddMediaWorkflowJobLockRequest wrapper for the AddMediaWorkflowJobLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaWorkflowJobLock.go.html to see an example of how to use AddMediaWorkflowJobLockRequest. +type AddMediaWorkflowJobLockRequest struct { + + // The details to be updated for the AddLock. + AddLockDetails `contributesTo:"body"` + + // Unique MediaWorkflowJob identifier. + MediaWorkflowJobId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowJobId"` + + // 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"` + + // 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 AddMediaWorkflowJobLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddMediaWorkflowJobLockRequest) 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 AddMediaWorkflowJobLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddMediaWorkflowJobLockRequest) 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 AddMediaWorkflowJobLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddMediaWorkflowJobLockResponse wrapper for the AddMediaWorkflowJobLock operation +type AddMediaWorkflowJobLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaWorkflowJob instance + MediaWorkflowJob `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 AddMediaWorkflowJobLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddMediaWorkflowJobLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/add_media_workflow_lock_request_response.go b/mediaservices/add_media_workflow_lock_request_response.go new file mode 100644 index 0000000000..3f77b050f9 --- /dev/null +++ b/mediaservices/add_media_workflow_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddMediaWorkflowLockRequest wrapper for the AddMediaWorkflowLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaWorkflowLock.go.html to see an example of how to use AddMediaWorkflowLockRequest. +type AddMediaWorkflowLockRequest struct { + + // AddResourceLockDetails body parameter + AddResourceLockDetails AddLockDetails `contributesTo:"body"` + + // Unique MediaWorkflow identifier. + MediaWorkflowId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowId"` + + // 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"` + + // 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 AddMediaWorkflowLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddMediaWorkflowLockRequest) 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 AddMediaWorkflowLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddMediaWorkflowLockRequest) 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 AddMediaWorkflowLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddMediaWorkflowLockResponse wrapper for the AddMediaWorkflowLock operation +type AddMediaWorkflowLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaWorkflow instance + MediaWorkflow `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 AddMediaWorkflowLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddMediaWorkflowLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/add_stream_cdn_config_lock_request_response.go b/mediaservices/add_stream_cdn_config_lock_request_response.go new file mode 100644 index 0000000000..ac4e946d43 --- /dev/null +++ b/mediaservices/add_stream_cdn_config_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddStreamCdnConfigLockRequest wrapper for the AddStreamCdnConfigLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddStreamCdnConfigLock.go.html to see an example of how to use AddStreamCdnConfigLockRequest. +type AddStreamCdnConfigLockRequest struct { + + // AddResourceLockDetails body parameter + AddResourceLockDetails AddLockDetails `contributesTo:"body"` + + // Unique StreamCdnConfig identifier. + StreamCdnConfigId *string `mandatory:"true" contributesTo:"path" name:"streamCdnConfigId"` + + // 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"` + + // 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"` + + // 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 AddStreamCdnConfigLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddStreamCdnConfigLockRequest) 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 AddStreamCdnConfigLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddStreamCdnConfigLockRequest) 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 AddStreamCdnConfigLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddStreamCdnConfigLockResponse wrapper for the AddStreamCdnConfigLock operation +type AddStreamCdnConfigLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The StreamCdnConfig instance + StreamCdnConfig `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 AddStreamCdnConfigLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddStreamCdnConfigLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/add_stream_distribution_channel_lock_request_response.go b/mediaservices/add_stream_distribution_channel_lock_request_response.go new file mode 100644 index 0000000000..71e161dc1f --- /dev/null +++ b/mediaservices/add_stream_distribution_channel_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddStreamDistributionChannelLockRequest wrapper for the AddStreamDistributionChannelLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddStreamDistributionChannelLock.go.html to see an example of how to use AddStreamDistributionChannelLockRequest. +type AddStreamDistributionChannelLockRequest struct { + + // AddResourceLockDetails body parameter + AddResourceLockDetails AddLockDetails `contributesTo:"body"` + + // Unique Stream Distribution Channel path identifier. + StreamDistributionChannelId *string `mandatory:"true" contributesTo:"path" name:"streamDistributionChannelId"` + + // 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"` + + // 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"` + + // 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 AddStreamDistributionChannelLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddStreamDistributionChannelLockRequest) 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 AddStreamDistributionChannelLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddStreamDistributionChannelLockRequest) 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 AddStreamDistributionChannelLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddStreamDistributionChannelLockResponse wrapper for the AddStreamDistributionChannelLock operation +type AddStreamDistributionChannelLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The StreamDistributionChannel instance + StreamDistributionChannel `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 AddStreamDistributionChannelLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddStreamDistributionChannelLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/add_stream_packaging_config_lock_request_response.go b/mediaservices/add_stream_packaging_config_lock_request_response.go new file mode 100644 index 0000000000..08aa130823 --- /dev/null +++ b/mediaservices/add_stream_packaging_config_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddStreamPackagingConfigLockRequest wrapper for the AddStreamPackagingConfigLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddStreamPackagingConfigLock.go.html to see an example of how to use AddStreamPackagingConfigLockRequest. +type AddStreamPackagingConfigLockRequest struct { + + // AddResourceLockDetails body parameter + AddResourceLockDetails AddLockDetails `contributesTo:"body"` + + // Unique Stream Packaging Configuration path identifier. + StreamPackagingConfigId *string `mandatory:"true" contributesTo:"path" name:"streamPackagingConfigId"` + + // 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"` + + // 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"` + + // 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 AddStreamPackagingConfigLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddStreamPackagingConfigLockRequest) 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 AddStreamPackagingConfigLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddStreamPackagingConfigLockRequest) 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 AddStreamPackagingConfigLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddStreamPackagingConfigLockResponse wrapper for the AddStreamPackagingConfigLock operation +type AddStreamPackagingConfigLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The StreamPackagingConfig instance + StreamPackagingConfig `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 AddStreamPackagingConfigLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddStreamPackagingConfigLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/change_media_asset_compartment_request_response.go b/mediaservices/change_media_asset_compartment_request_response.go index 07c33da40e..541b65e7de 100644 --- a/mediaservices/change_media_asset_compartment_request_response.go +++ b/mediaservices/change_media_asset_compartment_request_response.go @@ -24,6 +24,9 @@ type ChangeMediaAssetCompartmentRequest struct { // The information to be updated. ChangeMediaAssetCompartmentDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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 diff --git a/mediaservices/change_media_workflow_compartment_request_response.go b/mediaservices/change_media_workflow_compartment_request_response.go index e32ddd7c67..cfe1ae8fd3 100644 --- a/mediaservices/change_media_workflow_compartment_request_response.go +++ b/mediaservices/change_media_workflow_compartment_request_response.go @@ -24,6 +24,9 @@ type ChangeMediaWorkflowCompartmentRequest struct { // The change compartment payload. ChangeMediaWorkflowCompartmentDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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 @@ -89,9 +92,6 @@ type ChangeMediaWorkflowCompartmentResponse struct { // The underlying http response RawResponse *http.Response - // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` - // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` diff --git a/mediaservices/change_media_workflow_configuration_compartment_request_response.go b/mediaservices/change_media_workflow_configuration_compartment_request_response.go index 144dd1ea03..764cda970c 100644 --- a/mediaservices/change_media_workflow_configuration_compartment_request_response.go +++ b/mediaservices/change_media_workflow_configuration_compartment_request_response.go @@ -24,6 +24,9 @@ type ChangeMediaWorkflowConfigurationCompartmentRequest struct { // The information to be updated. ChangeMediaWorkflowConfigurationCompartmentDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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 @@ -89,9 +92,6 @@ type ChangeMediaWorkflowConfigurationCompartmentResponse struct { // The underlying http response RawResponse *http.Response - // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` - // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` diff --git a/mediaservices/change_media_workflow_job_compartment_request_response.go b/mediaservices/change_media_workflow_job_compartment_request_response.go index 105478c0ad..35ea550cad 100644 --- a/mediaservices/change_media_workflow_job_compartment_request_response.go +++ b/mediaservices/change_media_workflow_job_compartment_request_response.go @@ -24,6 +24,9 @@ type ChangeMediaWorkflowJobCompartmentRequest struct { // The change compartment payload. ChangeMediaWorkflowJobCompartmentDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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 @@ -89,9 +92,6 @@ type ChangeMediaWorkflowJobCompartmentResponse struct { // The underlying http response RawResponse *http.Response - // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` - // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` diff --git a/mediaservices/change_stream_distribution_channel_compartment_request_response.go b/mediaservices/change_stream_distribution_channel_compartment_request_response.go index 000804a8e3..0d40868efc 100644 --- a/mediaservices/change_stream_distribution_channel_compartment_request_response.go +++ b/mediaservices/change_stream_distribution_channel_compartment_request_response.go @@ -24,6 +24,9 @@ type ChangeStreamDistributionChannelCompartmentRequest struct { // The change compartment payload. ChangeStreamDistributionChannelCompartmentDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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 @@ -89,9 +92,6 @@ type ChangeStreamDistributionChannelCompartmentResponse struct { // The underlying http response RawResponse *http.Response - // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` - // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` diff --git a/mediaservices/create_media_asset_details.go b/mediaservices/create_media_asset_details.go index f840d20bb2..9ca9a82e1d 100644 --- a/mediaservices/create_media_asset_details.go +++ b/mediaservices/create_media_asset_details.go @@ -74,6 +74,9 @@ type CreateMediaAssetDetails 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"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m CreateMediaAssetDetails) String() string { diff --git a/mediaservices/create_media_workflow_configuration_details.go b/mediaservices/create_media_workflow_configuration_details.go index 6ec1e6632d..42f619c9af 100644 --- a/mediaservices/create_media_workflow_configuration_details.go +++ b/mediaservices/create_media_workflow_configuration_details.go @@ -38,6 +38,9 @@ type CreateMediaWorkflowConfigurationDetails 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"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m CreateMediaWorkflowConfigurationDetails) String() string { diff --git a/mediaservices/create_media_workflow_details.go b/mediaservices/create_media_workflow_details.go index e683b9c6f7..e3df215d41 100644 --- a/mediaservices/create_media_workflow_details.go +++ b/mediaservices/create_media_workflow_details.go @@ -46,6 +46,9 @@ type CreateMediaWorkflowDetails 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"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m CreateMediaWorkflowDetails) String() string { diff --git a/mediaservices/create_media_workflow_job_by_id_details.go b/mediaservices/create_media_workflow_job_by_id_details.go index 48748dc040..1cc2b3ea63 100644 --- a/mediaservices/create_media_workflow_job_by_id_details.go +++ b/mediaservices/create_media_workflow_job_by_id_details.go @@ -44,6 +44,9 @@ type CreateMediaWorkflowJobByIdDetails struct { // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // OCID of the MediaWorkflow that should be run. MediaWorkflowId *string `mandatory:"false" json:"mediaWorkflowId"` } @@ -78,6 +81,11 @@ func (m CreateMediaWorkflowJobByIdDetails) GetDefinedTags() map[string]map[strin return m.DefinedTags } +// GetLocks returns Locks +func (m CreateMediaWorkflowJobByIdDetails) GetLocks() []ResourceLock { + return m.Locks +} + func (m CreateMediaWorkflowJobByIdDetails) String() string { return common.PointerString(m) } diff --git a/mediaservices/create_media_workflow_job_by_name_details.go b/mediaservices/create_media_workflow_job_by_name_details.go index a24ff10b38..e1d40231b6 100644 --- a/mediaservices/create_media_workflow_job_by_name_details.go +++ b/mediaservices/create_media_workflow_job_by_name_details.go @@ -44,6 +44,9 @@ type CreateMediaWorkflowJobByNameDetails struct { // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Name of the system MediaWorkflow that should be run. MediaWorkflowName *string `mandatory:"false" json:"mediaWorkflowName"` } @@ -78,6 +81,11 @@ func (m CreateMediaWorkflowJobByNameDetails) GetDefinedTags() map[string]map[str return m.DefinedTags } +// GetLocks returns Locks +func (m CreateMediaWorkflowJobByNameDetails) GetLocks() []ResourceLock { + return m.Locks +} + func (m CreateMediaWorkflowJobByNameDetails) String() string { return common.PointerString(m) } diff --git a/mediaservices/create_media_workflow_job_details.go b/mediaservices/create_media_workflow_job_details.go index abb27f2217..559f612c33 100644 --- a/mediaservices/create_media_workflow_job_details.go +++ b/mediaservices/create_media_workflow_job_details.go @@ -43,6 +43,9 @@ type CreateMediaWorkflowJobDetails interface { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` GetDefinedTags() map[string]map[string]interface{} + + // Locks associated with this resource. + GetLocks() []ResourceLock } type createmediaworkflowjobdetails struct { @@ -52,6 +55,7 @@ type createmediaworkflowjobdetails struct { Parameters map[string]interface{} `mandatory:"false" json:"parameters"` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + Locks []ResourceLock `mandatory:"false" json:"locks"` CompartmentId *string `mandatory:"true" json:"compartmentId"` WorkflowIdentifierType string `json:"workflowIdentifierType"` } @@ -73,6 +77,7 @@ func (m *createmediaworkflowjobdetails) UnmarshalJSON(data []byte) error { m.Parameters = s.Model.Parameters m.FreeformTags = s.Model.FreeformTags m.DefinedTags = s.Model.DefinedTags + m.Locks = s.Model.Locks m.WorkflowIdentifierType = s.Model.WorkflowIdentifierType return err @@ -126,6 +131,11 @@ func (m createmediaworkflowjobdetails) GetDefinedTags() map[string]map[string]in return m.DefinedTags } +// GetLocks returns Locks +func (m createmediaworkflowjobdetails) GetLocks() []ResourceLock { + return m.Locks +} + // GetCompartmentId returns CompartmentId func (m createmediaworkflowjobdetails) GetCompartmentId() *string { return m.CompartmentId diff --git a/mediaservices/create_stream_cdn_config_details.go b/mediaservices/create_stream_cdn_config_details.go index adeafcaec2..9bf922c7d4 100644 --- a/mediaservices/create_stream_cdn_config_details.go +++ b/mediaservices/create_stream_cdn_config_details.go @@ -38,6 +38,9 @@ type CreateStreamCdnConfigDetails 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"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m CreateStreamCdnConfigDetails) String() string { @@ -62,6 +65,7 @@ func (m *CreateStreamCdnConfigDetails) UnmarshalJSON(data []byte) (e error) { IsEnabled *bool `json:"isEnabled"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Locks []ResourceLock `json:"locks"` DisplayName *string `json:"displayName"` DistributionChannelId *string `json:"distributionChannelId"` Config streamcdnconfigsection `json:"config"` @@ -78,6 +82,8 @@ func (m *CreateStreamCdnConfigDetails) UnmarshalJSON(data []byte) (e error) { m.DefinedTags = model.DefinedTags + m.Locks = make([]ResourceLock, len(model.Locks)) + copy(m.Locks, model.Locks) m.DisplayName = model.DisplayName m.DistributionChannelId = model.DistributionChannelId diff --git a/mediaservices/create_stream_distribution_channel_details.go b/mediaservices/create_stream_distribution_channel_details.go index c920f7bffb..9fb8fee5f5 100644 --- a/mediaservices/create_stream_distribution_channel_details.go +++ b/mediaservices/create_stream_distribution_channel_details.go @@ -32,6 +32,9 @@ type CreateStreamDistributionChannelDetails 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"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m CreateStreamDistributionChannelDetails) String() string { diff --git a/mediaservices/create_stream_packaging_config_details.go b/mediaservices/create_stream_packaging_config_details.go index eb3ef63f4a..20b33ed2e9 100644 --- a/mediaservices/create_stream_packaging_config_details.go +++ b/mediaservices/create_stream_packaging_config_details.go @@ -41,6 +41,9 @@ type CreateStreamPackagingConfigDetails 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"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m CreateStreamPackagingConfigDetails) String() string { @@ -68,6 +71,7 @@ func (m *CreateStreamPackagingConfigDetails) UnmarshalJSON(data []byte) (e error Encryption streampackagingconfigencryption `json:"encryption"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Locks []ResourceLock `json:"locks"` DistributionChannelId *string `json:"distributionChannelId"` DisplayName *string `json:"displayName"` StreamPackagingFormat CreateStreamPackagingConfigDetailsStreamPackagingFormatEnum `json:"streamPackagingFormat"` @@ -93,6 +97,8 @@ func (m *CreateStreamPackagingConfigDetails) UnmarshalJSON(data []byte) (e error m.DefinedTags = model.DefinedTags + m.Locks = make([]ResourceLock, len(model.Locks)) + copy(m.Locks, model.Locks) m.DistributionChannelId = model.DistributionChannelId m.DisplayName = model.DisplayName diff --git a/mediaservices/dash_stream_packaging_config.go b/mediaservices/dash_stream_packaging_config.go index c86a0c52d3..d14e72f02e 100644 --- a/mediaservices/dash_stream_packaging_config.go +++ b/mediaservices/dash_stream_packaging_config.go @@ -55,6 +55,9 @@ type DashStreamPackagingConfig struct { // 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"` + // The current state of the Packaging Configuration. LifecycleState StreamPackagingConfigLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` } @@ -119,6 +122,11 @@ func (m DashStreamPackagingConfig) GetSystemTags() map[string]map[string]interfa return m.SystemTags } +// GetLocks returns Locks +func (m DashStreamPackagingConfig) GetLocks() []ResourceLock { + return m.Locks +} + func (m DashStreamPackagingConfig) String() string { return common.PointerString(m) } @@ -162,6 +170,7 @@ func (m *DashStreamPackagingConfig) 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"` DistributionChannelId *string `json:"distributionChannelId"` @@ -196,6 +205,8 @@ func (m *DashStreamPackagingConfig) 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/mediaservices/delete_media_asset_distribution_channel_attachment_request_response.go b/mediaservices/delete_media_asset_distribution_channel_attachment_request_response.go index 4e32d0693d..55c0f2b638 100644 --- a/mediaservices/delete_media_asset_distribution_channel_attachment_request_response.go +++ b/mediaservices/delete_media_asset_distribution_channel_attachment_request_response.go @@ -24,6 +24,9 @@ type DeleteMediaAssetDistributionChannelAttachmentRequest struct { // Unique DistributionChannel identifier. DistributionChannelId *string `mandatory:"true" contributesTo:"path" name:"distributionChannelId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/delete_media_asset_request_response.go b/mediaservices/delete_media_asset_request_response.go index cf3f520362..39208d763c 100644 --- a/mediaservices/delete_media_asset_request_response.go +++ b/mediaservices/delete_media_asset_request_response.go @@ -21,6 +21,9 @@ type DeleteMediaAssetRequest struct { // Unique MediaAsset identifier MediaAssetId *string `mandatory:"true" contributesTo:"path" name:"mediaAssetId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/delete_media_workflow_configuration_request_response.go b/mediaservices/delete_media_workflow_configuration_request_response.go index 1bd924be4e..aaf254570e 100644 --- a/mediaservices/delete_media_workflow_configuration_request_response.go +++ b/mediaservices/delete_media_workflow_configuration_request_response.go @@ -21,6 +21,9 @@ type DeleteMediaWorkflowConfigurationRequest struct { // Unique MediaWorkflowConfiguration identifier. MediaWorkflowConfigurationId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowConfigurationId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. @@ -79,9 +82,6 @@ type DeleteMediaWorkflowConfigurationResponse struct { // The underlying http response RawResponse *http.Response - // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` - // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` diff --git a/mediaservices/delete_media_workflow_job_request_response.go b/mediaservices/delete_media_workflow_job_request_response.go index dbb08a72b3..ee4038e093 100644 --- a/mediaservices/delete_media_workflow_job_request_response.go +++ b/mediaservices/delete_media_workflow_job_request_response.go @@ -21,6 +21,9 @@ type DeleteMediaWorkflowJobRequest struct { // Unique MediaWorkflowJob identifier. MediaWorkflowJobId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowJobId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` @@ -79,9 +82,6 @@ type DeleteMediaWorkflowJobResponse struct { // The underlying http response RawResponse *http.Response - // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` - // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` diff --git a/mediaservices/delete_media_workflow_request_response.go b/mediaservices/delete_media_workflow_request_response.go index f84cf5def4..ddbcb4183f 100644 --- a/mediaservices/delete_media_workflow_request_response.go +++ b/mediaservices/delete_media_workflow_request_response.go @@ -21,6 +21,9 @@ type DeleteMediaWorkflowRequest struct { // Unique MediaWorkflow identifier. MediaWorkflowId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` diff --git a/mediaservices/delete_stream_cdn_config_request_response.go b/mediaservices/delete_stream_cdn_config_request_response.go index 0789fcaae9..d6fc2f4725 100644 --- a/mediaservices/delete_stream_cdn_config_request_response.go +++ b/mediaservices/delete_stream_cdn_config_request_response.go @@ -21,6 +21,9 @@ type DeleteStreamCdnConfigRequest struct { // Unique StreamCdnConfig identifier. StreamCdnConfigId *string `mandatory:"true" contributesTo:"path" name:"streamCdnConfigId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` diff --git a/mediaservices/delete_stream_distribution_channel_request_response.go b/mediaservices/delete_stream_distribution_channel_request_response.go index be97bc5d22..63819b148d 100644 --- a/mediaservices/delete_stream_distribution_channel_request_response.go +++ b/mediaservices/delete_stream_distribution_channel_request_response.go @@ -21,6 +21,9 @@ type DeleteStreamDistributionChannelRequest struct { // Unique Stream Distribution Channel path identifier. StreamDistributionChannelId *string `mandatory:"true" contributesTo:"path" name:"streamDistributionChannelId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` diff --git a/mediaservices/delete_stream_packaging_config_request_response.go b/mediaservices/delete_stream_packaging_config_request_response.go index 51307fafbf..4220b2f787 100644 --- a/mediaservices/delete_stream_packaging_config_request_response.go +++ b/mediaservices/delete_stream_packaging_config_request_response.go @@ -21,6 +21,9 @@ type DeleteStreamPackagingConfigRequest struct { // Unique Stream Packaging Configuration path identifier. StreamPackagingConfigId *string `mandatory:"true" contributesTo:"path" name:"streamPackagingConfigId"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` diff --git a/mediaservices/hls_stream_packaging_config.go b/mediaservices/hls_stream_packaging_config.go index 6ed22d096a..ac3b26623d 100644 --- a/mediaservices/hls_stream_packaging_config.go +++ b/mediaservices/hls_stream_packaging_config.go @@ -55,6 +55,9 @@ type HlsStreamPackagingConfig struct { // 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"` + // The current state of the Packaging Configuration. LifecycleState StreamPackagingConfigLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` } @@ -119,6 +122,11 @@ func (m HlsStreamPackagingConfig) GetSystemTags() map[string]map[string]interfac return m.SystemTags } +// GetLocks returns Locks +func (m HlsStreamPackagingConfig) GetLocks() []ResourceLock { + return m.Locks +} + func (m HlsStreamPackagingConfig) String() string { return common.PointerString(m) } @@ -162,6 +170,7 @@ func (m *HlsStreamPackagingConfig) 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"` DistributionChannelId *string `json:"distributionChannelId"` @@ -196,6 +205,8 @@ func (m *HlsStreamPackagingConfig) 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/mediaservices/job_output.go b/mediaservices/job_output.go index dcdad0a51d..9d9bb74478 100644 --- a/mediaservices/job_output.go +++ b/mediaservices/job_output.go @@ -67,6 +67,7 @@ const ( JobOutputAssetTypeTranscriptionJob JobOutputAssetTypeEnum = "TRANSCRIPTION_JOB" JobOutputAssetTypeVisionJob JobOutputAssetTypeEnum = "VISION_JOB" JobOutputAssetTypeTextAnalysis JobOutputAssetTypeEnum = "TEXT_ANALYSIS" + JobOutputAssetTypeInputFile JobOutputAssetTypeEnum = "INPUT_FILE" JobOutputAssetTypeOther JobOutputAssetTypeEnum = "OTHER" ) @@ -79,6 +80,7 @@ var mappingJobOutputAssetTypeEnum = map[string]JobOutputAssetTypeEnum{ "TRANSCRIPTION_JOB": JobOutputAssetTypeTranscriptionJob, "VISION_JOB": JobOutputAssetTypeVisionJob, "TEXT_ANALYSIS": JobOutputAssetTypeTextAnalysis, + "INPUT_FILE": JobOutputAssetTypeInputFile, "OTHER": JobOutputAssetTypeOther, } @@ -91,6 +93,7 @@ var mappingJobOutputAssetTypeEnumLowerCase = map[string]JobOutputAssetTypeEnum{ "transcription_job": JobOutputAssetTypeTranscriptionJob, "vision_job": JobOutputAssetTypeVisionJob, "text_analysis": JobOutputAssetTypeTextAnalysis, + "input_file": JobOutputAssetTypeInputFile, "other": JobOutputAssetTypeOther, } @@ -114,6 +117,7 @@ func GetJobOutputAssetTypeEnumStringValues() []string { "TRANSCRIPTION_JOB", "VISION_JOB", "TEXT_ANALYSIS", + "INPUT_FILE", "OTHER", } } diff --git a/mediaservices/list_media_workflow_job_facts_request_response.go b/mediaservices/list_media_workflow_job_facts_request_response.go deleted file mode 100644 index 883247873b..0000000000 --- a/mediaservices/list_media_workflow_job_facts_request_response.go +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. -// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -// Code generated. DO NOT EDIT. - -package mediaservices - -import ( - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "net/http" - "strings" -) - -// ListMediaWorkflowJobFactsRequest wrapper for the ListMediaWorkflowJobFacts operation -// -// # See also -// -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowJobFacts.go.html to see an example of how to use ListMediaWorkflowJobFactsRequest. -type ListMediaWorkflowJobFactsRequest struct { - - // Unique MediaWorkflowJob identifier. - MediaWorkflowJobId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowJobId"` - - // Filter by MediaWorkflowJob ID and MediaWorkflowJobFact key. - Key *int `mandatory:"false" contributesTo:"query" name:"key"` - - // Types of details to include. - Type ListMediaWorkflowJobFactsTypeEnum `mandatory:"false" contributesTo:"query" name:"type" omitEmpty:"true"` - - // Types of details to include. - SortBy ListMediaWorkflowJobFactsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` - - // The sort order to use, either 'ASC' or 'DESC'. - SortOrder ListMediaWorkflowJobFactsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` - - // A token representing the position at which to start retrieving results. This must come from the - // `opc-next-page` header field of a previous response. - Page *string `mandatory:"false" contributesTo:"query" name:"page"` - - // The maximum number of items to return. - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - - // 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 ListMediaWorkflowJobFactsRequest) String() string { - return common.PointerString(request) -} - -// HTTPRequest implements the OCIRequest interface -func (request ListMediaWorkflowJobFactsRequest) 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 ListMediaWorkflowJobFactsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { - - return nil, false - -} - -// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. -func (request ListMediaWorkflowJobFactsRequest) 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 ListMediaWorkflowJobFactsRequest) ValidateEnumValue() (bool, error) { - errMessage := []string{} - if _, ok := GetMappingListMediaWorkflowJobFactsTypeEnum(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(GetListMediaWorkflowJobFactsTypeEnumStringValues(), ","))) - } - if _, ok := GetMappingListMediaWorkflowJobFactsSortByEnum(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(GetListMediaWorkflowJobFactsSortByEnumStringValues(), ","))) - } - if _, ok := GetMappingListMediaWorkflowJobFactsSortOrderEnum(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(GetListMediaWorkflowJobFactsSortOrderEnumStringValues(), ","))) - } - if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) - } - return false, nil -} - -// ListMediaWorkflowJobFactsResponse wrapper for the ListMediaWorkflowJobFacts operation -type ListMediaWorkflowJobFactsResponse struct { - - // The underlying http response - RawResponse *http.Response - - // A list of MediaWorkflowJobFactCollection instances - MediaWorkflowJobFactCollection `presentIn:"body"` - - // Unique Oracle-assigned identifier for the request. If you need to contact - // Oracle about a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` - - // For pagination of a list of items. When paging through a list, if this header appears in the response, - // then a partial list might have been returned. Include this value as the `page` parameter for the - // subsequent GET request to get the next batch of items. - OpcNextPage *string `presentIn:"header" name:"opc-next-page"` -} - -func (response ListMediaWorkflowJobFactsResponse) String() string { - return common.PointerString(response) -} - -// HTTPResponse implements the OCIResponse interface -func (response ListMediaWorkflowJobFactsResponse) HTTPResponse() *http.Response { - return response.RawResponse -} - -// ListMediaWorkflowJobFactsTypeEnum Enum with underlying type: string -type ListMediaWorkflowJobFactsTypeEnum string - -// Set of constants representing the allowable values for ListMediaWorkflowJobFactsTypeEnum -const ( - ListMediaWorkflowJobFactsTypeRunnablejob ListMediaWorkflowJobFactsTypeEnum = "runnableJob" - ListMediaWorkflowJobFactsTypeTaskdeclaration ListMediaWorkflowJobFactsTypeEnum = "taskDeclaration" - ListMediaWorkflowJobFactsTypeWorkflow ListMediaWorkflowJobFactsTypeEnum = "workflow" - ListMediaWorkflowJobFactsTypeConfiguration ListMediaWorkflowJobFactsTypeEnum = "configuration" - ListMediaWorkflowJobFactsTypeParameterresolutionevent ListMediaWorkflowJobFactsTypeEnum = "parameterResolutionEvent" -) - -var mappingListMediaWorkflowJobFactsTypeEnum = map[string]ListMediaWorkflowJobFactsTypeEnum{ - "runnableJob": ListMediaWorkflowJobFactsTypeRunnablejob, - "taskDeclaration": ListMediaWorkflowJobFactsTypeTaskdeclaration, - "workflow": ListMediaWorkflowJobFactsTypeWorkflow, - "configuration": ListMediaWorkflowJobFactsTypeConfiguration, - "parameterResolutionEvent": ListMediaWorkflowJobFactsTypeParameterresolutionevent, -} - -var mappingListMediaWorkflowJobFactsTypeEnumLowerCase = map[string]ListMediaWorkflowJobFactsTypeEnum{ - "runnablejob": ListMediaWorkflowJobFactsTypeRunnablejob, - "taskdeclaration": ListMediaWorkflowJobFactsTypeTaskdeclaration, - "workflow": ListMediaWorkflowJobFactsTypeWorkflow, - "configuration": ListMediaWorkflowJobFactsTypeConfiguration, - "parameterresolutionevent": ListMediaWorkflowJobFactsTypeParameterresolutionevent, -} - -// GetListMediaWorkflowJobFactsTypeEnumValues Enumerates the set of values for ListMediaWorkflowJobFactsTypeEnum -func GetListMediaWorkflowJobFactsTypeEnumValues() []ListMediaWorkflowJobFactsTypeEnum { - values := make([]ListMediaWorkflowJobFactsTypeEnum, 0) - for _, v := range mappingListMediaWorkflowJobFactsTypeEnum { - values = append(values, v) - } - return values -} - -// GetListMediaWorkflowJobFactsTypeEnumStringValues Enumerates the set of values in String for ListMediaWorkflowJobFactsTypeEnum -func GetListMediaWorkflowJobFactsTypeEnumStringValues() []string { - return []string{ - "runnableJob", - "taskDeclaration", - "workflow", - "configuration", - "parameterResolutionEvent", - } -} - -// GetMappingListMediaWorkflowJobFactsTypeEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingListMediaWorkflowJobFactsTypeEnum(val string) (ListMediaWorkflowJobFactsTypeEnum, bool) { - enum, ok := mappingListMediaWorkflowJobFactsTypeEnumLowerCase[strings.ToLower(val)] - return enum, ok -} - -// ListMediaWorkflowJobFactsSortByEnum Enum with underlying type: string -type ListMediaWorkflowJobFactsSortByEnum string - -// Set of constants representing the allowable values for ListMediaWorkflowJobFactsSortByEnum -const ( - ListMediaWorkflowJobFactsSortByKey ListMediaWorkflowJobFactsSortByEnum = "key" -) - -var mappingListMediaWorkflowJobFactsSortByEnum = map[string]ListMediaWorkflowJobFactsSortByEnum{ - "key": ListMediaWorkflowJobFactsSortByKey, -} - -var mappingListMediaWorkflowJobFactsSortByEnumLowerCase = map[string]ListMediaWorkflowJobFactsSortByEnum{ - "key": ListMediaWorkflowJobFactsSortByKey, -} - -// GetListMediaWorkflowJobFactsSortByEnumValues Enumerates the set of values for ListMediaWorkflowJobFactsSortByEnum -func GetListMediaWorkflowJobFactsSortByEnumValues() []ListMediaWorkflowJobFactsSortByEnum { - values := make([]ListMediaWorkflowJobFactsSortByEnum, 0) - for _, v := range mappingListMediaWorkflowJobFactsSortByEnum { - values = append(values, v) - } - return values -} - -// GetListMediaWorkflowJobFactsSortByEnumStringValues Enumerates the set of values in String for ListMediaWorkflowJobFactsSortByEnum -func GetListMediaWorkflowJobFactsSortByEnumStringValues() []string { - return []string{ - "key", - } -} - -// GetMappingListMediaWorkflowJobFactsSortByEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingListMediaWorkflowJobFactsSortByEnum(val string) (ListMediaWorkflowJobFactsSortByEnum, bool) { - enum, ok := mappingListMediaWorkflowJobFactsSortByEnumLowerCase[strings.ToLower(val)] - return enum, ok -} - -// ListMediaWorkflowJobFactsSortOrderEnum Enum with underlying type: string -type ListMediaWorkflowJobFactsSortOrderEnum string - -// Set of constants representing the allowable values for ListMediaWorkflowJobFactsSortOrderEnum -const ( - ListMediaWorkflowJobFactsSortOrderAsc ListMediaWorkflowJobFactsSortOrderEnum = "ASC" - ListMediaWorkflowJobFactsSortOrderDesc ListMediaWorkflowJobFactsSortOrderEnum = "DESC" -) - -var mappingListMediaWorkflowJobFactsSortOrderEnum = map[string]ListMediaWorkflowJobFactsSortOrderEnum{ - "ASC": ListMediaWorkflowJobFactsSortOrderAsc, - "DESC": ListMediaWorkflowJobFactsSortOrderDesc, -} - -var mappingListMediaWorkflowJobFactsSortOrderEnumLowerCase = map[string]ListMediaWorkflowJobFactsSortOrderEnum{ - "asc": ListMediaWorkflowJobFactsSortOrderAsc, - "desc": ListMediaWorkflowJobFactsSortOrderDesc, -} - -// GetListMediaWorkflowJobFactsSortOrderEnumValues Enumerates the set of values for ListMediaWorkflowJobFactsSortOrderEnum -func GetListMediaWorkflowJobFactsSortOrderEnumValues() []ListMediaWorkflowJobFactsSortOrderEnum { - values := make([]ListMediaWorkflowJobFactsSortOrderEnum, 0) - for _, v := range mappingListMediaWorkflowJobFactsSortOrderEnum { - values = append(values, v) - } - return values -} - -// GetListMediaWorkflowJobFactsSortOrderEnumStringValues Enumerates the set of values in String for ListMediaWorkflowJobFactsSortOrderEnum -func GetListMediaWorkflowJobFactsSortOrderEnumStringValues() []string { - return []string{ - "ASC", - "DESC", - } -} - -// GetMappingListMediaWorkflowJobFactsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingListMediaWorkflowJobFactsSortOrderEnum(val string) (ListMediaWorkflowJobFactsSortOrderEnum, bool) { - enum, ok := mappingListMediaWorkflowJobFactsSortOrderEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/mediaservices/media_asset.go b/mediaservices/media_asset.go index 5c6a0c344b..b501cbd206 100644 --- a/mediaservices/media_asset.go +++ b/mediaservices/media_asset.go @@ -90,6 +90,9 @@ type MediaAsset struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaAsset) String() string { diff --git a/mediaservices/media_asset_distribution_channel_attachment.go b/mediaservices/media_asset_distribution_channel_attachment.go index 7405de5d92..33751a1eb6 100644 --- a/mediaservices/media_asset_distribution_channel_attachment.go +++ b/mediaservices/media_asset_distribution_channel_attachment.go @@ -36,6 +36,9 @@ type MediaAssetDistributionChannelAttachment struct { // The ingest MediaWorkflowJob ID that created this attachment. MediaWorkflowJobId *string `mandatory:"false" json:"mediaWorkflowJobId"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaAssetDistributionChannelAttachment) String() string { diff --git a/mediaservices/media_asset_distribution_channel_attachment_summary.go b/mediaservices/media_asset_distribution_channel_attachment_summary.go index 9a281320f0..855252754e 100644 --- a/mediaservices/media_asset_distribution_channel_attachment_summary.go +++ b/mediaservices/media_asset_distribution_channel_attachment_summary.go @@ -39,6 +39,9 @@ type MediaAssetDistributionChannelAttachmentSummary struct { // The ingest MediaWorkflowJob ID that created this attachment. MediaWorkflowJobId *string `mandatory:"false" json:"mediaWorkflowJobId"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaAssetDistributionChannelAttachmentSummary) String() string { diff --git a/mediaservices/media_asset_summary.go b/mediaservices/media_asset_summary.go index 92c4def1b4..8ae951ad36 100644 --- a/mediaservices/media_asset_summary.go +++ b/mediaservices/media_asset_summary.go @@ -57,6 +57,9 @@ type MediaAssetSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaAssetSummary) String() string { diff --git a/mediaservices/media_workflow.go b/mediaservices/media_workflow.go index 41503f9b79..73b3e5a3ea 100644 --- a/mediaservices/media_workflow.go +++ b/mediaservices/media_workflow.go @@ -31,7 +31,7 @@ type MediaWorkflow struct { // The processing to be done in this workflow. Each key of the MediaWorkflowTasks in this array is unique // within the array. The order of the items is preserved from the order of the tasks array in // CreateMediaWorkflowDetails or UpdateMediaWorkflowDetails. - Tasks []MediaWorkflowTask `mandatory:"false" json:"tasks"` + Tasks []MediaWorkflowTask `mandatory:"true" json:"tasks"` // Configurations to be applied to all the runs of this workflow. Parameters in these configurations are // overridden by parameters in the MediaWorkflowConfigurations of the MediaWorkflowJob and the @@ -59,6 +59,9 @@ type MediaWorkflow struct { // The version of the MediaWorkflow. Version *int64 `mandatory:"false" json:"version"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // 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/mediaservices/media_workflow_configuration.go b/mediaservices/media_workflow_configuration.go index f7d87acd93..d21744fc07 100644 --- a/mediaservices/media_workflow_configuration.go +++ b/mediaservices/media_workflow_configuration.go @@ -57,6 +57,9 @@ type MediaWorkflowConfiguration struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaWorkflowConfiguration) String() string { diff --git a/mediaservices/media_workflow_configuration_summary.go b/mediaservices/media_workflow_configuration_summary.go index 85fe0e5e18..d3ce9270dc 100644 --- a/mediaservices/media_workflow_configuration_summary.go +++ b/mediaservices/media_workflow_configuration_summary.go @@ -51,6 +51,9 @@ type MediaWorkflowConfigurationSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaWorkflowConfigurationSummary) String() string { diff --git a/mediaservices/media_workflow_job.go b/mediaservices/media_workflow_job.go index c80a1d3262..233eca4bfb 100644 --- a/mediaservices/media_workflow_job.go +++ b/mediaservices/media_workflow_job.go @@ -69,6 +69,9 @@ type MediaWorkflowJob struct { // Time when the job finished. An RFC3339 formatted datetime string. TimeEnded *common.SDKTime `mandatory:"false" json:"timeEnded"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // 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"` @@ -109,6 +112,7 @@ const ( MediaWorkflowJobLifecycleStateAccepted MediaWorkflowJobLifecycleStateEnum = "ACCEPTED" MediaWorkflowJobLifecycleStateInProgress MediaWorkflowJobLifecycleStateEnum = "IN_PROGRESS" MediaWorkflowJobLifecycleStateWaiting MediaWorkflowJobLifecycleStateEnum = "WAITING" + MediaWorkflowJobLifecycleStateRejected MediaWorkflowJobLifecycleStateEnum = "REJECTED" MediaWorkflowJobLifecycleStateFailed MediaWorkflowJobLifecycleStateEnum = "FAILED" MediaWorkflowJobLifecycleStateSucceeded MediaWorkflowJobLifecycleStateEnum = "SUCCEEDED" MediaWorkflowJobLifecycleStateCanceling MediaWorkflowJobLifecycleStateEnum = "CANCELING" @@ -119,6 +123,7 @@ var mappingMediaWorkflowJobLifecycleStateEnum = map[string]MediaWorkflowJobLifec "ACCEPTED": MediaWorkflowJobLifecycleStateAccepted, "IN_PROGRESS": MediaWorkflowJobLifecycleStateInProgress, "WAITING": MediaWorkflowJobLifecycleStateWaiting, + "REJECTED": MediaWorkflowJobLifecycleStateRejected, "FAILED": MediaWorkflowJobLifecycleStateFailed, "SUCCEEDED": MediaWorkflowJobLifecycleStateSucceeded, "CANCELING": MediaWorkflowJobLifecycleStateCanceling, @@ -129,6 +134,7 @@ var mappingMediaWorkflowJobLifecycleStateEnumLowerCase = map[string]MediaWorkflo "accepted": MediaWorkflowJobLifecycleStateAccepted, "in_progress": MediaWorkflowJobLifecycleStateInProgress, "waiting": MediaWorkflowJobLifecycleStateWaiting, + "rejected": MediaWorkflowJobLifecycleStateRejected, "failed": MediaWorkflowJobLifecycleStateFailed, "succeeded": MediaWorkflowJobLifecycleStateSucceeded, "canceling": MediaWorkflowJobLifecycleStateCanceling, @@ -150,6 +156,7 @@ func GetMediaWorkflowJobLifecycleStateEnumStringValues() []string { "ACCEPTED", "IN_PROGRESS", "WAITING", + "REJECTED", "FAILED", "SUCCEEDED", "CANCELING", diff --git a/mediaservices/media_workflow_job_fact.go b/mediaservices/media_workflow_job_fact.go deleted file mode 100644 index afdb634bab..0000000000 --- a/mediaservices/media_workflow_job_fact.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. -// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -// Code generated. DO NOT EDIT. - -// Media Services API -// -// Media Services (includes Media Flow and Media Streams) is a fully managed service for processing media (video) source content. Use Media Flow and Media Streams to transcode and package digital video using configurable workflows and stream video outputs. -// Use the Media Services API to configure media workflows and run Media Flow jobs, create distribution channels, ingest assets, create Preview URLs and play assets. For more information, see Media Flow (https://docs.cloud.oracle.com/iaas/Content/dms-mediaflow/home.htm) and Media Streams (https://docs.cloud.oracle.com/iaas/Content/dms-mediastream/home.htm). -// - -package mediaservices - -import ( - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "strings" -) - -// MediaWorkflowJobFact One fact of a list of facts associated to a MediaWorkflowJob that presents a point-in-time -// snapshot of the resources, data and events that were composed to generate a runnable job. -// This information will be used internally to trouble-shoot problematic workflows or jobs. -type MediaWorkflowJobFact struct { - - // Reference to the parent job. - MediaWorkflowJobId *string `mandatory:"true" json:"mediaWorkflowJobId"` - - // System generated serial number to uniquely identify a detail in order within a MediaWorkflowJob. - Key *int64 `mandatory:"true" json:"key"` - - // Unique name. It is read-only and generated for the fact. - Name *string `mandatory:"true" json:"name"` - - // The type of information contained in this detail. - Type *string `mandatory:"true" json:"type"` - - // The body of the detail captured as JSON. - Detail map[string]interface{} `mandatory:"true" json:"detail"` -} - -func (m MediaWorkflowJobFact) String() string { - return common.PointerString(m) -} - -// ValidateEnumValue returns an error when providing an unsupported enum value -// This function is being called during constructing API request process -// Not recommended for calling this function directly -func (m MediaWorkflowJobFact) ValidateEnumValue() (bool, error) { - errMessage := []string{} - - if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) - } - return false, nil -} diff --git a/mediaservices/media_workflow_job_fact_collection.go b/mediaservices/media_workflow_job_fact_collection.go deleted file mode 100644 index 9d493f913b..0000000000 --- a/mediaservices/media_workflow_job_fact_collection.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. -// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -// Code generated. DO NOT EDIT. - -// Media Services API -// -// Media Services (includes Media Flow and Media Streams) is a fully managed service for processing media (video) source content. Use Media Flow and Media Streams to transcode and package digital video using configurable workflows and stream video outputs. -// Use the Media Services API to configure media workflows and run Media Flow jobs, create distribution channels, ingest assets, create Preview URLs and play assets. For more information, see Media Flow (https://docs.cloud.oracle.com/iaas/Content/dms-mediaflow/home.htm) and Media Streams (https://docs.cloud.oracle.com/iaas/Content/dms-mediastream/home.htm). -// - -package mediaservices - -import ( - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "strings" -) - -// MediaWorkflowJobFactCollection Results of a jobDetail search, a list of MediaWorkflowJobFacts items and metadata of the search. -type MediaWorkflowJobFactCollection struct { - - // List of mediaWorkflowJob items. - Items []MediaWorkflowJobFactSummary `mandatory:"true" json:"items"` -} - -func (m MediaWorkflowJobFactCollection) String() string { - return common.PointerString(m) -} - -// ValidateEnumValue returns an error when providing an unsupported enum value -// This function is being called during constructing API request process -// Not recommended for calling this function directly -func (m MediaWorkflowJobFactCollection) ValidateEnumValue() (bool, error) { - errMessage := []string{} - - if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) - } - return false, nil -} diff --git a/mediaservices/media_workflow_job_fact_sort_by.go b/mediaservices/media_workflow_job_fact_sort_by.go deleted file mode 100644 index 5e7eda138c..0000000000 --- a/mediaservices/media_workflow_job_fact_sort_by.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. -// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -// Code generated. DO NOT EDIT. - -// Media Services API -// -// Media Services (includes Media Flow and Media Streams) is a fully managed service for processing media (video) source content. Use Media Flow and Media Streams to transcode and package digital video using configurable workflows and stream video outputs. -// Use the Media Services API to configure media workflows and run Media Flow jobs, create distribution channels, ingest assets, create Preview URLs and play assets. For more information, see Media Flow (https://docs.cloud.oracle.com/iaas/Content/dms-mediaflow/home.htm) and Media Streams (https://docs.cloud.oracle.com/iaas/Content/dms-mediastream/home.htm). -// - -package mediaservices - -import ( - "strings" -) - -// MediaWorkflowJobFactSortByEnum Enum with underlying type: string -type MediaWorkflowJobFactSortByEnum string - -// Set of constants representing the allowable values for MediaWorkflowJobFactSortByEnum -const ( - MediaWorkflowJobFactSortByKey MediaWorkflowJobFactSortByEnum = "key" -) - -var mappingMediaWorkflowJobFactSortByEnum = map[string]MediaWorkflowJobFactSortByEnum{ - "key": MediaWorkflowJobFactSortByKey, -} - -var mappingMediaWorkflowJobFactSortByEnumLowerCase = map[string]MediaWorkflowJobFactSortByEnum{ - "key": MediaWorkflowJobFactSortByKey, -} - -// GetMediaWorkflowJobFactSortByEnumValues Enumerates the set of values for MediaWorkflowJobFactSortByEnum -func GetMediaWorkflowJobFactSortByEnumValues() []MediaWorkflowJobFactSortByEnum { - values := make([]MediaWorkflowJobFactSortByEnum, 0) - for _, v := range mappingMediaWorkflowJobFactSortByEnum { - values = append(values, v) - } - return values -} - -// GetMediaWorkflowJobFactSortByEnumStringValues Enumerates the set of values in String for MediaWorkflowJobFactSortByEnum -func GetMediaWorkflowJobFactSortByEnumStringValues() []string { - return []string{ - "key", - } -} - -// GetMappingMediaWorkflowJobFactSortByEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingMediaWorkflowJobFactSortByEnum(val string) (MediaWorkflowJobFactSortByEnum, bool) { - enum, ok := mappingMediaWorkflowJobFactSortByEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/mediaservices/media_workflow_job_fact_summary.go b/mediaservices/media_workflow_job_fact_summary.go deleted file mode 100644 index 4809cad0a9..0000000000 --- a/mediaservices/media_workflow_job_fact_summary.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved. -// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -// Code generated. DO NOT EDIT. - -// Media Services API -// -// Media Services (includes Media Flow and Media Streams) is a fully managed service for processing media (video) source content. Use Media Flow and Media Streams to transcode and package digital video using configurable workflows and stream video outputs. -// Use the Media Services API to configure media workflows and run Media Flow jobs, create distribution channels, ingest assets, create Preview URLs and play assets. For more information, see Media Flow (https://docs.cloud.oracle.com/iaas/Content/dms-mediaflow/home.htm) and Media Streams (https://docs.cloud.oracle.com/iaas/Content/dms-mediastream/home.htm). -// - -package mediaservices - -import ( - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "strings" -) - -// MediaWorkflowJobFactSummary Summary of a MediaWorkflowJobFact -type MediaWorkflowJobFactSummary struct { - - // Reference to the parent job. - MediaWorkflowJobId *string `mandatory:"true" json:"mediaWorkflowJobId"` - - // System generated serial number to uniquely identify a detail in order within a MediaWorkflowJob. - Key *int64 `mandatory:"true" json:"key"` - - // Unique name. It is read-only and generated for the fact. - Name *string `mandatory:"true" json:"name"` - - // The type of information contained in this detail. - Type *string `mandatory:"true" json:"type"` -} - -func (m MediaWorkflowJobFactSummary) String() string { - return common.PointerString(m) -} - -// ValidateEnumValue returns an error when providing an unsupported enum value -// This function is being called during constructing API request process -// Not recommended for calling this function directly -func (m MediaWorkflowJobFactSummary) ValidateEnumValue() (bool, error) { - errMessage := []string{} - - if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) - } - return false, nil -} diff --git a/mediaservices/media_workflow_job_summary.go b/mediaservices/media_workflow_job_summary.go index c583ced432..661fefde3f 100644 --- a/mediaservices/media_workflow_job_summary.go +++ b/mediaservices/media_workflow_job_summary.go @@ -51,6 +51,9 @@ type MediaWorkflowJobSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaWorkflowJobSummary) String() string { diff --git a/mediaservices/media_workflow_summary.go b/mediaservices/media_workflow_summary.go index 97df4e0558..80b5228dc4 100644 --- a/mediaservices/media_workflow_summary.go +++ b/mediaservices/media_workflow_summary.go @@ -54,6 +54,9 @@ type MediaWorkflowSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaWorkflowSummary) String() string { diff --git a/mediaservices/media_workflow_task.go b/mediaservices/media_workflow_task.go index 2eae3ef71b..3a64d773e6 100644 --- a/mediaservices/media_workflow_task.go +++ b/mediaservices/media_workflow_task.go @@ -20,6 +20,9 @@ import ( // processing, and any processing that must be completed before this processing begins. type MediaWorkflowTask struct { + // The type of process to run at this task. Refers to the name of a MediaWorkflowTaskDeclaration. + Type *string `mandatory:"true" json:"type"` + // The version of the MediaWorkflowTaskDeclaration. Version *int64 `mandatory:"true" json:"version"` @@ -27,8 +30,10 @@ type MediaWorkflowTask struct { // and MediaWorkflowJobs. Tasks are referenced as prerequisites and to track output and state. Key *string `mandatory:"true" json:"key"` - // The type of process to run at this task. Refers to the name of a MediaWorkflowTaskDeclaration. - Type *string `mandatory:"false" json:"type"` + // Data specifiying how this task is to be run. The data is a JSON object that must conform to the JSON Schema + // specified by the parameters of the MediaWorkflowTaskDeclaration this task references. The parameters may + // contain values or references to other parameters. + Parameters map[string]interface{} `mandatory:"true" json:"parameters"` // Keys to the other tasks in this workflow that must be completed before execution of this task can begin. Prerequisites []string `mandatory:"false" json:"prerequisites"` @@ -43,11 +48,6 @@ type MediaWorkflowTask struct { // enableParameterReference is equal to the value of this property. This property must be prenset if and only if // a enableParameterReference is given. The value is a JSON node. EnableWhenReferencedParameterEquals map[string]interface{} `mandatory:"false" json:"enableWhenReferencedParameterEquals"` - - // Data specifiying how this task is to be run. The data is a JSON object that must conform to the JSON Schema - // specified by the parameters of the MediaWorkflowTaskDeclaration this task references. The parameters may - // contain values or references to other parameters. - Parameters map[string]interface{} `mandatory:"false" json:"parameters"` } func (m MediaWorkflowTask) String() string { diff --git a/mediaservices/media_workflow_task_declaration.go b/mediaservices/media_workflow_task_declaration.go index 97762e09a9..1a27cbd9b8 100644 --- a/mediaservices/media_workflow_task_declaration.go +++ b/mediaservices/media_workflow_task_declaration.go @@ -34,6 +34,9 @@ type MediaWorkflowTaskDeclaration struct { // JSON schema similar to the parameterSchema, but permits parameter values to refer to other parameters using the // ${/path/to/another/parmeter} syntax. This is used to validate task parameters when workflows are created. ParametersSchemaAllowingReferences map[string]interface{} `mandatory:"true" json:"parametersSchemaAllowingReferences"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m MediaWorkflowTaskDeclaration) String() string { diff --git a/mediaservices/mediaservices_client.go b/mediaservices/mediaservices_client.go index b9859bcaf0..b87073ff0f 100644 --- a/mediaservices/mediaservices_client.go +++ b/mediaservices/mediaservices_client.go @@ -92,13 +92,13 @@ func (client *MediaServicesClient) ConfigurationProvider() *common.Configuration return client.config } -// ChangeMediaAssetCompartment Moves a MediaAsset resource from one compartment identifier to another. +// AddMediaAssetLock Add a lock to an MediaAsset. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaAssetCompartment.go.html to see an example of how to use ChangeMediaAssetCompartment API. -// A default retry strategy applies to this operation ChangeMediaAssetCompartment() -func (client MediaServicesClient) ChangeMediaAssetCompartment(ctx context.Context, request ChangeMediaAssetCompartmentRequest) (response ChangeMediaAssetCompartmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaAssetLock.go.html to see an example of how to use AddMediaAssetLock API. +// A default retry strategy applies to this operation AddMediaAssetLock() +func (client MediaServicesClient) AddMediaAssetLock(ctx context.Context, request AddMediaAssetLockRequest) (response AddMediaAssetLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -112,42 +112,42 @@ func (client MediaServicesClient) ChangeMediaAssetCompartment(ctx context.Contex request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.changeMediaAssetCompartment, policy) + ociResponse, err = common.Retry(ctx, request, client.addMediaAssetLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ChangeMediaAssetCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = AddMediaAssetLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ChangeMediaAssetCompartmentResponse{} + response = AddMediaAssetLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ChangeMediaAssetCompartmentResponse); ok { + if convertedResponse, ok := ociResponse.(AddMediaAssetLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaAssetCompartmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into AddMediaAssetLockResponse") } return } -// changeMediaAssetCompartment implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) changeMediaAssetCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// addMediaAssetLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) addMediaAssetLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaAssets/{mediaAssetId}/actions/changeCompartment", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaAssets/{mediaAssetId}/actions/addLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ChangeMediaAssetCompartmentResponse + var response AddMediaAssetLockResponse 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/dms/20211101/MediaAsset/ChangeMediaAssetCompartment" - err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaAssetCompartment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaAsset/AddMediaAssetLock" + err = common.PostProcessServiceError(err, "MediaServices", "AddMediaAssetLock", apiReferenceLink) return response, err } @@ -155,13 +155,13 @@ func (client MediaServicesClient) changeMediaAssetCompartment(ctx context.Contex return response, err } -// ChangeMediaWorkflowCompartment Moves a MediaWorkflow resource from one compartment identifier to another. +// AddMediaWorkflowConfigurationLock Add a lock to a MediaWorkflowConfiguration. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaWorkflowCompartment.go.html to see an example of how to use ChangeMediaWorkflowCompartment API. -// A default retry strategy applies to this operation ChangeMediaWorkflowCompartment() -func (client MediaServicesClient) ChangeMediaWorkflowCompartment(ctx context.Context, request ChangeMediaWorkflowCompartmentRequest) (response ChangeMediaWorkflowCompartmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaWorkflowConfigurationLock.go.html to see an example of how to use AddMediaWorkflowConfigurationLock API. +// A default retry strategy applies to this operation AddMediaWorkflowConfigurationLock() +func (client MediaServicesClient) AddMediaWorkflowConfigurationLock(ctx context.Context, request AddMediaWorkflowConfigurationLockRequest) (response AddMediaWorkflowConfigurationLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -175,42 +175,42 @@ func (client MediaServicesClient) ChangeMediaWorkflowCompartment(ctx context.Con request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.changeMediaWorkflowCompartment, policy) + ociResponse, err = common.Retry(ctx, request, client.addMediaWorkflowConfigurationLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ChangeMediaWorkflowCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = AddMediaWorkflowConfigurationLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ChangeMediaWorkflowCompartmentResponse{} + response = AddMediaWorkflowConfigurationLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ChangeMediaWorkflowCompartmentResponse); ok { + if convertedResponse, ok := ociResponse.(AddMediaWorkflowConfigurationLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaWorkflowCompartmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into AddMediaWorkflowConfigurationLockResponse") } return } -// changeMediaWorkflowCompartment implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) changeMediaWorkflowCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// addMediaWorkflowConfigurationLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) addMediaWorkflowConfigurationLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflows/{mediaWorkflowId}/actions/changeCompartment", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}/actions/addLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ChangeMediaWorkflowCompartmentResponse + var response AddMediaWorkflowConfigurationLockResponse 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/dms/20211101/MediaWorkflow/ChangeMediaWorkflowCompartment" - err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaWorkflowCompartment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowConfiguration/AddMediaWorkflowConfigurationLock" + err = common.PostProcessServiceError(err, "MediaServices", "AddMediaWorkflowConfigurationLock", apiReferenceLink) return response, err } @@ -218,13 +218,13 @@ func (client MediaServicesClient) changeMediaWorkflowCompartment(ctx context.Con return response, err } -// ChangeMediaWorkflowConfigurationCompartment Moves a MediaWorkflowConfiguration resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// AddMediaWorkflowJobLock Add a lock to a MediaWorkflowJob. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaWorkflowConfigurationCompartment.go.html to see an example of how to use ChangeMediaWorkflowConfigurationCompartment API. -// A default retry strategy applies to this operation ChangeMediaWorkflowConfigurationCompartment() -func (client MediaServicesClient) ChangeMediaWorkflowConfigurationCompartment(ctx context.Context, request ChangeMediaWorkflowConfigurationCompartmentRequest) (response ChangeMediaWorkflowConfigurationCompartmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaWorkflowJobLock.go.html to see an example of how to use AddMediaWorkflowJobLock API. +// A default retry strategy applies to this operation AddMediaWorkflowJobLock() +func (client MediaServicesClient) AddMediaWorkflowJobLock(ctx context.Context, request AddMediaWorkflowJobLockRequest) (response AddMediaWorkflowJobLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -238,42 +238,42 @@ func (client MediaServicesClient) ChangeMediaWorkflowConfigurationCompartment(ct request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.changeMediaWorkflowConfigurationCompartment, policy) + ociResponse, err = common.Retry(ctx, request, client.addMediaWorkflowJobLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ChangeMediaWorkflowConfigurationCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = AddMediaWorkflowJobLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ChangeMediaWorkflowConfigurationCompartmentResponse{} + response = AddMediaWorkflowJobLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ChangeMediaWorkflowConfigurationCompartmentResponse); ok { + if convertedResponse, ok := ociResponse.(AddMediaWorkflowJobLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaWorkflowConfigurationCompartmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into AddMediaWorkflowJobLockResponse") } return } -// changeMediaWorkflowConfigurationCompartment implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) changeMediaWorkflowConfigurationCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// addMediaWorkflowJobLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) addMediaWorkflowJobLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}/actions/changeCompartment", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowJobs/{mediaWorkflowJobId}/actions/addLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ChangeMediaWorkflowConfigurationCompartmentResponse + var response AddMediaWorkflowJobLockResponse 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/dms/20211101/MediaWorkflowConfiguration/ChangeMediaWorkflowConfigurationCompartment" - err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaWorkflowConfigurationCompartment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowJob/AddMediaWorkflowJobLock" + err = common.PostProcessServiceError(err, "MediaServices", "AddMediaWorkflowJobLock", apiReferenceLink) return response, err } @@ -281,13 +281,13 @@ func (client MediaServicesClient) changeMediaWorkflowConfigurationCompartment(ct return response, err } -// ChangeMediaWorkflowJobCompartment Moves a MediaWorkflowJob resource from one compartment identifier to another. +// AddMediaWorkflowLock Add a lock to a MediaWorkflow. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaWorkflowJobCompartment.go.html to see an example of how to use ChangeMediaWorkflowJobCompartment API. -// A default retry strategy applies to this operation ChangeMediaWorkflowJobCompartment() -func (client MediaServicesClient) ChangeMediaWorkflowJobCompartment(ctx context.Context, request ChangeMediaWorkflowJobCompartmentRequest) (response ChangeMediaWorkflowJobCompartmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddMediaWorkflowLock.go.html to see an example of how to use AddMediaWorkflowLock API. +// A default retry strategy applies to this operation AddMediaWorkflowLock() +func (client MediaServicesClient) AddMediaWorkflowLock(ctx context.Context, request AddMediaWorkflowLockRequest) (response AddMediaWorkflowLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -301,42 +301,42 @@ func (client MediaServicesClient) ChangeMediaWorkflowJobCompartment(ctx context. request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.changeMediaWorkflowJobCompartment, policy) + ociResponse, err = common.Retry(ctx, request, client.addMediaWorkflowLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ChangeMediaWorkflowJobCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = AddMediaWorkflowLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ChangeMediaWorkflowJobCompartmentResponse{} + response = AddMediaWorkflowLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ChangeMediaWorkflowJobCompartmentResponse); ok { + if convertedResponse, ok := ociResponse.(AddMediaWorkflowLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaWorkflowJobCompartmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into AddMediaWorkflowLockResponse") } return } -// changeMediaWorkflowJobCompartment implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) changeMediaWorkflowJobCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// addMediaWorkflowLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) addMediaWorkflowLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowJobs/{mediaWorkflowJobId}/actions/changeCompartment", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflows/{mediaWorkflowId}/actions/addLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ChangeMediaWorkflowJobCompartmentResponse + var response AddMediaWorkflowLockResponse 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/dms/20211101/MediaWorkflowJob/ChangeMediaWorkflowJobCompartment" - err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaWorkflowJobCompartment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflow/AddMediaWorkflowLock" + err = common.PostProcessServiceError(err, "MediaServices", "AddMediaWorkflowLock", apiReferenceLink) return response, err } @@ -344,13 +344,13 @@ func (client MediaServicesClient) changeMediaWorkflowJobCompartment(ctx context. return response, err } -// ChangeStreamDistributionChannelCompartment Moves a Stream Distribution Channel resource from one compartment identifier to another. +// AddStreamCdnConfigLock Add a lock to a StreamCdnConfig. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeStreamDistributionChannelCompartment.go.html to see an example of how to use ChangeStreamDistributionChannelCompartment API. -// A default retry strategy applies to this operation ChangeStreamDistributionChannelCompartment() -func (client MediaServicesClient) ChangeStreamDistributionChannelCompartment(ctx context.Context, request ChangeStreamDistributionChannelCompartmentRequest) (response ChangeStreamDistributionChannelCompartmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddStreamCdnConfigLock.go.html to see an example of how to use AddStreamCdnConfigLock API. +// A default retry strategy applies to this operation AddStreamCdnConfigLock() +func (client MediaServicesClient) AddStreamCdnConfigLock(ctx context.Context, request AddStreamCdnConfigLockRequest) (response AddStreamCdnConfigLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -364,42 +364,42 @@ func (client MediaServicesClient) ChangeStreamDistributionChannelCompartment(ctx request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.changeStreamDistributionChannelCompartment, policy) + ociResponse, err = common.Retry(ctx, request, client.addStreamCdnConfigLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ChangeStreamDistributionChannelCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = AddStreamCdnConfigLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ChangeStreamDistributionChannelCompartmentResponse{} + response = AddStreamCdnConfigLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ChangeStreamDistributionChannelCompartmentResponse); ok { + if convertedResponse, ok := ociResponse.(AddStreamCdnConfigLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ChangeStreamDistributionChannelCompartmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into AddStreamCdnConfigLockResponse") } return } -// changeStreamDistributionChannelCompartment implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) changeStreamDistributionChannelCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// addStreamCdnConfigLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) addStreamCdnConfigLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels/{streamDistributionChannelId}/actions/changeCompartment", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamCdnConfigs/{streamCdnConfigId}/actions/addLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ChangeStreamDistributionChannelCompartmentResponse + var response AddStreamCdnConfigLockResponse 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/dms/20211101/StreamDistributionChannel/ChangeStreamDistributionChannelCompartment" - err = common.PostProcessServiceError(err, "MediaServices", "ChangeStreamDistributionChannelCompartment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamCdnConfig/AddStreamCdnConfigLock" + err = common.PostProcessServiceError(err, "MediaServices", "AddStreamCdnConfigLock", apiReferenceLink) return response, err } @@ -407,13 +407,13 @@ func (client MediaServicesClient) changeStreamDistributionChannelCompartment(ctx return response, err } -// CreateMediaAsset Creates a new MediaAsset. +// AddStreamDistributionChannelLock Add a lock to a StreamDistributionChannel. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaAsset.go.html to see an example of how to use CreateMediaAsset API. -// A default retry strategy applies to this operation CreateMediaAsset() -func (client MediaServicesClient) CreateMediaAsset(ctx context.Context, request CreateMediaAssetRequest) (response CreateMediaAssetResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddStreamDistributionChannelLock.go.html to see an example of how to use AddStreamDistributionChannelLock API. +// A default retry strategy applies to this operation AddStreamDistributionChannelLock() +func (client MediaServicesClient) AddStreamDistributionChannelLock(ctx context.Context, request AddStreamDistributionChannelLockRequest) (response AddStreamDistributionChannelLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -427,42 +427,42 @@ func (client MediaServicesClient) CreateMediaAsset(ctx context.Context, request request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createMediaAsset, policy) + ociResponse, err = common.Retry(ctx, request, client.addStreamDistributionChannelLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateMediaAssetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = AddStreamDistributionChannelLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateMediaAssetResponse{} + response = AddStreamDistributionChannelLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateMediaAssetResponse); ok { + if convertedResponse, ok := ociResponse.(AddStreamDistributionChannelLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateMediaAssetResponse") + err = fmt.Errorf("failed to convert OCIResponse into AddStreamDistributionChannelLockResponse") } return } -// createMediaAsset implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) createMediaAsset(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// addStreamDistributionChannelLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) addStreamDistributionChannelLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaAssets", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels/{streamDistributionChannelId}/actions/addLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateMediaAssetResponse + var response AddStreamDistributionChannelLockResponse 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/dms/20211101/MediaAsset/CreateMediaAsset" - err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaAsset", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamDistributionChannel/AddStreamDistributionChannelLock" + err = common.PostProcessServiceError(err, "MediaServices", "AddStreamDistributionChannelLock", apiReferenceLink) return response, err } @@ -470,13 +470,13 @@ func (client MediaServicesClient) createMediaAsset(ctx context.Context, request return response, err } -// CreateMediaWorkflow Creates a new MediaWorkflow. +// AddStreamPackagingConfigLock Add a lock to a StreamPackagingConfig. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaWorkflow.go.html to see an example of how to use CreateMediaWorkflow API. -// A default retry strategy applies to this operation CreateMediaWorkflow() -func (client MediaServicesClient) CreateMediaWorkflow(ctx context.Context, request CreateMediaWorkflowRequest) (response CreateMediaWorkflowResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/AddStreamPackagingConfigLock.go.html to see an example of how to use AddStreamPackagingConfigLock API. +// A default retry strategy applies to this operation AddStreamPackagingConfigLock() +func (client MediaServicesClient) AddStreamPackagingConfigLock(ctx context.Context, request AddStreamPackagingConfigLockRequest) (response AddStreamPackagingConfigLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -490,56 +490,56 @@ func (client MediaServicesClient) CreateMediaWorkflow(ctx context.Context, reque request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createMediaWorkflow, policy) + ociResponse, err = common.Retry(ctx, request, client.addStreamPackagingConfigLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateMediaWorkflowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = AddStreamPackagingConfigLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateMediaWorkflowResponse{} + response = AddStreamPackagingConfigLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateMediaWorkflowResponse); ok { + if convertedResponse, ok := ociResponse.(AddStreamPackagingConfigLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateMediaWorkflowResponse") + err = fmt.Errorf("failed to convert OCIResponse into AddStreamPackagingConfigLockResponse") } return } -// createMediaWorkflow implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) createMediaWorkflow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// addStreamPackagingConfigLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) addStreamPackagingConfigLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflows", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamPackagingConfigs/{streamPackagingConfigId}/actions/addLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateMediaWorkflowResponse + var response AddStreamPackagingConfigLockResponse 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/dms/20211101/MediaWorkflow/CreateMediaWorkflow" - err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaWorkflow", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamPackagingConfig/AddStreamPackagingConfigLock" + err = common.PostProcessServiceError(err, "MediaServices", "AddStreamPackagingConfigLock", apiReferenceLink) return response, err } - err = common.UnmarshalResponse(httpResponse, &response) + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &streampackagingconfig{}) return response, err } -// CreateMediaWorkflowConfiguration Creates a new MediaWorkflowConfiguration. +// ChangeMediaAssetCompartment Moves a MediaAsset resource from one compartment identifier to another. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaWorkflowConfiguration.go.html to see an example of how to use CreateMediaWorkflowConfiguration API. -// A default retry strategy applies to this operation CreateMediaWorkflowConfiguration() -func (client MediaServicesClient) CreateMediaWorkflowConfiguration(ctx context.Context, request CreateMediaWorkflowConfigurationRequest) (response CreateMediaWorkflowConfigurationResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaAssetCompartment.go.html to see an example of how to use ChangeMediaAssetCompartment API. +// A default retry strategy applies to this operation ChangeMediaAssetCompartment() +func (client MediaServicesClient) ChangeMediaAssetCompartment(ctx context.Context, request ChangeMediaAssetCompartmentRequest) (response ChangeMediaAssetCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -553,42 +553,42 @@ func (client MediaServicesClient) CreateMediaWorkflowConfiguration(ctx context.C request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createMediaWorkflowConfiguration, policy) + ociResponse, err = common.Retry(ctx, request, client.changeMediaAssetCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateMediaWorkflowConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ChangeMediaAssetCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateMediaWorkflowConfigurationResponse{} + response = ChangeMediaAssetCompartmentResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateMediaWorkflowConfigurationResponse); ok { + if convertedResponse, ok := ociResponse.(ChangeMediaAssetCompartmentResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateMediaWorkflowConfigurationResponse") + err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaAssetCompartmentResponse") } return } -// createMediaWorkflowConfiguration implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) createMediaWorkflowConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// changeMediaAssetCompartment implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) changeMediaAssetCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowConfigurations", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaAssets/{mediaAssetId}/actions/changeCompartment", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateMediaWorkflowConfigurationResponse + var response ChangeMediaAssetCompartmentResponse 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/dms/20211101/MediaWorkflowConfiguration/CreateMediaWorkflowConfiguration" - err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaWorkflowConfiguration", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaAsset/ChangeMediaAssetCompartment" + err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaAssetCompartment", apiReferenceLink) return response, err } @@ -596,13 +596,13 @@ func (client MediaServicesClient) createMediaWorkflowConfiguration(ctx context.C return response, err } -// CreateMediaWorkflowJob Run the MediaWorkflow according to the given mediaWorkflow definition and configuration. +// ChangeMediaWorkflowCompartment Moves a MediaWorkflow resource from one compartment identifier to another. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaWorkflowJob.go.html to see an example of how to use CreateMediaWorkflowJob API. -// A default retry strategy applies to this operation CreateMediaWorkflowJob() -func (client MediaServicesClient) CreateMediaWorkflowJob(ctx context.Context, request CreateMediaWorkflowJobRequest) (response CreateMediaWorkflowJobResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaWorkflowCompartment.go.html to see an example of how to use ChangeMediaWorkflowCompartment API. +// A default retry strategy applies to this operation ChangeMediaWorkflowCompartment() +func (client MediaServicesClient) ChangeMediaWorkflowCompartment(ctx context.Context, request ChangeMediaWorkflowCompartmentRequest) (response ChangeMediaWorkflowCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -616,42 +616,42 @@ func (client MediaServicesClient) CreateMediaWorkflowJob(ctx context.Context, re request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createMediaWorkflowJob, policy) + ociResponse, err = common.Retry(ctx, request, client.changeMediaWorkflowCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateMediaWorkflowJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ChangeMediaWorkflowCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateMediaWorkflowJobResponse{} + response = ChangeMediaWorkflowCompartmentResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateMediaWorkflowJobResponse); ok { + if convertedResponse, ok := ociResponse.(ChangeMediaWorkflowCompartmentResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateMediaWorkflowJobResponse") + err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaWorkflowCompartmentResponse") } return } -// createMediaWorkflowJob implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) createMediaWorkflowJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// changeMediaWorkflowCompartment implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) changeMediaWorkflowCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowJobs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflows/{mediaWorkflowId}/actions/changeCompartment", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateMediaWorkflowJobResponse + var response ChangeMediaWorkflowCompartmentResponse 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/dms/20211101/MediaWorkflowJob/CreateMediaWorkflowJob" - err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaWorkflowJob", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflow/ChangeMediaWorkflowCompartment" + err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaWorkflowCompartment", apiReferenceLink) return response, err } @@ -659,13 +659,13 @@ func (client MediaServicesClient) createMediaWorkflowJob(ctx context.Context, re return response, err } -// CreateStreamCdnConfig Creates a new CDN Configuration. +// ChangeMediaWorkflowConfigurationCompartment Moves a MediaWorkflowConfiguration resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateStreamCdnConfig.go.html to see an example of how to use CreateStreamCdnConfig API. -// A default retry strategy applies to this operation CreateStreamCdnConfig() -func (client MediaServicesClient) CreateStreamCdnConfig(ctx context.Context, request CreateStreamCdnConfigRequest) (response CreateStreamCdnConfigResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaWorkflowConfigurationCompartment.go.html to see an example of how to use ChangeMediaWorkflowConfigurationCompartment API. +// A default retry strategy applies to this operation ChangeMediaWorkflowConfigurationCompartment() +func (client MediaServicesClient) ChangeMediaWorkflowConfigurationCompartment(ctx context.Context, request ChangeMediaWorkflowConfigurationCompartmentRequest) (response ChangeMediaWorkflowConfigurationCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -679,42 +679,42 @@ func (client MediaServicesClient) CreateStreamCdnConfig(ctx context.Context, req request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createStreamCdnConfig, policy) + ociResponse, err = common.Retry(ctx, request, client.changeMediaWorkflowConfigurationCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateStreamCdnConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ChangeMediaWorkflowConfigurationCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateStreamCdnConfigResponse{} + response = ChangeMediaWorkflowConfigurationCompartmentResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateStreamCdnConfigResponse); ok { + if convertedResponse, ok := ociResponse.(ChangeMediaWorkflowConfigurationCompartmentResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateStreamCdnConfigResponse") + err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaWorkflowConfigurationCompartmentResponse") } return } -// createStreamCdnConfig implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) createStreamCdnConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// changeMediaWorkflowConfigurationCompartment implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) changeMediaWorkflowConfigurationCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamCdnConfigs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}/actions/changeCompartment", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateStreamCdnConfigResponse + var response ChangeMediaWorkflowConfigurationCompartmentResponse 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/dms/20211101/StreamCdnConfig/CreateStreamCdnConfig" - err = common.PostProcessServiceError(err, "MediaServices", "CreateStreamCdnConfig", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowConfiguration/ChangeMediaWorkflowConfigurationCompartment" + err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaWorkflowConfigurationCompartment", apiReferenceLink) return response, err } @@ -722,13 +722,13 @@ func (client MediaServicesClient) createStreamCdnConfig(ctx context.Context, req return response, err } -// CreateStreamDistributionChannel Creates a new Stream Distribution Channel. +// ChangeMediaWorkflowJobCompartment Moves a MediaWorkflowJob resource from one compartment identifier to another. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateStreamDistributionChannel.go.html to see an example of how to use CreateStreamDistributionChannel API. -// A default retry strategy applies to this operation CreateStreamDistributionChannel() -func (client MediaServicesClient) CreateStreamDistributionChannel(ctx context.Context, request CreateStreamDistributionChannelRequest) (response CreateStreamDistributionChannelResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeMediaWorkflowJobCompartment.go.html to see an example of how to use ChangeMediaWorkflowJobCompartment API. +// A default retry strategy applies to this operation ChangeMediaWorkflowJobCompartment() +func (client MediaServicesClient) ChangeMediaWorkflowJobCompartment(ctx context.Context, request ChangeMediaWorkflowJobCompartmentRequest) (response ChangeMediaWorkflowJobCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -742,42 +742,42 @@ func (client MediaServicesClient) CreateStreamDistributionChannel(ctx context.Co request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createStreamDistributionChannel, policy) + ociResponse, err = common.Retry(ctx, request, client.changeMediaWorkflowJobCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ChangeMediaWorkflowJobCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateStreamDistributionChannelResponse{} + response = ChangeMediaWorkflowJobCompartmentResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateStreamDistributionChannelResponse); ok { + if convertedResponse, ok := ociResponse.(ChangeMediaWorkflowJobCompartmentResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateStreamDistributionChannelResponse") + err = fmt.Errorf("failed to convert OCIResponse into ChangeMediaWorkflowJobCompartmentResponse") } return } -// createStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) createStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// changeMediaWorkflowJobCompartment implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) changeMediaWorkflowJobCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowJobs/{mediaWorkflowJobId}/actions/changeCompartment", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateStreamDistributionChannelResponse + var response ChangeMediaWorkflowJobCompartmentResponse 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/dms/20211101/StreamDistributionChannel/CreateStreamDistributionChannel" - err = common.PostProcessServiceError(err, "MediaServices", "CreateStreamDistributionChannel", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowJob/ChangeMediaWorkflowJobCompartment" + err = common.PostProcessServiceError(err, "MediaServices", "ChangeMediaWorkflowJobCompartment", apiReferenceLink) return response, err } @@ -785,13 +785,13 @@ func (client MediaServicesClient) createStreamDistributionChannel(ctx context.Co return response, err } -// CreateStreamPackagingConfig Creates a new Packaging Configuration. +// ChangeStreamDistributionChannelCompartment Moves a Stream Distribution Channel resource from one compartment identifier to another. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateStreamPackagingConfig.go.html to see an example of how to use CreateStreamPackagingConfig API. -// A default retry strategy applies to this operation CreateStreamPackagingConfig() -func (client MediaServicesClient) CreateStreamPackagingConfig(ctx context.Context, request CreateStreamPackagingConfigRequest) (response CreateStreamPackagingConfigResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ChangeStreamDistributionChannelCompartment.go.html to see an example of how to use ChangeStreamDistributionChannelCompartment API. +// A default retry strategy applies to this operation ChangeStreamDistributionChannelCompartment() +func (client MediaServicesClient) ChangeStreamDistributionChannelCompartment(ctx context.Context, request ChangeStreamDistributionChannelCompartmentRequest) (response ChangeStreamDistributionChannelCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -805,56 +805,555 @@ func (client MediaServicesClient) CreateStreamPackagingConfig(ctx context.Contex request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createStreamPackagingConfig, policy) + ociResponse, err = common.Retry(ctx, request, client.changeStreamDistributionChannelCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateStreamPackagingConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ChangeStreamDistributionChannelCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateStreamPackagingConfigResponse{} + response = ChangeStreamDistributionChannelCompartmentResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateStreamPackagingConfigResponse); ok { + if convertedResponse, ok := ociResponse.(ChangeStreamDistributionChannelCompartmentResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateStreamPackagingConfigResponse") + err = fmt.Errorf("failed to convert OCIResponse into ChangeStreamDistributionChannelCompartmentResponse") } return } -// createStreamPackagingConfig implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) createStreamPackagingConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// changeStreamDistributionChannelCompartment implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) changeStreamDistributionChannelCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamPackagingConfigs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels/{streamDistributionChannelId}/actions/changeCompartment", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateStreamPackagingConfigResponse + var response ChangeStreamDistributionChannelCompartmentResponse 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/dms/20211101/StreamPackagingConfig/CreateStreamPackagingConfig" - err = common.PostProcessServiceError(err, "MediaServices", "CreateStreamPackagingConfig", apiReferenceLink) - return response, err + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamDistributionChannel/ChangeStreamDistributionChannelCompartment" + err = common.PostProcessServiceError(err, "MediaServices", "ChangeStreamDistributionChannelCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateMediaAsset Creates a new MediaAsset. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaAsset.go.html to see an example of how to use CreateMediaAsset API. +// A default retry strategy applies to this operation CreateMediaAsset() +func (client MediaServicesClient) CreateMediaAsset(ctx context.Context, request CreateMediaAssetRequest) (response CreateMediaAssetResponse, 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.createMediaAsset, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateMediaAssetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateMediaAssetResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateMediaAssetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMediaAssetResponse") + } + return +} + +// createMediaAsset implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) createMediaAsset(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaAssets", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateMediaAssetResponse + 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/dms/20211101/MediaAsset/CreateMediaAsset" + err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaAsset", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateMediaWorkflow Creates a new MediaWorkflow. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaWorkflow.go.html to see an example of how to use CreateMediaWorkflow API. +// A default retry strategy applies to this operation CreateMediaWorkflow() +func (client MediaServicesClient) CreateMediaWorkflow(ctx context.Context, request CreateMediaWorkflowRequest) (response CreateMediaWorkflowResponse, 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.createMediaWorkflow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateMediaWorkflowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateMediaWorkflowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateMediaWorkflowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMediaWorkflowResponse") + } + return +} + +// createMediaWorkflow implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) createMediaWorkflow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflows", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateMediaWorkflowResponse + 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/dms/20211101/MediaWorkflow/CreateMediaWorkflow" + err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaWorkflow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateMediaWorkflowConfiguration Creates a new MediaWorkflowConfiguration. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaWorkflowConfiguration.go.html to see an example of how to use CreateMediaWorkflowConfiguration API. +// A default retry strategy applies to this operation CreateMediaWorkflowConfiguration() +func (client MediaServicesClient) CreateMediaWorkflowConfiguration(ctx context.Context, request CreateMediaWorkflowConfigurationRequest) (response CreateMediaWorkflowConfigurationResponse, 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.createMediaWorkflowConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateMediaWorkflowConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateMediaWorkflowConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateMediaWorkflowConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMediaWorkflowConfigurationResponse") + } + return +} + +// createMediaWorkflowConfiguration implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) createMediaWorkflowConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowConfigurations", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateMediaWorkflowConfigurationResponse + 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/dms/20211101/MediaWorkflowConfiguration/CreateMediaWorkflowConfiguration" + err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaWorkflowConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateMediaWorkflowJob Run the MediaWorkflow according to the given mediaWorkflow definition and configuration. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateMediaWorkflowJob.go.html to see an example of how to use CreateMediaWorkflowJob API. +// A default retry strategy applies to this operation CreateMediaWorkflowJob() +func (client MediaServicesClient) CreateMediaWorkflowJob(ctx context.Context, request CreateMediaWorkflowJobRequest) (response CreateMediaWorkflowJobResponse, 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.createMediaWorkflowJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateMediaWorkflowJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateMediaWorkflowJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateMediaWorkflowJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMediaWorkflowJobResponse") + } + return +} + +// createMediaWorkflowJob implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) createMediaWorkflowJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowJobs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateMediaWorkflowJobResponse + 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/dms/20211101/MediaWorkflowJob/CreateMediaWorkflowJob" + err = common.PostProcessServiceError(err, "MediaServices", "CreateMediaWorkflowJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateStreamCdnConfig Creates a new CDN Configuration. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateStreamCdnConfig.go.html to see an example of how to use CreateStreamCdnConfig API. +// A default retry strategy applies to this operation CreateStreamCdnConfig() +func (client MediaServicesClient) CreateStreamCdnConfig(ctx context.Context, request CreateStreamCdnConfigRequest) (response CreateStreamCdnConfigResponse, 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.createStreamCdnConfig, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateStreamCdnConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateStreamCdnConfigResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateStreamCdnConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateStreamCdnConfigResponse") + } + return +} + +// createStreamCdnConfig implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) createStreamCdnConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamCdnConfigs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateStreamCdnConfigResponse + 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/dms/20211101/StreamCdnConfig/CreateStreamCdnConfig" + err = common.PostProcessServiceError(err, "MediaServices", "CreateStreamCdnConfig", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateStreamDistributionChannel Creates a new Stream Distribution Channel. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateStreamDistributionChannel.go.html to see an example of how to use CreateStreamDistributionChannel API. +// A default retry strategy applies to this operation CreateStreamDistributionChannel() +func (client MediaServicesClient) CreateStreamDistributionChannel(ctx context.Context, request CreateStreamDistributionChannelRequest) (response CreateStreamDistributionChannelResponse, 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.createStreamDistributionChannel, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateStreamDistributionChannelResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateStreamDistributionChannelResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateStreamDistributionChannelResponse") + } + return +} + +// createStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) createStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateStreamDistributionChannelResponse + 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/dms/20211101/StreamDistributionChannel/CreateStreamDistributionChannel" + err = common.PostProcessServiceError(err, "MediaServices", "CreateStreamDistributionChannel", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateStreamPackagingConfig Creates a new Packaging Configuration. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/CreateStreamPackagingConfig.go.html to see an example of how to use CreateStreamPackagingConfig API. +// A default retry strategy applies to this operation CreateStreamPackagingConfig() +func (client MediaServicesClient) CreateStreamPackagingConfig(ctx context.Context, request CreateStreamPackagingConfigRequest) (response CreateStreamPackagingConfigResponse, 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.createStreamPackagingConfig, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateStreamPackagingConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateStreamPackagingConfigResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateStreamPackagingConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateStreamPackagingConfigResponse") + } + return +} + +// createStreamPackagingConfig implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) createStreamPackagingConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamPackagingConfigs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateStreamPackagingConfigResponse + 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/dms/20211101/StreamPackagingConfig/CreateStreamPackagingConfig" + err = common.PostProcessServiceError(err, "MediaServices", "CreateStreamPackagingConfig", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &streampackagingconfig{}) + return response, err +} + +// DeleteMediaAsset Deletes a MediaAsset resource by identifier. If DeleteChildren is passed in as the mode, all the assets with the parentMediaAssetId matching the ID will be deleted. If DeleteDerivatives is set as the mode, all the assets with the masterMediaAssetId matching the ID will be deleted. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaAsset.go.html to see an example of how to use DeleteMediaAsset API. +// A default retry strategy applies to this operation DeleteMediaAsset() +func (client MediaServicesClient) DeleteMediaAsset(ctx context.Context, request DeleteMediaAssetRequest) (response DeleteMediaAssetResponse, 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.deleteMediaAsset, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteMediaAssetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteMediaAssetResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteMediaAssetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaAssetResponse") + } + return +} + +// deleteMediaAsset implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteMediaAsset(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaAssets/{mediaAssetId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteMediaAssetResponse + 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/dms/20211101/MediaAsset/DeleteMediaAsset" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaAsset", apiReferenceLink) + return response, err } - err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &streampackagingconfig{}) + err = common.UnmarshalResponse(httpResponse, &response) return response, err } -// DeleteMediaAsset Deletes a MediaAsset resource by identifier. If DeleteChildren is passed in as the mode, all the assets with the parentMediaAssetId matching the ID will be deleted. If DeleteDerivatives is set as the mode, all the assets with the masterMediaAssetId matching the ID will be deleted. +// DeleteMediaAssetDistributionChannelAttachment Deletes a MediaAsset from the DistributionChannel by identifiers. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaAsset.go.html to see an example of how to use DeleteMediaAsset API. -// A default retry strategy applies to this operation DeleteMediaAsset() -func (client MediaServicesClient) DeleteMediaAsset(ctx context.Context, request DeleteMediaAssetRequest) (response DeleteMediaAssetResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaAssetDistributionChannelAttachment.go.html to see an example of how to use DeleteMediaAssetDistributionChannelAttachment API. +// A default retry strategy applies to this operation DeleteMediaAssetDistributionChannelAttachment() +func (client MediaServicesClient) DeleteMediaAssetDistributionChannelAttachment(ctx context.Context, request DeleteMediaAssetDistributionChannelAttachmentRequest) (response DeleteMediaAssetDistributionChannelAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -863,42 +1362,274 @@ func (client MediaServicesClient) DeleteMediaAsset(ctx context.Context, request if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteMediaAsset, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteMediaAssetDistributionChannelAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteMediaAssetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteMediaAssetDistributionChannelAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteMediaAssetResponse{} + response = DeleteMediaAssetDistributionChannelAttachmentResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteMediaAssetResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteMediaAssetDistributionChannelAttachmentResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaAssetResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaAssetDistributionChannelAttachmentResponse") } return } -// deleteMediaAsset implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteMediaAsset(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteMediaAssetDistributionChannelAttachment implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteMediaAssetDistributionChannelAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaAssets/{mediaAssetId}/distributionChannelAttachments/{distributionChannelId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteMediaAssetDistributionChannelAttachmentResponse + 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/dms/20211101/MediaAssetDistributionChannelAttachment/DeleteMediaAssetDistributionChannelAttachment" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaAssetDistributionChannelAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteMediaWorkflow The MediaWorkflow lifecycleState will change to DELETED. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaWorkflow.go.html to see an example of how to use DeleteMediaWorkflow API. +// A default retry strategy applies to this operation DeleteMediaWorkflow() +func (client MediaServicesClient) DeleteMediaWorkflow(ctx context.Context, request DeleteMediaWorkflowRequest) (response DeleteMediaWorkflowResponse, 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.deleteMediaWorkflow, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteMediaWorkflowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteMediaWorkflowResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteMediaWorkflowResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaWorkflowResponse") + } + return +} + +// deleteMediaWorkflow implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteMediaWorkflow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaWorkflows/{mediaWorkflowId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteMediaWorkflowResponse + 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/dms/20211101/MediaWorkflow/DeleteMediaWorkflow" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaWorkflow", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteMediaWorkflowConfiguration Deletes a MediaWorkflowConfiguration resource by identifier. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaWorkflowConfiguration.go.html to see an example of how to use DeleteMediaWorkflowConfiguration API. +// A default retry strategy applies to this operation DeleteMediaWorkflowConfiguration() +func (client MediaServicesClient) DeleteMediaWorkflowConfiguration(ctx context.Context, request DeleteMediaWorkflowConfigurationRequest) (response DeleteMediaWorkflowConfigurationResponse, 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.deleteMediaWorkflowConfiguration, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteMediaWorkflowConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteMediaWorkflowConfigurationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteMediaWorkflowConfigurationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaWorkflowConfigurationResponse") + } + return +} + +// deleteMediaWorkflowConfiguration implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteMediaWorkflowConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteMediaWorkflowConfigurationResponse + 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/dms/20211101/MediaWorkflowConfiguration/DeleteMediaWorkflowConfiguration" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaWorkflowConfiguration", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteMediaWorkflowJob This is an asynchronous operation. The MediaWorkflowJob lifecycleState will change to CANCELING temporarily until the job is completely CANCELED. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaWorkflowJob.go.html to see an example of how to use DeleteMediaWorkflowJob API. +// A default retry strategy applies to this operation DeleteMediaWorkflowJob() +func (client MediaServicesClient) DeleteMediaWorkflowJob(ctx context.Context, request DeleteMediaWorkflowJobRequest) (response DeleteMediaWorkflowJobResponse, 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.deleteMediaWorkflowJob, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteMediaWorkflowJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteMediaWorkflowJobResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteMediaWorkflowJobResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaWorkflowJobResponse") + } + return +} + +// deleteMediaWorkflowJob implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteMediaWorkflowJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaWorkflowJobs/{mediaWorkflowJobId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteMediaWorkflowJobResponse + 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/dms/20211101/MediaWorkflowJob/DeleteMediaWorkflowJob" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaWorkflowJob", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteStreamCdnConfig The StreamCdnConfig lifecycleState will change to DELETED. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteStreamCdnConfig.go.html to see an example of how to use DeleteStreamCdnConfig API. +// A default retry strategy applies to this operation DeleteStreamCdnConfig() +func (client MediaServicesClient) DeleteStreamCdnConfig(ctx context.Context, request DeleteStreamCdnConfigRequest) (response DeleteStreamCdnConfigResponse, 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.deleteStreamCdnConfig, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteStreamCdnConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteStreamCdnConfigResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteStreamCdnConfigResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteStreamCdnConfigResponse") + } + return +} + +// deleteStreamCdnConfig implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteStreamCdnConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaAssets/{mediaAssetId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/streamCdnConfigs/{streamCdnConfigId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteMediaAssetResponse + var response DeleteStreamCdnConfigResponse 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/dms/20211101/MediaAsset/DeleteMediaAsset" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaAsset", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamCdnConfig/DeleteStreamCdnConfig" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteStreamCdnConfig", apiReferenceLink) return response, err } @@ -906,13 +1637,13 @@ func (client MediaServicesClient) deleteMediaAsset(ctx context.Context, request return response, err } -// DeleteMediaAssetDistributionChannelAttachment Deletes a MediaAsset from the DistributionChannel by identifiers. +// DeleteStreamDistributionChannel The Stream Distribution Channel lifecycleState will change to DELETED. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaAssetDistributionChannelAttachment.go.html to see an example of how to use DeleteMediaAssetDistributionChannelAttachment API. -// A default retry strategy applies to this operation DeleteMediaAssetDistributionChannelAttachment() -func (client MediaServicesClient) DeleteMediaAssetDistributionChannelAttachment(ctx context.Context, request DeleteMediaAssetDistributionChannelAttachmentRequest) (response DeleteMediaAssetDistributionChannelAttachmentResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteStreamDistributionChannel.go.html to see an example of how to use DeleteStreamDistributionChannel API. +// A default retry strategy applies to this operation DeleteStreamDistributionChannel() +func (client MediaServicesClient) DeleteStreamDistributionChannel(ctx context.Context, request DeleteStreamDistributionChannelRequest) (response DeleteStreamDistributionChannelResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -921,42 +1652,42 @@ func (client MediaServicesClient) DeleteMediaAssetDistributionChannelAttachment( if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteMediaAssetDistributionChannelAttachment, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteStreamDistributionChannel, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteMediaAssetDistributionChannelAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteMediaAssetDistributionChannelAttachmentResponse{} + response = DeleteStreamDistributionChannelResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteMediaAssetDistributionChannelAttachmentResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteStreamDistributionChannelResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaAssetDistributionChannelAttachmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteStreamDistributionChannelResponse") } return } -// deleteMediaAssetDistributionChannelAttachment implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteMediaAssetDistributionChannelAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaAssets/{mediaAssetId}/distributionChannelAttachments/{distributionChannelId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/streamDistributionChannels/{streamDistributionChannelId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteMediaAssetDistributionChannelAttachmentResponse + var response DeleteStreamDistributionChannelResponse 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/dms/20211101/MediaAssetDistributionChannelAttachment/DeleteMediaAssetDistributionChannelAttachment" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaAssetDistributionChannelAttachment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamDistributionChannel/DeleteStreamDistributionChannel" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteStreamDistributionChannel", apiReferenceLink) return response, err } @@ -964,13 +1695,13 @@ func (client MediaServicesClient) deleteMediaAssetDistributionChannelAttachment( return response, err } -// DeleteMediaWorkflow The MediaWorkflow lifecycleState will change to DELETED. +// DeleteStreamPackagingConfig The Stream Packaging Configuration lifecycleState will change to DELETED. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaWorkflow.go.html to see an example of how to use DeleteMediaWorkflow API. -// A default retry strategy applies to this operation DeleteMediaWorkflow() -func (client MediaServicesClient) DeleteMediaWorkflow(ctx context.Context, request DeleteMediaWorkflowRequest) (response DeleteMediaWorkflowResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteStreamPackagingConfig.go.html to see an example of how to use DeleteStreamPackagingConfig API. +// A default retry strategy applies to this operation DeleteStreamPackagingConfig() +func (client MediaServicesClient) DeleteStreamPackagingConfig(ctx context.Context, request DeleteStreamPackagingConfigRequest) (response DeleteStreamPackagingConfigResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -979,42 +1710,42 @@ func (client MediaServicesClient) DeleteMediaWorkflow(ctx context.Context, reque if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteMediaWorkflow, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteStreamPackagingConfig, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteMediaWorkflowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteStreamPackagingConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteMediaWorkflowResponse{} + response = DeleteStreamPackagingConfigResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteMediaWorkflowResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteStreamPackagingConfigResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaWorkflowResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteStreamPackagingConfigResponse") } return } -// deleteMediaWorkflow implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteMediaWorkflow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteStreamPackagingConfig implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) deleteStreamPackagingConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaWorkflows/{mediaWorkflowId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/streamPackagingConfigs/{streamPackagingConfigId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteMediaWorkflowResponse + var response DeleteStreamPackagingConfigResponse 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/dms/20211101/MediaWorkflow/DeleteMediaWorkflow" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaWorkflow", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamPackagingConfig/DeleteStreamPackagingConfig" + err = common.PostProcessServiceError(err, "MediaServices", "DeleteStreamPackagingConfig", apiReferenceLink) return response, err } @@ -1022,13 +1753,13 @@ func (client MediaServicesClient) deleteMediaWorkflow(ctx context.Context, reque return response, err } -// DeleteMediaWorkflowConfiguration Deletes a MediaWorkflowConfiguration resource by identifier. +// GetMediaAsset Gets a MediaAsset by identifier. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaWorkflowConfiguration.go.html to see an example of how to use DeleteMediaWorkflowConfiguration API. -// A default retry strategy applies to this operation DeleteMediaWorkflowConfiguration() -func (client MediaServicesClient) DeleteMediaWorkflowConfiguration(ctx context.Context, request DeleteMediaWorkflowConfigurationRequest) (response DeleteMediaWorkflowConfigurationResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaAsset.go.html to see an example of how to use GetMediaAsset API. +// A default retry strategy applies to this operation GetMediaAsset() +func (client MediaServicesClient) GetMediaAsset(ctx context.Context, request GetMediaAssetRequest) (response GetMediaAssetResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1037,42 +1768,42 @@ func (client MediaServicesClient) DeleteMediaWorkflowConfiguration(ctx context.C if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteMediaWorkflowConfiguration, policy) + ociResponse, err = common.Retry(ctx, request, client.getMediaAsset, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteMediaWorkflowConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetMediaAssetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteMediaWorkflowConfigurationResponse{} + response = GetMediaAssetResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteMediaWorkflowConfigurationResponse); ok { + if convertedResponse, ok := ociResponse.(GetMediaAssetResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaWorkflowConfigurationResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetMediaAssetResponse") } return } -// deleteMediaWorkflowConfiguration implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteMediaWorkflowConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getMediaAsset implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getMediaAsset(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets/{mediaAssetId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteMediaWorkflowConfigurationResponse + var response GetMediaAssetResponse 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/dms/20211101/MediaWorkflowConfiguration/DeleteMediaWorkflowConfiguration" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaWorkflowConfiguration", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaAsset/GetMediaAsset" + err = common.PostProcessServiceError(err, "MediaServices", "GetMediaAsset", apiReferenceLink) return response, err } @@ -1080,13 +1811,13 @@ func (client MediaServicesClient) deleteMediaWorkflowConfiguration(ctx context.C return response, err } -// DeleteMediaWorkflowJob This is an asynchronous operation. The MediaWorkflowJob lifecycleState will change to CANCELING temporarily until the job is completely CANCELED. +// GetMediaAssetDistributionChannelAttachment Gets a MediaAssetDistributionChannelAttachment for a MediaAsset by identifiers. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteMediaWorkflowJob.go.html to see an example of how to use DeleteMediaWorkflowJob API. -// A default retry strategy applies to this operation DeleteMediaWorkflowJob() -func (client MediaServicesClient) DeleteMediaWorkflowJob(ctx context.Context, request DeleteMediaWorkflowJobRequest) (response DeleteMediaWorkflowJobResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaAssetDistributionChannelAttachment.go.html to see an example of how to use GetMediaAssetDistributionChannelAttachment API. +// A default retry strategy applies to this operation GetMediaAssetDistributionChannelAttachment() +func (client MediaServicesClient) GetMediaAssetDistributionChannelAttachment(ctx context.Context, request GetMediaAssetDistributionChannelAttachmentRequest) (response GetMediaAssetDistributionChannelAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1095,42 +1826,42 @@ func (client MediaServicesClient) DeleteMediaWorkflowJob(ctx context.Context, re if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteMediaWorkflowJob, policy) + ociResponse, err = common.Retry(ctx, request, client.getMediaAssetDistributionChannelAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteMediaWorkflowJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetMediaAssetDistributionChannelAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteMediaWorkflowJobResponse{} + response = GetMediaAssetDistributionChannelAttachmentResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteMediaWorkflowJobResponse); ok { + if convertedResponse, ok := ociResponse.(GetMediaAssetDistributionChannelAttachmentResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteMediaWorkflowJobResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetMediaAssetDistributionChannelAttachmentResponse") } return } -// deleteMediaWorkflowJob implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteMediaWorkflowJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getMediaAssetDistributionChannelAttachment implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getMediaAssetDistributionChannelAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/mediaWorkflowJobs/{mediaWorkflowJobId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets/{mediaAssetId}/distributionChannelAttachments/{distributionChannelId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteMediaWorkflowJobResponse + var response GetMediaAssetDistributionChannelAttachmentResponse 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/dms/20211101/MediaWorkflowJob/DeleteMediaWorkflowJob" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteMediaWorkflowJob", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaAssetDistributionChannelAttachment/GetMediaAssetDistributionChannelAttachment" + err = common.PostProcessServiceError(err, "MediaServices", "GetMediaAssetDistributionChannelAttachment", apiReferenceLink) return response, err } @@ -1138,13 +1869,13 @@ func (client MediaServicesClient) deleteMediaWorkflowJob(ctx context.Context, re return response, err } -// DeleteStreamCdnConfig The StreamCdnConfig lifecycleState will change to DELETED. +// GetMediaWorkflow Gets a MediaWorkflow by identifier. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteStreamCdnConfig.go.html to see an example of how to use DeleteStreamCdnConfig API. -// A default retry strategy applies to this operation DeleteStreamCdnConfig() -func (client MediaServicesClient) DeleteStreamCdnConfig(ctx context.Context, request DeleteStreamCdnConfigRequest) (response DeleteStreamCdnConfigResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflow.go.html to see an example of how to use GetMediaWorkflow API. +// A default retry strategy applies to this operation GetMediaWorkflow() +func (client MediaServicesClient) GetMediaWorkflow(ctx context.Context, request GetMediaWorkflowRequest) (response GetMediaWorkflowResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1153,42 +1884,42 @@ func (client MediaServicesClient) DeleteStreamCdnConfig(ctx context.Context, req if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteStreamCdnConfig, policy) + ociResponse, err = common.Retry(ctx, request, client.getMediaWorkflow, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteStreamCdnConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetMediaWorkflowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteStreamCdnConfigResponse{} + response = GetMediaWorkflowResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteStreamCdnConfigResponse); ok { + if convertedResponse, ok := ociResponse.(GetMediaWorkflowResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteStreamCdnConfigResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetMediaWorkflowResponse") } return } -// deleteStreamCdnConfig implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteStreamCdnConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getMediaWorkflow implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getMediaWorkflow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/streamCdnConfigs/{streamCdnConfigId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflows/{mediaWorkflowId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteStreamCdnConfigResponse + var response GetMediaWorkflowResponse 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/dms/20211101/StreamCdnConfig/DeleteStreamCdnConfig" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteStreamCdnConfig", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflow/GetMediaWorkflow" + err = common.PostProcessServiceError(err, "MediaServices", "GetMediaWorkflow", apiReferenceLink) return response, err } @@ -1196,13 +1927,13 @@ func (client MediaServicesClient) deleteStreamCdnConfig(ctx context.Context, req return response, err } -// DeleteStreamDistributionChannel The Stream Distribution Channel lifecycleState will change to DELETED. +// GetMediaWorkflowConfiguration Gets a MediaWorkflowConfiguration by identifier // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteStreamDistributionChannel.go.html to see an example of how to use DeleteStreamDistributionChannel API. -// A default retry strategy applies to this operation DeleteStreamDistributionChannel() -func (client MediaServicesClient) DeleteStreamDistributionChannel(ctx context.Context, request DeleteStreamDistributionChannelRequest) (response DeleteStreamDistributionChannelResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflowConfiguration.go.html to see an example of how to use GetMediaWorkflowConfiguration API. +// A default retry strategy applies to this operation GetMediaWorkflowConfiguration() +func (client MediaServicesClient) GetMediaWorkflowConfiguration(ctx context.Context, request GetMediaWorkflowConfigurationRequest) (response GetMediaWorkflowConfigurationResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1211,42 +1942,42 @@ func (client MediaServicesClient) DeleteStreamDistributionChannel(ctx context.Co if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteStreamDistributionChannel, policy) + ociResponse, err = common.Retry(ctx, request, client.getMediaWorkflowConfiguration, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetMediaWorkflowConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteStreamDistributionChannelResponse{} + response = GetMediaWorkflowConfigurationResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteStreamDistributionChannelResponse); ok { + if convertedResponse, ok := ociResponse.(GetMediaWorkflowConfigurationResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteStreamDistributionChannelResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetMediaWorkflowConfigurationResponse") } return } -// deleteStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getMediaWorkflowConfiguration implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getMediaWorkflowConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/streamDistributionChannels/{streamDistributionChannelId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteStreamDistributionChannelResponse + var response GetMediaWorkflowConfigurationResponse 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/dms/20211101/StreamDistributionChannel/DeleteStreamDistributionChannel" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteStreamDistributionChannel", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowConfiguration/GetMediaWorkflowConfiguration" + err = common.PostProcessServiceError(err, "MediaServices", "GetMediaWorkflowConfiguration", apiReferenceLink) return response, err } @@ -1254,13 +1985,13 @@ func (client MediaServicesClient) deleteStreamDistributionChannel(ctx context.Co return response, err } -// DeleteStreamPackagingConfig The Stream Packaging Configuration lifecycleState will change to DELETED. +// GetMediaWorkflowJob Gets the MediaWorkflowJob. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/DeleteStreamPackagingConfig.go.html to see an example of how to use DeleteStreamPackagingConfig API. -// A default retry strategy applies to this operation DeleteStreamPackagingConfig() -func (client MediaServicesClient) DeleteStreamPackagingConfig(ctx context.Context, request DeleteStreamPackagingConfigRequest) (response DeleteStreamPackagingConfigResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflowJob.go.html to see an example of how to use GetMediaWorkflowJob API. +// A default retry strategy applies to this operation GetMediaWorkflowJob() +func (client MediaServicesClient) GetMediaWorkflowJob(ctx context.Context, request GetMediaWorkflowJobRequest) (response GetMediaWorkflowJobResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1269,42 +2000,42 @@ func (client MediaServicesClient) DeleteStreamPackagingConfig(ctx context.Contex if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteStreamPackagingConfig, policy) + ociResponse, err = common.Retry(ctx, request, client.getMediaWorkflowJob, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteStreamPackagingConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetMediaWorkflowJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteStreamPackagingConfigResponse{} + response = GetMediaWorkflowJobResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteStreamPackagingConfigResponse); ok { + if convertedResponse, ok := ociResponse.(GetMediaWorkflowJobResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteStreamPackagingConfigResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetMediaWorkflowJobResponse") } return } -// deleteStreamPackagingConfig implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) deleteStreamPackagingConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getMediaWorkflowJob implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getMediaWorkflowJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/streamPackagingConfigs/{streamPackagingConfigId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowJobs/{mediaWorkflowJobId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteStreamPackagingConfigResponse + var response GetMediaWorkflowJobResponse 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/dms/20211101/StreamPackagingConfig/DeleteStreamPackagingConfig" - err = common.PostProcessServiceError(err, "MediaServices", "DeleteStreamPackagingConfig", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowJob/GetMediaWorkflowJob" + err = common.PostProcessServiceError(err, "MediaServices", "GetMediaWorkflowJob", apiReferenceLink) return response, err } @@ -1312,13 +2043,13 @@ func (client MediaServicesClient) deleteStreamPackagingConfig(ctx context.Contex return response, err } -// GetMediaAsset Gets a MediaAsset by identifier. +// GetStreamCdnConfig Gets a StreamCdnConfig by identifier. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaAsset.go.html to see an example of how to use GetMediaAsset API. -// A default retry strategy applies to this operation GetMediaAsset() -func (client MediaServicesClient) GetMediaAsset(ctx context.Context, request GetMediaAssetRequest) (response GetMediaAssetResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetStreamCdnConfig.go.html to see an example of how to use GetStreamCdnConfig API. +// A default retry strategy applies to this operation GetStreamCdnConfig() +func (client MediaServicesClient) GetStreamCdnConfig(ctx context.Context, request GetStreamCdnConfigRequest) (response GetStreamCdnConfigResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1327,42 +2058,42 @@ func (client MediaServicesClient) GetMediaAsset(ctx context.Context, request Get if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getMediaAsset, policy) + ociResponse, err = common.Retry(ctx, request, client.getStreamCdnConfig, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetMediaAssetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetStreamCdnConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetMediaAssetResponse{} + response = GetStreamCdnConfigResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetMediaAssetResponse); ok { + if convertedResponse, ok := ociResponse.(GetStreamCdnConfigResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetMediaAssetResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetStreamCdnConfigResponse") } return } -// getMediaAsset implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getMediaAsset(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getStreamCdnConfig implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getStreamCdnConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets/{mediaAssetId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamCdnConfigs/{streamCdnConfigId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetMediaAssetResponse + var response GetStreamCdnConfigResponse 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/dms/20211101/MediaAsset/GetMediaAsset" - err = common.PostProcessServiceError(err, "MediaServices", "GetMediaAsset", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamCdnConfig/GetStreamCdnConfig" + err = common.PostProcessServiceError(err, "MediaServices", "GetStreamCdnConfig", apiReferenceLink) return response, err } @@ -1370,13 +2101,13 @@ func (client MediaServicesClient) getMediaAsset(ctx context.Context, request com return response, err } -// GetMediaAssetDistributionChannelAttachment Gets a MediaAssetDistributionChannelAttachment for a MediaAsset by identifiers. +// GetStreamDistributionChannel Gets a Stream Distribution Channel by identifier. // // # See also -// -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaAssetDistributionChannelAttachment.go.html to see an example of how to use GetMediaAssetDistributionChannelAttachment API. -// A default retry strategy applies to this operation GetMediaAssetDistributionChannelAttachment() -func (client MediaServicesClient) GetMediaAssetDistributionChannelAttachment(ctx context.Context, request GetMediaAssetDistributionChannelAttachmentRequest) (response GetMediaAssetDistributionChannelAttachmentResponse, err error) { +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetStreamDistributionChannel.go.html to see an example of how to use GetStreamDistributionChannel API. +// A default retry strategy applies to this operation GetStreamDistributionChannel() +func (client MediaServicesClient) GetStreamDistributionChannel(ctx context.Context, request GetStreamDistributionChannelRequest) (response GetStreamDistributionChannelResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1385,42 +2116,42 @@ func (client MediaServicesClient) GetMediaAssetDistributionChannelAttachment(ctx if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getMediaAssetDistributionChannelAttachment, policy) + ociResponse, err = common.Retry(ctx, request, client.getStreamDistributionChannel, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetMediaAssetDistributionChannelAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetMediaAssetDistributionChannelAttachmentResponse{} + response = GetStreamDistributionChannelResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetMediaAssetDistributionChannelAttachmentResponse); ok { + if convertedResponse, ok := ociResponse.(GetStreamDistributionChannelResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetMediaAssetDistributionChannelAttachmentResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetStreamDistributionChannelResponse") } return } -// getMediaAssetDistributionChannelAttachment implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getMediaAssetDistributionChannelAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets/{mediaAssetId}/distributionChannelAttachments/{distributionChannelId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamDistributionChannels/{streamDistributionChannelId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetMediaAssetDistributionChannelAttachmentResponse + var response GetStreamDistributionChannelResponse 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/dms/20211101/MediaAssetDistributionChannelAttachment/GetMediaAssetDistributionChannelAttachment" - err = common.PostProcessServiceError(err, "MediaServices", "GetMediaAssetDistributionChannelAttachment", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamDistributionChannel/GetStreamDistributionChannel" + err = common.PostProcessServiceError(err, "MediaServices", "GetStreamDistributionChannel", apiReferenceLink) return response, err } @@ -1428,13 +2159,13 @@ func (client MediaServicesClient) getMediaAssetDistributionChannelAttachment(ctx return response, err } -// GetMediaWorkflow Gets a MediaWorkflow by identifier. +// GetStreamPackagingConfig Gets a Stream Packaging Configuration by identifier. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflow.go.html to see an example of how to use GetMediaWorkflow API. -// A default retry strategy applies to this operation GetMediaWorkflow() -func (client MediaServicesClient) GetMediaWorkflow(ctx context.Context, request GetMediaWorkflowRequest) (response GetMediaWorkflowResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetStreamPackagingConfig.go.html to see an example of how to use GetStreamPackagingConfig API. +// A default retry strategy applies to this operation GetStreamPackagingConfig() +func (client MediaServicesClient) GetStreamPackagingConfig(ctx context.Context, request GetStreamPackagingConfigRequest) (response GetStreamPackagingConfigResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1443,56 +2174,56 @@ func (client MediaServicesClient) GetMediaWorkflow(ctx context.Context, request if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getMediaWorkflow, policy) + ociResponse, err = common.Retry(ctx, request, client.getStreamPackagingConfig, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetMediaWorkflowResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = GetStreamPackagingConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetMediaWorkflowResponse{} + response = GetStreamPackagingConfigResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetMediaWorkflowResponse); ok { + if convertedResponse, ok := ociResponse.(GetStreamPackagingConfigResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetMediaWorkflowResponse") + err = fmt.Errorf("failed to convert OCIResponse into GetStreamPackagingConfigResponse") } return } -// getMediaWorkflow implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getMediaWorkflow(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// getStreamPackagingConfig implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) getStreamPackagingConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflows/{mediaWorkflowId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamPackagingConfigs/{streamPackagingConfigId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetMediaWorkflowResponse + var response GetStreamPackagingConfigResponse 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/dms/20211101/MediaWorkflow/GetMediaWorkflow" - err = common.PostProcessServiceError(err, "MediaServices", "GetMediaWorkflow", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamPackagingConfig/GetStreamPackagingConfig" + err = common.PostProcessServiceError(err, "MediaServices", "GetStreamPackagingConfig", apiReferenceLink) return response, err } - err = common.UnmarshalResponse(httpResponse, &response) + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &streampackagingconfig{}) return response, err } -// GetMediaWorkflowConfiguration Gets a MediaWorkflowConfiguration by identifier +// IngestStreamDistributionChannel Ingests an Asset into a Distribution Channel. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflowConfiguration.go.html to see an example of how to use GetMediaWorkflowConfiguration API. -// A default retry strategy applies to this operation GetMediaWorkflowConfiguration() -func (client MediaServicesClient) GetMediaWorkflowConfiguration(ctx context.Context, request GetMediaWorkflowConfigurationRequest) (response GetMediaWorkflowConfigurationResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/IngestStreamDistributionChannel.go.html to see an example of how to use IngestStreamDistributionChannel API. +// A default retry strategy applies to this operation IngestStreamDistributionChannel() +func (client MediaServicesClient) IngestStreamDistributionChannel(ctx context.Context, request IngestStreamDistributionChannelRequest) (response IngestStreamDistributionChannelResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1501,42 +2232,47 @@ func (client MediaServicesClient) GetMediaWorkflowConfiguration(ctx context.Cont if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getMediaWorkflowConfiguration, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.ingestStreamDistributionChannel, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetMediaWorkflowConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = IngestStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetMediaWorkflowConfigurationResponse{} + response = IngestStreamDistributionChannelResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetMediaWorkflowConfigurationResponse); ok { + if convertedResponse, ok := ociResponse.(IngestStreamDistributionChannelResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetMediaWorkflowConfigurationResponse") + err = fmt.Errorf("failed to convert OCIResponse into IngestStreamDistributionChannelResponse") } return } -// getMediaWorkflowConfiguration implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getMediaWorkflowConfiguration(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// ingestStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) ingestStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels/{streamDistributionChannelId}/actions/ingest", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetMediaWorkflowConfigurationResponse + var response IngestStreamDistributionChannelResponse 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/dms/20211101/MediaWorkflowConfiguration/GetMediaWorkflowConfiguration" - err = common.PostProcessServiceError(err, "MediaServices", "GetMediaWorkflowConfiguration", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamDistributionChannel/IngestStreamDistributionChannel" + err = common.PostProcessServiceError(err, "MediaServices", "IngestStreamDistributionChannel", apiReferenceLink) return response, err } @@ -1544,13 +2280,13 @@ func (client MediaServicesClient) getMediaWorkflowConfiguration(ctx context.Cont return response, err } -// GetMediaWorkflowJob Gets the MediaWorkflowJob. +// ListMediaAssetDistributionChannelAttachments Lists the MediaAssetDistributionChannelAttachments for a MediaAsset by identifier. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflowJob.go.html to see an example of how to use GetMediaWorkflowJob API. -// A default retry strategy applies to this operation GetMediaWorkflowJob() -func (client MediaServicesClient) GetMediaWorkflowJob(ctx context.Context, request GetMediaWorkflowJobRequest) (response GetMediaWorkflowJobResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaAssetDistributionChannelAttachments.go.html to see an example of how to use ListMediaAssetDistributionChannelAttachments API. +// A default retry strategy applies to this operation ListMediaAssetDistributionChannelAttachments() +func (client MediaServicesClient) ListMediaAssetDistributionChannelAttachments(ctx context.Context, request ListMediaAssetDistributionChannelAttachmentsRequest) (response ListMediaAssetDistributionChannelAttachmentsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1559,42 +2295,42 @@ func (client MediaServicesClient) GetMediaWorkflowJob(ctx context.Context, reque if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getMediaWorkflowJob, policy) + ociResponse, err = common.Retry(ctx, request, client.listMediaAssetDistributionChannelAttachments, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetMediaWorkflowJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListMediaAssetDistributionChannelAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetMediaWorkflowJobResponse{} + response = ListMediaAssetDistributionChannelAttachmentsResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetMediaWorkflowJobResponse); ok { + if convertedResponse, ok := ociResponse.(ListMediaAssetDistributionChannelAttachmentsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetMediaWorkflowJobResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListMediaAssetDistributionChannelAttachmentsResponse") } return } -// getMediaWorkflowJob implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getMediaWorkflowJob(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMediaAssetDistributionChannelAttachments implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listMediaAssetDistributionChannelAttachments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowJobs/{mediaWorkflowJobId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets/{mediaAssetId}/distributionChannelAttachments", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetMediaWorkflowJobResponse + var response ListMediaAssetDistributionChannelAttachmentsResponse 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/dms/20211101/MediaWorkflowJob/GetMediaWorkflowJob" - err = common.PostProcessServiceError(err, "MediaServices", "GetMediaWorkflowJob", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaAssetDistributionChannelAttachmentCollection/ListMediaAssetDistributionChannelAttachments" + err = common.PostProcessServiceError(err, "MediaServices", "ListMediaAssetDistributionChannelAttachments", apiReferenceLink) return response, err } @@ -1602,13 +2338,13 @@ func (client MediaServicesClient) getMediaWorkflowJob(ctx context.Context, reque return response, err } -// GetMediaWorkflowJobFact Get the MediaWorkflowJobFact identified by the mediaWorkflowJobId and Fact ID. +// ListMediaAssets Returns a list of MediaAssetSummary. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetMediaWorkflowJobFact.go.html to see an example of how to use GetMediaWorkflowJobFact API. -// A default retry strategy applies to this operation GetMediaWorkflowJobFact() -func (client MediaServicesClient) GetMediaWorkflowJobFact(ctx context.Context, request GetMediaWorkflowJobFactRequest) (response GetMediaWorkflowJobFactResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaAssets.go.html to see an example of how to use ListMediaAssets API. +// A default retry strategy applies to this operation ListMediaAssets() +func (client MediaServicesClient) ListMediaAssets(ctx context.Context, request ListMediaAssetsRequest) (response ListMediaAssetsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1617,42 +2353,42 @@ func (client MediaServicesClient) GetMediaWorkflowJobFact(ctx context.Context, r if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getMediaWorkflowJobFact, policy) + ociResponse, err = common.Retry(ctx, request, client.listMediaAssets, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetMediaWorkflowJobFactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListMediaAssetsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetMediaWorkflowJobFactResponse{} + response = ListMediaAssetsResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetMediaWorkflowJobFactResponse); ok { + if convertedResponse, ok := ociResponse.(ListMediaAssetsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetMediaWorkflowJobFactResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListMediaAssetsResponse") } return } -// getMediaWorkflowJobFact implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getMediaWorkflowJobFact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMediaAssets implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listMediaAssets(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowJobs/{mediaWorkflowJobId}/facts/{key}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetMediaWorkflowJobFactResponse + var response ListMediaAssetsResponse 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/dms/20211101/MediaWorkflowJobFact/GetMediaWorkflowJobFact" - err = common.PostProcessServiceError(err, "MediaServices", "GetMediaWorkflowJobFact", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaAsset/ListMediaAssets" + err = common.PostProcessServiceError(err, "MediaServices", "ListMediaAssets", apiReferenceLink) return response, err } @@ -1660,13 +2396,13 @@ func (client MediaServicesClient) getMediaWorkflowJobFact(ctx context.Context, r return response, err } -// GetStreamCdnConfig Gets a StreamCdnConfig by identifier. +// ListMediaWorkflowConfigurations Returns a list of MediaWorkflowConfigurations. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetStreamCdnConfig.go.html to see an example of how to use GetStreamCdnConfig API. -// A default retry strategy applies to this operation GetStreamCdnConfig() -func (client MediaServicesClient) GetStreamCdnConfig(ctx context.Context, request GetStreamCdnConfigRequest) (response GetStreamCdnConfigResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowConfigurations.go.html to see an example of how to use ListMediaWorkflowConfigurations API. +// A default retry strategy applies to this operation ListMediaWorkflowConfigurations() +func (client MediaServicesClient) ListMediaWorkflowConfigurations(ctx context.Context, request ListMediaWorkflowConfigurationsRequest) (response ListMediaWorkflowConfigurationsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1675,42 +2411,42 @@ func (client MediaServicesClient) GetStreamCdnConfig(ctx context.Context, reques if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getStreamCdnConfig, policy) + ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflowConfigurations, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetStreamCdnConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListMediaWorkflowConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetStreamCdnConfigResponse{} + response = ListMediaWorkflowConfigurationsResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetStreamCdnConfigResponse); ok { + if convertedResponse, ok := ociResponse.(ListMediaWorkflowConfigurationsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetStreamCdnConfigResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowConfigurationsResponse") } return } -// getStreamCdnConfig implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getStreamCdnConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMediaWorkflowConfigurations implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listMediaWorkflowConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamCdnConfigs/{streamCdnConfigId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowConfigurations", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetStreamCdnConfigResponse + var response ListMediaWorkflowConfigurationsResponse 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/dms/20211101/StreamCdnConfig/GetStreamCdnConfig" - err = common.PostProcessServiceError(err, "MediaServices", "GetStreamCdnConfig", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowConfigurationCollection/ListMediaWorkflowConfigurations" + err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflowConfigurations", apiReferenceLink) return response, err } @@ -1718,13 +2454,13 @@ func (client MediaServicesClient) getStreamCdnConfig(ctx context.Context, reques return response, err } -// GetStreamDistributionChannel Gets a Stream Distribution Channel by identifier. +// ListMediaWorkflowJobs Lists the MediaWorkflowJobs. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetStreamDistributionChannel.go.html to see an example of how to use GetStreamDistributionChannel API. -// A default retry strategy applies to this operation GetStreamDistributionChannel() -func (client MediaServicesClient) GetStreamDistributionChannel(ctx context.Context, request GetStreamDistributionChannelRequest) (response GetStreamDistributionChannelResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowJobs.go.html to see an example of how to use ListMediaWorkflowJobs API. +// A default retry strategy applies to this operation ListMediaWorkflowJobs() +func (client MediaServicesClient) ListMediaWorkflowJobs(ctx context.Context, request ListMediaWorkflowJobsRequest) (response ListMediaWorkflowJobsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1733,42 +2469,42 @@ func (client MediaServicesClient) GetStreamDistributionChannel(ctx context.Conte if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getStreamDistributionChannel, policy) + ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflowJobs, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListMediaWorkflowJobsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetStreamDistributionChannelResponse{} + response = ListMediaWorkflowJobsResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetStreamDistributionChannelResponse); ok { + if convertedResponse, ok := ociResponse.(ListMediaWorkflowJobsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetStreamDistributionChannelResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowJobsResponse") } return } -// getStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMediaWorkflowJobs implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listMediaWorkflowJobs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamDistributionChannels/{streamDistributionChannelId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowJobs", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetStreamDistributionChannelResponse + var response ListMediaWorkflowJobsResponse 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/dms/20211101/StreamDistributionChannel/GetStreamDistributionChannel" - err = common.PostProcessServiceError(err, "MediaServices", "GetStreamDistributionChannel", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowJob/ListMediaWorkflowJobs" + err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflowJobs", apiReferenceLink) return response, err } @@ -1776,13 +2512,13 @@ func (client MediaServicesClient) getStreamDistributionChannel(ctx context.Conte return response, err } -// GetStreamPackagingConfig Gets a Stream Packaging Configuration by identifier. +// ListMediaWorkflowTaskDeclarations Returns a list of MediaWorkflowTaskDeclarations. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/GetStreamPackagingConfig.go.html to see an example of how to use GetStreamPackagingConfig API. -// A default retry strategy applies to this operation GetStreamPackagingConfig() -func (client MediaServicesClient) GetStreamPackagingConfig(ctx context.Context, request GetStreamPackagingConfigRequest) (response GetStreamPackagingConfigResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowTaskDeclarations.go.html to see an example of how to use ListMediaWorkflowTaskDeclarations API. +// A default retry strategy applies to this operation ListMediaWorkflowTaskDeclarations() +func (client MediaServicesClient) ListMediaWorkflowTaskDeclarations(ctx context.Context, request ListMediaWorkflowTaskDeclarationsRequest) (response ListMediaWorkflowTaskDeclarationsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1791,56 +2527,56 @@ func (client MediaServicesClient) GetStreamPackagingConfig(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.getStreamPackagingConfig, policy) + ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflowTaskDeclarations, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetStreamPackagingConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListMediaWorkflowTaskDeclarationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = GetStreamPackagingConfigResponse{} + response = ListMediaWorkflowTaskDeclarationsResponse{} } } return } - if convertedResponse, ok := ociResponse.(GetStreamPackagingConfigResponse); ok { + if convertedResponse, ok := ociResponse.(ListMediaWorkflowTaskDeclarationsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into GetStreamPackagingConfigResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowTaskDeclarationsResponse") } return } -// getStreamPackagingConfig implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) getStreamPackagingConfig(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMediaWorkflowTaskDeclarations implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listMediaWorkflowTaskDeclarations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamPackagingConfigs/{streamPackagingConfigId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowTaskDeclarations", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response GetStreamPackagingConfigResponse + var response ListMediaWorkflowTaskDeclarationsResponse 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/dms/20211101/StreamPackagingConfig/GetStreamPackagingConfig" - err = common.PostProcessServiceError(err, "MediaServices", "GetStreamPackagingConfig", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowTaskDeclarationCollection/ListMediaWorkflowTaskDeclarations" + err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflowTaskDeclarations", apiReferenceLink) return response, err } - err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &streampackagingconfig{}) + err = common.UnmarshalResponse(httpResponse, &response) return response, err } -// IngestStreamDistributionChannel Ingests an Asset into a Distribution Channel. +// ListMediaWorkflows Lists the MediaWorkflows. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/IngestStreamDistributionChannel.go.html to see an example of how to use IngestStreamDistributionChannel API. -// A default retry strategy applies to this operation IngestStreamDistributionChannel() -func (client MediaServicesClient) IngestStreamDistributionChannel(ctx context.Context, request IngestStreamDistributionChannelRequest) (response IngestStreamDistributionChannelResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflows.go.html to see an example of how to use ListMediaWorkflows API. +// A default retry strategy applies to this operation ListMediaWorkflows() +func (client MediaServicesClient) ListMediaWorkflows(ctx context.Context, request ListMediaWorkflowsRequest) (response ListMediaWorkflowsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1849,47 +2585,42 @@ func (client MediaServicesClient) IngestStreamDistributionChannel(ctx context.Co 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.ingestStreamDistributionChannel, policy) + ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflows, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = IngestStreamDistributionChannelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListMediaWorkflowsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = IngestStreamDistributionChannelResponse{} + response = ListMediaWorkflowsResponse{} } } return } - if convertedResponse, ok := ociResponse.(IngestStreamDistributionChannelResponse); ok { + if convertedResponse, ok := ociResponse.(ListMediaWorkflowsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into IngestStreamDistributionChannelResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowsResponse") } return } -// ingestStreamDistributionChannel implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) ingestStreamDistributionChannel(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMediaWorkflows implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listMediaWorkflows(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels/{streamDistributionChannelId}/actions/ingest", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflows", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response IngestStreamDistributionChannelResponse + var response ListMediaWorkflowsResponse 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/dms/20211101/StreamDistributionChannel/IngestStreamDistributionChannel" - err = common.PostProcessServiceError(err, "MediaServices", "IngestStreamDistributionChannel", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflow/ListMediaWorkflows" + err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflows", apiReferenceLink) return response, err } @@ -1897,13 +2628,13 @@ func (client MediaServicesClient) ingestStreamDistributionChannel(ctx context.Co return response, err } -// ListMediaAssetDistributionChannelAttachments Lists the MediaAssetDistributionChannelAttachments for a MediaAsset by identifier. +// ListStreamCdnConfigs Lists the StreamCdnConfig. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaAssetDistributionChannelAttachments.go.html to see an example of how to use ListMediaAssetDistributionChannelAttachments API. -// A default retry strategy applies to this operation ListMediaAssetDistributionChannelAttachments() -func (client MediaServicesClient) ListMediaAssetDistributionChannelAttachments(ctx context.Context, request ListMediaAssetDistributionChannelAttachmentsRequest) (response ListMediaAssetDistributionChannelAttachmentsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListStreamCdnConfigs.go.html to see an example of how to use ListStreamCdnConfigs API. +// A default retry strategy applies to this operation ListStreamCdnConfigs() +func (client MediaServicesClient) ListStreamCdnConfigs(ctx context.Context, request ListStreamCdnConfigsRequest) (response ListStreamCdnConfigsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1912,42 +2643,42 @@ func (client MediaServicesClient) ListMediaAssetDistributionChannelAttachments(c if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMediaAssetDistributionChannelAttachments, policy) + ociResponse, err = common.Retry(ctx, request, client.listStreamCdnConfigs, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMediaAssetDistributionChannelAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListStreamCdnConfigsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMediaAssetDistributionChannelAttachmentsResponse{} + response = ListStreamCdnConfigsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMediaAssetDistributionChannelAttachmentsResponse); ok { + if convertedResponse, ok := ociResponse.(ListStreamCdnConfigsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMediaAssetDistributionChannelAttachmentsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListStreamCdnConfigsResponse") } return } -// listMediaAssetDistributionChannelAttachments implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listMediaAssetDistributionChannelAttachments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listStreamCdnConfigs implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listStreamCdnConfigs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets/{mediaAssetId}/distributionChannelAttachments", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamCdnConfigs", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMediaAssetDistributionChannelAttachmentsResponse + var response ListStreamCdnConfigsResponse 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/dms/20211101/MediaAssetDistributionChannelAttachmentCollection/ListMediaAssetDistributionChannelAttachments" - err = common.PostProcessServiceError(err, "MediaServices", "ListMediaAssetDistributionChannelAttachments", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamCdnConfig/ListStreamCdnConfigs" + err = common.PostProcessServiceError(err, "MediaServices", "ListStreamCdnConfigs", apiReferenceLink) return response, err } @@ -1955,13 +2686,13 @@ func (client MediaServicesClient) listMediaAssetDistributionChannelAttachments(c return response, err } -// ListMediaAssets Returns a list of MediaAssetSummary. +// ListStreamDistributionChannels Lists the Stream Distribution Channels. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaAssets.go.html to see an example of how to use ListMediaAssets API. -// A default retry strategy applies to this operation ListMediaAssets() -func (client MediaServicesClient) ListMediaAssets(ctx context.Context, request ListMediaAssetsRequest) (response ListMediaAssetsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListStreamDistributionChannels.go.html to see an example of how to use ListStreamDistributionChannels API. +// A default retry strategy applies to this operation ListStreamDistributionChannels() +func (client MediaServicesClient) ListStreamDistributionChannels(ctx context.Context, request ListStreamDistributionChannelsRequest) (response ListStreamDistributionChannelsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -1970,42 +2701,42 @@ func (client MediaServicesClient) ListMediaAssets(ctx context.Context, request L if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMediaAssets, policy) + ociResponse, err = common.Retry(ctx, request, client.listStreamDistributionChannels, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMediaAssetsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListStreamDistributionChannelsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMediaAssetsResponse{} + response = ListStreamDistributionChannelsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMediaAssetsResponse); ok { + if convertedResponse, ok := ociResponse.(ListStreamDistributionChannelsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMediaAssetsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListStreamDistributionChannelsResponse") } return } -// listMediaAssets implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listMediaAssets(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listStreamDistributionChannels implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listStreamDistributionChannels(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaAssets", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamDistributionChannels", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMediaAssetsResponse + var response ListStreamDistributionChannelsResponse 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/dms/20211101/MediaAsset/ListMediaAssets" - err = common.PostProcessServiceError(err, "MediaServices", "ListMediaAssets", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamDistributionChannel/ListStreamDistributionChannels" + err = common.PostProcessServiceError(err, "MediaServices", "ListStreamDistributionChannels", apiReferenceLink) return response, err } @@ -2013,13 +2744,13 @@ func (client MediaServicesClient) listMediaAssets(ctx context.Context, request c return response, err } -// ListMediaWorkflowConfigurations Returns a list of MediaWorkflowConfigurations. +// ListStreamPackagingConfigs Lists the Stream Packaging Configurations. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowConfigurations.go.html to see an example of how to use ListMediaWorkflowConfigurations API. -// A default retry strategy applies to this operation ListMediaWorkflowConfigurations() -func (client MediaServicesClient) ListMediaWorkflowConfigurations(ctx context.Context, request ListMediaWorkflowConfigurationsRequest) (response ListMediaWorkflowConfigurationsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListStreamPackagingConfigs.go.html to see an example of how to use ListStreamPackagingConfigs API. +// A default retry strategy applies to this operation ListStreamPackagingConfigs() +func (client MediaServicesClient) ListStreamPackagingConfigs(ctx context.Context, request ListStreamPackagingConfigsRequest) (response ListStreamPackagingConfigsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2028,42 +2759,42 @@ func (client MediaServicesClient) ListMediaWorkflowConfigurations(ctx context.Co if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflowConfigurations, policy) + ociResponse, err = common.Retry(ctx, request, client.listStreamPackagingConfigs, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMediaWorkflowConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListStreamPackagingConfigsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMediaWorkflowConfigurationsResponse{} + response = ListStreamPackagingConfigsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMediaWorkflowConfigurationsResponse); ok { + if convertedResponse, ok := ociResponse.(ListStreamPackagingConfigsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowConfigurationsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListStreamPackagingConfigsResponse") } return } -// listMediaWorkflowConfigurations implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listMediaWorkflowConfigurations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listStreamPackagingConfigs implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listStreamPackagingConfigs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowConfigurations", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamPackagingConfigs", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMediaWorkflowConfigurationsResponse + var response ListStreamPackagingConfigsResponse 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/dms/20211101/MediaWorkflowConfigurationCollection/ListMediaWorkflowConfigurations" - err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflowConfigurations", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamPackagingConfig/ListStreamPackagingConfigs" + err = common.PostProcessServiceError(err, "MediaServices", "ListStreamPackagingConfigs", apiReferenceLink) return response, err } @@ -2071,13 +2802,13 @@ func (client MediaServicesClient) listMediaWorkflowConfigurations(ctx context.Co return response, err } -// ListMediaWorkflowJobFacts Internal API to get a point-in-time snapshot of a MediaWorkflowJob. +// ListSystemMediaWorkflows Lists the SystemMediaWorkflows that can be used to run a job by name or as a template to create a MediaWorkflow. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowJobFacts.go.html to see an example of how to use ListMediaWorkflowJobFacts API. -// A default retry strategy applies to this operation ListMediaWorkflowJobFacts() -func (client MediaServicesClient) ListMediaWorkflowJobFacts(ctx context.Context, request ListMediaWorkflowJobFactsRequest) (response ListMediaWorkflowJobFactsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListSystemMediaWorkflows.go.html to see an example of how to use ListSystemMediaWorkflows API. +// A default retry strategy applies to this operation ListSystemMediaWorkflows() +func (client MediaServicesClient) ListSystemMediaWorkflows(ctx context.Context, request ListSystemMediaWorkflowsRequest) (response ListSystemMediaWorkflowsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2086,42 +2817,42 @@ func (client MediaServicesClient) ListMediaWorkflowJobFacts(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflowJobFacts, policy) + ociResponse, err = common.Retry(ctx, request, client.listSystemMediaWorkflows, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMediaWorkflowJobFactsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListSystemMediaWorkflowsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMediaWorkflowJobFactsResponse{} + response = ListSystemMediaWorkflowsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMediaWorkflowJobFactsResponse); ok { + if convertedResponse, ok := ociResponse.(ListSystemMediaWorkflowsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowJobFactsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListSystemMediaWorkflowsResponse") } return } -// listMediaWorkflowJobFacts implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listMediaWorkflowJobFacts(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listSystemMediaWorkflows implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) listSystemMediaWorkflows(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowJobs/{mediaWorkflowJobId}/facts", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/systemMediaWorkflows", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMediaWorkflowJobFactsResponse + var response ListSystemMediaWorkflowsResponse 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/dms/20211101/MediaWorkflowJobFact/ListMediaWorkflowJobFacts" - err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflowJobFacts", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflow/ListSystemMediaWorkflows" + err = common.PostProcessServiceError(err, "MediaServices", "ListSystemMediaWorkflows", apiReferenceLink) return response, err } @@ -2129,13 +2860,13 @@ func (client MediaServicesClient) listMediaWorkflowJobFacts(ctx context.Context, return response, err } -// ListMediaWorkflowJobs Lists the MediaWorkflowJobs. +// RemoveMediaAssetLock Remove a lock to an MediaAsset. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowJobs.go.html to see an example of how to use ListMediaWorkflowJobs API. -// A default retry strategy applies to this operation ListMediaWorkflowJobs() -func (client MediaServicesClient) ListMediaWorkflowJobs(ctx context.Context, request ListMediaWorkflowJobsRequest) (response ListMediaWorkflowJobsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaAssetLock.go.html to see an example of how to use RemoveMediaAssetLock API. +// A default retry strategy applies to this operation RemoveMediaAssetLock() +func (client MediaServicesClient) RemoveMediaAssetLock(ctx context.Context, request RemoveMediaAssetLockRequest) (response RemoveMediaAssetLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2144,42 +2875,47 @@ func (client MediaServicesClient) ListMediaWorkflowJobs(ctx context.Context, req if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflowJobs, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeMediaAssetLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMediaWorkflowJobsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RemoveMediaAssetLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMediaWorkflowJobsResponse{} + response = RemoveMediaAssetLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMediaWorkflowJobsResponse); ok { + if convertedResponse, ok := ociResponse.(RemoveMediaAssetLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowJobsResponse") + err = fmt.Errorf("failed to convert OCIResponse into RemoveMediaAssetLockResponse") } return } -// listMediaWorkflowJobs implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listMediaWorkflowJobs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeMediaAssetLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) removeMediaAssetLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowJobs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaAssets/{mediaAssetId}/actions/removeLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMediaWorkflowJobsResponse + var response RemoveMediaAssetLockResponse 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/dms/20211101/MediaWorkflowJob/ListMediaWorkflowJobs" - err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflowJobs", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaAsset/RemoveMediaAssetLock" + err = common.PostProcessServiceError(err, "MediaServices", "RemoveMediaAssetLock", apiReferenceLink) return response, err } @@ -2187,13 +2923,13 @@ func (client MediaServicesClient) listMediaWorkflowJobs(ctx context.Context, req return response, err } -// ListMediaWorkflowTaskDeclarations Returns a list of MediaWorkflowTaskDeclarations. +// RemoveMediaWorkflowConfigurationLock Remove a lock from a MediaWorkflowConfiguration. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflowTaskDeclarations.go.html to see an example of how to use ListMediaWorkflowTaskDeclarations API. -// A default retry strategy applies to this operation ListMediaWorkflowTaskDeclarations() -func (client MediaServicesClient) ListMediaWorkflowTaskDeclarations(ctx context.Context, request ListMediaWorkflowTaskDeclarationsRequest) (response ListMediaWorkflowTaskDeclarationsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaWorkflowConfigurationLock.go.html to see an example of how to use RemoveMediaWorkflowConfigurationLock API. +// A default retry strategy applies to this operation RemoveMediaWorkflowConfigurationLock() +func (client MediaServicesClient) RemoveMediaWorkflowConfigurationLock(ctx context.Context, request RemoveMediaWorkflowConfigurationLockRequest) (response RemoveMediaWorkflowConfigurationLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2202,42 +2938,47 @@ func (client MediaServicesClient) ListMediaWorkflowTaskDeclarations(ctx context. if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflowTaskDeclarations, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeMediaWorkflowConfigurationLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMediaWorkflowTaskDeclarationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RemoveMediaWorkflowConfigurationLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMediaWorkflowTaskDeclarationsResponse{} + response = RemoveMediaWorkflowConfigurationLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMediaWorkflowTaskDeclarationsResponse); ok { + if convertedResponse, ok := ociResponse.(RemoveMediaWorkflowConfigurationLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowTaskDeclarationsResponse") + err = fmt.Errorf("failed to convert OCIResponse into RemoveMediaWorkflowConfigurationLockResponse") } return } -// listMediaWorkflowTaskDeclarations implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listMediaWorkflowTaskDeclarations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeMediaWorkflowConfigurationLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) removeMediaWorkflowConfigurationLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflowTaskDeclarations", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowConfigurations/{mediaWorkflowConfigurationId}/actions/removeLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMediaWorkflowTaskDeclarationsResponse + var response RemoveMediaWorkflowConfigurationLockResponse 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/dms/20211101/MediaWorkflowTaskDeclarationCollection/ListMediaWorkflowTaskDeclarations" - err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflowTaskDeclarations", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowConfiguration/RemoveMediaWorkflowConfigurationLock" + err = common.PostProcessServiceError(err, "MediaServices", "RemoveMediaWorkflowConfigurationLock", apiReferenceLink) return response, err } @@ -2245,13 +2986,13 @@ func (client MediaServicesClient) listMediaWorkflowTaskDeclarations(ctx context. return response, err } -// ListMediaWorkflows Lists the MediaWorkflows. +// RemoveMediaWorkflowJobLock Remove a lock from a MediaWorkflowJob. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListMediaWorkflows.go.html to see an example of how to use ListMediaWorkflows API. -// A default retry strategy applies to this operation ListMediaWorkflows() -func (client MediaServicesClient) ListMediaWorkflows(ctx context.Context, request ListMediaWorkflowsRequest) (response ListMediaWorkflowsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaWorkflowJobLock.go.html to see an example of how to use RemoveMediaWorkflowJobLock API. +// A default retry strategy applies to this operation RemoveMediaWorkflowJobLock() +func (client MediaServicesClient) RemoveMediaWorkflowJobLock(ctx context.Context, request RemoveMediaWorkflowJobLockRequest) (response RemoveMediaWorkflowJobLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2260,42 +3001,47 @@ func (client MediaServicesClient) ListMediaWorkflows(ctx context.Context, reques if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMediaWorkflows, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeMediaWorkflowJobLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMediaWorkflowsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RemoveMediaWorkflowJobLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMediaWorkflowsResponse{} + response = RemoveMediaWorkflowJobLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMediaWorkflowsResponse); ok { + if convertedResponse, ok := ociResponse.(RemoveMediaWorkflowJobLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMediaWorkflowsResponse") + err = fmt.Errorf("failed to convert OCIResponse into RemoveMediaWorkflowJobLockResponse") } return } -// listMediaWorkflows implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listMediaWorkflows(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeMediaWorkflowJobLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) removeMediaWorkflowJobLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mediaWorkflows", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflowJobs/{mediaWorkflowJobId}/actions/removeLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMediaWorkflowsResponse + var response RemoveMediaWorkflowJobLockResponse 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/dms/20211101/MediaWorkflow/ListMediaWorkflows" - err = common.PostProcessServiceError(err, "MediaServices", "ListMediaWorkflows", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflowJob/RemoveMediaWorkflowJobLock" + err = common.PostProcessServiceError(err, "MediaServices", "RemoveMediaWorkflowJobLock", apiReferenceLink) return response, err } @@ -2303,13 +3049,13 @@ func (client MediaServicesClient) listMediaWorkflows(ctx context.Context, reques return response, err } -// ListStreamCdnConfigs Lists the StreamCdnConfig. +// RemoveMediaWorkflowLock Remove a lock from a MediaWorkflow. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListStreamCdnConfigs.go.html to see an example of how to use ListStreamCdnConfigs API. -// A default retry strategy applies to this operation ListStreamCdnConfigs() -func (client MediaServicesClient) ListStreamCdnConfigs(ctx context.Context, request ListStreamCdnConfigsRequest) (response ListStreamCdnConfigsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaWorkflowLock.go.html to see an example of how to use RemoveMediaWorkflowLock API. +// A default retry strategy applies to this operation RemoveMediaWorkflowLock() +func (client MediaServicesClient) RemoveMediaWorkflowLock(ctx context.Context, request RemoveMediaWorkflowLockRequest) (response RemoveMediaWorkflowLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2318,42 +3064,47 @@ func (client MediaServicesClient) ListStreamCdnConfigs(ctx context.Context, requ if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listStreamCdnConfigs, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeMediaWorkflowLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListStreamCdnConfigsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RemoveMediaWorkflowLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListStreamCdnConfigsResponse{} + response = RemoveMediaWorkflowLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListStreamCdnConfigsResponse); ok { + if convertedResponse, ok := ociResponse.(RemoveMediaWorkflowLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListStreamCdnConfigsResponse") + err = fmt.Errorf("failed to convert OCIResponse into RemoveMediaWorkflowLockResponse") } return } -// listStreamCdnConfigs implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listStreamCdnConfigs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeMediaWorkflowLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) removeMediaWorkflowLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamCdnConfigs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/mediaWorkflows/{mediaWorkflowId}/actions/removeLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListStreamCdnConfigsResponse + var response RemoveMediaWorkflowLockResponse 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/dms/20211101/StreamCdnConfig/ListStreamCdnConfigs" - err = common.PostProcessServiceError(err, "MediaServices", "ListStreamCdnConfigs", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/MediaWorkflow/RemoveMediaWorkflowLock" + err = common.PostProcessServiceError(err, "MediaServices", "RemoveMediaWorkflowLock", apiReferenceLink) return response, err } @@ -2361,13 +3112,13 @@ func (client MediaServicesClient) listStreamCdnConfigs(ctx context.Context, requ return response, err } -// ListStreamDistributionChannels Lists the Stream Distribution Channels. +// RemoveStreamCdnConfigLock Remove a lock from a StreamCdnConfig. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListStreamDistributionChannels.go.html to see an example of how to use ListStreamDistributionChannels API. -// A default retry strategy applies to this operation ListStreamDistributionChannels() -func (client MediaServicesClient) ListStreamDistributionChannels(ctx context.Context, request ListStreamDistributionChannelsRequest) (response ListStreamDistributionChannelsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveStreamCdnConfigLock.go.html to see an example of how to use RemoveStreamCdnConfigLock API. +// A default retry strategy applies to this operation RemoveStreamCdnConfigLock() +func (client MediaServicesClient) RemoveStreamCdnConfigLock(ctx context.Context, request RemoveStreamCdnConfigLockRequest) (response RemoveStreamCdnConfigLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2376,42 +3127,47 @@ func (client MediaServicesClient) ListStreamDistributionChannels(ctx context.Con if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listStreamDistributionChannels, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeStreamCdnConfigLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListStreamDistributionChannelsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RemoveStreamCdnConfigLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListStreamDistributionChannelsResponse{} + response = RemoveStreamCdnConfigLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListStreamDistributionChannelsResponse); ok { + if convertedResponse, ok := ociResponse.(RemoveStreamCdnConfigLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListStreamDistributionChannelsResponse") + err = fmt.Errorf("failed to convert OCIResponse into RemoveStreamCdnConfigLockResponse") } return } -// listStreamDistributionChannels implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listStreamDistributionChannels(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeStreamCdnConfigLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) removeStreamCdnConfigLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamDistributionChannels", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamCdnConfigs/{streamCdnConfigId}/actions/removeLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListStreamDistributionChannelsResponse + var response RemoveStreamCdnConfigLockResponse 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/dms/20211101/StreamDistributionChannel/ListStreamDistributionChannels" - err = common.PostProcessServiceError(err, "MediaServices", "ListStreamDistributionChannels", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamCdnConfig/RemoveStreamCdnConfigLock" + err = common.PostProcessServiceError(err, "MediaServices", "RemoveStreamCdnConfigLock", apiReferenceLink) return response, err } @@ -2419,13 +3175,13 @@ func (client MediaServicesClient) listStreamDistributionChannels(ctx context.Con return response, err } -// ListStreamPackagingConfigs Lists the Stream Packaging Configurations. +// RemoveStreamDistributionChannelLock Remove a lock to a StreamDistributionChannel. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListStreamPackagingConfigs.go.html to see an example of how to use ListStreamPackagingConfigs API. -// A default retry strategy applies to this operation ListStreamPackagingConfigs() -func (client MediaServicesClient) ListStreamPackagingConfigs(ctx context.Context, request ListStreamPackagingConfigsRequest) (response ListStreamPackagingConfigsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveStreamDistributionChannelLock.go.html to see an example of how to use RemoveStreamDistributionChannelLock API. +// A default retry strategy applies to this operation RemoveStreamDistributionChannelLock() +func (client MediaServicesClient) RemoveStreamDistributionChannelLock(ctx context.Context, request RemoveStreamDistributionChannelLockRequest) (response RemoveStreamDistributionChannelLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2434,42 +3190,47 @@ func (client MediaServicesClient) ListStreamPackagingConfigs(ctx context.Context if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listStreamPackagingConfigs, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeStreamDistributionChannelLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListStreamPackagingConfigsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RemoveStreamDistributionChannelLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListStreamPackagingConfigsResponse{} + response = RemoveStreamDistributionChannelLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListStreamPackagingConfigsResponse); ok { + if convertedResponse, ok := ociResponse.(RemoveStreamDistributionChannelLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListStreamPackagingConfigsResponse") + err = fmt.Errorf("failed to convert OCIResponse into RemoveStreamDistributionChannelLockResponse") } return } -// listStreamPackagingConfigs implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listStreamPackagingConfigs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeStreamDistributionChannelLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) removeStreamDistributionChannelLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/streamPackagingConfigs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamDistributionChannels/{streamDistributionChannelId}/actions/removeLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListStreamPackagingConfigsResponse + var response RemoveStreamDistributionChannelLockResponse 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/dms/20211101/StreamPackagingConfig/ListStreamPackagingConfigs" - err = common.PostProcessServiceError(err, "MediaServices", "ListStreamPackagingConfigs", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamDistributionChannel/RemoveStreamDistributionChannelLock" + err = common.PostProcessServiceError(err, "MediaServices", "RemoveStreamDistributionChannelLock", apiReferenceLink) return response, err } @@ -2477,13 +3238,13 @@ func (client MediaServicesClient) listStreamPackagingConfigs(ctx context.Context return response, err } -// ListSystemMediaWorkflows Lists the SystemMediaWorkflows that can be used to run a job by name or as a template to create a MediaWorkflow. +// RemoveStreamPackagingConfigLock Remove a lock from a StreamPackagingConfig. // // # See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/ListSystemMediaWorkflows.go.html to see an example of how to use ListSystemMediaWorkflows API. -// A default retry strategy applies to this operation ListSystemMediaWorkflows() -func (client MediaServicesClient) ListSystemMediaWorkflows(ctx context.Context, request ListSystemMediaWorkflowsRequest) (response ListSystemMediaWorkflowsResponse, err error) { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveStreamPackagingConfigLock.go.html to see an example of how to use RemoveStreamPackagingConfigLock API. +// A default retry strategy applies to this operation RemoveStreamPackagingConfigLock() +func (client MediaServicesClient) RemoveStreamPackagingConfigLock(ctx context.Context, request RemoveStreamPackagingConfigLockRequest) (response RemoveStreamPackagingConfigLockResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2492,46 +3253,51 @@ func (client MediaServicesClient) ListSystemMediaWorkflows(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listSystemMediaWorkflows, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeStreamPackagingConfigLock, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListSystemMediaWorkflowsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = RemoveStreamPackagingConfigLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListSystemMediaWorkflowsResponse{} + response = RemoveStreamPackagingConfigLockResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListSystemMediaWorkflowsResponse); ok { + if convertedResponse, ok := ociResponse.(RemoveStreamPackagingConfigLockResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListSystemMediaWorkflowsResponse") + err = fmt.Errorf("failed to convert OCIResponse into RemoveStreamPackagingConfigLockResponse") } return } -// listSystemMediaWorkflows implements the OCIOperation interface (enables retrying operations) -func (client MediaServicesClient) listSystemMediaWorkflows(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// removeStreamPackagingConfigLock implements the OCIOperation interface (enables retrying operations) +func (client MediaServicesClient) removeStreamPackagingConfigLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/systemMediaWorkflows", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/streamPackagingConfigs/{streamPackagingConfigId}/actions/removeLock", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListSystemMediaWorkflowsResponse + var response RemoveStreamPackagingConfigLockResponse 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/dms/20211101/MediaWorkflow/ListSystemMediaWorkflows" - err = common.PostProcessServiceError(err, "MediaServices", "ListSystemMediaWorkflows", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dms/20211101/StreamPackagingConfig/RemoveStreamPackagingConfigLock" + err = common.PostProcessServiceError(err, "MediaServices", "RemoveStreamPackagingConfigLock", apiReferenceLink) return response, err } - err = common.UnmarshalResponse(httpResponse, &response) + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &streampackagingconfig{}) return response, err } diff --git a/mediaservices/mediaservices_mediastream_client.go b/mediaservices/mediaservices_mediastream_client.go index 8b0ebc2fc1..eceaa6caa8 100644 --- a/mediaservices/mediaservices_mediastream_client.go +++ b/mediaservices/mediaservices_mediastream_client.go @@ -92,7 +92,7 @@ func (client *MediaStreamClient) ConfigurationProvider() *common.ConfigurationPr return client.config } -// GeneratePlaylist Gets the playlist content for the specified Packaging Configuration and Media Asset combination. +// GeneratePlaylist Gets the playlist content for the specified Packaging Configuration and Media Asset combination. This API call is made using the MediaStreamsClient, which requires the endpoint to be set with the value of the distribution channel domain name (for example, https://example_channel.dc.mediaservices.example_region.oci.oraclecloud.com) to generate a session token or playlist for a media asset registered in this distribution channel. // // # See also // @@ -149,7 +149,7 @@ func (client MediaStreamClient) generatePlaylist(ctx context.Context, request co return response, err } -// GenerateSessionToken Generate a new streaming session token. +// GenerateSessionToken Generate a new streaming session token. This API call is made using the MediaStreamsClient, which requires the endpoint to be set with the value of the distribution channel domain name (for example, https://example_channel.dc.mediaservices.example_region.oci.oraclecloud.com) to generate a session token or playlist for a media asset registered in this distribution channel. // // # See also // diff --git a/mediaservices/remove_lock_details.go b/mediaservices/remove_lock_details.go new file mode 100644 index 0000000000..1359dfc9d5 --- /dev/null +++ b/mediaservices/remove_lock_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. + +// Media Services API +// +// Media Services (includes Media Flow and Media Streams) is a fully managed service for processing media (video) source content. Use Media Flow and Media Streams to transcode and package digital video using configurable workflows and stream video outputs. +// Use the Media Services API to configure media workflows and run Media Flow jobs, create distribution channels, ingest assets, create Preview URLs and play assets. For more information, see Media Flow (https://docs.cloud.oracle.com/iaas/Content/dms-mediaflow/home.htm) and Media Streams (https://docs.cloud.oracle.com/iaas/Content/dms-mediastream/home.htm). +// + +package mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveLockDetails Request payload to remove lock to the resource. +type RemoveLockDetails struct { + + // Type of the lock. + Type RemoveLockDetailsTypeEnum `mandatory:"true" json:"type"` + + // The compartment ID of the lock. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // 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"` + + // When the lock was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m RemoveLockDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RemoveLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRemoveLockDetailsTypeEnum(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(GetRemoveLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveLockDetailsTypeEnum Enum with underlying type: string +type RemoveLockDetailsTypeEnum string + +// Set of constants representing the allowable values for RemoveLockDetailsTypeEnum +const ( + RemoveLockDetailsTypeFull RemoveLockDetailsTypeEnum = "FULL" + RemoveLockDetailsTypeDelete RemoveLockDetailsTypeEnum = "DELETE" +) + +var mappingRemoveLockDetailsTypeEnum = map[string]RemoveLockDetailsTypeEnum{ + "FULL": RemoveLockDetailsTypeFull, + "DELETE": RemoveLockDetailsTypeDelete, +} + +var mappingRemoveLockDetailsTypeEnumLowerCase = map[string]RemoveLockDetailsTypeEnum{ + "full": RemoveLockDetailsTypeFull, + "delete": RemoveLockDetailsTypeDelete, +} + +// GetRemoveLockDetailsTypeEnumValues Enumerates the set of values for RemoveLockDetailsTypeEnum +func GetRemoveLockDetailsTypeEnumValues() []RemoveLockDetailsTypeEnum { + values := make([]RemoveLockDetailsTypeEnum, 0) + for _, v := range mappingRemoveLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetRemoveLockDetailsTypeEnumStringValues Enumerates the set of values in String for RemoveLockDetailsTypeEnum +func GetRemoveLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingRemoveLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRemoveLockDetailsTypeEnum(val string) (RemoveLockDetailsTypeEnum, bool) { + enum, ok := mappingRemoveLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mediaservices/remove_media_asset_lock_request_response.go b/mediaservices/remove_media_asset_lock_request_response.go new file mode 100644 index 0000000000..466ce3d3ca --- /dev/null +++ b/mediaservices/remove_media_asset_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveMediaAssetLockRequest wrapper for the RemoveMediaAssetLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaAssetLock.go.html to see an example of how to use RemoveMediaAssetLockRequest. +type RemoveMediaAssetLockRequest struct { + + // The details to be updated for the RemoveLock. + RemoveLockDetails `contributesTo:"body"` + + // Unique MediaAsset identifier + MediaAssetId *string `mandatory:"true" contributesTo:"path" name:"mediaAssetId"` + + // 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"` + + // 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 RemoveMediaAssetLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveMediaAssetLockRequest) 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 RemoveMediaAssetLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveMediaAssetLockRequest) 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 RemoveMediaAssetLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveMediaAssetLockResponse wrapper for the RemoveMediaAssetLock operation +type RemoveMediaAssetLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaAsset instance + MediaAsset `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 RemoveMediaAssetLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveMediaAssetLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/remove_media_workflow_configuration_lock_request_response.go b/mediaservices/remove_media_workflow_configuration_lock_request_response.go new file mode 100644 index 0000000000..d79f1551a2 --- /dev/null +++ b/mediaservices/remove_media_workflow_configuration_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveMediaWorkflowConfigurationLockRequest wrapper for the RemoveMediaWorkflowConfigurationLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaWorkflowConfigurationLock.go.html to see an example of how to use RemoveMediaWorkflowConfigurationLockRequest. +type RemoveMediaWorkflowConfigurationLockRequest struct { + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails RemoveLockDetails `contributesTo:"body"` + + // Unique MediaWorkflowConfiguration identifier. + MediaWorkflowConfigurationId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowConfigurationId"` + + // 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"` + + // 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"` + + // 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 RemoveMediaWorkflowConfigurationLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveMediaWorkflowConfigurationLockRequest) 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 RemoveMediaWorkflowConfigurationLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveMediaWorkflowConfigurationLockRequest) 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 RemoveMediaWorkflowConfigurationLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveMediaWorkflowConfigurationLockResponse wrapper for the RemoveMediaWorkflowConfigurationLock operation +type RemoveMediaWorkflowConfigurationLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaWorkflowConfiguration instance + MediaWorkflowConfiguration `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 RemoveMediaWorkflowConfigurationLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveMediaWorkflowConfigurationLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/remove_media_workflow_job_lock_request_response.go b/mediaservices/remove_media_workflow_job_lock_request_response.go new file mode 100644 index 0000000000..0867880840 --- /dev/null +++ b/mediaservices/remove_media_workflow_job_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveMediaWorkflowJobLockRequest wrapper for the RemoveMediaWorkflowJobLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaWorkflowJobLock.go.html to see an example of how to use RemoveMediaWorkflowJobLockRequest. +type RemoveMediaWorkflowJobLockRequest struct { + + // The details to be updated for the RemoveLock. + RemoveLockDetails `contributesTo:"body"` + + // Unique MediaWorkflowJob identifier. + MediaWorkflowJobId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowJobId"` + + // 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"` + + // 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 RemoveMediaWorkflowJobLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveMediaWorkflowJobLockRequest) 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 RemoveMediaWorkflowJobLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveMediaWorkflowJobLockRequest) 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 RemoveMediaWorkflowJobLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveMediaWorkflowJobLockResponse wrapper for the RemoveMediaWorkflowJobLock operation +type RemoveMediaWorkflowJobLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaWorkflowJob instance + MediaWorkflowJob `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 RemoveMediaWorkflowJobLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveMediaWorkflowJobLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/remove_media_workflow_lock_request_response.go b/mediaservices/remove_media_workflow_lock_request_response.go new file mode 100644 index 0000000000..ed092752da --- /dev/null +++ b/mediaservices/remove_media_workflow_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveMediaWorkflowLockRequest wrapper for the RemoveMediaWorkflowLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveMediaWorkflowLock.go.html to see an example of how to use RemoveMediaWorkflowLockRequest. +type RemoveMediaWorkflowLockRequest struct { + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails RemoveLockDetails `contributesTo:"body"` + + // Unique MediaWorkflow identifier. + MediaWorkflowId *string `mandatory:"true" contributesTo:"path" name:"mediaWorkflowId"` + + // 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"` + + // 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 RemoveMediaWorkflowLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveMediaWorkflowLockRequest) 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 RemoveMediaWorkflowLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveMediaWorkflowLockRequest) 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 RemoveMediaWorkflowLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveMediaWorkflowLockResponse wrapper for the RemoveMediaWorkflowLock operation +type RemoveMediaWorkflowLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MediaWorkflow instance + MediaWorkflow `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 RemoveMediaWorkflowLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveMediaWorkflowLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/remove_stream_cdn_config_lock_request_response.go b/mediaservices/remove_stream_cdn_config_lock_request_response.go new file mode 100644 index 0000000000..595c018d4f --- /dev/null +++ b/mediaservices/remove_stream_cdn_config_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveStreamCdnConfigLockRequest wrapper for the RemoveStreamCdnConfigLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveStreamCdnConfigLock.go.html to see an example of how to use RemoveStreamCdnConfigLockRequest. +type RemoveStreamCdnConfigLockRequest struct { + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails RemoveLockDetails `contributesTo:"body"` + + // Unique StreamCdnConfig identifier. + StreamCdnConfigId *string `mandatory:"true" contributesTo:"path" name:"streamCdnConfigId"` + + // 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"` + + // 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"` + + // 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 RemoveStreamCdnConfigLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveStreamCdnConfigLockRequest) 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 RemoveStreamCdnConfigLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveStreamCdnConfigLockRequest) 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 RemoveStreamCdnConfigLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveStreamCdnConfigLockResponse wrapper for the RemoveStreamCdnConfigLock operation +type RemoveStreamCdnConfigLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The StreamCdnConfig instance + StreamCdnConfig `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 RemoveStreamCdnConfigLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveStreamCdnConfigLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/remove_stream_distribution_channel_lock_request_response.go b/mediaservices/remove_stream_distribution_channel_lock_request_response.go new file mode 100644 index 0000000000..78f1528be2 --- /dev/null +++ b/mediaservices/remove_stream_distribution_channel_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveStreamDistributionChannelLockRequest wrapper for the RemoveStreamDistributionChannelLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveStreamDistributionChannelLock.go.html to see an example of how to use RemoveStreamDistributionChannelLockRequest. +type RemoveStreamDistributionChannelLockRequest struct { + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails RemoveLockDetails `contributesTo:"body"` + + // Unique Stream Distribution Channel path identifier. + StreamDistributionChannelId *string `mandatory:"true" contributesTo:"path" name:"streamDistributionChannelId"` + + // 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"` + + // 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"` + + // 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 RemoveStreamDistributionChannelLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveStreamDistributionChannelLockRequest) 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 RemoveStreamDistributionChannelLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveStreamDistributionChannelLockRequest) 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 RemoveStreamDistributionChannelLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveStreamDistributionChannelLockResponse wrapper for the RemoveStreamDistributionChannelLock operation +type RemoveStreamDistributionChannelLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The StreamDistributionChannel instance + StreamDistributionChannel `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 RemoveStreamDistributionChannelLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveStreamDistributionChannelLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/remove_stream_packaging_config_lock_request_response.go b/mediaservices/remove_stream_packaging_config_lock_request_response.go new file mode 100644 index 0000000000..3f9d1d9ea0 --- /dev/null +++ b/mediaservices/remove_stream_packaging_config_lock_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 mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveStreamPackagingConfigLockRequest wrapper for the RemoveStreamPackagingConfigLock operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/mediaservices/RemoveStreamPackagingConfigLock.go.html to see an example of how to use RemoveStreamPackagingConfigLockRequest. +type RemoveStreamPackagingConfigLockRequest struct { + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails RemoveLockDetails `contributesTo:"body"` + + // Unique Stream Packaging Configuration path identifier. + StreamPackagingConfigId *string `mandatory:"true" contributesTo:"path" name:"streamPackagingConfigId"` + + // 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"` + + // 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"` + + // 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 RemoveStreamPackagingConfigLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveStreamPackagingConfigLockRequest) 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 RemoveStreamPackagingConfigLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveStreamPackagingConfigLockRequest) 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 RemoveStreamPackagingConfigLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveStreamPackagingConfigLockResponse wrapper for the RemoveStreamPackagingConfigLock operation +type RemoveStreamPackagingConfigLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The StreamPackagingConfig instance + StreamPackagingConfig `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 RemoveStreamPackagingConfigLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveStreamPackagingConfigLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/mediaservices/resource_lock.go b/mediaservices/resource_lock.go new file mode 100644 index 0000000000..e1470fb80f --- /dev/null +++ b/mediaservices/resource_lock.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. + +// Media Services API +// +// Media Services (includes Media Flow and Media Streams) is a fully managed service for processing media (video) source content. Use Media Flow and Media Streams to transcode and package digital video using configurable workflows and stream video outputs. +// Use the Media Services API to configure media workflows and run Media Flow jobs, create distribution channels, ingest assets, create Preview URLs and play assets. For more information, see Media Flow (https://docs.cloud.oracle.com/iaas/Content/dms-mediaflow/home.htm) and Media Streams (https://docs.cloud.oracle.com/iaas/Content/dms-mediastream/home.htm). +// + +package mediaservices + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceLock Resource locks are used to prevent certain APIs from being called for the resource. +// A full lock prevents both updating the resource and deleting the resource. A delete +// lock prevents deleting the resource. +type ResourceLock struct { + + // Type of the lock. + Type ResourceLockTypeEnum `mandatory:"true" json:"type"` + + // The compartment ID of the lock. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // 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"` + + // When the lock was created. + 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/mediaservices/stream_cdn_config.go b/mediaservices/stream_cdn_config.go index 77d322bf60..89219e6423 100644 --- a/mediaservices/stream_cdn_config.go +++ b/mediaservices/stream_cdn_config.go @@ -60,6 +60,9 @@ type StreamCdnConfig struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m StreamCdnConfig) String() string { @@ -91,6 +94,7 @@ func (m *StreamCdnConfig) 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"` DisplayName *string `json:"displayName"` CompartmentId *string `json:"compartmentId"` @@ -118,6 +122,8 @@ func (m *StreamCdnConfig) 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.DisplayName = model.DisplayName diff --git a/mediaservices/stream_cdn_config_summary.go b/mediaservices/stream_cdn_config_summary.go index 96080e158e..1b5a104653 100644 --- a/mediaservices/stream_cdn_config_summary.go +++ b/mediaservices/stream_cdn_config_summary.go @@ -57,6 +57,9 @@ type StreamCdnConfigSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m StreamCdnConfigSummary) String() string { diff --git a/mediaservices/stream_distribution_channel.go b/mediaservices/stream_distribution_channel.go index 70037d76f1..456f53801c 100644 --- a/mediaservices/stream_distribution_channel.go +++ b/mediaservices/stream_distribution_channel.go @@ -51,6 +51,9 @@ type StreamDistributionChannel struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m StreamDistributionChannel) String() string { diff --git a/mediaservices/stream_distribution_channel_summary.go b/mediaservices/stream_distribution_channel_summary.go index e7da344b52..52f7fc0542 100644 --- a/mediaservices/stream_distribution_channel_summary.go +++ b/mediaservices/stream_distribution_channel_summary.go @@ -51,6 +51,9 @@ type StreamDistributionChannelSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m StreamDistributionChannelSummary) String() string { diff --git a/mediaservices/stream_packaging_config.go b/mediaservices/stream_packaging_config.go index 2050ae734b..a1dc0322ef 100644 --- a/mediaservices/stream_packaging_config.go +++ b/mediaservices/stream_packaging_config.go @@ -57,6 +57,9 @@ type StreamPackagingConfig interface { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` GetSystemTags() map[string]map[string]interface{} + + // Locks associated with this resource. + GetLocks() []ResourceLock } type streampackagingconfig struct { @@ -68,6 +71,7 @@ type streampackagingconfig struct { FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + Locks []ResourceLock `mandatory:"false" json:"locks"` Id *string `mandatory:"true" json:"id"` CompartmentId *string `mandatory:"true" json:"compartmentId"` DistributionChannelId *string `mandatory:"true" json:"distributionChannelId"` @@ -99,6 +103,7 @@ func (m *streampackagingconfig) UnmarshalJSON(data []byte) error { m.FreeformTags = s.Model.FreeformTags m.DefinedTags = s.Model.DefinedTags m.SystemTags = s.Model.SystemTags + m.Locks = s.Model.Locks m.StreamPackagingFormat = s.Model.StreamPackagingFormat return err @@ -162,6 +167,11 @@ func (m streampackagingconfig) GetSystemTags() map[string]map[string]interface{} return m.SystemTags } +// GetLocks returns Locks +func (m streampackagingconfig) GetLocks() []ResourceLock { + return m.Locks +} + // GetId returns Id func (m streampackagingconfig) GetId() *string { return m.Id diff --git a/mediaservices/stream_packaging_config_summary.go b/mediaservices/stream_packaging_config_summary.go index d4e2e77432..13cbb6c890 100644 --- a/mediaservices/stream_packaging_config_summary.go +++ b/mediaservices/stream_packaging_config_summary.go @@ -51,6 +51,9 @@ type StreamPackagingConfigSummary struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m StreamPackagingConfigSummary) String() string { diff --git a/mediaservices/system_media_workflow.go b/mediaservices/system_media_workflow.go index dac4d5133e..9e76b6dc52 100644 --- a/mediaservices/system_media_workflow.go +++ b/mediaservices/system_media_workflow.go @@ -35,6 +35,9 @@ type SystemMediaWorkflow struct { // The values declared here can be overridden by the MediaWorkflowConfigurations or parameters supplied when creating // MediaWorkflowJobs from this MediaWorkflow. Parameters map[string]interface{} `mandatory:"false" json:"parameters"` + + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` } func (m SystemMediaWorkflow) String() string { diff --git a/mediaservices/update_media_asset_request_response.go b/mediaservices/update_media_asset_request_response.go index d6323602cd..0bfad150df 100644 --- a/mediaservices/update_media_asset_request_response.go +++ b/mediaservices/update_media_asset_request_response.go @@ -24,6 +24,9 @@ type UpdateMediaAssetRequest struct { // The information to be updated. UpdateMediaAssetDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/update_media_workflow_configuration_request_response.go b/mediaservices/update_media_workflow_configuration_request_response.go index 04c00f66a6..786d33c520 100644 --- a/mediaservices/update_media_workflow_configuration_request_response.go +++ b/mediaservices/update_media_workflow_configuration_request_response.go @@ -24,6 +24,9 @@ type UpdateMediaWorkflowConfigurationRequest struct { // The information to be updated. UpdateMediaWorkflowConfigurationDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/update_media_workflow_job_request_response.go b/mediaservices/update_media_workflow_job_request_response.go index 48497af6d4..262dbb6bb2 100644 --- a/mediaservices/update_media_workflow_job_request_response.go +++ b/mediaservices/update_media_workflow_job_request_response.go @@ -24,6 +24,9 @@ type UpdateMediaWorkflowJobRequest struct { // The information to be updated. UpdateMediaWorkflowJobDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/update_media_workflow_request_response.go b/mediaservices/update_media_workflow_request_response.go index c64fa211fa..995735574b 100644 --- a/mediaservices/update_media_workflow_request_response.go +++ b/mediaservices/update_media_workflow_request_response.go @@ -24,6 +24,9 @@ type UpdateMediaWorkflowRequest struct { // The information to be updated. UpdateMediaWorkflowDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/update_stream_cdn_config_request_response.go b/mediaservices/update_stream_cdn_config_request_response.go index b54d5e6ff6..b70e027149 100644 --- a/mediaservices/update_stream_cdn_config_request_response.go +++ b/mediaservices/update_stream_cdn_config_request_response.go @@ -24,6 +24,9 @@ type UpdateStreamCdnConfigRequest struct { // The information to be updated. UpdateStreamCdnConfigDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/update_stream_distribution_channel_request_response.go b/mediaservices/update_stream_distribution_channel_request_response.go index 56afa8f061..2cd91a386d 100644 --- a/mediaservices/update_stream_distribution_channel_request_response.go +++ b/mediaservices/update_stream_distribution_channel_request_response.go @@ -24,6 +24,9 @@ type UpdateStreamDistributionChannelRequest struct { // The information to be updated. UpdateStreamDistributionChannelDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. diff --git a/mediaservices/update_stream_packaging_config_request_response.go b/mediaservices/update_stream_packaging_config_request_response.go index 00fe53169e..56bd516a81 100644 --- a/mediaservices/update_stream_packaging_config_request_response.go +++ b/mediaservices/update_stream_packaging_config_request_response.go @@ -24,6 +24,9 @@ type UpdateStreamPackagingConfigRequest struct { // The information to be updated. UpdateStreamPackagingConfigDetails `contributesTo:"body"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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. @@ -88,9 +91,6 @@ type UpdateStreamPackagingConfigResponse struct { // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` - // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. - OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` - // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` diff --git a/mysql/certificate_generation_type.go b/mysql/certificate_generation_type.go new file mode 100644 index 0000000000..c009fd28fc --- /dev/null +++ b/mysql/certificate_generation_type.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. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "strings" +) + +// CertificateGenerationTypeEnum Enum with underlying type: string +type CertificateGenerationTypeEnum string + +// Set of constants representing the allowable values for CertificateGenerationTypeEnum +const ( + CertificateGenerationTypeSystem CertificateGenerationTypeEnum = "SYSTEM" + CertificateGenerationTypeByoc CertificateGenerationTypeEnum = "BYOC" +) + +var mappingCertificateGenerationTypeEnum = map[string]CertificateGenerationTypeEnum{ + "SYSTEM": CertificateGenerationTypeSystem, + "BYOC": CertificateGenerationTypeByoc, +} + +var mappingCertificateGenerationTypeEnumLowerCase = map[string]CertificateGenerationTypeEnum{ + "system": CertificateGenerationTypeSystem, + "byoc": CertificateGenerationTypeByoc, +} + +// GetCertificateGenerationTypeEnumValues Enumerates the set of values for CertificateGenerationTypeEnum +func GetCertificateGenerationTypeEnumValues() []CertificateGenerationTypeEnum { + values := make([]CertificateGenerationTypeEnum, 0) + for _, v := range mappingCertificateGenerationTypeEnum { + values = append(values, v) + } + return values +} + +// GetCertificateGenerationTypeEnumStringValues Enumerates the set of values in String for CertificateGenerationTypeEnum +func GetCertificateGenerationTypeEnumStringValues() []string { + return []string{ + "SYSTEM", + "BYOC", + } +} + +// GetMappingCertificateGenerationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCertificateGenerationTypeEnum(val string) (CertificateGenerationTypeEnum, bool) { + enum, ok := mappingCertificateGenerationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/mysql/create_db_system_details.go b/mysql/create_db_system_details.go index d11e4c42e4..a9ef381543 100644 --- a/mysql/create_db_system_details.go +++ b/mysql/create_db_system_details.go @@ -120,6 +120,8 @@ type CreateDbSystemDetails struct { // Whether to enable monitoring via the Database Management service. DatabaseManagement DatabaseManagementStatusEnum `mandatory:"false" json:"databaseManagement,omitempty"` + + SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` } func (m CreateDbSystemDetails) String() string { @@ -169,6 +171,7 @@ func (m *CreateDbSystemDetails) UnmarshalJSON(data []byte) (e error) { DeletionPolicy *CreateDeletionPolicyDetails `json:"deletionPolicy"` CrashRecovery CrashRecoveryStatusEnum `json:"crashRecovery"` DatabaseManagement DatabaseManagementStatusEnum `json:"databaseManagement"` + SecureConnections *SecureConnectionDetails `json:"secureConnections"` CompartmentId *string `json:"compartmentId"` ShapeName *string `json:"shapeName"` SubnetId *string `json:"subnetId"` @@ -231,6 +234,8 @@ func (m *CreateDbSystemDetails) UnmarshalJSON(data []byte) (e error) { m.DatabaseManagement = model.DatabaseManagement + m.SecureConnections = model.SecureConnections + m.CompartmentId = model.CompartmentId m.ShapeName = model.ShapeName diff --git a/mysql/db_system.go b/mysql/db_system.go index 1216572cd0..4ff0e57976 100644 --- a/mysql/db_system.go +++ b/mysql/db_system.go @@ -134,6 +134,8 @@ type DbSystem struct { // Whether to enable monitoring via the Database Management service. DatabaseManagement DatabaseManagementStatusEnum `mandatory:"false" json:"databaseManagement,omitempty"` + + SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` } func (m DbSystem) String() string { @@ -187,6 +189,7 @@ func (m *DbSystem) UnmarshalJSON(data []byte) (e error) { CrashRecovery CrashRecoveryStatusEnum `json:"crashRecovery"` PointInTimeRecoveryDetails *PointInTimeRecoveryDetails `json:"pointInTimeRecoveryDetails"` DatabaseManagement DatabaseManagementStatusEnum `json:"databaseManagement"` + SecureConnections *SecureConnectionDetails `json:"secureConnections"` Id *string `json:"id"` DisplayName *string `json:"displayName"` CompartmentId *string `json:"compartmentId"` @@ -259,6 +262,8 @@ func (m *DbSystem) UnmarshalJSON(data []byte) (e error) { m.DatabaseManagement = model.DatabaseManagement + m.SecureConnections = model.SecureConnections + m.Id = model.Id m.DisplayName = model.DisplayName diff --git a/mysql/db_system_snapshot.go b/mysql/db_system_snapshot.go index 4913a6dc96..71e751653c 100644 --- a/mysql/db_system_snapshot.go +++ b/mysql/db_system_snapshot.go @@ -102,6 +102,8 @@ type DbSystemSnapshot struct { // Whether to enable monitoring via the Database Management service. DatabaseManagement DatabaseManagementStatusEnum `mandatory:"false" json:"databaseManagement,omitempty"` + + SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` } func (m DbSystemSnapshot) String() string { diff --git a/mysql/replica.go b/mysql/replica.go index cfdaee166a..65d38630d1 100644 --- a/mysql/replica.go +++ b/mysql/replica.go @@ -86,6 +86,8 @@ type Replica struct { ConfigurationId *string `mandatory:"false" json:"configurationId"` ReplicaOverrides *ReplicaOverrides `mandatory:"false" json:"replicaOverrides"` + + SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` } func (m Replica) String() string { diff --git a/mysql/secure_connection_details.go b/mysql/secure_connection_details.go new file mode 100644 index 0000000000..18122c182e --- /dev/null +++ b/mysql/secure_connection_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. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SecureConnectionDetails Secure connection configuration details. +type SecureConnectionDetails struct { + + // Select whether to use MySQL Database Service-managed certificate (SYSTEM) or your own certificate (BYOC). + CertificateGenerationType CertificateGenerationTypeEnum `mandatory:"true" json:"certificateGenerationType"` + + // The OCID of the certificate to use. + CertificateId *string `mandatory:"false" json:"certificateId"` +} + +func (m SecureConnectionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m SecureConnectionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCertificateGenerationTypeEnum(string(m.CertificateGenerationType)); !ok && m.CertificateGenerationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CertificateGenerationType: %s. Supported values are: %s.", m.CertificateGenerationType, strings.Join(GetCertificateGenerationTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/mysql/update_db_system_details.go b/mysql/update_db_system_details.go index da6aa183c7..f4ade0f757 100644 --- a/mysql/update_db_system_details.go +++ b/mysql/update_db_system_details.go @@ -120,6 +120,8 @@ type UpdateDbSystemDetails struct { // Whether to enable monitoring via the Database Management service. DatabaseManagement DatabaseManagementStatusEnum `mandatory:"false" json:"databaseManagement,omitempty"` + + SecureConnections *SecureConnectionDetails `mandatory:"false" json:"secureConnections"` } func (m UpdateDbSystemDetails) String() string { diff --git a/vault/adb_target_system_details.go b/vault/adb_target_system_details.go new file mode 100644 index 0000000000..a14679e598 --- /dev/null +++ b/vault/adb_target_system_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. + +// Vault Secret Management API +// +// Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingsecrets.htm). +// + +package vault + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AdbTargetSystemDetails Target System type and id for an autonomous database target system +type AdbTargetSystemDetails struct { + + // The unique identifier (OCID) for the autonomous database that Vault Secret connects to. + AdbId *string `mandatory:"true" json:"adbId"` +} + +func (m AdbTargetSystemDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AdbTargetSystemDetails) 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 AdbTargetSystemDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAdbTargetSystemDetails AdbTargetSystemDetails + s := struct { + DiscriminatorParam string `json:"targetSystemType"` + MarshalTypeAdbTargetSystemDetails + }{ + "ADB", + (MarshalTypeAdbTargetSystemDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vault/cancel_secret_deletion_request_response.go b/vault/cancel_secret_deletion_request_response.go index 612731b92d..8c12940f9c 100644 --- a/vault/cancel_secret_deletion_request_response.go +++ b/vault/cancel_secret_deletion_request_response.go @@ -84,8 +84,7 @@ type CancelSecretDeletionResponse struct { // 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. + // 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"` } diff --git a/vault/cancel_secret_rotation_request_response.go b/vault/cancel_secret_rotation_request_response.go new file mode 100644 index 0000000000..85028e7a46 --- /dev/null +++ b/vault/cancel_secret_rotation_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 vault + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelSecretRotationRequest wrapper for the CancelSecretRotation operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/vault/CancelSecretRotation.go.html to see an example of how to use CancelSecretRotationRequest. +type CancelSecretRotationRequest struct { + + // The OCID of the secret. + SecretId *string `mandatory:"true" contributesTo:"path" name:"secretId"` + + // 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 provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 CancelSecretRotationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelSecretRotationRequest) 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 CancelSecretRotationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelSecretRotationRequest) 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 CancelSecretRotationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelSecretRotationResponse wrapper for the CancelSecretRotation operation +type CancelSecretRotationResponse 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 CancelSecretRotationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelSecretRotationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vault/cancel_secret_version_deletion_request_response.go b/vault/cancel_secret_version_deletion_request_response.go index 38a9a57e39..989bb91b05 100644 --- a/vault/cancel_secret_version_deletion_request_response.go +++ b/vault/cancel_secret_version_deletion_request_response.go @@ -87,8 +87,7 @@ type CancelSecretVersionDeletionResponse struct { // 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. + // 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"` } diff --git a/vault/change_secret_compartment_request_response.go b/vault/change_secret_compartment_request_response.go index 64ee799ffc..81b48a25e1 100644 --- a/vault/change_secret_compartment_request_response.go +++ b/vault/change_secret_compartment_request_response.go @@ -95,8 +95,7 @@ type ChangeSecretCompartmentResponse struct { // 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. + // 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"` } diff --git a/vault/create_secret_details.go b/vault/create_secret_details.go index f0d8bb6e9e..4b79bdc862 100644 --- a/vault/create_secret_details.go +++ b/vault/create_secret_details.go @@ -22,8 +22,6 @@ type CreateSecretDetails struct { // The OCID of the compartment where you want to create the secret. CompartmentId *string `mandatory:"true" json:"compartmentId"` - SecretContent SecretContentDetails `mandatory:"true" json:"secretContent"` - // A user-friendly name for the secret. Secret names should be unique within a vault. Avoid entering confidential information. Valid characters are uppercase or lowercase letters, numbers, hyphens, underscores, and periods. SecretName *string `mandatory:"true" json:"secretName"` @@ -51,6 +49,10 @@ type CreateSecretDetails struct { // metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. Metadata map[string]interface{} `mandatory:"false" json:"metadata"` + SecretContent SecretContentDetails `mandatory:"false" json:"secretContent"` + + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` + // A list of rules to control how the secret is used and managed. SecretRules []SecretRule `mandatory:"false" json:"secretRules"` } @@ -74,16 +76,17 @@ func (m CreateSecretDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *CreateSecretDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - Description *string `json:"description"` - FreeformTags map[string]string `json:"freeformTags"` - KeyId *string `json:"keyId"` - Metadata map[string]interface{} `json:"metadata"` - SecretRules []secretrule `json:"secretRules"` - CompartmentId *string `json:"compartmentId"` - SecretContent secretcontentdetails `json:"secretContent"` - SecretName *string `json:"secretName"` - VaultId *string `json:"vaultId"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Description *string `json:"description"` + FreeformTags map[string]string `json:"freeformTags"` + KeyId *string `json:"keyId"` + Metadata map[string]interface{} `json:"metadata"` + SecretContent secretcontentdetails `json:"secretContent"` + RotationConfig *RotationConfig `json:"rotationConfig"` + SecretRules []secretrule `json:"secretRules"` + CompartmentId *string `json:"compartmentId"` + SecretName *string `json:"secretName"` + VaultId *string `json:"vaultId"` }{} e = json.Unmarshal(data, &model) @@ -101,6 +104,18 @@ func (m *CreateSecretDetails) UnmarshalJSON(data []byte) (e error) { m.Metadata = model.Metadata + nn, e = model.SecretContent.UnmarshalPolymorphicJSON(model.SecretContent.JsonData) + if e != nil { + return + } + if nn != nil { + m.SecretContent = nn.(SecretContentDetails) + } else { + m.SecretContent = nil + } + + m.RotationConfig = model.RotationConfig + m.SecretRules = make([]SecretRule, len(model.SecretRules)) for i, n := range model.SecretRules { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) @@ -115,16 +130,6 @@ func (m *CreateSecretDetails) UnmarshalJSON(data []byte) (e error) { } m.CompartmentId = model.CompartmentId - nn, e = model.SecretContent.UnmarshalPolymorphicJSON(model.SecretContent.JsonData) - if e != nil { - return - } - if nn != nil { - m.SecretContent = nn.(SecretContentDetails) - } else { - m.SecretContent = nil - } - m.SecretName = model.SecretName m.VaultId = model.VaultId diff --git a/vault/create_secret_request_response.go b/vault/create_secret_request_response.go index 099c70d42d..73966a629a 100644 --- a/vault/create_secret_request_response.go +++ b/vault/create_secret_request_response.go @@ -88,8 +88,7 @@ type CreateSecretResponse struct { // 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. + // 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"` } diff --git a/vault/function_target_system_details.go b/vault/function_target_system_details.go new file mode 100644 index 0000000000..3ed7175863 --- /dev/null +++ b/vault/function_target_system_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. + +// Vault Secret Management API +// +// Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingsecrets.htm). +// + +package vault + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FunctionTargetSystemDetails Details of the OCI function that vault secret connects to. +type FunctionTargetSystemDetails struct { + + // The unique identifier (OCID) of the OCI Functions that vault secret connects to. + FunctionId *string `mandatory:"true" json:"functionId"` +} + +func (m FunctionTargetSystemDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m FunctionTargetSystemDetails) 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 FunctionTargetSystemDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeFunctionTargetSystemDetails FunctionTargetSystemDetails + s := struct { + DiscriminatorParam string `json:"targetSystemType"` + MarshalTypeFunctionTargetSystemDetails + }{ + "FUNCTION", + (MarshalTypeFunctionTargetSystemDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vault/get_secret_request_response.go b/vault/get_secret_request_response.go index fbfa41d702..d5ae4e982f 100644 --- a/vault/get_secret_request_response.go +++ b/vault/get_secret_request_response.go @@ -80,8 +80,7 @@ type GetSecretResponse struct { // 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. + // 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"` } diff --git a/vault/get_secret_version_request_response.go b/vault/get_secret_version_request_response.go index 629381b895..8a218a7464 100644 --- a/vault/get_secret_version_request_response.go +++ b/vault/get_secret_version_request_response.go @@ -83,8 +83,7 @@ type GetSecretVersionResponse struct { // 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. + // 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"` } diff --git a/vault/list_secret_versions_request_response.go b/vault/list_secret_versions_request_response.go index bfcd647926..a1e94caf2b 100644 --- a/vault/list_secret_versions_request_response.go +++ b/vault/list_secret_versions_request_response.go @@ -102,8 +102,7 @@ type ListSecretVersionsResponse struct { // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). 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. + // 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"` } diff --git a/vault/list_secrets_request_response.go b/vault/list_secrets_request_response.go index 51419b3478..37ddff5cd8 100644 --- a/vault/list_secrets_request_response.go +++ b/vault/list_secrets_request_response.go @@ -115,8 +115,7 @@ type ListSecretsResponse struct { // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#List_Pagination). 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. + // 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"` } diff --git a/vault/rotate_secret_request_response.go b/vault/rotate_secret_request_response.go new file mode 100644 index 0000000000..fc98a6936c --- /dev/null +++ b/vault/rotate_secret_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 vault + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RotateSecretRequest wrapper for the RotateSecret operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/vault/RotateSecret.go.html to see an example of how to use RotateSecretRequest. +type RotateSecretRequest struct { + + // The OCID of the secret. + SecretId *string `mandatory:"true" contributesTo:"path" name:"secretId"` + + // 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 provided, the returned request ID + // will include this value. Otherwise, a random request ID will be + // generated by the service. + 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 (e.g., 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 RotateSecretRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RotateSecretRequest) 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 RotateSecretRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RotateSecretRequest) 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 RotateSecretRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RotateSecretResponse wrapper for the RotateSecret operation +type RotateSecretResponse 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 of the work request. Use GetWorkRequest with this OCID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response RotateSecretResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RotateSecretResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vault/rotation_config.go b/vault/rotation_config.go new file mode 100644 index 0000000000..359ce3b6c5 --- /dev/null +++ b/vault/rotation_config.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. + +// Vault Secret Management API +// +// Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingsecrets.htm). +// + +package vault + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RotationConfig Defines the frequency of the rotation and the information about the target system +type RotationConfig struct { + TargetSystemDetails TargetSystemDetails `mandatory:"true" json:"targetSystemDetails"` + + // The time interval that indicates the frequency for rotating secret data, as described in ISO 8601 format. + // The minimum value is 1 day and maximum value is 360 days. + // For example, if you want to set the time interval for rotating a secret data as 30 days, the duration is expressed as "P30D." + RotationInterval *string `mandatory:"false" json:"rotationInterval"` + + // Enables auto rotation, when set to true rotationInterval must be set. + IsScheduledRotationEnabled *bool `mandatory:"false" json:"isScheduledRotationEnabled"` +} + +func (m RotationConfig) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RotationConfig) 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 *RotationConfig) UnmarshalJSON(data []byte) (e error) { + model := struct { + RotationInterval *string `json:"rotationInterval"` + IsScheduledRotationEnabled *bool `json:"isScheduledRotationEnabled"` + TargetSystemDetails targetsystemdetails `json:"targetSystemDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.RotationInterval = model.RotationInterval + + m.IsScheduledRotationEnabled = model.IsScheduledRotationEnabled + + nn, e = model.TargetSystemDetails.UnmarshalPolymorphicJSON(model.TargetSystemDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.TargetSystemDetails = nn.(TargetSystemDetails) + } else { + m.TargetSystemDetails = nil + } + + return +} diff --git a/vault/schedule_secret_deletion_request_response.go b/vault/schedule_secret_deletion_request_response.go index 0196d7db63..54a843f880 100644 --- a/vault/schedule_secret_deletion_request_response.go +++ b/vault/schedule_secret_deletion_request_response.go @@ -87,8 +87,7 @@ type ScheduleSecretDeletionResponse struct { // 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. + // 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"` } diff --git a/vault/schedule_secret_version_deletion_request_response.go b/vault/schedule_secret_version_deletion_request_response.go index c781562747..57a4f5600a 100644 --- a/vault/schedule_secret_version_deletion_request_response.go +++ b/vault/schedule_secret_version_deletion_request_response.go @@ -90,8 +90,7 @@ type ScheduleSecretVersionDeletionResponse struct { // 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. + // 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"` } diff --git a/vault/secret.go b/vault/secret.go index 91bdf1037a..4802fa4989 100644 --- a/vault/secret.go +++ b/vault/secret.go @@ -65,6 +65,19 @@ type Secret struct { // metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. Metadata map[string]interface{} `mandatory:"false" json:"metadata"` + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` + + // Additional information about the status of the secret rotation + RotationStatus SecretRotationStatusEnum `mandatory:"false" json:"rotationStatus,omitempty"` + + // A property indicating when the secret was last rotated successfully, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + LastRotationTime *common.SDKTime `mandatory:"false" json:"lastRotationTime"` + + // A property indicating when the secret is scheduled to be rotated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + NextRotationTime *common.SDKTime `mandatory:"false" json:"nextRotationTime"` + // A list of rules that control how the secret is used and managed. SecretRules []SecretRule `mandatory:"false" json:"secretRules"` @@ -90,6 +103,9 @@ func (m Secret) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetSecretLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingSecretRotationStatusEnum(string(m.RotationStatus)); !ok && m.RotationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RotationStatus: %s. Supported values are: %s.", m.RotationStatus, strings.Join(GetSecretRotationStatusEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } @@ -106,6 +122,10 @@ func (m *Secret) UnmarshalJSON(data []byte) (e error) { KeyId *string `json:"keyId"` LifecycleDetails *string `json:"lifecycleDetails"` Metadata map[string]interface{} `json:"metadata"` + RotationConfig *RotationConfig `json:"rotationConfig"` + RotationStatus SecretRotationStatusEnum `json:"rotationStatus"` + LastRotationTime *common.SDKTime `json:"lastRotationTime"` + NextRotationTime *common.SDKTime `json:"nextRotationTime"` SecretRules []secretrule `json:"secretRules"` TimeOfCurrentVersionExpiry *common.SDKTime `json:"timeOfCurrentVersionExpiry"` TimeOfDeletion *common.SDKTime `json:"timeOfDeletion"` @@ -136,6 +156,14 @@ func (m *Secret) UnmarshalJSON(data []byte) (e error) { m.Metadata = model.Metadata + m.RotationConfig = model.RotationConfig + + m.RotationStatus = model.RotationStatus + + m.LastRotationTime = model.LastRotationTime + + m.NextRotationTime = model.NextRotationTime + m.SecretRules = make([]SecretRule, len(model.SecretRules)) for i, n := range model.SecretRules { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) @@ -236,3 +264,53 @@ func GetMappingSecretLifecycleStateEnum(val string) (SecretLifecycleStateEnum, b enum, ok := mappingSecretLifecycleStateEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// SecretRotationStatusEnum Enum with underlying type: string +type SecretRotationStatusEnum string + +// Set of constants representing the allowable values for SecretRotationStatusEnum +const ( + SecretRotationStatusInProgress SecretRotationStatusEnum = "IN_PROGRESS" + SecretRotationStatusScheduled SecretRotationStatusEnum = "SCHEDULED" + SecretRotationStatusNotEnabled SecretRotationStatusEnum = "NOT_ENABLED" + SecretRotationStatusCancelling SecretRotationStatusEnum = "CANCELLING" +) + +var mappingSecretRotationStatusEnum = map[string]SecretRotationStatusEnum{ + "IN_PROGRESS": SecretRotationStatusInProgress, + "SCHEDULED": SecretRotationStatusScheduled, + "NOT_ENABLED": SecretRotationStatusNotEnabled, + "CANCELLING": SecretRotationStatusCancelling, +} + +var mappingSecretRotationStatusEnumLowerCase = map[string]SecretRotationStatusEnum{ + "in_progress": SecretRotationStatusInProgress, + "scheduled": SecretRotationStatusScheduled, + "not_enabled": SecretRotationStatusNotEnabled, + "cancelling": SecretRotationStatusCancelling, +} + +// GetSecretRotationStatusEnumValues Enumerates the set of values for SecretRotationStatusEnum +func GetSecretRotationStatusEnumValues() []SecretRotationStatusEnum { + values := make([]SecretRotationStatusEnum, 0) + for _, v := range mappingSecretRotationStatusEnum { + values = append(values, v) + } + return values +} + +// GetSecretRotationStatusEnumStringValues Enumerates the set of values in String for SecretRotationStatusEnum +func GetSecretRotationStatusEnumStringValues() []string { + return []string{ + "IN_PROGRESS", + "SCHEDULED", + "NOT_ENABLED", + "CANCELLING", + } +} + +// GetMappingSecretRotationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSecretRotationStatusEnum(val string) (SecretRotationStatusEnum, bool) { + enum, ok := mappingSecretRotationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vault/secret_summary.go b/vault/secret_summary.go index c2726badc4..5af82b1556 100644 --- a/vault/secret_summary.go +++ b/vault/secret_summary.go @@ -50,12 +50,29 @@ type SecretSummary struct { // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + // The OCID of the master encryption key that is used to encrypt the secret. You must specify a symmetric key to encrypt the secret during import to the vault. You cannot encrypt secrets with asymmetric keys. Furthermore, the key must exist in the vault that you specify. KeyId *string `mandatory:"false" json:"keyId"` // Additional information about the secret's current lifecycle state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` + + // Additional information about the status of the secret rotation + RotationStatus SecretRotationStatusEnum `mandatory:"false" json:"rotationStatus,omitempty"` + + // A property indicating when the secret was last rotated successfully, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + LastRotationTime *common.SDKTime `mandatory:"false" json:"lastRotationTime"` + + // A property indicating when the secret is scheduled to be rotated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + NextRotationTime *common.SDKTime `mandatory:"false" json:"nextRotationTime"` + // An optional property indicating when the current secret version will expire, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. // Example: `2019-04-03T21:10:29.600Z` TimeOfCurrentVersionExpiry *common.SDKTime `mandatory:"false" json:"timeOfCurrentVersionExpiry"` @@ -78,6 +95,9 @@ func (m SecretSummary) ValidateEnumValue() (bool, error) { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetSecretSummaryLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingSecretRotationStatusEnum(string(m.RotationStatus)); !ok && m.RotationStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RotationStatus: %s. Supported values are: %s.", m.RotationStatus, strings.Join(GetSecretRotationStatusEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } diff --git a/vault/secret_version_summary.go b/vault/secret_version_summary.go index aa29b2bcdb..d1344eba51 100644 --- a/vault/secret_version_summary.go +++ b/vault/secret_version_summary.go @@ -49,6 +49,10 @@ type SecretVersionSummary struct { // An optional property indicating when the secret version will expire, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. // Example: `2019-04-03T21:10:29.600Z` TimeOfExpiry *common.SDKTime `mandatory:"false" json:"timeOfExpiry"` + + // 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 SecretVersionSummary) String() string { diff --git a/vault/target_system_details.go b/vault/target_system_details.go new file mode 100644 index 0000000000..50aaf408ad --- /dev/null +++ b/vault/target_system_details.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. + +// Vault Secret Management API +// +// Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/managingsecrets.htm). +// + +package vault + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TargetSystemDetails The TargetSystemDetails provides the targetSystem type and type-specific connection metadata +type TargetSystemDetails interface { +} + +type targetsystemdetails struct { + JsonData []byte + TargetSystemType string `json:"targetSystemType"` +} + +// UnmarshalJSON unmarshals json +func (m *targetsystemdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalertargetsystemdetails targetsystemdetails + s := struct { + Model Unmarshalertargetsystemdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.TargetSystemType = s.Model.TargetSystemType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *targetsystemdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.TargetSystemType { + case "ADB": + mm := AdbTargetSystemDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "FUNCTION": + mm := FunctionTargetSystemDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for TargetSystemDetails: %s.", m.TargetSystemType) + return *m, nil + } +} + +func (m targetsystemdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m targetsystemdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// TargetSystemDetailsTargetSystemTypeEnum Enum with underlying type: string +type TargetSystemDetailsTargetSystemTypeEnum string + +// Set of constants representing the allowable values for TargetSystemDetailsTargetSystemTypeEnum +const ( + TargetSystemDetailsTargetSystemTypeAdb TargetSystemDetailsTargetSystemTypeEnum = "ADB" + TargetSystemDetailsTargetSystemTypeFunction TargetSystemDetailsTargetSystemTypeEnum = "FUNCTION" +) + +var mappingTargetSystemDetailsTargetSystemTypeEnum = map[string]TargetSystemDetailsTargetSystemTypeEnum{ + "ADB": TargetSystemDetailsTargetSystemTypeAdb, + "FUNCTION": TargetSystemDetailsTargetSystemTypeFunction, +} + +var mappingTargetSystemDetailsTargetSystemTypeEnumLowerCase = map[string]TargetSystemDetailsTargetSystemTypeEnum{ + "adb": TargetSystemDetailsTargetSystemTypeAdb, + "function": TargetSystemDetailsTargetSystemTypeFunction, +} + +// GetTargetSystemDetailsTargetSystemTypeEnumValues Enumerates the set of values for TargetSystemDetailsTargetSystemTypeEnum +func GetTargetSystemDetailsTargetSystemTypeEnumValues() []TargetSystemDetailsTargetSystemTypeEnum { + values := make([]TargetSystemDetailsTargetSystemTypeEnum, 0) + for _, v := range mappingTargetSystemDetailsTargetSystemTypeEnum { + values = append(values, v) + } + return values +} + +// GetTargetSystemDetailsTargetSystemTypeEnumStringValues Enumerates the set of values in String for TargetSystemDetailsTargetSystemTypeEnum +func GetTargetSystemDetailsTargetSystemTypeEnumStringValues() []string { + return []string{ + "ADB", + "FUNCTION", + } +} + +// GetMappingTargetSystemDetailsTargetSystemTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTargetSystemDetailsTargetSystemTypeEnum(val string) (TargetSystemDetailsTargetSystemTypeEnum, bool) { + enum, ok := mappingTargetSystemDetailsTargetSystemTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vault/update_secret_details.go b/vault/update_secret_details.go index 5ad744074b..75976b3296 100644 --- a/vault/update_secret_details.go +++ b/vault/update_secret_details.go @@ -44,6 +44,8 @@ type UpdateSecretDetails struct { SecretContent SecretContentDetails `mandatory:"false" json:"secretContent"` + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` + // A list of rules to control how the secret is used and managed. SecretRules []SecretRule `mandatory:"false" json:"secretRules"` } @@ -73,6 +75,7 @@ func (m *UpdateSecretDetails) UnmarshalJSON(data []byte) (e error) { FreeformTags map[string]string `json:"freeformTags"` Metadata map[string]interface{} `json:"metadata"` SecretContent secretcontentdetails `json:"secretContent"` + RotationConfig *RotationConfig `json:"rotationConfig"` SecretRules []secretrule `json:"secretRules"` }{} @@ -101,6 +104,8 @@ func (m *UpdateSecretDetails) UnmarshalJSON(data []byte) (e error) { m.SecretContent = nil } + m.RotationConfig = model.RotationConfig + m.SecretRules = make([]SecretRule, len(model.SecretRules)) for i, n := range model.SecretRules { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) diff --git a/vault/update_secret_request_response.go b/vault/update_secret_request_response.go index aead3ea685..a7deef452f 100644 --- a/vault/update_secret_request_response.go +++ b/vault/update_secret_request_response.go @@ -90,8 +90,7 @@ type UpdateSecretResponse struct { // 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. + // 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"` } diff --git a/vault/vault_vaults_client.go b/vault/vault_vaults_client.go index 7b9eb305d6..2efbb97a12 100644 --- a/vault/vault_vaults_client.go +++ b/vault/vault_vaults_client.go @@ -150,6 +150,66 @@ func (client VaultsClient) cancelSecretDeletion(ctx context.Context, request com return response, err } +// CancelSecretRotation Cancels the ongoing secret rotation. The cancellation is contingent on how +// far the rotation process has progressed. Upon cancelling a rotation, all +// future rotations are also disabled. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/vault/CancelSecretRotation.go.html to see an example of how to use CancelSecretRotation API. +// A default retry strategy applies to this operation CancelSecretRotation() +func (client VaultsClient) CancelSecretRotation(ctx context.Context, request CancelSecretRotationRequest) (response CancelSecretRotationResponse, 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.cancelSecretRotation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelSecretRotationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelSecretRotationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelSecretRotationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelSecretRotationResponse") + } + return +} + +// cancelSecretRotation implements the OCIOperation interface (enables retrying operations) +func (client VaultsClient) cancelSecretRotation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/secrets/{secretId}/actions/cancelRotation", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelSecretRotationResponse + 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/secretmgmt/20180608/Secret/CancelSecretRotation" + err = common.PostProcessServiceError(err, "Vaults", "CancelSecretRotation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CancelSecretVersionDeletion Cancels the scheduled deletion of a secret version. // // # See also @@ -567,6 +627,69 @@ func (client VaultsClient) listSecrets(ctx context.Context, request common.OCIRe return response, err } +// RotateSecret API to force rotation of an existing secret in Vault and the specified target system; expects secret to have a valid Target System Details object +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/vault/RotateSecret.go.html to see an example of how to use RotateSecret API. +// A default retry strategy applies to this operation RotateSecret() +func (client VaultsClient) RotateSecret(ctx context.Context, request RotateSecretRequest) (response RotateSecretResponse, 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.rotateSecret, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RotateSecretResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RotateSecretResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RotateSecretResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RotateSecretResponse") + } + return +} + +// rotateSecret implements the OCIOperation interface (enables retrying operations) +func (client VaultsClient) rotateSecret(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/secrets/{secretId}/actions/rotate", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RotateSecretResponse + 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/secretmgmt/20180608/Secret/RotateSecret" + err = common.PostProcessServiceError(err, "Vaults", "RotateSecret", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ScheduleSecretDeletion Schedules the deletion of the specified secret. This sets the lifecycle state of the secret // to `PENDING_DELETION` and then deletes it after the specified retention period ends. //